import BlocklyChallenge from './blockly.js'; import { Editor } from '../../../editor/editor.js'; import { BannerWidget, IBannerButton } from '../../../challenge/widget/banner.js'; import { Part } from '../../../parts/part.js'; import '../../../challenge/components/kc-toolbox-entry-preview.js'; import '../../../challenge/components/kc-part-api-preview.js'; export interface IBannerIconProvider { getDomNode(): HTMLElement; } export declare class KanoCodeChallenge extends BlocklyChallenge { editor: Editor; private _beaconSub?; private _beaconSoundSub?; private tooltips; banner?: BannerWidget; bannerButtons: IBannerButton[]; private bannerIconProvider?; progress: number; private stylesheet; private bannerTitle; constructor(editor: Editor); /** * Parses the provided text, extract and replace eventual template values with preview widgets. * It is important to make sure each preview widget returns only one element for it to be displayed inline * If it returns more than one, marked.js will display it as a block * @param text Source text to be processed as rich content */ protected processRichText(text: string): string; /** * Displays a list of tooltips as content widgets of the editor * @param tooltips A list of tooltip data from a challenge step */ protected displayTooltips(tooltips: any[]): void; /** * Remove the tooltips previously added */ protected hideTooltips(): void; /** * Displays a banner as a content widget on top of the sourceEditor * @param data Banner data from a challenge step */ protected displayBanner(data: any): void; /** * Removes a previously added banner */ protected hideBanner(): void; /** * Displays a beacon as a content widget on the editor * @param data Beacon data from a challenge step */ protected displayBeacon(data: any): void; /** * Removes a previously added beacon */ protected hideBeacon(): void; _getOpenPartsDialogStep(data: any): { validation: { 'open-parts': boolean; }; beacon: string; banner: any; }; _getCreatePartStep(data: any): { validation: { 'add-part': { type: any; alias: any; }; }; beacon: string; banner: any; }; _createPartShorthand(data: any): ({ validation: { 'open-parts': boolean; }; beacon: string; banner: any; } | { validation: { 'add-part': { type: any; alias: any; }; }; beacon: string; banner: any; })[]; _partsClosed(): void; /** * Will tell if a property defined in a validation and an event matches * Example: * The validation says: 'userStyle.background' and the event says * 'userStyle.background', the properties match * The story creator can define a step that just wait for a vague action * to be made: * validation: 'position.*' will match things like 'position.x' and * 'position.y' */ matchProperty(validation: any, event: any): boolean; matchValue(validation: any, event: any): boolean; matchTool(validation: any, event: any): boolean; matchAddPart(validation: any, event: { data: Part; }): boolean; matchPartType(validation: any, part: Part): boolean; matchSettingsInteraction(validation: any, event: any): boolean; readonly done: boolean; _getOpenFlyoutStep(data: any): any; _getCreateBlockStep(data: any): any; _getConnectBlockStep(data: any): any; _getDropBlockStep(data: any): any; _changeInputShorthand(data: any): { validation: { blockly: { value: { target: any; value: any; skipCheck: any; }; }; }; }; /** * Defines the provider for the banner icon. This provider will define a DOM node tu use instead of the progress circle * @param provider A banner icon provider */ setBannerIconProvider(provider: IBannerIconProvider): void; setBannerTitle(title: string): void; setSteps(steps: any[]): void; stripGeneratorSteps(steps: any[]): void; dispose(): void; } export default KanoCodeChallenge;