Class: ImageNode

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

Extends

  • DecoratorNode<JSX.Element>

Constructors

new ImageNode()

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

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

Parameters

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

Returns

ImageNode

Overrides

DecoratorNode<JSX.Element>.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

ParameterType
altTextundefined | string

Returns

void


setSrc()

setSrc(src): void

Parameters

ParameterType
srcstring

Returns

void


setTitle()

setTitle(title): void

Parameters

ParameterType
titleundefined | string

Returns

void


setWidthAndHeight()

setWidthAndHeight(width, height): void

Sets the image dimensions

Parameters

ParameterType
widthnumber | "inherit"
heightnumber | "inherit"

Returns

void