UNPKG

nehan

Version:

Html layout engine for paged-media written in Typescript

119 lines (118 loc) 4.62 kB
import { NehanElement, CssStyleDeclaration, LogicalSize, LogicalPadding, LogicalBorder, BoxSizing } from './public-api'; declare type OptionalNumber = "none" | number; declare type AutableNumber = "auto" | number; interface ComputedValue { save: (style: CssStyleDeclaration) => void; } declare class ComputedLength implements ComputedValue { length: AutableNumber; prop: string; constructor(length: AutableNumber, prop: string); static load(element: NehanElement, prop: string): ComputedLength; get number(): number; set number(value: number); isAuto(): boolean; setAutoZero(): void; save(style: CssStyleDeclaration): void; } declare class ComputedPosition { before: ComputedLength; end: ComputedLength; after: ComputedLength; start: ComputedLength; constructor(before: ComputedLength, end: ComputedLength, after: ComputedLength, start: ComputedLength); static load(element: NehanElement): ComputedPosition; save(style: CssStyleDeclaration): void; isAutoInline(): boolean; } declare class ComputedMinSize { private minSize; private prop; constructor(minSize: OptionalNumber, prop: string); static load(element: NehanElement, prop: string): ComputedMinSize; save(style: CssStyleDeclaration): void; apply(value: number): number; } declare class ComputedMaxSize { private maxSize; private prop; constructor(maxSize: OptionalNumber, prop: string); static load(element: NehanElement, prop: string): ComputedMaxSize; save(style: CssStyleDeclaration): void; apply(value: number): number; } declare class ComputedMinMaxRange { private minSize; private maxSize; constructor(minSize: ComputedMinSize, maxSize: ComputedMaxSize); static load(element: NehanElement, minProp: string, maxProp: string): ComputedMinMaxRange; save(style: CssStyleDeclaration): void; apply(value: number): number; } declare class ComputedMinMaxBoxSize { private minMaxMeasure; private minMaxExtent; constructor(minMaxMeasure: ComputedMinMaxRange, minMaxExtent: ComputedMinMaxRange); static load(element: NehanElement): ComputedMinMaxBoxSize; save(style: CssStyleDeclaration): void; apply(measure: number, extent: number): LogicalSize; } declare class ComputedLogicalSize { measure: ComputedLength; extent: ComputedLength; constructor(measure: ComputedLength, extent: ComputedLength); static load(element: NehanElement): ComputedLogicalSize; save(style: CssStyleDeclaration): void; } declare class ComputedPhysicalSize { width: ComputedLength; height: ComputedLength; constructor(width: ComputedLength, height: ComputedLength); static load(element: NehanElement): ComputedPhysicalSize; static loadPhysicalSize(element: NehanElement, prop: string): ComputedLength; save(style: CssStyleDeclaration): void; } declare class ComputedMargin { before: ComputedLength; end: ComputedLength; after: ComputedLength; start: ComputedLength; constructor(before: ComputedLength, end: ComputedLength, after: ComputedLength, start: ComputedLength); static load(element: NehanElement): ComputedMargin; save(style: CssStyleDeclaration): void; get measure(): number; get extent(): number; isAutoMeasure(): boolean; isAutoExtent(): boolean; clearAutoInline(): void; clearAutoBlock(): void; clearInline(): void; clearBlock(): void; } declare class ComputedBoxEdges { padding: LogicalPadding; border: LogicalBorder; margin: ComputedMargin; constructor(padding: LogicalPadding, border: LogicalBorder, margin: ComputedMargin); static load(element: NehanElement): ComputedBoxEdges; save(style: CssStyleDeclaration): void; get measure(): number; get extent(): number; get borderBoxMeasure(): number; get borderBoxExtent(): number; } export declare class ComputedRegion { boxSizing: BoxSizing; containingMeasure: number; containingExtent: ComputedLength; logicalSize: ComputedLogicalSize; physicalSize: ComputedPhysicalSize; position: ComputedPosition; edges: ComputedBoxEdges; minMaxBoxSize: ComputedMinMaxBoxSize; constructor(boxSizing: BoxSizing, containingMeasure: number, containingExtent: ComputedLength, logicalSize: ComputedLogicalSize, physicalSize: ComputedPhysicalSize, position: ComputedPosition, edges: ComputedBoxEdges, minMaxBoxSize: ComputedMinMaxBoxSize); static load(element: NehanElement): ComputedRegion | undefined; save(style: CssStyleDeclaration): void; get borderBoxMeasure(): number; } export {};