import { Creator, IGeneratedStep, ICreatorOptions } from '../../../creator/creator.js'; import { BlocklySourceEditor } from '../../blockly.js'; import { Field } from '@kano/kwc-blockly/blockly.js'; import { IInnerTextDiffResult } from './xml.js'; import { ICreatorHelper } from '../../../creator/index.js'; import { Editor } from '../../../editor/editor.js'; import { BlocklyStepper } from './stepper/blockly-stepper.js'; import { IDisposable } from '@kano/common/index.js'; export * from './helpers.js'; import './copy.js'; import { IExceptionMapItem } from './block-exceptions.js'; interface IConnectionInfo { name: string; parentStep?: IGeneratedStep; id?: string; } export declare class BlocklyCreator extends Creator { sourceEditor?: BlocklySourceEditor; helpers: ICreatorHelper[]; aliases: IDisposable[]; blockExceptionMap: Map | undefined; constructor(editor: Editor, opts: ICreatorOptions); createStepper(): BlocklyStepper; onInject(): void; generate(): import("../../../creator/creator.js").IGeneratedChallenge & { steps: IGeneratedStep[]; id: string | null; name: string | null; defaultApp: string; }; generateChallengeId(dom: XMLDocument): string | null; generateChallengeName(dom: XMLDocument): string | null; generateLastStep(dom: XMLDocument): IGeneratedStep | null; getConnectionForStatementOrValue(block: HTMLElement): string | null; generateConnectionQuery(result: IConnectionInfo): string | null; customBlockToSteps(block: HTMLElement): IGeneratedStep[]; startToSteps(block: HTMLElement): IGeneratedStep[]; blockToSteps(block: HTMLElement): IGeneratedStep[]; checkForBlockExceptions(legacyCategory: string, legacyType: string): string[]; getOriginalStepFromSource(source: string): any; /** * For a given Blockly XML node, generate the matching steps * This only acts as a router for the different types of blocks that this generator can handle * @param node The node in the Blockly XMLtree used as a source to generate the steps */ nodeToSteps(node: HTMLElement): IGeneratedStep[]; /** * Find the first block node under a statement or next node and generate the steps * @param node A statement or next node to generate steps from */ statementOrNextToSteps(node: HTMLElement): IGeneratedStep[]; valueToSteps(node: HTMLElement): IGeneratedStep[]; fieldToSteps(node: HTMLElement): IGeneratedStep[]; getFieldForNode(node: HTMLElement): Field | null; runFieldHelper(field: Field, defaultValue: string, currentValue: string, step: IGeneratedStep): IGeneratedStep; shadowToSteps(parent: HTMLElement, inputName: string, shadow: HTMLElement): IGeneratedStep[]; getFieldForInnerTextResult(result: IInnerTextDiffResult): Field | null; focusTarget(source: string): void; }