Skip to main content

Class: ImageElement

Hierarchy​

Constructors​

constructor​

• new ImageElement(document, node, captureTextNodes?)

Parameters​

NameType
documentDocument
nodeHTMLElement
captureTextNodes?boolean

Overrides​

RenderedElement.constructor

Defined in​

src/Document/ImageElement.ts:14

Properties​

ignoreChildTypes​

â–ª Static Readonly ignoreChildTypes: string[]

Inherited from​

RenderedElement.ignoreChildTypes

Defined in​

src/Document/Element.ts:11


attributes​

• Readonly attributes: Record<string, Property<unknown>> = {}

Inherited from​

RenderedElement.attributes

Defined in​

src/Document/Element.ts:14


styles​

• Readonly styles: Record<string, Property<unknown>> = {}

Inherited from​

RenderedElement.styles

Defined in​

src/Document/Element.ts:15


stylesSpecificity​

• Readonly stylesSpecificity: Record<string, string> = {}

Inherited from​

RenderedElement.stylesSpecificity

Defined in​

src/Document/Element.ts:16


animationFrozen​

• animationFrozen: boolean = false

Inherited from​

RenderedElement.animationFrozen

Defined in​

src/Document/Element.ts:17


animationFrozenValue​

• animationFrozenValue: string = ''

Inherited from​

RenderedElement.animationFrozenValue

Defined in​

src/Document/Element.ts:18


parent​

• parent: Element = null

Inherited from​

RenderedElement.parent

Defined in​

src/Document/Element.ts:19


children​

• children: Element[] = []

Inherited from​

RenderedElement.children

Defined in​

src/Document/Element.ts:20


document​

• Protected Readonly document: Document

Inherited from​

RenderedElement.document

Defined in​

src/Document/Element.ts:23


node​

• Protected Optional Readonly node: HTMLElement

Inherited from​

RenderedElement.node

Defined in​

src/Document/Element.ts:24


captureTextNodes​

• Protected Readonly captureTextNodes: boolean = false

Inherited from​

RenderedElement.captureTextNodes

Defined in​

src/Document/Element.ts:25


type​

• type: string = 'image'

Overrides​

RenderedElement.type

Defined in​

src/Document/ImageElement.ts:10


loaded​

• loaded: boolean = false

Defined in​

src/Document/ImageElement.ts:11


image​

• Protected image: string | CanvasImageSource

Defined in​

src/Document/ImageElement.ts:12

Methods​

getAttribute​

â–¸ getAttribute(name, createIfNotExists?): Property<unknown>

Parameters​

NameTypeDefault value
namestringundefined
createIfNotExistsbooleanfalse

Returns​

Property<unknown>

Inherited from​

RenderedElement.getAttribute

Defined in​

src/Document/Element.ts:87


getHrefAttribute​

â–¸ getHrefAttribute(): Property<unknown>

Returns​

Property<unknown>

Inherited from​

RenderedElement.getHrefAttribute

Defined in​

src/Document/Element.ts:101


getStyle​

â–¸ getStyle(name, createIfNotExists?, skipAncestors?): Property<unknown>

Parameters​

NameTypeDefault value
namestringundefined
createIfNotExistsbooleanfalse
skipAncestorsbooleanfalse

Returns​

Property<unknown>

Inherited from​

RenderedElement.getStyle

Defined in​

src/Document/Element.ts:114


render​

â–¸ render(ctx): void

Parameters​

NameType
ctxRenderingContext2D

Returns​

void

Inherited from​

RenderedElement.render

Defined in​

src/Document/Element.ts:151


applyEffects​

â–¸ Protected applyEffects(ctx): void

Parameters​

NameType
ctxRenderingContext2D

Returns​

void

Inherited from​

RenderedElement.applyEffects

Defined in​

src/Document/Element.ts:190


addChild​

â–¸ Protected addChild(childNode): void

Parameters​

NameType
childNodeHTMLElement | Element

Returns​

void

Inherited from​

RenderedElement.addChild

Defined in​

src/Document/Element.ts:220


matchesSelector​

â–¸ Protected matchesSelector(selector): boolean

Parameters​

NameType
selectorstring

Returns​

boolean

Inherited from​

RenderedElement.matchesSelector

Defined in​

src/Document/Element.ts:232


addStylesFromStyleDefinition​

â–¸ addStylesFromStyleDefinition(): void

Returns​

void

Inherited from​

RenderedElement.addStylesFromStyleDefinition

Defined in​

src/Document/Element.ts:248


removeStyles​

â–¸ Protected removeStyles(element, ignoreStyles): [string, string][]

Parameters​

NameType
elementElement
ignoreStylesstring[]

Returns​

[string, string][]

Inherited from​

RenderedElement.removeStyles

Defined in​

src/Document/Element.ts:283


restoreStyles​

â–¸ Protected restoreStyles(element, styles): void

Parameters​

NameType
elementElement
styles[string, string][]

Returns​

void

Inherited from​

RenderedElement.restoreStyles

Defined in​

src/Document/Element.ts:301


isFirstChild​

â–¸ isFirstChild(): boolean

Returns​

boolean

Inherited from​

RenderedElement.isFirstChild

Defined in​

src/Document/Element.ts:307


loadImage​

â–¸ Protected loadImage(href): Promise<void>

Parameters​

NameType
hrefstring

Returns​

Promise<void>

Defined in​

src/Document/ImageElement.ts:38


loadSvg​

â–¸ Protected loadSvg(href): Promise<void>

Parameters​

NameType
hrefstring

Returns​

Promise<void>

Defined in​

src/Document/ImageElement.ts:50


renderChildren​

â–¸ renderChildren(ctx): void

Parameters​

NameType
ctxRenderingContext2D

Returns​

void

Overrides​

RenderedElement.renderChildren

Defined in​

src/Document/ImageElement.ts:77


getBoundingBox​

â–¸ getBoundingBox(): BoundingBox

Returns​

BoundingBox

Defined in​

src/Document/ImageElement.ts:139


calculateOpacity​

â–¸ Protected calculateOpacity(): number

Returns​

number

Inherited from​

RenderedElement.calculateOpacity

Defined in​

src/Document/RenderedElement.ts:13


setContext​

â–¸ setContext(ctx, fromMeasure?): void

Parameters​

NameTypeDefault value
ctxRenderingContext2Dundefined
fromMeasurebooleanfalse

Returns​

void

Inherited from​

RenderedElement.setContext

Defined in​

src/Document/RenderedElement.ts:31


clearContext​

â–¸ clearContext(ctx): void

Parameters​

NameType
ctxRenderingContext2D

Returns​

void

Inherited from​

RenderedElement.clearContext

Defined in​

src/Document/RenderedElement.ts:215