UNPKG

@dotcms/uve

Version:

Official JavaScript library for interacting with Universal Visual Editor (UVE)

27 lines (26 loc) 1.17 kB
import { BlockEditorNode } from '@dotcms/types'; import { BlockEditorState, DotCMSContainerBound } from '@dotcms/types/internal'; /** * Sets the bounds of the containers in the editor. * Retrieves the containers from the DOM and sends their position data to the editor. * @private * @memberof DotCMSPageEditor */ export declare function setBounds(bounds: DotCMSContainerBound[]): void; /** * Validates the structure of a Block Editor node. * * This function performs validation checks on a BlockEditorNode object to ensure: * - The node exists and is a valid object * - The node has a 'doc' type * - The node has a valid content array containing at least one block * - Each block in the content array: * - Has a valid string type property * - Has valid object attributes (if present) * - Has valid nested content (if present) * * @param {BlockEditorNode} blocks - The BlockEditorNode structure to validate * @returns {BlockEditorState} The validation result * @property {string | null} BlockEditorState.error - Error message if validation fails, null if valid */ export declare const isValidBlocks: (blocks: BlockEditorNode) => BlockEditorState;