Class: ImageNode

A lexical node that represents an image. Use "$createImageNode" to construct one.

Hierarchy

  • DecoratorNode<JSX.Element>

    ImageNode

Table of contents

Constructors

Methods

Constructors

constructor

new ImageNode(src, altText, title, width?, height?, key?): ImageNode

Constructs a new ImageNode with the specified image parameters. Use $createImageNode to construct one.

Parameters

NameType
srcstring
altTextstring
titleundefined | string
width?number | "inherit"
height?number | "inherit"
key?string

Returns

ImageNode

Overrides

DecoratorNode&lt;JSX.Element&gt;.constructor

Methods

getAltText

getAltText(): string

Returns

string


getHeight

getHeight(): number | "inherit"

Returns

number | "inherit"


getSrc

getSrc(): string

Returns

string


getTitle

getTitle(): undefined | string

Returns

undefined | string


getWidth

getWidth(): number | "inherit"

Returns

number | "inherit"


setAltText

setAltText(altText): void

Parameters

NameType
altTextundefined | string

Returns

void


setSrc

setSrc(src): void

Parameters

NameType
srcstring

Returns

void


setTitle

setTitle(title): void

Parameters

NameType
titleundefined | string

Returns

void


setWidthAndHeight

setWidthAndHeight(width, height): void

Sets the image dimensions

Parameters

NameType
widthnumber | "inherit"
heightnumber | "inherit"

Returns

void