import { BlockInstance } from "@wordpress/blocks"; import { BlockValidationResult, RecommendedBlock, RequiredBlock } from "../../core/validation"; import { BlockPresence } from "../../core/validation/BlockValidationResult"; /** * Finds all blocks that should/could be in the inner blocks, but aren't. * * @param existingBlocks The actual array of all inner blocks. * @param wantedBlocks All of the blocks that should occur (required), or could occur (recommended) in the inner blocks. * @param blockPresence The block presence. * * @returns {BlockValidationResult[]} The names of blocks that should/could occur but don't, with reason 'MissingBlock'. */ declare function findMissingBlocks(existingBlocks: BlockInstance[], wantedBlocks: RequiredBlock[] | RecommendedBlock[], blockPresence: BlockPresence): BlockValidationResult[]; /** * Finds all blocks that occur more than once in the inner blocks. * * @param existingBlocks The actual array of all inner blocks. * @param allBlocks All of the blocks that should occur (required), or could occur (recommended) in the inner blocks. * @param blockPresence The block presence. * * @returns {BlockValidationResult[]} The names of blocks that occur more than once in the inner blocks with reason 'TooMany'. */ declare function findRedundantBlocks(existingBlocks: BlockInstance[], allBlocks: RequiredBlock[] | RecommendedBlock[], blockPresence: BlockPresence): BlockValidationResult[]; /** * Finds all blocks that have found themselves invalid. * * @param blockInstance The block whose InnerBlocks are validated. * @param requiredBlocks Requirements of the blocks that should occur in the inner blocks. * * @returns {BlockValidationResult[]} The array of blocks that have invalidated themselves. */ declare function validateInnerblockTree(blockInstance: BlockInstance): BlockValidationResult[]; /** * Validates all inner blocks recursively and returns all invalid blocks. * * @param blockInstance The block whose inner blocks need to be validated. * @param requiredBlocks The inner blocks that are required. * @param recommendedBlocks The inner blocks that are recommended. * * @returns {BlockValidationResult[]} The names and reasons of the inner blocks that are invalid. */ declare function validateInnerBlocks(blockInstance: BlockInstance, requiredBlocks?: RequiredBlock[], recommendedBlocks?: RecommendedBlock[]): BlockValidationResult[]; export default validateInnerBlocks; export { findMissingBlocks, findRedundantBlocks, validateInnerblockTree };