/// /// import type { AddressValue, FileActionOptions, FileBroadcastOptions, FileObserveOptions } from '../index'; import type { Container } from '../lib/base'; import type { APP_STATE, BOX_STANDARD } from './lib/constant'; import type { MultiSet, ProjectMap } from './lib/session'; export type TargetElement = HTMLElement | string; export type RootElement = TargetElement | ElementSettings; export type AppThreadData = [AppProcessing, HTMLElement[], SelectorRoot[], string[]?]; export type AppSessionSelectorCallback = (sessionId: string, rule: CSSStyleRule, selector: string, context?: Element, namespace?: CssCascadeLayer, container?: CssConditionData, scope?: CssScopeData) => void; export type AppSessionConditionCallback = (sessionId: string, rule: CSSGroupingRule, conditionText: T, context?: Element, namespace?: CssCascadeLayer, container?: CssConditionData, scope?: CssScopeData) => void; export type NodeParentAttr = "actualParent" | "absoluteParent" | "parent"; export type NodeUIParentAttr = NodeParentAttr | "renderParent" | "documentParent" | "outerWrapper"; export type NodeUISiblingType = "first" | "last" | "only"; export type NodeChildrenAttr = KeyOfType>; export type NodeUIChildrenAttr = NodeChildrenAttr | KeyOfType>; export type MutationCallback = (mutations: MutationRecord[], observer: MutationObserver, settings?: ElementSettings) => void; export type FileActionResult = Promise; export type LoadConfigInherit = boolean | "append" | "preserve" | { append?: boolean; preserve?: boolean; depth?: number }; export type ExcludeQuery = Array<{ selector: string } & ExcludeOptions>; export type ExtensionRequest = Extension | string; export type SlotParentMap = Map; export interface ElementSettings extends Partial, PathInfo, ObserveAction { projectId?: string; element?: TargetElement; include?: string | string[]; exclude?: string | string[]; data?: PlainObject; options?: AnyObject; excludeQuery?: ExcludeQuery; fromQuery?: boolean; beforeCascade?: (sessionId: string) => void; afterCascade?: (sessionId: string, node: T) => void; } export interface ElementSettingsUI extends ElementSettings { beforeFinalize?: (node: T) => void; beforeRender?: (layout: LayoutUI) => void; } export interface FileCopyingOptions extends FileActionOptions { pathname?: string; emptyDir?: boolean; modified?: boolean; } export interface FileArchivingOptions extends FileActionOptions, FormatAction { filename?: string; copyTo?: string; } export interface FileActionAsync { saveAs(filename: string, options?: FileActionOptions): FileActionResult; saveFiles(filename: string, options: FileActionOptions): FileActionResult; copyTo(pathname: string | string[], options?: FileActionOptions): FileActionResult; copyFiles(pathname: string | string[], options: FileActionOptions): FileActionResult; appendTo(pathname: string, options?: FileActionOptions): FileActionResult; appendFiles(filename: string, options: FileActionOptions): FileActionResult; } export interface ErrorAction { writeError(message: unknown, hint?: string): void; } export interface PrefetchAction { get prefetchData(): Prefetch; } export interface CssRuleAction { propertyMap?: ObjectMap; counterStyleMap?: ObjectMap; } export interface AppBase { application: Application; framework: number; userSettings: UserSettings; } export interface AppHandler { readonly application: Application; } export interface AppFramework { base?: PlainObject; extensions?: PlainObject; lib?: PlainObject; system?: ObjectMap; create(): AppBase; cached(): AppBase; removeObserver?(element: HTMLElement): boolean; } export interface AppSession { active: Map>; data: Map; usedSelector?: AppSessionSelectorCallback; unusedSelector?: AppSessionSelectorCallback; unusedContainer?: AppSessionConditionCallback; unusedScope?: AppSessionConditionCallback>; unusedMedia?: AppSessionConditionCallback; unusedSupports?: AppSessionConditionCallback; } export interface AppProcessing = Extension, V extends ElementSettings = ElementSettings> extends CssRuleAction { projectId: string; sessionId: string; resourceId: number; readyState: APP_STATE; cache: NodeList; excluded: NodeList; rootElements: HTMLElement[]; settings: V | null; customSettings: Array; extensions: U[]; layerRoot: Map; /** @deprecated */ containerName: ObjectMap>; node: T | null; documentElement: T | null; cssRuleData: Map; shadowRootRules: Map | null; index: number; /** @deprecated */ styleMap?: PropertyValueSuffix<"", PseudoElt, CssStyleMap | ObjectMap<[string, boolean]>> | null; styleSheets?: string[]; targetFragment?: FragmentTargetText; included?: string[]; afterInsertNode?: U[]; } export interface AppSessionUI extends AppSession { projects: ObjectMap>; shadowRootSlots: SlotParentMap | null; } export interface AppProjectUI extends AppData, FinalizeDataExtensionUI { projectId: string; resourceId: number; userSettings: Partial; layouts: LayoutAsset[]; documentRoot: LayoutRoot[]; pseudoElements: Element[]; requireFormat: boolean; layoutDir: string; directory?: U; outFinalized?: V[]; replacedElements?: Map; /** @deprecated RENAME */ firstLetterValue?: Map; sort(): LayoutAsset[]; set rendered(value); get rendered(): W[]; set closed(value); get closed(): boolean; } export interface AppFinalize = Extension> { processing: AppProcessing[]; children: T[]; extensions: U[]; } export interface AppFinalizeUI = ExtensionUI, V extends UserResourceSettings = UserResourceSettingsUI, W = ControllerSettingsDirectoryUI> extends AppFinalize { project?: AppProjectUI; beforeFinalize?: boolean; } export interface AppModule { init(): void; reset(): void; } export interface AppData { clear(): void; } export interface ExtensionQueue { add: ExtensionRequest[]; remove: ExtensionRequest[]; options: Map; rejected: Set>; modified: boolean; } export interface PrefetchData { css?: StringMap; javascript?: StringMap; svg?: StringMap; image?: ObjectMap; audio?: ObjectMap; video?: ObjectMap; } export class Prefetch { data: PrefetchData; set(value: PrefetchData): void; get(type: "image", uri: string): ArrayBuffer | undefined; get(type: "css" | "javascript" | "svg", uri: string): string | undefined; } export class Application = Extension, V extends UserSettings = UserSettings, W extends UserResourceSettings = UserResourceSettings> implements AppModule, AppData, FileActionAsync, ErrorAction, PrefetchAction { static readonly KEY_NAME: string | symbol; static prioritizeExtensions = Extension>(value: string, extensions: Y[]): Y[]; static disconnectObservers(): void; static reconnectObservers(): void; userSettings: V; readonly systemName: string; readonly framework: number; readonly session: AppSession; readonly extensions: U[]; readonly builtInExtensions: Map; readonly Node: Constructor; getUserSetting(id: number | string | AppProcessing | undefined, name: X, fallback?: W[X]): W[X] | undefined; getCustomSetting(id: number | string | AppProcessing | undefined, name: X, fallback?: W[X]): W[X] | undefined; init(): void; reset(projectId?: string): void; clear(): void; clearQueries(): void; finalize(projectId?: string): Promise; setExtensions(namespaces?: string[]): void; setPrefetchData(value: PrefetchData): void; parseDocument(...elements: RootElement[]): Promise; parseDocumentSync(...elements: RootElement[]): T | T[] | void; observe(value?: boolean | MutationObserverInit): void; disconnectObservers(): void; reconnectObservers(): void; removeObserver(element: HTMLElement): boolean; createThread(elements: RootElement[], sync: boolean): AppThreadData; resumeThread(processing: AppProcessing, rootElements: HTMLElement[], requestCount: number): Node | Node[] | void; createCache(processing: AppProcessing, documentRoot: HTMLElement): T | undefined; parseStyleSheets(processing: AppProcessing, documentRoot?: DocumentRoot, shadowRoot?: ShadowRoot | null): void; setCascadeStyle(layerRoot: CssCascadeLayer, element: Element, pseudoElt?: PseudoElt): CssStyleMap | undefined; replaceShadowRootSlots(shadowRoot: ShadowRoot, slotsMap?: SlotParentMap): SlotParentMap; createNode(sessionId: string, options: CreateNodeOptions): T; createNodeStatic(processing: AppProcessing, element?: Element): T; insertNode(processing: AppProcessing, element: Element): T | undefined; afterCreateCache(processing: AppProcessing, node: T): void; getProcessing(sessionId: string): AppProcessing | undefined; getProcessingCache(sessionId: string): NodeList; getProcessingByProjectId(projectId: string): AppProcessing | undefined; getProcessingByResourceId(resourceId: number): AppProcessing | undefined; getProjectId(id: number | string): string; asProcessing(processing: number | string | AppProcessing | undefined): AppProcessing | undefined; getResourceId(projectId?: string, existing?: boolean): number; getDatasetName(attr: string, element: HTMLElement): string | undefined; setDatasetName(attr: string, element: HTMLElement, value: string): void; addRootElement(sessionId: string, element: HTMLElement): void; usable(ext: U): boolean; saveAs(filename: string, options?: FileArchivingOptions, setting?: string, overwrite?: boolean): FileActionResult; saveFiles(filename: string, options: FileArchivingOptions, setting?: string, overwrite?: boolean): FileActionResult; copyTo(pathname: string | string[], options?: FileCopyingOptions, setting?: string, overwrite?: boolean): FileActionResult; copyFiles(pathname: string | string[], options: FileCopyingOptions, setting?: string, overwrite?: boolean): FileActionResult; appendTo(pathname: string, options?: FileArchivingOptions, setting?: string, overwrite?: boolean): FileActionResult; appendFiles(pathname: string, options: FileArchivingOptions, setting?: string, overwrite?: boolean): FileActionResult; loadSettings(setting: string, namespace: string, options?: X, overwrite?: boolean): Promise; closeProject(projectId?: string, readyState?: number): AppFinalize; hasReadyState(projectId?: string, readyState?: number): boolean; writeError(message: unknown, hint?: string): void; toString(projectId?: string): string; get mainElement(): HTMLElement; get controllerHandler(): Controller; get resourceHandler(): Resource | null; get fileHandler(): File | null; get extensionManager(): ExtensionManager | null; get elementMap(): WeakMap; get prefetchData(): Prefetch; get pageEncoding(): string; get nextId(): number; constructor( framework: number, nodeConstructor: Constructor, ControllerConstructor: Constructor>, ExtensionManagerConstructor?: Constructor>, ResourceConstructor?: Constructor>, builtInExtensions?: Map ); } export class ApplicationUI = ExtensionUI, V extends UserResourceSettings = UserResourceSettingsUI, W = ControllerSettingsDirectoryUI> extends Application { userSettings: V; readonly session: AppSessionUI; readonly extensions: U[]; readonly builtInExtensions: Map; getProject(projectId?: string): AppProjectUI; conditionElement(element: HTMLElement, sessionId: string, cascadeAll?: boolean, pseudoElt?: PseudoElt): boolean; insertNode(processing: AppProcessing, element: Element, cascadeAll?: boolean, pseudoElt?: PseudoElt): T | undefined; setPathData(node: T, data?: PathInfo | null, projectId?: string): void; useElement(element: HTMLElement): boolean; createNode(sessionId: string, options: CreateNodeUIOptions): T; renderNode(layout: ContentUI): NodeTemplate | undefined; addLayout(layout: ContentUI): void; addLayoutTemplate(parent: T, node: T, template: NodeTemplate, index?: number): void; declareRoot(node: T, layouts?: LayoutRoot[], index?: number): void; saveDocument(filename: string, content: string, options?: SaveDocumentOptions>): void; closeProject(projectId?: string, flags?: number): AppFinalizeUI; getOutputDirectory(project: AppProjectUI | number | string, name?: keyof W): string; get controllerHandler(): ControllerUI; get resourceHandler(): ResourceUI; get extensionManager(): ExtensionManager; /** @deprecated getProject().layouts */ get layouts(): FileAsset[]; get clearMap(): Map; get extensionMap(): WeakMap; } export class Controller implements AppModule, AppData, AppHandler { static readonly KEY_NAME: string | symbol; readonly localSettings: ControllerSettings; init(): void; reset(): void; clear(): void; processUserSettings(processing: AppProcessing): void; sortInitialCache(cache: NodeList): void; includeElement(element: HTMLElement): boolean; applyDefaultStyles(processing: AppProcessing, element: Element, pseudoElt?: PseudoElt): void; preventNodeCascade(node: T, layerRoot?: CssCascadeLayer): boolean; afterInsertNode(node: T, sessionId: string): void; get application(): Application; get generateSessionId(): string; get generateProjectId(): string; constructor(application: Application); } export class ControllerUI extends Controller { readonly localSettings: ControllerSettingsUI; /** @deprecated optimize(project) */ optimize(rendered: T[], project?: AppProjectUI): Promise; /** @deprecated finalize(project) */ finalize(layouts: FileAsset[], project?: AppProjectUI): Promise; evaluateNonStatic(documentRoot: T, cache: NodeList): void; visibleElement(element: HTMLElement, sessionId: string, pseudoElt?: string): boolean; processUnknownParent(layout: LayoutUI): void; processUnknownChild(layout: ContentUI): void; processTraverseHorizontal(layout: LayoutUI, siblings: T[]): LayoutUI | undefined; processTraverseVertical(layout: LayoutUI, siblings: T[]): LayoutUI | undefined; processLayoutHorizontal(layout: LayoutUI): LayoutUI; setConstraints(rendering: NodeList): void; renderNode(layout: ContentUI): NodeTemplate | undefined; renderNodeGroup(layout: LayoutUI): NodeTemplate | undefined; createNodeGroup(node: T, children: T[], parent?: T | null, options?: CreateNodeGroupUIOptions): T; createNodeWrapper(node: T, parent: T, options?: CreateNodeWrapperUIOptions): T; sortRenderPosition(parent: T, templates: NodeTemplate[]): NodeTemplate[]; addBeforeOutsideTemplate(node: T, value: string, format?: boolean, index?: number): void; addBeforeInsideTemplate(node: T, value: string, format?: boolean, index?: number): void; addAfterInsideTemplate(node: T, value: string, format?: boolean, index?: number): void; addAfterOutsideTemplate(node: T, value: string, format?: boolean, index?: number): void; getBeforeOutsideTemplate(node: T, depth: number): string; getBeforeInsideTemplate(node: T, depth: number): string; getAfterInsideTemplate(node: T, depth: number): string; getAfterOutsideTemplate(node: T, depth: number): string; writeDocument(templates: NodeTemplate[], depth: number, options?: WriteDocumentOptions): string; getEnclosingXmlTag(controlName: string, attributes?: string, content?: string): string; get application(): ApplicationUI; get containerTypeHorizontal(): LayoutType; get containerTypeVertical(): LayoutType; get containerTypeVerticalMargin(): LayoutType; get containerTypePercent(): LayoutType; } export class Resource | null> implements AppModule, AppData, AppHandler, PrefetchAction { static readonly KEY_NAME: string | symbol; static readonly ASSETS: ResourceSessionAsset; static hasMimeType(formats: MIMEOrAll, value: string): boolean; init(): void; reset(): void; clear(): void; createThread(resourceId: number): void; mergeStyleSheets(processing: AppProcessing, documentRoot?: DocumentRoot): void; preloadAssets(resourceId: number, documentRoot: HTMLElement, elements: SelectorRoot[], options?: PreloadAssetsOptions): [PreloadItem[], HTMLImageElement[]]; parseFontFace(resourceId: number, rule: CSSFontFaceRule, styleSheetHref?: string | null): void; parseFontFace(resourceId: number, cssText: string, styleSheetHref?: string | null, from?: string | string[]): void; parseKeyframes(resourceId: number, cssRule: CSSKeyframesRule, options?: StyleSheetOptions): void; parseFontFeatureValues(resourceId: number, cssRule: CSSFontFeatureValuesRule, options?: StyleSheetOptions): void; addAsset(resourceId: number, asset: RawAsset): void; addImage(resourceId: number, uri: string, options: ImageOptions): void; addImage(resourceId: number, uri: string, width?: number, height?: number): void; getImage(resourceId: number, uri: string): ImageAsset | undefined; addFont(resourceId: number, data: FontFaceData): void; getFonts(resourceId: number, fontFamily: string, options: FontsOptions): FontFaceData[]; getFonts(resourceId: number, fontFamily: string, fontStyle?: string, fontWeight?: string): FontFaceData[]; addVideo(resourceId: number, uri: string, options?: AudioOptions): void; getVideo(resourceId: number, uri: string): Asset & ResourceAction | undefined; addAudio(resourceId: number, uri: string, options?: VideoOptions): void; getAudio(resourceId: number, uri: string): Asset & ResourceAction | undefined; addRawData(resourceId: number, uri: string, options: RawDataOptions): RawAsset | undefined; getRawData(resourceId: number, uri: string): RawAsset | undefined; addImageElement(resourceId: number, element: HTMLImageElement, uri?: string, from?: string | string[]): ImageAsset | undefined; getAssetsMap(resourceId: number): ResourceAssetsMap; getImageData(resourceId: number, value: string): ImageAsset[]; assignFilename(uri: string, mimeType?: string, ext?: string): string; get application(): Application; set fileHandler(value); get fileHandler(): U; get prefetchData(): Prefetch; get controllerSettings(): ControllerSettings; /** @deprecated DELETE */ get mimeTypeMap(): ObjectMap; get mapOfAssets(): ResourceSessionAsset; constructor(application: Application); } export class ResourceUI extends Resource { static readonly STORED: ResourceSessionStored; static generateId(resourceId: number, section: string, name: string, start?: number): string; static appendId(resourceId: number, section: string, name: string): boolean; static insertStoredAsset(resourceId: number, type: string, name: string, value: unknown, options?: InsertStoredAssetOptions): string; /** @deprecated options */ static insertStoredAsset(resourceId: number, type: string, name: string, value: unknown, within?: boolean): string; static findStoredAsset(resourceId: number, type: string, name: string, options?: FindStoredAssetOptions): U | undefined; /** @deprecated options */ static findStoredAsset(resourceId: number, type: string, name: string, remove?: boolean): U | undefined; static setHtmlEntities(value?: T, init?: RequestInit): MaybePromise; characterMap: StringMap; placeholderIntl: ObjectMap; setData(rendering: NodeList): void; writeRawImage(resourceId: number, filename: string, options: RawDataOptions): RawAsset | undefined; /** @deprecated */ writeRawSvg(resourceId: number, element: SVGSVGElement, dimension?: Dimension): string; setBoxStyle(node: T): void; setFontStyle(node: T): void; setValueString(node: T): void; getStoredMap(resourceId: number): ResourceStoredMap; getKeyframes(resourceId: number, node?: T): KeyframesMap | null; hasFontStyle(node: T): boolean; getInputPlaceholder(type: string, languages: string[], fallback?: string): string; getImageDimension(resourceId: number, uri: string): Dimension; preFormatString(value: string, entities?: unknown[]): string; removeExcludedText(node: T, element?: Element): string; parseBackgroundImage(node: T, value: string, outImage?: ImageSet[]): ResourceBackgroundImage[] | undefined; get application(): ApplicationUI; get controllerSettings(): ControllerSettingsUI; /** @deprecated characterMap[" "] */ get STRING_SPACE(): string; /** @deprecated characterMap["\n"] */ get STRING_NEWLINE(): string; /** @deprecated characterMap["\u200B"] */ get STRING_WBR(): string; } export class Extension { enabled: boolean; readonly framework: number; readonly name: string; readonly options: U; readonly data: WeakMap; readonly project: ProjectMap; readonly dependencies: ExtensionDependency[]; readonly subscribers: MultiSet; readonly keyName: symbol; getUserSetting(id: number | string | AppProcessing | undefined, name: X, fallback?: U[X]): U[X] | undefined; getCustomSetting(id: number | string | AppProcessing | undefined, name: X, fallback?: U[X]): U[X] | undefined; reset(): void; require(value: ExtensionDependency | string): void; beforeParseDocument(sessionId: string): void; beforeCascadeRoot(processing: AppProcessing): void; afterParseDocument(sessionId: string): void; beforeInsertNode?(element: HTMLElement, sessionId: string): boolean; afterInsertNode?(node: T): boolean; set application(value); get application(): Application; set controller(value); get controller(): Controller; set resource(value); get resource(): Resource | null; constructor(name: string, framework: number, options?: ExtensionOptions); } export class ExtensionUI extends Extension { static includes(source: string | undefined, value: string): boolean; static findNestedElement(node: W, name: string): StyleElement | undefined; readonly tagNames: string[] | undefined; readonly eventOnly: boolean; readonly cascadeAll: boolean; readonly documentBase: boolean; is(node: T): boolean; condition(node: T, parent: T): boolean; included(node: T | HTMLElement | null): boolean; getDataSet(node: T | HTMLElement | null): StringMap; processNode(node: T, parent: T): ExtensionResult | void; processChild(node: T, parent: T): ExtensionResult | void; addDescendant(node: T): void; afterBaseLayout(sessionId: string, cache?: NodeList): void; afterConstraints(sessionId: string, cache?: NodeList): void; afterResources(sessionId: string, resourceId: number, cache?: NodeList): void; beforeBaseLayout(sessionId: string, cache?: NodeList): void; afterCloseDocument(nodes: T[]): void; beforeFinalize(data: FinalizeDataExtensionUI): void; afterFinalize(data: FinalizeDataExtensionUI): void; postBaseLayout?(node: T): void; postConstraints?(node: T): void; postResources?(node: T): void; postOptimize?(node: T, rendered: T[]): void; postBoxSpacing?(node: T, rendered: T[]): void; set application(value); get application(): ApplicationUI; set controller(value); get controller(): ControllerUI; set resource(value); get resource(): ResourceUI; constructor(name: string, framework: number, options?: ExtensionUIOptions); } export class ExtensionManager = Extension> { readonly cache: Set; add(ext: U | string): boolean; remove(ext: U | string): boolean; get(name: string, builtIn?: boolean): U | undefined; has(name: string): boolean; checkDependencies(): string[] | undefined; mergeQueue(queue: ExtensionQueue): string[] | undefined; mergeSession(processing: AppProcessing): void; valueOf(name: string, attr: string, fallback?: U): U | undefined; valueAsObject(name: string, attr: string, fallback?: U | null): U | null; valueAsString(name: string, attr: string, fallback?: string): string; valueAsNumber(name: string, attr: string, fallback?: number): number; valueAsBoolean(name: string, attr: string, fallback?: boolean): boolean; get application(): Application; get extensions(): U[]; constructor(application: Application); } export class File implements AppData, FileActionAsync, ErrorAction, PrefetchAction { static downloadFile(href: BlobPart, filename?: string, mimeType?: string): void; static copyDocument(value: string | string[]): string | string[]; static findConfigUri(filename: string | FileActionOptions, options?: FileActionOptions): string | undefined; /** @deprecated squared.base.lib.internal */ static checkSocketClient(socket: WebSocket, socketId: string, response: unknown, socketKey?: string): response is U; static isLocalAddress(hostname: AddressValue): boolean; static addLocalAddress(hostname: AddressValue): void; static closeSummary(): void; readonly archiveFormats: string[]; clear(): void; loadConfig(uri: string, options?: FileActionOptions): Promise; loadData(key: string, options: LoadDataOptions): Promise; copying(pathname: string | string[], options: FileCopyingOptions): FileActionResult; archiving(pathname: string, options: FileArchivingOptions): FileActionResult; observing(pathname: string, options?: FileObserveOptions): FileActionResult; broadcasting(callback: BroadcastMessageCallback, options: FileBroadcastOptions): WebSocket | null; saveAs(filename: string, options?: FileArchivingOptions): FileActionResult; saveFiles(filename: string, options: FileArchivingOptions): FileActionResult; copyTo(pathname: string | string[], options?: FileCopyingOptions): FileActionResult; copyFiles(pathname: string | string[], options: FileCopyingOptions): FileActionResult; appendTo(pathname: string, options?: FileCopyingOptions): FileActionResult; appendFiles(pathname: string, options: FileArchivingOptions): FileActionResult; kill(pid: number): Promise; finalizeRequestBody(options: RequestData): void; getCopyQueryParameters(options: FileCopyingOptions): string; getArchiveQueryParameters(options: FileArchivingOptions): string; setAuth(...args: unknown[]): void; setEndpoint(name: string, value: string): void; getAuthToken(): string; addLocalAddress(hostname: AddressValue): void; getResourceId(options?: FileActionOptions | string): number; writeError(message: unknown, hint?: string): void; get resource(): Resource; get userSettings(): UserResourceSettings; get location(): URL; get origin(): string; set hostname(value); get hostname(): string; get auth(): AuthData; get prefetchData(): Prefetch; get generateProcessId(): string; constructor(resource: Resource); } export class ContentUI implements LayoutType { parent: T; node: T; containerType: number; alignmentType: number; clearMap?: Map; renderIndex?: number; next?: boolean; set itemCount(value); get itemCount(): number; constructor(parent: T, node: T, containerType?: number, alignmentType?: number); } export class LayoutUI extends Container implements ContentUI { static create(options: LayoutOptions): LayoutUI; parent: T; node: T; containerType: number; alignmentType: number; renderIndex: number; absolute: boolean; clearMap?: Map; rowCount?: number; columnCount?: number; next?: boolean; setContainerType(containerType: number, alignmentType: number): void; addAlign(value: number): number; hasAlign(value: number): boolean; set itemCount(value); get itemCount(): number; get linearData(): LinearData | null; get linearX(): boolean; get linearY(): boolean; get hasX(): boolean; get hasY(): boolean; get floated(): Set | null; get singleRowAligned(): boolean; /** @deprecated NodeUI | null */ get firstChild(): T | undefined; constructor(parent: T, node: T, containerType?: number, alignmentType?: number, children?: T[]); } export class Node extends Container implements BoxModel, Dimension { static boxValueOf(node: T, attr: BoxModelAttr, options?: CssUnitOptions): number; static sanitizeCss(element: HTMLElement, input: CssStyleMap, writingMode: string | undefined, output: CssStyleMap | undefined, elementData: ElementData | undefined): CssStyleMap; static sanitizeCss(element: HTMLElement, input: CssStyleMap, writingMode?: string, output?: CssStyleMap, override?: boolean): CssStyleMap; readonly id: number; readonly sessionId: string; setParent(parent: Node | null, depth?: number, index?: number): void; syncWith(sessionId?: string, cache?: boolean): boolean; saveAsInitial(): void; elementAttr(attr: string, value: T): T | undefined; data(name: string | symbol, attr: string | symbol, value?: unknown, overwrite?: boolean): T | undefined; unsetCache(...attrs: T[]): void; unsetState>(...attrs: T[]): void; resetCache(): void; resetState(): void; ascend(options?: AscendParameterOptions, attr?: boolean | string | ((item: T) => boolean), error?: (item: T) => boolean): T[]; ascendOne(options?: AscendParameterOptions, attr?: boolean | string | ((item: T) => boolean), error?: (item: T) => boolean): T | undefined; descend(options?: DescendParameterOptions, error?: (item: T) => boolean): T[]; descendOne(options?: DescendParameterOptions, error?: (item: T) => boolean): T | undefined; intersectX(rect: BoxRectDimension, options?: CoordsXYOptions): boolean; intersectY(rect: BoxRectDimension, options?: CoordsXYOptions): boolean; withinX(rect: BoxRectDimension, options?: OffsetXYOptions): boolean; withinY(rect: BoxRectDimension, options?: OffsetXYOptions): boolean; outsideX(rect: BoxRectDimension, options?: OffsetXYOptions): boolean; outsideY(rect: BoxRectDimension, options?: OffsetXYOptions): boolean; as(target: U): InstanceType | null; any(...target: U): InstanceType> | null; css(attr: CssStyleAttr, value?: string, cache?: boolean): string; cssInitial(attr: CssStyleAttr, options?: CssInitialOptions): string; cssAny(attr: CssStyleAttr, values: string[], options?: CssAnyOptions): boolean; cssAscend(attr: CssStyleAttr, options?: CssAscendOptions): string; cssSort(attr: CssStyleAttr, options?: CssSortOptions): Node[]; cssSpecificity(attr: CssStyleAttr, context?: string): Specificity | undefined; cssParent(attr: CssStyleAttr, value?: string, cache?: boolean): string; cssUnit(attr: CssStyleAttr, options?: CssUnitOptions): number; cssAsTuple(...attrs: CssStyleAttr[]): string[]; cssAsObject(...attrs: CssStyleAttr[]): CssStyleMap; cssApply(values: CssStyleMap, overwrite?: boolean, cache?: boolean): this; cssCopy(node: Node, ...attrs: CssStyleAttr[]): void; cssCopyIfEmpty(node: Node, ...attrs: CssStyleAttr[]): void; cssTry(attr: CssStyleAttr, value: string, callback?: FunctionBind): boolean; cssTryAll(attrs: CssStyleMap, callback?: FunctionBind): CssStyleMap | boolean; cssFinally(attrs: CssStyleAttr | CssStyleMap): void; withDisplay(type: number, ...values: string[]): boolean; withDisplay(...values: string[]): boolean; withLayout(outside: "block" | "inline" | number, type: number, ...values: string[]): boolean; withLayout(outside: "block" | "inline" | number, ...values: string[]): boolean; parseColor(value: string, opacity: number): ColorRGB | null; parseColor(value: string, options?: NodeParseColorOptions): ColorRGB | null; parseUnit(value: unknown, options?: NodeParseUnitOptions): number; convertUnit(value: unknown, options: NodeConvertUnitOptions): string; convertUnit(value: unknown, unit?: string, options?: NodeConvertUnitOptions): string; has(attr: CssStyleAttr, options?: HasOptions): boolean; hasUnit(attr: CssStyleAttr, percent: boolean): boolean; hasUnit(attr: CssStyleAttr, options?: HasUnitOptions | boolean): boolean; toInt(attr: CssStyleAttr, options: CssInitialOptions): number; toInt(attr: CssStyleAttr, fallback?: number, options?: CssInitialOptions): number; toFloat(attr: CssStyleAttr, options: CssInitialOptions): number; toFloat(attr: CssStyleAttr, fallback?: number, options?: CssInitialOptions): number; toElementInt(attr: string, fallback?: number): number; toElementFloat(attr: string, fallback?: number): number; toElementBoolean(attr: string, fallback?: boolean): boolean; toElementString(attr: string, fallback?: string): string; setBounds(cache?: boolean): BoxRectDimension | null; resetBounds(recalibrate?: boolean): void; getContainerSize(options?: NodeUnitOptions): number; getLayoutAlign(value: string, dimension?: DimensionAttr): string; flex(attr: "inline" | "row" | "column" | "reverse" | "wrap" | "wrapReverse", parent?: boolean | Node): T; flex(attr: "alignContent" | "justifyContent" | "basis" | "alignSelf" | "justifySelf", parent?: boolean | Node): T; flex(attr: "grow" | "shrink" | "order", parent?: boolean | Node): T; flex(attr: T, parent?: boolean | Node): boolean | number | string; min(attr: string, options?: MinMaxOptions): Node; max(attr: string, options?: MinMaxOptions): Node; querySelector(value: string): Node | null; querySelectorAll(value: string, queryMap?: Node[], queryRoot?: HTMLElement | null): Node[]; ancestors(value?: string | AscendParameterOptions, options?: AscendParameterOptions): Node[]; ancestorsOne(value?: string | AscendParameterOptions, options?: AscendParameterOptions): Node | undefined; descendants(value?: string | DescendParameterOptions, options?: DescendParameterOptions): Node[]; descendantsOne(value?: string | DescendParameterOptions, options?: DescendParameterOptions): Node | undefined; siblings(value?: string | SiblingsParameterOptions, options?: SiblingsParameterOptions): Node[]; siblingsOne(value?: string | SiblingsParameterOptions, options?: SiblingsParameterOptions): Node | undefined; isSibling(type: NodeUISiblingType, attr: T): boolean; isSibling(type: NodeUISiblingType, filter: IteratorPredicate): boolean; isSibling(type: NodeUISiblingType, options?: SiblingOptions): boolean; boxOf(attr: keyof (BoxRect & Dimension)): number; valueOf(attr: CssStyleAttr, options?: CssInitialOptions): string; get documentRoot(): boolean; get parent(): Node | null; get shadowRoot(): boolean; get shadowHost(): ShadowRoot | null; get depth(): number; get childIndex(): number; get naturalChildren(): Node[]; get naturalElements(): Node[]; get dir(): TextDirection; get textBounds(): BoxRectDimension | null; get box(): BoxRectDimension; get bounds(): BoxRectDimension; get linear(): BoxRectDimension; get element(): Element | null; get elementId(): string; get tagName(): string; get naturalChild(): boolean; get naturalElement(): boolean; get customElement(): boolean; get parentElement(): Element | null; get htmlElement(): boolean; get styleElement(): boolean; get imageElement(): boolean; get svgElement(): boolean; get flexElement(): boolean; get gridElement(): boolean; get textElement(): boolean; get tableElement(): boolean; get inputElement(): boolean; get buttonElement(): boolean; get mathElement(): boolean; get voidElement(): boolean; get pseudoElement(): boolean; get pseudoElt(): PseudoElt | ""; get documentBody(): boolean; get dataset(): DOMStringMap; get centerAligned(): boolean; get rightAligned(): boolean; get bottomAligned(): boolean; get width(): number; get height(): number; get hasWidth(): boolean; get hasHeight(): boolean; get lineHeight(): number; get display(): string; get positionStatic(): boolean; get positionRelative(): boolean; get positionFixed(): boolean; get top(): number; get right(): number; get bottom(): number; get left(): number; get borderTopWidth(): number; get borderRightWidth(): number; get borderBottomWidth(): number; get borderLeftWidth(): number; get marginTop(): number; get marginRight(): number; get marginBottom(): number; get marginLeft(): number; get paddingTop(): number; get paddingRight(): number; get paddingBottom(): number; get paddingLeft(): number; get outlineWidth(): number; get inline(): boolean; get inlineStatic(): boolean; get inlineText(): boolean; get block(): boolean; get blockStatic(): boolean; get plainText(): boolean; get textContent(): string; get lineBreak(): boolean; get pageFlow(): boolean; get autoMargin(): AutoMargin; get floating(): boolean; get float(): FloatDirectionAttr; get floatClear(): ClearDirectionAttr; get baseline(): boolean; get multiline(): boolean; get contentBox(): boolean; get contentBoxWidth(): number; get contentBoxHeight(): number; get borderBoxElement(): boolean; /** @deprecated flex(attr) */ get flexdata(): FlexboxLayout; get flexbox(): Flexbox; get zIndex(): number; get opacity(): number; get backgroundColor(): string; get backgroundImage(): string; get visibleStyle(): VisibleStyle; get fontSize(): number; get verticalAlign(): number; get actualParent(): Node | null; get absoluteParent(): Node | null; get wrapperOf(): Node | null; get actualWidth(): number; get actualHeight(): number; get actualDimension(): Dimension; get leftPos(): number; get rightPos(): number; get containerDimension(): Readonly[] | null; get containerHeight(): boolean; get percentWidth(): number; get percentHeight(): number; get aspectRatio(): [number, number] | null; get firstChild(): Node | null; get lastChild(): Node | null; get firstElementChild(): Node | null; get lastElementChild(): Node | null; get previousSibling(): Node | null; get nextSibling(): Node | null; get previousElementSibling(): Node | null; get nextElementSibling(): Node | null; get attributes(): StringMap; get keyframes(): KeyframesMap | null; get checked(): boolean | null; get boundingClientRect(): DOMRect | null; get preserveWhiteSpace(): boolean; get nowrapWhiteSpace(): boolean; get style(): CSSStyleDeclaration; get cssStyle(): CssStyleMap; get textStyle(): CssStyleMap; get writingMode(): string; get elementData(): ElementData | null; get initial(): InitialData; constructor(id: number, sessionId?: string, element?: Element, children?: Node[]); } export class NodeUI extends Node implements LayoutType { static baseline(list: T[], options: BaselineOptions): T | null; static baseline(list: T[], text?: boolean, image?: boolean): T | null; static baselineElement(node: T): boolean; static linearData(list: T[], cleared?: Map | null, absolute?: boolean): LinearData; static partitionRows(list: T[], cleared?: Map | null): T[][]; alignmentType: number; contentAltered: boolean; baselineActive: boolean; baselineAltered: boolean; rendered: boolean; excluded: boolean; rootElement: boolean; lineBreakLeading: boolean; lineBreakTrailing: boolean; floatContainer: boolean; absoluteContainer: boolean; renderChildren: NodeUI[]; renderExtension: Extension[] | null; renderTemplates: NodeTemplate[] | null; documentChildren?: NodeUI[]; setControlType(controlName: string, containerType?: number): void; setExclusions(): void; setLayout(): void; setAlignment(): void; setBoxSpacing(): void; attr(name: string, attr: string, value?: string, overwrite?: boolean): string; attrx(attr: string, value?: string, overwrite?: boolean): string; alignParent(...position: AnchorPositionAttr[]): boolean; alignSibling(position: AnchorPositionAttr, documentId?: string): string; anchorChain(...values: PositionAttr[]): NodeUI[]; anchorSibling(orientation: OrientationAttr, documentId?: string): [AnchorPositionAttr, string][]; localizeString(value: string): T; inherit(node: NodeUI, ...modules: string[]): PlainObject | null; inheritApply(module: string, data: PlainObject): void; transferData(node: NodeUI, overwrite?: boolean, ...keys: Array): void; clone(id: number): void; cloneBase(node: NodeUI): void; is(containerType: number): boolean; of(containerType: number, ...alignmentType: number[]): boolean; namespace(name: string): StringMap; namespaces(): [string, StringMap][]; unsafe(name: string | PlainObject, value?: unknown): T | undefined; delete(name: string, ...attrs: string[]): void; deleteOne(name: string, attr: string): void; apply(options: PlainObject): void; lockAttr(name: string, attr: string): void; unlockAttr(name: string, attr: string): void; lockedAttr(name: string, attr: string): boolean; joinAttr(name: string, attr: string, value: string, delim?: string): string; unsetCache(...attrs: Array): void; addAlign(value: number): void; removeAlign(value: number): void; hasAlign(value: number): boolean; hasProcedure(value: number): boolean; hasResource(value: number): boolean; hasSection(value: number): boolean; hasOptimization(value: number): boolean; exclude(options: ExcludeOptions): void; hide(options?: HideOptions): NodeTemplate | null; replaceTry(options: ReplaceTryOptions): boolean; removeTry(options?: RemoveTryOptions): NodeTemplate | null; render(parent: NodeUI): void; renderEach(predicate: IteratorPredicate>): this; parseWidth(value: string, parent?: boolean): number; parseHeight(value: string, parent?: boolean): number; actualRect(position: PositionAttr, dimension?: BoxType): number; actualPadding(attr: BoxPaddingAttr): number; actualMargin(attr: BoxMarginAttr): number; actualBoxWidth(value?: number): number; actualTextHeight(options?: TextHeightOptions): number; alignedVertically(siblings?: NodeUI[] | AlignedVerticallyOptions | null, cleared?: Map | null, horizontal?: boolean): number; previousSiblings(options?: TraverseSiblingsOptions): NodeUI[]; nextSiblings(options?: TraverseSiblingsOptions): NodeUI[]; actualSpacing(region: BOX_STANDARD): number; modifyBox(region: BOX_STANDARD, value: number, negative?: boolean): void; setBox(region: BOX_STANDARD, options: BoxOptions): void; getBox(region: BOX_STANDARD): [number, number]; resetBox(region: BOX_STANDARD, node?: NodeUI): void; transferBox(region: BOX_STANDARD, node: NodeUI): void; registerBox(region: BOX_STANDARD, node?: NodeUI): NodeUI | null; setCacheValue(attr: T, value: U): void; setCacheState, U extends CacheStateUI[T]>(attr: T, value: U): void; setCacheStyle(attr: keyof CssStyleMap, value: string): void; unsetStyle(...attrs: CssStyleAttr[]): void; hasVisibleStyle(border?: PositionAttr): boolean; extractAttributes(depth?: number, replaceWith?: AnyObject): string; css(attr: CssStyleAttr, value?: string | null, cache?: boolean): string; cssSet(attr: CssStyleAttr, value: string, cache?: boolean): string; translateX(value: number, options?: TranslateOptions): boolean; translateY(value: number, options?: TranslateOptions): boolean; flex(attr: "inline" | "row" | "column" | "reverse" | "wrap" | "wrapReverse", parent?: boolean | NodeUI, wrapped?: boolean): T; flex(attr: "alignContent" | "justifyContent" | "basis" | "alignSelf" | "justifySelf", parent?: boolean | NodeUI, wrapped?: boolean): T; flex(attr: "grow" | "shrink" | "order", parent?: boolean | NodeUI, wrapped?: boolean): T; flex(attr: T, parent?: boolean | NodeUI, wrapped?: boolean): boolean | number | string; getBoxSpacing(region?: BOX_STANDARD): BoxOf; getPositionOffset(name: "sticky"): Point; getFontSizeAdjust(fontFamily: string, fontSize?: number | null, fontRule?: number): number; getAnchoredSiblings(orientation: OrientationAttr): NodeUI[]; getPseudoElement(name: PseudoElt | PseudoStyleElt | PseudoStyleWebkitElt): CssStyleMap | null; getPseudoElement(name: PseudoElt | PseudoStyleElt | PseudoStyleWebkitElt, attr: undefined, context: string): CssStyleMap | null; getPseudoElement(name: PseudoElt | PseudoStyleElt | PseudoStyleWebkitElt, attr: T, context?: string): string; getPseudoElement(name: PseudoElt | PseudoStyleElt | PseudoStyleWebkitElt, attr?: CssStyleAttr, context?: string): T extends CssStyleMap ? CssStyleMap | null : string; setFontVariantAlternates(fontFamily: string, fontData?: FontFeatureValuesData): void; hasFixedDimension(dimension: DimensionAttr): boolean; isResizable(attr: DimensionSizableAttr, not?: string | string[]): boolean; isSibling(type: NodeUISiblingType, attr: T): boolean; isSibling(type: NodeUISiblingType, filter: IteratorPredicate): boolean; isSibling(type: NodeUISiblingType, options?: SiblingOptions): boolean; fitToScreen(value: Dimension): Dimension; getComments(type: ReferenceType, attrs?: CssStyleAttr[]): [string, string]; cssValue(attr: CssStyleAttr): string; cssValues(...attrs: CssStyleAttr[]): string[]; datasetValue(name: string, global?: boolean): string | undefined; set documentRoot(value); get documentRoot(): boolean; set depth(value); get depth(): number; set parent(value); get parent(): NodeUI | null; set documentParent(value); get documentParent(): NodeUI; set containerName(value); get containerName(): string; set autoPosition(value); get autoPosition(): boolean; set inlineText(value); get inlineText(): boolean; set textContent(value); get textContent(): string; get styleText(): boolean; set multiline(value); get multiline(): boolean; set visible(value); get visible(): boolean; set controlName(value); get controlName(): string; set actualParent(value); get actualParent(): NodeUI | null; set siblingsLeading(value); get siblingsLeading(): NodeUI[]; set siblingsTrailing(value); get siblingsTrailing(): NodeUI[]; set renderParent(value); get renderParent(): NodeUI | null; set outerWrapper(value); get outerWrapper(): NodeUI | null; set companion(value); get companion(): NodeUI | null; set renderedAs(value); get renderedAs(): NodeTemplate | null; set horizontalRows(value); get horizontalRows(): NodeUI[][] | null; set containerType(value: number); get containerType(): number; set positioned(value); get positioned(): boolean; set controlId(name: string); get controlId(): string; get referenceId(): string; get documentId(): string; set textIndent(value); get textIndent(): number; get preIndent(): [string, NodeUI] | null; get causesLineBreak(): boolean; get afterLineBreak(): boolean; set renderExclude(value: boolean); get renderExclude(): boolean; set renderAs(value); get renderAs(): NodeUI | null; set labelFor(value); get labelFor(): NodeUI | null; set innerWrapped(value); get innerWrapped(): NodeUI | null; set use(value); get use(): string; set localSettings(value); get localSettings(): LocalSettingsUI & ElementSettingsUI; get extensions(): string[]; get scalableElement(): boolean; get scrollElement(): boolean; get modalElement(): boolean; get controlElement(): boolean; get imageContainer(): boolean; get baselineHeight(): number; get support(): SupportUI; get layoutElement(): boolean; get layoutHorizontal(): boolean; get layoutVertical(): boolean; get nodeGroup(): boolean; get tagDisplay(): string; get inlineVertical(): boolean; get inlineDimension(): boolean; get blockStatic(): boolean; get blockVertical(): boolean; get blockDimension(): boolean; get inlineFlow(): boolean; get inlineBlock(): boolean; get verticalAligned(): boolean; get variableWidth(): boolean; get variableHeight(): boolean; get fullWidth(): boolean; get fullHeight(): boolean; get fullContentWidth(): boolean; get fullContentHeight(): boolean; get positiveAxis(): boolean; get leftTopAxis(): boolean; get baselineElement(): boolean; get flowElement(): boolean; get flowContent(): boolean; get flowChildren(): NodeUI[]; /** @deprecated flex("row") */ get flexRow(): boolean; /** @deprecated flex("column") */ get flexColumn(): boolean; get previousSibling(): NodeUI | null; get nextSibling(): NodeUI | null; get firstStaticChild(): NodeUI | null; get lastStaticChild(): NodeUI | null; get onlyChild(): boolean; get onlyStaticChild(): boolean; get horizontalRowStart(): boolean; get horizontalRowEnd(): boolean; get innerBefore(): NodeUI | null; get innerAfter(): NodeUI | null; get rendering(): boolean; get boxReset(): number[]; get boxAdjustment(): number[]; get overflowX(): boolean; get overflowY(): boolean; get textEmpty(): boolean; get textWidth(): number; get textMetrics(): TextMetrics | null; get wordSpacing(): number; get innerMostWrapped(): NodeUI; get outerMostWrapper(): NodeUI; get firstLineStyle(): CssStyleMap | null; get firstLetterStyle(): CssStyleMap | null; get textAlignLast(): string; get textJustified(): boolean; get fontFeatureSettings(): string[]; get fontVariationSettings(): string[]; get fontVariantAlternates(): string[]; get fontSynthesis(): FontSynthesis; get alignContent(): AlignContentValue | ""; get transformValue(): string; get metadata(): PlainObject | null; get outerRegion(): BoxRectDimension; get boundingRegion(): BoxRectDimension; set locales(value); get locales(): ResourceIntlLocales; } export class NodeGroupUI extends NodeUI {} export class NodeList extends Container { readonly sessionId: string; readonly resourceId: number; readonly projectId: string; afterAdd?(this: T, options: NodeListAddOptions): void; add(node: T, options?: NodeListAddOptions): this; sort(predicate: FunctionSort): this; constructor(children?: T[], sessionId?: string, resourceId?: number); } export * as extensions from './extensions'; export * as internal from './internal'; export * as lib from './lib';