open-agreements
Version:
Open-source legal template filling CLI and library
36 lines • 1.91 kB
TypeScript
/**
* Shared property builders: RunProps → w:rPr and paragraph formatting → w:pPr
* child maps, used by both the body emitters (run.ts / paragraph.ts) and the
* styles-part emitter so direct formatting and style definitions can never
* drift apart. All children are routed through the ordering tables.
*/
import type { ParagraphSpec, RunProps, StyleSpec, ThemeColorSlot } from '../types.js';
/** Paragraph-formatting subset shared by ParagraphSpec and StyleSpec.paragraph. */
export type ParagraphProps = Pick<ParagraphSpec, 'alignment' | 'spacing' | 'indent' | 'tabs' | 'pageBreakBefore' | 'keepNext' | 'keepLines'> & {
styleId?: string;
};
/**
* Build the ordered rPr children for a RunProps value. Returns null when no
* property is set so callers can omit the rPr container entirely.
*
* Complex-script twins (bCs/iCs/szCs) and the full rFonts script coverage
* (ascii + hAnsi + cs) are always emitted alongside their base properties so
* all script ranges agree.
*
* @conformance ECMA-376 edition 5, Part 1 § 17.3.2.28
*/
export declare function buildRunPropsElement(doc: Document, props: RunProps, opts?: {
themeColorValues?: ReadonlyMap<ThemeColorSlot, string>;
}): Element | null;
/**
* Build the ordered pPr children for a paragraph-formatting subset. Returns
* null when nothing is set. The optional extras hook lets phase-specific
* callers add already-built children (e.g. a section break sectPr) that
* still go through the same ordering discipline.
*
* @conformance ECMA-376 edition 5, Part 1 § 17.3.1.26
*/
export declare function buildParagraphPropsElement(doc: Document, props: ParagraphProps, extras?: ReadonlyMap<string, Element | Element[]>): Element | null;
/** Paragraph-formatting subset of a StyleSpec, normalized for the builder. */
export declare function styleParagraphProps(style: StyleSpec): ParagraphProps;
//# sourceMappingURL=properties.d.ts.map