It would be useful for there to be Typescript definitions so that Intellisense would work when developing extensions.
Currently Scratch does not use TypeScript. Maybe you can convert https://github.com/LLK/scratch-vm/blob/develop/src/extension-support/extension-metadata.js to TypeScript definitions?
@apple502j Are there definitions for the Scratch variable exposed to global?
Also, where should I put the type definitions?
Currently Scratch does not use TypeScript.
this is example:
/**
* @typedef {object} Scratch
* Scratch object exposed to extensions
* @property {object.<string, string>} ArgumentType - represents what can be inserted to the argument
* @property {pbject.<string, string>} BlockType - represents the block's shape
* @property {object.<string, string>} TargetType - represents the targets the block will be displayed on the toolbox
* @property {object.<ExtensionWorkerSubset>} extensions - represents extension worker subset
* @typedef {object} ExtensionWorkerSubset
* @property {function} register - function to register extensions
**/
@apple502j And where should I put the typings?
@apple502j BlockType, ReporterScope and ArgumentType is not declared.
@Richienb They are all string enums.
Again, TypeScript is not supported, so there is no place to put typings.
@apple502j What are the possible values for the enums?
See argument-type.js, block-type.js and target-type.js at https://github.com/LLK/scratch-vm/tree/develop/src/extension-support
@apple502j Are ArgumentType, BlockType and TargetType all properties of Scratch?
@Richienb yes.
@types/scratch-env has been published! Thanks for all the help!