Skip to content

Commit

Permalink
chore: update readme for event name autocompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
braem committed Mar 5, 2022
1 parent fd8c255 commit fc830b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Panorama JS Typings Generator

Simple python script that parses the output of the command `dump_panorama_js_scopes` from CS:GO, Dota 2, or Chaos Engine games and converts it to JSDoc for typing information of `$`, APIs, and panel types.
Simple python script that parses the output of the commands `dump_panorama_js_scopes` and `dump_panorama_events` from CS:GO, Dota 2, or Chaos Engine games and converts it to JSDoc for typing information of `$`, APIs, and panel types.

## Usage

```bash
python panorama_jsdoc_gen.py [dump_panorama_js_scopes_output] [outfile]
python3 panorama_jsdoc_gen.py [js_scopes_outputfile] [js_events_outputfile] [outfile]
```

The outfile can then be placed inside of your game's `panorama/scripts/` folder.
VS Code's built-in typescript extension will recognize it and pull in the types only if you have it opened and its file extension is `.js`.
This will give you autocomplete, hover, and other features for `$` and your game's APIs.
This will give you autocomplete, hover, and other features for `$` and your game's APIs. Event name autocompletion is included as well for `$.RegisterEventHandler` and `$.RegisterForUnhandledEvent`.

Panels can also be given types via JSDoc for the same features:
```javascript
Expand All @@ -29,7 +29,7 @@ Feel free to open an issue or pull request if you would like to see those games

Unfortunately we are unable to define Panorama's types via purely virtual JSDoc comments, so the output typings file contains dummy namespaces, classes, fields, and methods to fake typing information.

It is also impossible to have typing information for `$()`, considering `$` is itself a namespace with fields and methods.
It is also impossible to have typing information for `$()`, considering `$` is itself a namespace with fields and methods. However, a snippet for that is available in [this vscode extension](https://marketplace.visualstudio.com/items?itemName=braemie.panorama-css).

## Other Panorama Development Resources

Expand Down

0 comments on commit fc830b2

Please sign in to comment.