TypeScript
NodeCG includes TypeScript type definitions for NodeCG APIs.
caution
The type definition is experimental
Setup
Install TypeScript as your bundle's dev dependency.
Typing Replicants
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.