import { BlockContainer, IfcInline } from './flow.js'; export declare const inherited: unique symbol; type Inherited = typeof inherited; export declare const initial: unique symbol; type Initial = typeof initial; export type LogicalStyle = { marginBlockStart: number | 'auto'; marginBlockEnd: number | 'auto'; marginLineLeft: number | 'auto'; marginLineRight: number | 'auto'; paddingBlockStart: number; paddingBlockEnd: number; paddingLineLeft: number; paddingLineRight: number; borderBlockStartWidth: number; borderBlockEndWidth: number; borderLineLeftWidth: number; borderLineRightWidth: number; borderBlockStartStyle: number; borderBlockEndStyle: number; borderLineLeftStyle: number; borderLineRightStyle: number; blockSize: number | 'auto'; inlineSize: number | 'auto'; }; export type WhiteSpace = 'normal' | 'nowrap' | 'pre-wrap' | 'pre-line' | 'pre'; type ValuePctPxEm = number | { value: number; unit: '%' | 'em'; }; type ValuePctPxNone = number | { value: number; unit: '%' | null; }; type ValuePctPx = number | { value: number; unit: '%'; }; type ValuePxNone = number | { value: number; unit: null; }; type FontWeight = number | 'normal' | 'bolder' | 'lighter'; type FontStyle = 'normal' | 'italic' | 'oblique'; type FontVariant = 'normal' | 'small-caps'; export type FontStretch = 'normal' | 'ultra-condensed' | 'extra-condensed' | 'condensed' | 'semi-condensed' | 'semi-expanded' | 'expanded' | 'extra-expanded' | 'ultra-expanded'; type VerticalAlign = 'baseline' | 'middle' | 'sub' | 'super' | 'text-top' | 'text-bottom' | ValuePctPx | 'top' | 'bottom'; type BackgroundClip = 'border-box' | 'padding-box' | 'content-box'; export type Direction = 'ltr' | 'rtl'; type Display = { outer: OuterDisplay; inner: InnerDisplay; }; export type WritingMode = 'horizontal-tb' | 'vertical-lr' | 'vertical-rl'; type Position = 'absolute' | 'relative' | 'static'; export type Color = { r: number; g: number; b: number; a: number; }; type OuterDisplay = 'inline' | 'block' | 'none'; type InnerDisplay = 'flow' | 'flow-root' | 'none'; type BorderStyle = 'none' | 'hiden' | 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset'; type BoxSizing = 'border-box' | 'content-box' | 'padding-box'; export type TextAlign = 'start' | 'end' | 'left' | 'right' | 'center'; type Float = 'left' | 'right' | 'none'; type Clear = 'left' | 'right' | 'both' | 'none'; export type DeclaredPlainStyle = { whiteSpace?: WhiteSpace | Inherited | Initial; color?: Color | Inherited | Initial; fontSize?: ValuePctPxEm | Inherited | Initial; fontWeight?: FontWeight | Inherited | Initial; fontVariant?: FontVariant | Inherited | Initial; fontStyle?: FontStyle | Inherited | Initial; fontStretch?: FontStretch | Inherited | Initial; fontFamily?: string[] | Inherited | Initial; lineHeight?: 'normal' | ValuePctPxNone | Inherited | Initial; verticalAlign?: VerticalAlign; backgroundColor?: Color | Inherited | Initial; backgroundClip?: BackgroundClip | Inherited | Initial; display?: Display | Inherited | Initial; direction?: Direction | Inherited | Initial; writingMode?: WritingMode | Inherited | Initial; borderTopWidth?: number | Inherited | Initial; borderRightWidth?: number | Inherited | Initial; borderBottomWidth?: number | Inherited | Initial; borderLeftWidth?: number | Inherited | Initial; borderTopStyle?: BorderStyle | Inherited | Initial; borderRightStyle?: BorderStyle | Inherited | Initial; borderBottomStyle?: BorderStyle | Inherited | Initial; borderLeftStyle?: BorderStyle | Inherited | Initial; borderTopColor?: Color | Inherited | Initial; borderRightColor?: Color | Inherited | Initial; borderBottomColor?: Color | Inherited | Initial; borderLeftColor?: Color | Inherited | Initial; paddingTop?: ValuePctPx | Inherited | Initial; paddingRight?: ValuePctPx | Inherited | Initial; paddingBottom?: ValuePctPx | Inherited | Initial; paddingLeft?: ValuePctPx | Inherited | Initial; marginTop?: ValuePctPx | 'auto' | Inherited | Initial; marginRight?: ValuePctPx | 'auto' | Inherited | Initial; marginBottom?: ValuePctPx | 'auto' | Inherited | Initial; marginLeft?: ValuePctPx | 'auto' | Inherited | Initial; tabSize?: ValuePxNone | Inherited | Initial; position?: Position | Inherited | Initial; width?: ValuePctPx | 'auto' | Inherited | Initial; height?: ValuePctPx | 'auto' | Inherited | Initial; boxSizing?: BoxSizing | Inherited | Initial; textAlign?: TextAlign | Inherited | Initial; float?: Float | Inherited | Initial; clear?: Clear | Inherited | Initial; }; export declare const EMPTY_STYLE: DeclaredPlainStyle; export type CascadedPlainStyle = DeclaredPlainStyle; type RemoveUnits = T extends number ? number : T extends { value: number; unit: infer V; } | number ? V extends U ? number : number | { value: number; unit: Exclude; } : T; type SpecifiedPlainStyle = Required<{ [K in keyof DeclaredPlainStyle]: Exclude; }>; export type ComputedPlainStyle = { [K in keyof SpecifiedPlainStyle]: K extends 'fontSize' ? number : K extends 'lineHeight' ? 'normal' | number | { value: number; unit: null; } : K extends 'fontWeight' ? number : RemoveUnits; }; export declare class Style implements ComputedPlainStyle { whiteSpace: ComputedPlainStyle['whiteSpace']; color: ComputedPlainStyle['color']; fontSize: ComputedPlainStyle['fontSize']; fontWeight: ComputedPlainStyle['fontWeight']; fontVariant: ComputedPlainStyle['fontVariant']; fontStyle: ComputedPlainStyle['fontStyle']; fontFamily: ComputedPlainStyle['fontFamily']; fontStretch: ComputedPlainStyle['fontStretch']; verticalAlign: ComputedPlainStyle['verticalAlign']; backgroundColor: ComputedPlainStyle['backgroundColor']; backgroundClip: ComputedPlainStyle['backgroundClip']; display: ComputedPlainStyle['display']; direction: ComputedPlainStyle['direction']; writingMode: ComputedPlainStyle['writingMode']; borderTopStyle: ComputedPlainStyle['borderTopStyle']; borderRightStyle: ComputedPlainStyle['borderRightStyle']; borderBottomStyle: ComputedPlainStyle['borderBottomStyle']; borderLeftStyle: ComputedPlainStyle['borderLeftStyle']; borderTopColor: ComputedPlainStyle['borderTopColor']; borderRightColor: ComputedPlainStyle['borderRightColor']; borderBottomColor: ComputedPlainStyle['borderBottomColor']; borderLeftColor: ComputedPlainStyle['borderLeftColor']; paddingTop: ComputedPlainStyle['paddingTop']; paddingRight: ComputedPlainStyle['paddingRight']; paddingBottom: ComputedPlainStyle['paddingBottom']; paddingLeft: ComputedPlainStyle['paddingLeft']; borderTopWidth: ComputedPlainStyle['borderTopWidth']; borderRightWidth: ComputedPlainStyle['borderRightWidth']; borderBottomWidth: ComputedPlainStyle['borderBottomWidth']; borderLeftWidth: ComputedPlainStyle['borderLeftWidth']; marginTop: ComputedPlainStyle['marginTop']; marginRight: ComputedPlainStyle['marginRight']; marginBottom: ComputedPlainStyle['marginBottom']; marginLeft: ComputedPlainStyle['marginLeft']; width: ComputedPlainStyle['width']; height: ComputedPlainStyle['height']; tabSize: ComputedPlainStyle['tabSize']; position: ComputedPlainStyle['position']; boxSizing: ComputedPlainStyle['boxSizing']; float: ComputedPlainStyle['float']; clear: ComputedPlainStyle['clear']; private s; constructor(style: ComputedPlainStyle); get lineHeight(): number | "normal"; get textAlign(): "center" | "left" | "right"; hasPadding(): boolean; hasBorder(): boolean; getMarginBlockStart(box: BlockContainer | IfcInline): number | "auto"; getMarginBlockEnd(box: BlockContainer | IfcInline): number | "auto"; getMarginLineLeft(box: BlockContainer | IfcInline): number | "auto"; getMarginLineRight(box: BlockContainer | IfcInline): number | "auto"; getPaddingBlockStart(box: BlockContainer | IfcInline): number; getPaddingBlockEnd(box: BlockContainer | IfcInline): number; getPaddingLineLeft(box: BlockContainer | IfcInline): number; getPaddingLineRight(box: BlockContainer | IfcInline): number; getBorderBlockStartWidth(box: BlockContainer | IfcInline): number; getBorderBlockEndWidth(box: BlockContainer | IfcInline): number; getBorderLineLeftWidth(box: BlockContainer | IfcInline): number; getBorderLineRightWidth(box: BlockContainer | IfcInline): number; getBlockSize(box: BlockContainer | IfcInline): number | "auto"; getInlineSize(box: BlockContainer | IfcInline): number | "auto"; hasLineLeftGap(box: IfcInline): boolean | undefined; hasLineRightGap(box: IfcInline): boolean | undefined; } export declare const initialStyle: ComputedPlainStyle; type UaDeclaredStyles = { [tagName: string]: DeclaredPlainStyle; }; export declare const uaDeclaredStyles: UaDeclaredStyles; export declare function cascadeStyles(s1: DeclaredPlainStyle, s2: DeclaredPlainStyle): CascadedPlainStyle; /** * Very simple property inheritance model. createStyle starts out with cascaded * styles (CSS Cascading and Inheritance Level 4 §4.2) which is computed from * the [style] HTML attribute and a default internal style. Then it calculates * the specified style (§4.3) by doing inheritance and defaulting, and then * calculates the computed style (§4.4) by resolving em, some percentages, etc. * Used/actual styles (§4.5, §4.6) are calculated during layout, external to * this file. */ export declare function createComputedStyle(s1: ComputedPlainStyle, s2: CascadedPlainStyle): ComputedPlainStyle; export declare function createStyle(s: ComputedPlainStyle): Style; export {};