/// import { ReactElement } from "@wordpress/element"; import { BlockConfiguration, BlockEditProps, BlockSaveProps } from "@wordpress/blocks"; import BlockInstruction from "./BlockInstruction"; import Definition from "../Definition"; import BlockRootLeaf from "../../leaves/blocks/BlockRootLeaf"; import parse from "../../functions/blocks/parse"; export interface RenderEditProps extends BlockEditProps> { clientId: string; name?: string; } export interface RenderSaveProps extends BlockSaveProps> { clientId?: string; } export declare type MutableBlockConfiguration = { -readonly [K in keyof BlockConfiguration]: BlockConfiguration[K]; }; /** * BlockDefinition class. */ export default class BlockDefinition extends Definition { static separatorCharacters: string[]; static parser: typeof parse; instructions: Record; tree: BlockRootLeaf; /** * Renders editing the block. * * @param props The props. * * @returns The rendered block. */ edit(props: RenderEditProps): ReactElement; /** * Renders the persisted block. * * @param props The props. * * @returns {ReactElement} The rendered block. */ save(props: RenderSaveProps): ReactElement; /** * Registers the block with Gutenberg. */ register(): void; /** * Creates the sidebar elements. * * @param props The properties of the block to create a sidebar for. * * @returns {ReactElement[]} The sidebar element to render. */ sidebarElements(props: RenderEditProps): ReactElement[]; /** * Creates a block icon. * * @param {MutableBlockConfiguration} configuration The block configuration. * * @returns {ReactElement[]} The sidebar element to render. */ private createBlockIcon; }