From fc830b285ac3113bf2c9fb67a85055da461826c8 Mon Sep 17 00:00:00 2001 From: braem Date: Fri, 4 Mar 2022 16:37:51 -0800 Subject: [PATCH] chore: update readme for event name autocompletion --- readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index a8fda7f..b1f4b49 100644 --- a/readme.md +++ b/readme.md @@ -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 @@ -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