import { FlowBlock, ListBlock, SdtMetadata, FieldAnnotationMetadata, StructuredContentMetadata, DocumentSectionMetadata, DocPartMetadata } from '../../../../../../../layout-engine/contracts/src/index.js';
import { PMNode } from '../types.js';
type SdtMetadataForOverride<TOverride extends string | undefined> = TOverride extends 'fieldAnnotation' ? FieldAnnotationMetadata : TOverride extends 'structuredContent' | 'structuredContentBlock' ? StructuredContentMetadata : TOverride extends 'documentSection' ? DocumentSectionMetadata : TOverride extends 'docPartObject' ? DocPartMetadata : SdtMetadata;
/**
 * Type guard to check if a node has instruction attribute.
 */
export declare function hasInstruction(node: PMNode): node is PMNode & {
    attrs: {
        instruction?: string;
    };
};
/**
 * Safely extract instruction attribute from a node.
 */
export declare function getNodeInstruction(node: PMNode): string | undefined;
/**
 * Safely extract docPartGallery attribute from a node.
 */
export declare function getDocPartGallery(node: PMNode): string | undefined;
/**
 * Safely extract docPartObject ID attribute from a node.
 */
export declare function getDocPartObjectId(node: PMNode): string | undefined;
/**
 * Resolve SDT metadata from a ProseMirror node.
 * Uses the style engine's resolveSdtMetadata function with appropriate caching.
 *
 * @param node - PM node to extract metadata from
 * @param overrideType - Optional type override (e.g., 'documentSection', 'docPartObject')
 * @returns Resolved SDT metadata, or undefined if none
 */
export declare function resolveNodeSdtMetadata<TOverride extends string | undefined = undefined>(node: PMNode, overrideType?: TOverride): SdtMetadataForOverride<TOverride> | undefined;
/**
 * Apply SDT metadata to paragraph blocks.
 * Sets the sdt property in block.attrs for each paragraph.
 *
 * @param blocks - Array of flow blocks to process (only paragraphs are modified)
 * @param metadata - SDT metadata to apply
 */
export declare function applySdtMetadataToParagraphBlocks(blocks: FlowBlock[], metadata?: SdtMetadata): void;
/**
 * Apply SDT metadata to a table block and all its cell paragraphs.
 * Recursively applies metadata to nested paragraph content within table cells.
 *
 * @param tableBlock - Table block to process
 * @param metadata - SDT metadata to apply
 */
export declare function applySdtMetadataToTableBlock(tableBlock: FlowBlock | undefined, metadata?: SdtMetadata): void;
/**
 * Applies SDT metadata to all list items within a ListBlock.
 *
 * List items contain embedded paragraph blocks (ListItem.paragraph), and this function
 * ensures each paragraph receives the specified SDT metadata. This is commonly used when
 * a list appears inside a documentSection or other SDT container, so the list items
 * inherit the parent's metadata.
 *
 * @param listBlock - The list block whose items should receive metadata
 * @param metadata - The SDT metadata to apply (e.g., documentSection, structuredContent)
 *
 * @example
 * ```typescript
 * const sectionMetadata: DocumentSectionMetadata = {
 *   type: 'documentSection',
 *   id: 'section-1',
 *   title: 'Locked Section',
 *   isLocked: true
 * };
 *
 * applySdtMetadataToListBlock(listBlock, sectionMetadata);
 * // Now every list item's paragraph has section metadata
 * ```
 */
export declare function applySdtMetadataToListBlock(listBlock: ListBlock | undefined, metadata?: SdtMetadata): void;
export {};
//# sourceMappingURL=metadata.d.ts.map