/** * DOCX Module - Glossary Document (Building Blocks) * * Provides types and utilities for working with Glossary Document parts, * which contain AutoText entries, Quick Parts, and other Building Blocks. * * INTEGRATION STATUS: This module provides the glossary data model and query * helpers. To embed a glossary in a document, assign a {@link GlossaryDocument} * to `doc.glossary`; the packager then serialises it to * `word/glossary/document.xml`, registers the `glossaryDocument` relationship, * and adds the `[Content_Types].xml` override (the canonical OOXML location * Word reads Quick Parts / AutoText from). Glossary parts in existing files are * round-tripped via the same channel. This module is useful for: * - Building glossary data structures programmatically * - Querying/filtering building block collections * - Assembling a glossary to attach via `doc.glossary` */ import type { BodyContent, BuildingBlock, BuildingBlockGallery, GlossaryDocument, SectionProperties } from "../types.js"; export type { BuildingBlock, BuildingBlockGallery, GlossaryDocument } from "../types.js"; /** * Create a building block entry. * * @param name - Display name of the building block. * @param gallery - Which gallery it belongs to. * @param content - The body content of the building block. * @param options - Additional options. * @returns A BuildingBlock instance. * * @example * ```ts * const autoText = createBuildingBlock("Greeting", "autoText", [ * paragraph([text("Dear Sir/Madam,")]) * ]); * ``` */ export declare function createBuildingBlock(name: string, gallery: BuildingBlockGallery, content: readonly BodyContent[], options?: { category?: string; description?: string; sectionProperties?: SectionProperties; }): BuildingBlock; /** * Create a glossary document from building blocks. */ export declare function createGlossaryDocument(blocks: readonly BuildingBlock[]): GlossaryDocument; /** * Find a building block by name and gallery. */ export declare function findBuildingBlock(glossary: GlossaryDocument, name: string, gallery?: BuildingBlockGallery): BuildingBlock | undefined; /** * List all building blocks in a specific gallery. */ export declare function listBuildingBlocks(glossary: GlossaryDocument, gallery: BuildingBlockGallery): readonly BuildingBlock[]; /** * Extract AutoText entries from a glossary document. */ export declare function getAutoTextEntries(glossary: GlossaryDocument): readonly BuildingBlock[]; /** * Extract Quick Parts from a glossary document. */ export declare function getQuickParts(glossary: GlossaryDocument): readonly BuildingBlock[];