NodeCG includes TypeScript type definitions for NodeCG APIs.
The type definition is experimental
Install TypeScript as your bundle's dev dependency.
Optionally, you can define types of replicants using replicants' JSON schema.
- Define schema for replicants
- Use https://github.com/bcherny/json-schema-to-typescript to convert JSON schema to TypeScript type definitions
- Import the type and pass it to type parameter like this:
Using Type Definitions
More examples are available in
typetest directory, which is also used to test the type definitions.