Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to automatically generate a declaration file for the JS API #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

engbergandreas
Copy link
Member

This PR adds a Python script to automatically generate a declaration file (.d.ts) for the JavaScript API. This give TypeScript syntax highlighting and intellisense for the entire API including the OpenSpace lua functions.

For now we keep the openspace-ai-js.d.ts file in this repository since it seems to be quite a process to add it to the npm @types and DefinitelyTyped repo since our Lua API is updated quite often, it will be nice to have more control over it.

Usage

Simply copy the openspace-api-js.d.ts file from the declaration folder to the src project folder, might have to update the compilerOptions to include the new file as well.

Generate an updated version

Run the Python script generatetypescriptfile.py from the root folder of openspace-api-js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant