Skip to content

registry

hhh edited this page Jan 28, 2023 · 1 revision

registry

/**
 * Type of node constructors.
 */
type NodeConstructor<OptionType = any> = new (options?: OptionType) => CanvasNode<any>;

/**
 * Extract type of parameters of the given node constructor.
 */
type NodeConstructorParameters<Constructor extends NodeConstructor> = Constructor extends NodeConstructor<infer T> ? T : never;

/**
 * The registry of canvas node constructors.
 * (tag -> constructor)
 */
const registry: Map<string, NodeConstructor<any>>;

Documentation of canvasom

Clone this wiki locally