@lynx-js/offscreen-document
Version:
Offscreen Document allows developers to use particular DOM in WebWorker
60 lines (59 loc) • 2.33 kB
TypeScript
import { type OffscreenDocument } from './OffscreenDocument.js';
import { OffscreenCSSStyleDeclaration } from './OffscreenCSSStyleDeclaration.js';
export declare const ancestorDocument: unique symbol;
export declare const _attributes: unique symbol;
export declare const _children: unique symbol;
export declare const innerHTML: unique symbol;
export declare const _cssRuleContents: unique symbol;
export declare const uniqueId: unique symbol;
declare const _style: unique symbol;
type OffscreenStyleSheet = {
cssRules: {
style: {
cssText: string;
};
}[];
insertRule: (rule: string, index: number) => number;
};
export declare class OffscreenElement extends EventTarget {
#private;
[innerHTML]: string;
private [_style]?;
private readonly [_attributes];
private _parentElement;
readonly [_children]: OffscreenElement[];
[_cssRuleContents]?: string[];
/**
* @private
*/
readonly [uniqueId]: number;
/**
* @private
*/
[ancestorDocument]: OffscreenDocument;
readonly localName: string;
constructor(localName: string, elementUniqueId: number);
get sheet(): OffscreenStyleSheet;
get tagName(): string;
get style(): OffscreenCSSStyleDeclaration;
get children(): OffscreenElement[];
get parentElement(): OffscreenElement | null;
get parentNode(): OffscreenElement | null;
get firstElementChild(): OffscreenElement | null;
get lastElementChild(): OffscreenElement | null;
get nextElementSibling(): OffscreenElement | null;
protected _remove(): void;
setAttribute(qualifiedName: string, value: string): void;
getAttribute(qualifiedName: string): string | null;
removeAttribute(qualifiedName: string): void;
append(...nodes: (OffscreenElement)[]): void;
appendChild(node: OffscreenElement): OffscreenElement;
replaceWith(...nodes: (OffscreenElement)[]): void;
getAttributeNames(): string[];
remove(): void;
insertBefore(newNode: OffscreenElement, refNode: OffscreenElement | null): OffscreenElement;
removeChild(child: OffscreenElement | null): OffscreenElement;
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
set innerHTML(text: string);
}
export {};