/// import BlockLeaf from "./BlockLeaf"; import { RenderEditProps, RenderSaveProps } from "./BlockDefinition"; import { ReactElement } from "@wordpress/element"; import { BlockConfiguration, BlockInstance } from "@wordpress/blocks"; import { BlockValidationResult } from "../validation"; import Instruction, { InstructionOptions } from "../Instruction"; export declare type BlockInstructionClass = { new (id: number, options: InstructionOptions): BlockInstruction; options: InstructionOptions; }; /** * BlockInstruction class. */ export default abstract class BlockInstruction extends Instruction { /** * Renders saving the element. * * @param props The props. * @param leaf The leaf being rendered. * @param i The number the rendered element is of its parent. * * @returns {ReactElement | string} The element to render. */ save(props: RenderSaveProps, leaf: BlockLeaf, i: number): ReactElement | string; /** * Renders editing the element. * * @param props The props. * @param leaf The leaf being rendered. * @param i The number the rendered element is of its parent. * * @returns {ReactElement | string} The element to render. */ edit(props: RenderEditProps, leaf: BlockLeaf, i: number): ReactElement | string; /** * Renders the sidebar. * * @param props The props. * @param i The number the rendered element is of its parent. * * @returns {ReactElement | string} The sidebar element to render. */ sidebar(props: RenderEditProps, i: number): ReactElement; /** * Returns the configuration of this instruction. * * @returns {Partial} The configuration. */ configuration(): Partial; /** * Checks if the instruction block is valid. * * @param blockInstance The attributes from the block. * * @returns {BlockValidationResult} The validation result. */ validate(blockInstance: BlockInstance): BlockValidationResult; }