Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

creator

Given the specified element name, returns a function which creates an element of the given name, assuming that "this" is the parent element.

function creator<K extends keyof ElementTagNameMap>(name: K): (this: BaseType) => ElementTagNameMap[K];
function creator<NewGElement extends Element>(name: string): (this: BaseType) => NewGElement;
§
creator<K extends keyof ElementTagNameMap>(name: K): (this: BaseType) => ElementTagNameMap[K]
[src]

Given the specified element name, returns a function which creates an element of the given name, assuming that "this" is the parent element.

§Type Parameters

§
K extends keyof ElementTagNameMap
[src]

§Parameters

§
name: K
[src]

Tag name of the element to be added.

§Return Type

§
(this: BaseType) => ElementTagNameMap[K]
[src]
§
creator<NewGElement extends Element>(name: string): (this: BaseType) => NewGElement
[src]

Given the specified element name, returns a function which creates an element of the given name, assuming that "this" is the parent element.

The generic refers to the type of the new element to be returned by the creator function.

§Type Parameters

§
NewGElement extends Element
[src]

§Parameters

§
name: string
[src]

Tag name of the element to be added. See "namespace" for details on supported namespace prefixes, such as for SVG elements.

§Return Type

§
(this: BaseType) => NewGElement
[src]