import { BlockInstance } from "@wordpress/blocks"; import { BlockValidationResult } from "./validation"; export declare type InstructionPrimitive = string | number | boolean; export declare type InstructionValue = InstructionPrimitive | InstructionObject | InstructionArray; export declare type InstructionArray = readonly InstructionValue[]; export interface InstructionObject { [member: string]: InstructionValue; } export interface InstructionClass { new (id: number, options: InstructionOptions): T; } export declare type InstructionOptions = InstructionObject & { name: string; }; /** * Abstract instruction class. */ export default abstract class Instruction { static registeredInstructions: Record>; id: number; options: InstructionOptions; /** * Creates a render instruction. * * @param id The id. * @param options The options. */ constructor(id: number, options: InstructionOptions); /** * Returns the configuration of this instruction. * * @returns The configuration. */ configuration(): Partial>; /** * Returns whether or not this instruction should be included in the tree. * * @returns Whether or not to render this instruction. */ renderable(): boolean; /** * Validates the block instance against its definition. * * @param blockInstance The block to check. * @returns {BlockValidationResult} The validation result. */ validate(blockInstance: BlockInstance): BlockValidationResult; /** * Registers a new instruction. * * @param this This. * @param name The name of the instruction. * @param instruction The instruction class. * * @returns {void} */ static register(this: I, name: string, instruction: InstructionClass): void; /** * Creates an instruction instance. * * @param this This. * @param name The name of the instruction. * @param id The id of the instance. * @param options The options of the instance. * * @returns The instruction instance. */ static create(this: I, name: string, id: number, options: InstructionOptions): I["prototype"]; }