import { MetaModule, Meta, MetaVariable, MetaFunction, IMetaRenderer, ICategory } from '../../meta-api/module.js'; import { Block } from '@kano/kwc-blockly/blockly.js'; export declare type IBlocklyCategory = ICategory & { blocks: any[]; order?: number; }; interface ILegacyModule { def: { register(Blockly: any): void; defaults: any; category: IBlocklyCategory; }; } interface IBlockDefaults { [K: string]: { shadow: string | null; value: any; }; } interface IRenderedBlock { id: string; toolbox: boolean; defaults?: IBlockDefaults; register(Blockly: any): void; } export declare class BlocklyMetaRenderer implements IMetaRenderer { defaultsMap: Map; blocksMap: Map; legacyBlocksMap: Map; getEntryForBlock(blockType: string): MetaModule | undefined; getDefaultsForBlock(blockType: string): IBlockDefaults | undefined; getIdForBlock(blockType: string): Meta | undefined; renderLegacyToolboxEntry(mod: ILegacyModule, whitelist: string[] | null): ICategory | null; shadowForDefaults(defaults: IBlockDefaults): any; renderToolboxEntry(mod: MetaModule, whitelist: string[] | null): ICategory | null; disposeToolboxEntry(category: ICategory): void; render(m: MetaModule): IRenderedBlock[]; renderModule(m: MetaModule): IRenderedBlock[]; static getId(m: Meta): string; static renderVariable(m: MetaVariable): IRenderedBlock[]; static verboseWithPrefix(m: Meta): string; static renderGetter(m: MetaVariable): IRenderedBlock; static renderSetter(m: MetaVariable): IRenderedBlock; static formatFieldValue(value: any, def: any): any; /** * Looks up a Blockly block tree and find a parent block that has a callback function definition * with an argument matching the required type. Return the argument name. * @param block A blockly block * @param returnType A function argument to match */ static findScopedArgument(block: Block, returnType: any): string | null; renderFunction(m: MetaFunction): { register: (Blockly: any) => void; id: string; defaults: any; toolbox: boolean; }[]; static isInToolbox(m: Meta): boolean; static parseInputType(type: any, param: Meta): { type: string; options?: undefined; value?: undefined; text?: undefined; check?: undefined; } | { type: string; options: [string, string][]; value?: undefined; text?: undefined; check?: undefined; } | { type: string; value: any; options?: undefined; text?: undefined; check?: undefined; } | { type: string; text: any; options?: undefined; value?: undefined; check?: undefined; } | { type: string; check: any; options?: undefined; value?: undefined; text?: undefined; }; static parseType(type: any): any; } export default BlocklyMetaRenderer;