Skip to content

Module: utilities/dom

Classes

Functions

createElement

createElement<K>(tag, props?, ...children): HTMLElementTagNameMap[K]

Type parameters

NameType
Kextends keyof HTMLElementTagNameMap

Parameters

NameType
tagK
props?any
...childrenany[]

Returns

HTMLElementTagNameMap[K]

Defined in

src/utilities/dom.ts:105

createElement<K>(tag, props?, ...children): HTMLElementDeprecatedTagNameMap[K]

Type parameters

NameType
Kextends keyof HTMLElementDeprecatedTagNameMap

Parameters

NameType
tagK
props?any
...childrenany[]

Returns

HTMLElementDeprecatedTagNameMap[K]

Defined in

src/utilities/dom.ts:106


findReactFragment

findReactFragment<TNode>(frag, criteria, depth?, current?, visited?): TNode | null

Type parameters

NameType
TNodeextends SimpleNodeLike

Parameters

NameTypeDefault value
fragTNodeundefined
criteria(node: TNode) => booleanundefined
depthnumber25
currentnumber0
visited?Set<any>undefined

Returns

TNode | null

Defined in

src/utilities/dom.ts:54


findSharedParent

findSharedParent(element, other, selector?): boolean

Parameters

NameType
elementnull | HTMLElement
otherNode
selector?string

Returns

boolean

Defined in

src/utilities/dom.ts:206


highlightJson

highlightJson(object, pretty?, depth?, max_depth?): string

Parameters

NameTypeDefault value
objectanyundefined
prettybooleanfalse
depthnumber1
max_depthnumber30

Returns

string

Defined in

src/utilities/dom.ts:376


off

off(obj, type, listener, options?): void

Parameters

NameType
objEventTarget
typestring
listenernull | EventListenerOrEventListenerObject
options?boolean | EventListenerOptions

Returns

void

Defined in

src/utilities/dom.ts:41


on

on(obj, type, listener, options?): void

Parameters

NameType
objEventTarget
typestring
listenernull | EventListenerOrEventListenerObject
options?boolean | AddEventListenerOptions

Returns

void

Defined in

src/utilities/dom.ts:36


openFile

openFile(contentType, multiple): Promise<unknown>

Parameters

NameType
contentTypestring
multipleboolean

Returns

Promise<unknown>

Defined in

src/utilities/dom.ts:220


readFile

readFile(file, encoding?): Promise<unknown>

Parameters

NameTypeDefault value
fileBlobundefined
encodingstring'utf-8'

Returns

Promise<unknown>

Defined in

src/utilities/dom.ts:257


sanitize

sanitize(text): string

Parameters

NameType
textstring

Returns

string

Defined in

src/utilities/dom.ts:269


setChildren

setChildren(el, children, no_sanitize?, no_empty?): void

Parameters

NameTypeDefault value
elHTMLElementundefined
childrenanyundefined
no_sanitizebooleanfalse
no_emptybooleanfalse

Returns

void

Defined in

src/utilities/dom.ts:169