native-canvas
Version:
A canvas library allows for a HTML canvas to run natively on NodeJs, without a WebBrowser
431 lines (430 loc) • 19 kB
TypeScript
import { SdlWindow } from '../sdl-window/sdl-window';
export declare class SdlDocument implements Document {
private sdlWindow;
private _ATTRIBUTE_NODE;
private _CDATA_SECTION_NODE;
private _COMMENT_NODE;
private _DOCUMENT_FRAGMENT_NODE;
private _DOCUMENT_NODE;
private _DOCUMENT_POSITION_CONTAINED_BY;
private _DOCUMENT_POSITION_CONTAINS;
private _DOCUMENT_POSITION_DISCONNECTED;
private _DOCUMENT_POSITION_FOLLOWING;
private _DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
private _DOCUMENT_POSITION_PRECEDING;
private _DOCUMENT_TYPE_NODE;
private _ELEMENT_NODE;
private _ENTITY_NODE;
private _ENTITY_REFERENCE_NODE;
private _NOTATION_NODE;
private _PROCESSING_INSTRUCTION_NODE;
private _TEXT_NODE;
private _URL;
private _activeElement;
private _alinkColor;
private _all;
private _anchors;
private _applets;
private _baseURI;
private _bgColor;
private _body;
private _characterSet;
private _charset;
private _childElementCount;
private _childNodes;
private _children;
private _compatMode;
private _contentType;
private _cookie;
private _currentScript;
private _defaultView;
private _designMode;
private _dir;
private _doctype;
private _documentElement;
private _documentURI;
private _domain;
private _embeds;
private _fgColor;
private _firstChild;
private _firstElementChild;
private _forms;
private _fullscreen;
private _fullscreenEnabled;
private _head;
private _hidden;
private _images;
private _implementation;
private _inputEncoding;
private _isConnected;
private _lastChild;
private _lastElementChild;
private _lastModified;
private _linkColor;
private _links;
private _location;
private _namespaceURI;
private _nextSibling;
private _nodeName;
private _nodeType;
private _nodeValue;
private _onabort;
private _onanimationcancel;
private _onanimationend;
private _onanimationiteration;
private _onanimationstart;
private _onauxclick;
private _onblur;
private _oncancel;
private _oncanplay;
private _oncanplaythrough;
private _onchange;
private _onclick;
private _onclose;
private _oncontextmenu;
private _oncopy;
private _oncuechange;
private _oncut;
private _ondblclick;
private _ondrag;
private _ondragend;
private _ondragenter;
private _ondragexit;
private _ondragleave;
private _ondragover;
private _ondragstart;
private _ondrop;
private _ondurationchange;
private _onemptied;
private _onended;
private _onerror;
private _onfocus;
private _onfullscreenchange;
private _onfullscreenerror;
private _ongotpointercapture;
private _oninput;
private _oninvalid;
private _onkeydown;
private _onkeypress;
private _onkeyup;
private _onload;
private _onloadeddata;
private _onloadedmetadata;
private _onloadend;
private _onloadstart;
private _onlostpointercapture;
private _onmousedown;
private _onmouseenter;
private _onmouseleave;
private _onmousemove;
private _onmouseout;
private _onmouseover;
private _onmouseup;
private _onpaste;
private _onpause;
private _onplay;
private _onplaying;
private _onpointercancel;
private _onpointerdown;
private _onpointerenter;
private _onpointerleave;
private _onpointermove;
private _onpointerout;
private _onpointerover;
private _onpointerup;
private _onprogress;
private _onratechange;
private _onreadystatechange;
private _onreset;
private _onresize;
private _onscroll;
private _onsecuritypolicyviolation;
private _onseeked;
private _onseeking;
private _onselect;
private _onstalled;
private _onsubmit;
private _onsuspend;
private _ontimeupdate;
private _ontoggle;
private _ontouchcancel;
private _ontouchend;
private _ontouchmove;
private _ontouchstart;
private _ontransitioncancel;
private _ontransitionend;
private _ontransitionrun;
private _ontransitionstart;
private _onvisibilitychange;
private _onvolumechange;
private _onwaiting;
private _onwheel;
private _origin;
private _ownerDocument;
private _parentElement;
private _parentNode;
private _plugins;
private _previousSibling;
private _readyState;
private _referrer;
private _scripts;
private _scrollingElement;
private _styleSheets;
private _textContent;
private _timeline;
private _title;
private _visibilityState;
private _vlinkColor;
private _canvas;
private _document;
constructor(sdlWindow: SdlWindow);
readonly clientTop: number;
readonly clientLeft: number;
ATTRIBUTE_NODE: number;
CDATA_SECTION_NODE: number;
COMMENT_NODE: number;
DOCUMENT_FRAGMENT_NODE: number;
DOCUMENT_NODE: number;
DOCUMENT_POSITION_CONTAINED_BY: number;
DOCUMENT_POSITION_CONTAINS: number;
DOCUMENT_POSITION_DISCONNECTED: number;
DOCUMENT_POSITION_FOLLOWING: number;
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
DOCUMENT_POSITION_PRECEDING: number;
DOCUMENT_TYPE_NODE: number;
ELEMENT_NODE: number;
ENTITY_NODE: number;
ENTITY_REFERENCE_NODE: number;
NOTATION_NODE: number;
PROCESSING_INSTRUCTION_NODE: number;
TEXT_NODE: number;
URL: string;
activeElement: Element | null;
all: HTMLAllCollection;
anchors: HTMLCollectionOf<HTMLAnchorElement>;
applets: HTMLCollectionOf<HTMLAppletElement>;
baseURI: string;
characterSet: string;
charset: string;
childElementCount: number;
childNodes: NodeListOf<ChildNode>;
children: HTMLCollection;
compatMode: string;
contentType: string;
currentScript: HTMLOrSVGScriptElement | null;
defaultView: WindowProxy | null;
doctype: DocumentType | null;
documentElement: HTMLElement | null;
documentURI: string;
embeds: HTMLCollectionOf<HTMLEmbedElement>;
firstChild: ChildNode | null;
firstElementChild: Element | null;
forms: HTMLCollectionOf<HTMLFormElement>;
fullscreen: boolean;
fullscreenEnabled: boolean;
head: HTMLHeadElement | null;
hidden: boolean;
images: HTMLCollectionOf<HTMLImageElement>;
implementation: DOMImplementation;
inputEncoding: string;
isConnected: boolean;
lastChild: ChildNode | null;
lastElementChild: Element | null;
lastModified: string;
links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>;
namespaceURI: string | null;
nextSibling: Node | null;
nodeName: string;
nodeType: number;
origin: string;
ownerDocument: Document | null;
parentElement: HTMLElement | null;
parentNode: (Node & ParentNode) | null;
plugins: HTMLCollectionOf<HTMLEmbedElement>;
previousSibling: Node | null;
readyState: DocumentReadyState;
referrer: string;
scripts: HTMLCollectionOf<HTMLScriptElement>;
scrollingElement: Element | null;
styleSheets: StyleSheetList;
timeline: DocumentTimeline;
visibilityState: VisibilityState;
title: string;
addEventListener(type: string, listener: any, options?: boolean | AddEventListenerOptions): void;
adoptNode<T extends Node>(source: T): T;
append(...nodes: (Node | string)[]): void;
appendChild<T extends Node>(newChild: T): T;
captureEvents(): void;
caretPositionFromPoint(x: number, y: number): CaretPosition | null;
caretRangeFromPoint(x: number, y: number): Range;
clear(): void;
cloneNode(deep?: boolean): Node;
close(): void;
compareDocumentPosition(other: Node): number;
contains(other: Node | null): boolean;
createAttribute(localName: string): Attr;
createAttributeNS(namespace: string | null, qualifiedName: string): Attr;
createCDATASection(data: string): CDATASection;
createComment(data: string): Comment;
createDocumentFragment(): DocumentFragment;
createElement(tagName: string, options?: ElementCreationOptions): any | HTMLElement;
createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): any;
createEvent(eventInterface: any): any;
createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator;
createProcessingInstruction(target: string, data: string): ProcessingInstruction;
createRange(): Range;
createTextNode(data: string): Text;
createTouch(view: WindowProxy, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch;
createTouchList(...touches: Touch[]): TouchList;
createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null, entityReferenceExpansion?: boolean): TreeWalker;
dispatchEvent(event: Event): boolean;
elementFromPoint(x: number, y: number): Element | null;
elementsFromPoint(x: number, y: number): Element[];
evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;
execCommand(commandId: string, showUI?: boolean, value?: string): boolean;
exitFullscreen(): Promise<void>;
getAnimations(): Animation[];
getElementById(elementId: string): HTMLElement | any | Element;
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
getElementsByName(elementName: string): NodeListOf<HTMLElement>;
getElementsByTagName(qualifiedName: any): any;
getElementsByTagNameNS(namespaceURI: string, localName: string): any;
getRootNode(options?: GetRootNodeOptions): Node;
getSelection(): Selection | null;
hasChildNodes(): boolean;
hasFocus(): boolean;
importNode<T extends Node>(importedNode: T, deep: boolean): T;
insertBefore<T extends Node>(newChild: T, refChild: Node | null): T;
isDefaultNamespace(namespace: string | null): boolean;
isEqualNode(otherNode: Node | null): boolean;
isSameNode(otherNode: Node | null): boolean;
lookupNamespaceURI(prefix: string | null): string | null;
lookupPrefix(namespace: string | null): string | null;
normalize(): void;
open(url?: string, name?: string, features?: string, replace?: boolean): Document;
prepend(...nodes: (Node | string)[]): void;
queryCommandEnabled(commandId: string): boolean;
queryCommandIndeterm(commandId: string): boolean;
queryCommandState(commandId: string): boolean;
queryCommandSupported(commandId: string): boolean;
queryCommandValue(commandId: string): string;
querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
querySelector<E extends Element = Element>(selectors: string): E | null;
querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
releaseEvents(): void;
removeChild<T extends Node>(oldChild: T): T;
removeEventListener(type: any, listener: any, options?: boolean | EventListenerOptions): void;
replaceChild<T extends Node>(newChild: Node, oldChild: T): T;
write(...text: string[]): void;
writeln(...text: string[]): void;
alinkColor: string;
bgColor: string;
body: HTMLElement;
cookie: string;
designMode: string;
dir: string;
domain: string;
fgColor: string;
linkColor: string;
location: Location | null;
nodeValue: string | null;
onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
onauxclick: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragexit: ((this: GlobalEventHandlers, ev: Event) => any) | null;
ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onerror: ErrorEventHandler;
onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
onfullscreenchange: ((this: Document, ev: Event) => any) | null;
onfullscreenerror: ((this: Document, ev: Event) => any) | null;
ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadend: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onreadystatechange: ((this: Document, ev: ProgressEvent) => any) | null;
onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
onscroll: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onselect: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onsubmit: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
ontouchcancel: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
ontouchend: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
ontouchmove: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
ontouchstart: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;
ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
onvisibilitychange: ((this: Document, ev: Event) => any) | null;
onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
textContent: string | null;
vlinkColor: string;
canvas: HTMLCanvasElement;
document: any;
readonly window: SdlWindow;
}