import { Colord } from 'colord'; interface NormalizedAudio { src: string; } type Audio = string | NormalizedAudio; declare function normalizeAudio(audio: Audio): NormalizedAudio | undefined; interface RgbColor { r: number; g: number; b: number; } interface HslColor { h: number; s: number; l: number; } interface HsvColor { h: number; s: number; v: number; } interface HwbColor { h: number; w: number; b: number; } interface XyzColor { x: number; y: number; z: number; } interface LabColor { l: number; a: number; b: number; } interface LchColor { l: number; c: number; h: number; } interface CmykColor { c: number; m: number; y: number; k: number; } type WithAlpha = O & { a: number; }; type RgbaColor = WithAlpha; type HslaColor = WithAlpha; type HsvaColor = WithAlpha; type HwbaColor = WithAlpha; type XyzaColor = WithAlpha; type LabaColor = LabColor & { alpha: number; }; type LchaColor = WithAlpha; type CmykaColor = WithAlpha; type ObjectColor = RgbColor | RgbaColor | HslColor | HslaColor | HsvColor | HsvaColor | HwbColor | HwbaColor | XyzColor | XyzaColor | LabColor | LabaColor | LchColor | LchaColor | CmykColor | CmykaColor; type Uint32Color = number; type Color = Uint32Color | ObjectColor | string; type Hex8Color = string; type NormalizedColor = Hex8Color; declare function parseColor(color: Color): Colord; declare const defaultColor: NormalizedColor; declare function isColor(value: string): boolean; declare function normalizeColor(color: Color, orFail?: boolean): NormalizedColor; interface ColorStop { offset: number; color: NormalizedColor; } interface LinearGradient { angle: number; stops: ColorStop[]; repeat?: boolean; } type LinearGradientWithType = LinearGradient & { type: 'linear-gradient'; }; interface RadialGradient { stops: ColorStop[]; repeat?: boolean; } type RadialGradientWithType = RadialGradient & { type: 'radial-gradient'; }; declare function isGradient(cssText: string): boolean; declare function normalizeGradient(cssText: string): (LinearGradientWithType | RadialGradientWithType)[]; interface LinearGradientNode { type: 'linear-gradient' orientation?: DirectionalNode | AngularNode | undefined colorStops: ColorStopNode[] } interface RepeatingLinearGradientNode { type: 'repeating-linear-gradient' orientation?: DirectionalNode | AngularNode | undefined colorStops: ColorStopNode[] } interface RadialGradientNode { type: 'radial-gradient' orientation?: (ShapeNode | DefaultRadialNode | ExtentKeywordNode)[] | undefined colorStops: ColorStopNode[] } interface RepeatingRadialGradientNode { type: 'repeating-radial-gradient' orientation?: (ShapeNode | DefaultRadialNode | ExtentKeywordNode)[] | undefined colorStops: ColorStopNode[] } interface DirectionalNode { type: 'directional' value: | 'left' | 'top' | 'bottom' | 'right' | 'left top' | 'top left' | 'left bottom' | 'bottom left' | 'right top' | 'top right' | 'right bottom' | 'bottom right' } interface AngularNode { type: 'angular' value: string } interface LiteralNode { type: 'literal' value: string length?: PxNode | EmNode | PercentNode | undefined } interface HexNode { type: 'hex' value: string length?: PxNode | EmNode | PercentNode | undefined } interface RgbNode { type: 'rgb' value: [string, string, string] length?: PxNode | EmNode | PercentNode | undefined } interface RgbaNode { type: 'rgba' value: [string, string, string, string?] length?: PxNode | EmNode | PercentNode | undefined } interface ShapeNode { type: 'shape' style?: ExtentKeywordNode | PxNode | EmNode | PercentNode | PositionKeywordNode | undefined value: 'ellipse' | 'circle' at?: PositionNode | undefined } interface DefaultRadialNode { type: 'default-radial' at: PositionNode } interface PositionKeywordNode { type: 'position-keyword' value: 'center' | 'left' | 'top' | 'bottom' | 'right' } interface PositionNode { type: 'position' value: { x: ExtentKeywordNode | PxNode | EmNode | PercentNode | PositionKeywordNode y: ExtentKeywordNode | PxNode | EmNode | PercentNode | PositionKeywordNode } } interface ExtentKeywordNode { type: 'extent-keyword' value: 'closest-side' | 'closest-corner' | 'farthest-side' | 'farthest-corner' | 'contain' | 'cover' at?: PositionNode | undefined } interface PxNode { type: 'px' value: string } interface EmNode { type: 'em' value: string } interface PercentNode { type: '%' value: string } type ColorStopNode = LiteralNode | HexNode | RgbNode | RgbaNode type GradientNode = LinearGradientNode | RepeatingLinearGradientNode | RadialGradientNode | RepeatingRadialGradientNode declare function parseGradient(cssText: string): GradientNode[] declare function stringifyGradient(ast: GradientNode[]): string interface ColorFillObject { color: Color; } type ColorFill = string | ColorFillObject; interface NormalizedColorFill { color: NormalizedColor; } declare const colorFillFields: (keyof NormalizedColorFill)[]; declare function normalizeColorFill(fill: ColorFill): NormalizedColorFill; type None = undefined | null | 'none'; type WithNone = T | None; type WithStyleNone = T | 'none'; type LineCap = 'butt' | 'round' | 'square'; type LineJoin = 'miter' | 'round' | 'bevel'; interface Toggleable { enabled: boolean; } type GradientFillObject = { image?: string; } & Partial; type GradientFill = string | GradientFillObject; interface NormalizedGradientFill { linearGradient?: LinearGradient; radialGradient?: RadialGradient; rotateWithShape?: boolean; } declare const gradientFillFields: (keyof NormalizedGradientFill)[]; declare function normalizeGradientFill(fill: GradientFill): NormalizedGradientFill; /** * 图片处理管线步骤:引用一个已注册的具名管线 + 参数。 * * 数据只记录「用了哪个管线 + 参数」,处理函数(image → image)是运行时注册的黑盒, * 不入持久化数据。渲染端按需把 `图片 + imagePipelines` 烘焙到运行时纹理;导出端按需物化成成品图。 */ interface ImagePipeline { name: string; params?: Record; } interface NormalizedImagePipeline extends ImagePipeline { } /** * 跨端的中立图片像素结构(等价 `ImageData`),供管线处理函数 `image → image` 使用。 * 不依赖 DOM,可在浏览器与 node 导出环境一致运行。 */ interface PipelineImage { data: Uint8ClampedArray; width: number; height: number; } declare function normalizeImagePipeline(pipeline: ImagePipeline): NormalizedImagePipeline; /** * 0 -0.5 0 * -0.5 -0.5 * 0 -0.5 0 */ interface ImageFillCropRect { left?: number; top?: number; bottom?: number; right?: number; } /** * 0 0.5 0 * 0.5 0.5 * 0 0.5 0 */ interface ImageFillStretchRect { left?: number; top?: number; bottom?: number; right?: number; } interface ImageFillTile { alignment?: string; scaleX?: number; scaleY?: number; translateX?: number; translateY?: number; flip?: string; } interface ImageFillObject { image: string; cropRect?: ImageFillCropRect; stretchRect?: ImageFillStretchRect; tile?: ImageFillTile; dpi?: number; opacity?: number; rotateWithShape?: boolean; /** * 图片处理管线:图片源在上屏/导出前依次流经的具名处理步骤(image → image)。 * 只记录管线名与参数;处理函数为运行时注册的黑盒,不入数据。 */ imagePipelines?: ImagePipeline[]; } type ImageFill = string | ImageFillObject; interface NormalizedImageFill extends ImageFillObject { imagePipelines?: NormalizedImagePipeline[]; } declare const imageFillFiedls: (keyof NormalizedImageFill)[]; declare function normalizeImageFill(fill: ImageFill): NormalizedImageFill; interface PresetFillObject { preset: string; foregroundColor?: WithNone; backgroundColor?: WithNone; } type PresetFill = string | PresetFillObject; interface NormalizedPresetFill extends PresetFillObject { foregroundColor?: NormalizedColor; backgroundColor?: NormalizedColor; } declare const presetFillFiedls: (keyof NormalizedPresetFill)[]; declare function normalizePresetFill(fill: PresetFill): NormalizedPresetFill; type FillObject = Partial & Partial & Partial & Partial & Partial; type Fill = string | FillObject; type NormalizedFill = Toggleable & Partial & Partial & Partial & Partial; declare function isColorFillObject(fill: FillObject): fill is ColorFillObject; declare function isColorFill(fill: Fill): fill is ColorFill; declare function isGradientFillObject(fill: FillObject): fill is GradientFillObject; declare function isGradientFill(fill: Fill): fill is GradientFill; declare function isImageFillObject(fill: FillObject): fill is ImageFillObject; declare function isImageFill(fill: Fill): fill is ImageFill; declare function isPresetFillObject(fill: FillObject): fill is PresetFillObject; declare function isPresetFill(fill: Fill): fill is PresetFill; declare function normalizeFill(fill: Fill): NormalizedFill; interface NormalizedBaseBackground { fillWithShape?: boolean; } type NormalizedBackground = NormalizedFill & NormalizedBaseBackground; type BackgroundObject = FillObject & Partial; type Background = string | BackgroundObject; declare function normalizeBackground(background: Background): NormalizedBackground; type BackgroundSize = 'contain' | 'cover' | string | 'stretch' | 'rigid'; interface NormalizedBackgroundStyle { backgroundImage: WithStyleNone; backgroundSize: BackgroundSize; backgroundColor: WithStyleNone; backgroundColormap: WithStyleNone>; } declare function getDefaultBackgroundStyle(): NormalizedBackgroundStyle; type ChartType = 'column' | 'bar' | 'line' | 'area' | 'pie' | 'doughnut' | 'scatter' | 'radar' | (string & {}); /** 分组方式(柱/条/面/线) */ type ChartGrouping = 'clustered' | 'stacked' | 'percentStacked' | 'standard'; type ChartLegend = false | 'top' | 'bottom' | 'left' | 'right'; interface ChartSeriesObject { name?: string; /** 数值序列(与 chart.categories 对齐) */ values: number[]; /** scatter 用:与 values 配对的 x 值 */ xValues?: number[]; color?: string; } interface ChartAxis { title?: string; min?: number; max?: number; /** 是否显示 */ visible?: boolean; } interface ChartObject extends Partial { type?: ChartType; grouping?: ChartGrouping; /** 分类标签(共享),如 ["一月","二月"] */ categories?: string[]; series?: ChartSeriesObject[]; title?: string; legend?: ChartLegend; categoryAxis?: ChartAxis; valueAxis?: ChartAxis; } type Chart = ChartObject; interface NormalizedChartSeries { name?: string; values: number[]; xValues?: number[]; color?: string; } interface NormalizedChart extends Toggleable { type: ChartType; grouping?: ChartGrouping; categories: string[]; series: NormalizedChartSeries[]; title?: string; legend?: ChartLegend; categoryAxis?: ChartAxis; valueAxis?: ChartAxis; } declare function normalizeChart(chart: Chart): NormalizedChart; /** 评论位置:相对所属元素原点的偏移。 */ interface CommentOffset { x: number; y: number; } /** 评论作者。 */ interface CommentAuthor { id?: string; name?: string; color?: string; /** 姓名缩写(PPTX 作者用;缺省可由 name 推导)。 */ initials?: string; } /** 线程中的单条消息(根消息即创建评论,其后为回复)。 */ interface CommentMessage { id?: string; author?: CommentAuthor; /** 正文。 */ body?: string; /** 创建时间(毫秒时间戳)。 */ createdAt?: number; } /** * 一条评论线程,作为 {@link Element} 的能力存于 `element.comments`。 * * - 锚点:`offset` 为**相对所属元素原点的偏移**(渲染时经元素世界矩阵还原为屏幕位置), * 随该元素及其祖先的平移 / 缩放 / 旋转、复制 / 删除 / 重组自然跟随。 * 「画布级评论」即挂在页/帧或根元素上的线程 —— 无需区分 canvas / element 锚点。 * - 归属页(如 PPTX 幻灯片)由元素在文档树中的位置决定,无需显式 pageId。 * - 线程级数据(offset / resolved)归线程本身;对话内容在 `messages`。 */ interface CommentThread { id?: string; /** 锚点偏移(相对所属元素原点)。 */ offset?: CommentOffset; /** 是否已解决。 */ resolved?: boolean; /** 对话消息(首条为创建,其后为回复)。 */ messages?: CommentMessage[]; } interface NormalizedCommentMessage { id: string; author?: CommentAuthor; body: string; createdAt?: number; } interface NormalizedCommentThread { id: string; offset?: CommentOffset; resolved?: boolean; messages: NormalizedCommentMessage[]; } declare function normalizeCommentMessage(message: CommentMessage): NormalizedCommentMessage; declare function normalizeCommentThread(thread: CommentThread): NormalizedCommentThread; declare function normalizeComments(comments?: CommentThread[]): NormalizedCommentThread[] | undefined; type ConnectionMode = 'straight' | 'orthogonal' | 'curved'; interface ConnectionAnchor { id: string; idx?: number; } interface Connection { start?: ConnectionAnchor; end?: ConnectionAnchor; mode?: ConnectionMode; } interface NormalizedConnection { start?: ConnectionAnchor; end?: ConnectionAnchor; mode: ConnectionMode; } declare function normalizeConnection(connection: Connection): NormalizedConnection; interface PropertyDeclaration { [key: string]: unknown; default?: unknown | (() => unknown); fallback?: unknown | (() => unknown); alias?: string; internal?: boolean; internalKey: symbol | string; } interface PropertyAccessor { /** `declaration` is a fast-path hint from decorated accessors; implementations may ignore it. */ getProperty?: (key: string, declaration?: PropertyDeclaration) => any; setProperty?: (key: string, newValue: any, declaration?: PropertyDeclaration) => void; onUpdateProperty?: (key: string, newValue: any, oldValue: any) => void; } declare function getDeclarations(constructor: any): Record; declare function propertyOffsetSet(target: any & PropertyAccessor, key: string, newValue: any, declaration: PropertyDeclaration): void; declare function propertyOffsetGet(target: any & PropertyAccessor, key: string, declaration: PropertyDeclaration): any; declare function propertyOffsetFallback(target: any & PropertyAccessor, key: string, declaration: PropertyDeclaration): any; declare function getPropertyDescriptor(key: string, declaration: PropertyDeclaration): { get: () => any; set: (v: any) => void; }; declare function defineProperty(constructor: any, key: string, declaration?: Partial): void; declare function property(declaration?: Partial): PropertyDecorator; declare function property2(declaration?: Partial): (_: ClassAccessorDecoratorTarget, context: ClassAccessorDecoratorContext) => ClassAccessorDecoratorResult; type LineEndType = 'oval' | 'stealth' | 'triangle' | 'arrow' | 'diamond'; type LineEndSize = 'sm' | 'md' | 'lg'; type OutlineStyle = 'dashed' | 'solid' | string; interface TailEnd { type: LineEndType; width?: WithNone; height?: WithNone; } interface HeadEnd { type: LineEndType; width?: WithNone; height?: WithNone; } interface NormalizedBaseOutline { width?: number; style?: OutlineStyle; lineCap?: LineCap; lineJoin?: LineJoin; headEnd?: HeadEnd; tailEnd?: TailEnd; } type OutlineObject = FillObject & Partial; type NormalizedOutline = NormalizedFill & NormalizedBaseOutline; type Outline = string | OutlineObject; declare function normalizeOutline(outline: Outline): NormalizedOutline; interface NormalizedOutlineStyle { outlineWidth: number; outlineOffset: number; outlineColor: WithStyleNone; outlineStyle: string; } declare function getDefaultOutlineStyle(): NormalizedOutlineStyle; type BoxShadow = string; type Shadow = BoxShadow | ShadowObject; type ShadowObject = Partial & Partial & { color?: WithNone; }; interface NormalizedShadow extends Toggleable { color: NormalizedColor; offsetX?: number; offsetY?: number; blur?: number; } declare function normalizeShadow(shadow: Shadow): NormalizedShadow; interface NormalizedShadowStyle { boxShadow: BoxShadow; shadowColor?: NormalizedColor; shadowOffsetX?: number; shadowOffsetY?: number; shadowBlur?: number; } declare function getDefaultShadowStyle(): NormalizedShadowStyle; /** * 滤镜/调色。字段与语义对齐 CSS filter 函数(可经 stringifyFilter 无损转成 CSS filter 字符串), * 并扩展若干 CSS 无等价、但 OOXML a:blip 支持的项(duotone / biLevel / colorChange)。 */ interface Filter { /** filter: blur(Npx) */ blur?: number; /** filter: brightness(N),1 = 原值 */ brightness?: number; /** filter: contrast(N),1 = 原值 */ contrast?: number; /** filter: grayscale(0~1) */ grayscale?: number; /** filter: hue-rotate(Ndeg) */ hueRotate?: number; /** filter: invert(0~1) */ invert?: number; /** filter: opacity(0~1) */ opacity?: number; /** filter: saturate(N),1 = 原值 */ saturate?: number; /** filter: sepia(0~1) */ sepia?: number; /** 双色调,[暗, 亮] 两色映射(OOXML a:duotone,无 CSS 等价) */ duotone?: [Color, Color]; /** 黑白阈值 0~1(OOXML a:biLevel,无直接 CSS 等价) */ biLevel?: number; /** 颜色替换(OOXML a:clrChange,无 CSS 等价) */ colorChange?: { from: Color; to: Color; }; } interface NormalizedFilter { blur?: number; brightness?: number; contrast?: number; grayscale?: number; hueRotate?: number; invert?: number; opacity?: number; saturate?: number; sepia?: number; duotone?: [NormalizedColor, NormalizedColor]; biLevel?: number; colorChange?: { from: NormalizedColor; to: NormalizedColor; }; } declare function normalizeFilter(filter: Filter): NormalizedFilter; /** * 把 Filter 转成 CSS filter 字符串(仅含有 CSS 等价的项)。 * duotone / biLevel / colorChange 无 CSS filter 形式,自动跳过。 */ declare function stringifyFilter(filter: NormalizedFilter): string; interface _EffectV0 { transformOrigin?: string; rotate?: number; scaleX?: number; scaleY?: number; skewX?: number; skewY?: number; translateX?: number; translateY?: number; shadowOffsetX?: number; shadowOffsetY?: number; shadowBlur?: number; shadowColor?: string; textStrokeWidth?: number; textStrokeColor?: string; color?: string; } interface Effect { fill?: WithNone; outline?: WithNone; shadow?: WithNone; transform?: WithStyleNone; transformOrigin?: string; /** 滤镜/调色(灰度/双色调/亮度/对比度等),多用于图片元素的整图调色 */ filter?: Filter; } interface NormalizedEffect { fill?: NormalizedFill; outline?: NormalizedOutline; shadow?: NormalizedShadow; transform?: string; transformOrigin?: string; filter?: NormalizedFilter; } declare const effectFields: (keyof Effect)[]; declare function normalizeEffect(effect: _EffectV0 & Effect): NormalizedEffect; interface NormalizedBaseForeground { fillWithShape?: boolean; } type NormalizedForeground = NormalizedBaseForeground & NormalizedFill; type ForegroundObject = Partial & FillObject; type Foreground = string | ForegroundObject; declare function normalizeForeground(foreground: Foreground): NormalizedForeground | undefined; interface Meta { [key: string]: any; } interface Node { name?: string; children?: Node[]; meta?: T; } type Shape = SVGPathData | SVGPathData[] | ShapePath[] | NormalizedShape; type SVGPathData = string; type FillRule = 'nonzero' | 'evenodd'; type StrokeLinecap = 'butt' | 'round' | 'square'; type StrokeLinejoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round'; interface ShapePathStyle { [key: string]: any; opacity: number; visibility: string; shadowColor: NormalizedColor; shadowOffsetX: number; shadowOffsetY: number; shadowBlur: number; fill: string; fillOpacity: number; fillRule: FillRule; stroke: string; strokeOpacity: number; strokeWidth: number; strokeLinecap: StrokeLinecap; strokeLinejoin: StrokeLinejoin; strokeMiterlimit: number; strokeDasharray: number[]; strokeDashoffset: number; } interface ShapePath extends Partial { data: SVGPathData; } interface ShapeConnectionPoint { idx: number; x: number; y: number; ang?: number; } interface NormalizedShape extends Toggleable { preset?: string; viewBox?: number[]; svg?: string; paths?: ShapePath[]; connectionPoints?: ShapeConnectionPoint[]; } declare function normalizeShape(shape: Shape): NormalizedShape; type StyleUnit = `${number}%` | number; type Display = 'inherit' | 'freeform' | 'flex'; type Direction = 'inherit' | 'ltr' | 'rtl'; type Overflow = 'hidden' | 'visible' | 'clip' | 'scroll' | 'auto'; type Visibility = 'hidden' | 'visible'; type FontWeight = 'normal' | 'bold' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; type FontStyle = 'normal' | 'italic' | 'oblique' | `oblique ${string}`; type FontKerning = WithStyleNone<'auto' | 'normal'>; type TextWrap = 'wrap' | 'nowrap'; type TextAlign = WithStyleNone<'center' | 'end' | 'left' | 'right' | 'start' | 'justify'>; type TextTransform = WithStyleNone<'uppercase' | 'lowercase'>; type TextOrientation = 'mixed' | 'upright' | 'sideways-right' | 'sideways'; type TextDecoration = WithStyleNone<'underline' | 'line-through' | 'overline'>; type VerticalAlign = 'baseline' | 'top' | 'middle' | 'bottom' | 'sub' | 'super' | 'text-top' | 'text-bottom'; type WritingMode = 'horizontal-tb' | 'vertical-lr' | 'vertical-rl'; type Align = 'auto' | 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline' | 'space-between' | 'space-around' | 'space-evenly'; type FlexDirection = 'column' | 'column-reverse' | 'row' | 'row-reverse'; type FlexWrap = 'nowrap' | 'wrap' | 'Wrap-reverse'; type Justify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'; type Position = 'static' | 'relative' | 'absolute'; type BorderStyle = WithStyleNone<'dashed' | 'solid'>; type BoxSizing = 'border-box' | 'content-box'; type PointerEvents = 'auto' | 'none'; type ListStyleType = WithStyleNone<'disc' | 'circle' | 'square' | 'decimal' | 'decimal-leading-zero' | 'lower-alpha' | 'upper-alpha' | 'lower-roman' | 'upper-roman' | 'lower-greek' | 'cjk-decimal' | 'trad-chinese-informal' | 'simp-chinese-informal' | 'japanese-informal' | 'hiragana' | 'katakana' | (string & {})>; type ListStyleImage = WithStyleNone; type ListStyleColormap = WithStyleNone>; type ListStyleSize = StyleUnit | `${number}rem` | 'cover'; type ListStylePosition = 'inside' | 'outside'; type HighlightLine = TextDecoration | 'outline'; type HighlightImage = WithStyleNone; type HighlightReferImage = WithStyleNone; type HighlightColormap = WithStyleNone>; type HighlightSize = StyleUnit | `${number}rem` | 'cover'; type HighlightThickness = StyleUnit; interface NormalizedLayoutStyle { overflow: Overflow; direction: Direction; display: Display; boxSizing: BoxSizing; width: StyleUnit | 'auto'; height: StyleUnit | 'auto'; maxHeight: StyleUnit; maxWidth: StyleUnit; minHeight: StyleUnit; minWidth: StyleUnit; position: Position; left: StyleUnit; top: StyleUnit; right: StyleUnit; bottom: StyleUnit; borderTop: string; borderLeft: string; borderRight: string; borderBottom: string; borderWidth: number; border: string; flex: number; flexBasis: StyleUnit | 'auto'; flexDirection: FlexDirection; flexGrow: number; flexShrink: number; flexWrap: FlexWrap; alignContent: Align; alignItems: Align; alignSelf: Align; justifyContent: Justify; gap: StyleUnit; marginTop: WithStyleNone; marginLeft: WithStyleNone; marginRight: WithStyleNone; marginBottom: WithStyleNone; margin: WithStyleNone; paddingTop: StyleUnit; paddingLeft: StyleUnit; paddingRight: StyleUnit; paddingBottom: StyleUnit; padding: StyleUnit; } declare function getDefaultLayoutStyle(): Partial; interface NormalizedTransformStyle { rotate: number; scaleX: number; scaleY: number; skewX: number; skewY: number; translateX: number; translateY: number; transform: WithStyleNone; transformOrigin: string; } declare function getDefaultTransformStyle(): NormalizedTransformStyle; type NormalizedElementStyle = Partial & NormalizedTransformStyle & NormalizedShadowStyle & NormalizedOutlineStyle & NormalizedBackgroundStyle & { borderRadius: number; borderColor: WithStyleNone; borderStyle: BorderStyle; visibility: Visibility; filter: string; opacity: number; pointerEvents: PointerEvents; maskImage: WithStyleNone; }; declare function getDefaultElementStyle(): NormalizedElementStyle; interface NormalizedHighlight { image: HighlightImage; referImage: HighlightReferImage; colormap: HighlightColormap; line: HighlightLine; size: HighlightSize; thickness: HighlightThickness; } interface NormalizedHighlightStyle { highlight: Partial; highlightImage: HighlightImage; highlightReferImage: HighlightReferImage; highlightColormap: HighlightColormap; highlightLine: HighlightLine; highlightSize: HighlightSize; highlightThickness: HighlightThickness; } declare function getDefaultHighlightStyle(): Required; interface NormalizedListStyle { type: ListStyleType; image: ListStyleImage; colormap: ListStyleColormap; size: ListStyleSize; position: ListStylePosition; } interface NormalizedListStyleStyle { listStyle: Partial; listStyleType: ListStyleType; listStyleImage: ListStyleImage; listStyleColormap: ListStyleColormap; listStyleSize: ListStyleSize; listStylePosition: ListStylePosition; } declare function getDefaultListStyleStyle(): NormalizedListStyleStyle; type NormalizedTextInlineStyle = NormalizedHighlightStyle & { color: NormalizedColor; verticalAlign: VerticalAlign; letterSpacing: number; wordSpacing: number; fontSize: number; fontWeight: FontWeight; fontFamily: string; fontStyle: FontStyle; fontKerning: FontKerning; textTransform: TextTransform; textOrientation: TextOrientation; textDecoration: TextDecoration; }; declare function getDefaultTextInlineStyle(): Required; type NormalizedTextLineStyle = NormalizedListStyleStyle & { writingMode: WritingMode; textWrap: TextWrap; textAlign: TextAlign; textIndent: number; lineHeight: number; }; declare function getDefaultTextLineStyle(): NormalizedTextLineStyle; interface NormalizedTextDrawStyle { textStrokeWidth: number; textStrokeColor: WithStyleNone; } type NormalizedTextStyle = NormalizedTextLineStyle & NormalizedTextInlineStyle & NormalizedTextDrawStyle; declare function getDefaultTextStyle(): NormalizedTextStyle; type FullStyle = NormalizedTextStyle & NormalizedElementStyle; type NormalizedStyle = Partial; type StyleObject = NormalizedStyle & { color?: WithStyleNone; backgroundColor?: WithStyleNone; borderColor?: WithStyleNone; outlineColor?: WithStyleNone; shadowColor?: WithStyleNone; }; type Style = StyleObject; declare function normalizeStyle(style: Style): NormalizedStyle; declare function getDefaultStyle(): FullStyle; interface TableColumnObject { width?: number; } interface TableRowObject { height?: number; } interface NormalizedTableColumn { width?: number; } interface NormalizedTableRow { height?: number; } interface TableCellObject { row: number; col: number; rowSpan?: number; colSpan?: number; children?: Element[]; background?: Background; style?: Style; } interface NormalizedTableCell { row: number; col: number; rowSpan?: number; colSpan?: number; children: NormalizedElement[]; background?: NormalizedBackground; style?: NormalizedStyle; } interface TableObject extends Partial { columns?: TableColumnObject[]; rows?: TableRowObject[]; cells?: TableCellObject[]; } type Table = TableObject; interface NormalizedTable extends Toggleable { columns: NormalizedTableColumn[]; rows: NormalizedTableRow[]; cells: NormalizedTableCell[]; } declare function normalizeTable(table: Table): NormalizedTable; type Text = string | FlatTextContent[] | TextObject; interface FragmentObject extends StyleObject { content: string; fill?: Fill; outline?: Outline; } interface NormalizedFragment extends NormalizedStyle { content: string; fill?: NormalizedFill; outline?: NormalizedOutline; } interface ParagraphObject extends StyleObject { fragments: FragmentObject[]; fill?: Fill; outline?: Outline; } interface NormalizedParagraph extends NormalizedStyle { fragments: NormalizedFragment[]; fill?: NormalizedFill; outline?: NormalizedOutline; } type FlatTextContent = string | FragmentObject | ParagraphObject | (string | FragmentObject)[]; type TextContent = FlatTextContent | FlatTextContent[]; type NormalizedTextContent = NormalizedParagraph[]; interface TextDeformation { type: string; intensities?: number[]; maxFontSize?: number; } interface NormalizedTextDeformation { type: string; intensities?: number[]; maxFontSize: number; } interface TextObject extends Pick, Partial { content?: TextContent; style?: Style; deformation?: TextDeformation; measureDom?: any; fonts?: any; effects?: Effect[]; } interface NormalizedText extends Pick, Toggleable { content: NormalizedTextContent; style?: NormalizedStyle; deformation?: NormalizedTextDeformation; effects?: NormalizedEffect[]; measureDom?: any; fonts?: any; } declare function hasCRLF(content: string): boolean; declare function isCRLF(char: string): boolean; declare function normalizeCRLF(content: string): string; declare function normalizeTextContent(value: TextContent): NormalizedTextContent; declare function isParagraphObject(value: any): value is ParagraphObject; declare function isFragmentObject(value: any): value is FragmentObject; declare function normalizeTextDeformation(deformation: TextDeformation): NormalizedTextDeformation; declare function normalizeText(value: Text): NormalizedText; declare function textContentToString(value: TextContent): string; interface NormalizedVideo { src: string; } type Video = string | NormalizedVideo; declare function normalizeVideo(video: Video): NormalizedVideo | undefined; interface Element extends Effect, Omit, 'children'> { id?: string; style?: WithNone