/** * One element node in a fast-xml-parser `preserveOrder` tree: a record with a * single tag-name key (its children) plus an optional `:@` attributes object. */ export type PoNode = Record; /** An ordered list of sibling {@link PoNode}s (the parser's array form). */ export type PoTree = ReadonlyArray; /** The element's tag name (the one key that is neither `:@` nor `#text`), or undefined. */ export declare function poTag(node: PoNode | undefined): string | undefined; /** Whether the node's tag equals `tag` exactly (prefix-sensitive). */ export declare function poIs(node: PoNode | undefined, tag: string): boolean; /** The node's child elements (the value under its tag key), or `[]`. */ export declare function poChildren(node: PoNode | undefined): ReadonlyArray; /** The node's direct children with tag `tag`. */ export declare function poChildrenWith(node: PoNode | undefined, tag: string): Array; /** The node's first direct child with tag `tag`, or undefined. */ export declare function poFirstChild(node: PoNode | undefined, tag: string): PoNode | undefined; /** * An attribute value by local `name`, trying the common OOXML namespace prefixes * (`w:`/`r:`/`m:`/`xml:`, then bare) in priority order. Returns undefined when * absent or non-string. */ export declare function poAttr(node: PoNode | undefined, name: string): string | undefined; /** * Like `poAttr` but matches by LOCAL name regardless of the prefix — for vendor * extensions whose namespace `poAttr` does not special-case (e.g. `w14:paraId`, * `w15:done`, `w15:paraIdParent`). */ export declare function poAttrLocal(node: PoNode | undefined, name: string): string | undefined; /** * Like `poIs` but matches a tag by LOCAL name, so an element authored under any * prefix (`w15:commentsEx`, `mc:commentsEx`, …) still resolves. */ export declare function poIsLocal(node: PoNode | undefined, name: string): boolean; /** {@link poAttr} parsed as a finite number, or undefined when absent/non-numeric. */ export declare function poIntAttr(node: PoNode | undefined, name: string): number | undefined; /** * §22.9.2.15 ST_UniversalMeasure — a number with a UNIT (`"28.35pt"`, `"1cm"`) * as twips. Producers write whole page geometries, tab stops and indents this * way; read as a plain number they are nothing at all. * * @param raw The attribute value. * @returns The measure in twips, or undefined when it names no unit. */ export declare function universalMeasureTwips(raw: string): number | undefined; /** Shorthand for the `val` attribute (`@w:val`/…). */ export declare function poVal(node: PoNode | undefined): string | undefined; /** * Read an OOXML boolean toggle property (§17.17.4): a present element with no * `val` (or `val` true/1/on) is `true`; `false`/`0`/`off` is `false`; an absent * element (`node` undefined) is undefined ("inherit"). */ export declare function poToggle(node: PoNode | undefined): boolean | undefined; /** Concatenate the node's direct `#text` leaf children into a single string. */ export declare function poText(node: PoNode | undefined): string; /** * Walk a chain of tags from the tree root, descending into the first child that * matches each successive `path` segment. Returns the node at the path end, or * undefined if any segment is missing. */ export declare function poFindByPath(tree: PoTree, path: ReadonlyArray): PoNode | undefined; /** Depth-first search for the first descendant with the given `tag`. */ export declare function poFindDescendant(node: PoNode | undefined, tag: string): PoNode | undefined;