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
Parameter | Type |
---|---|
src | string |
altText | string |
title | undefined | string |
width ? | number | "inherit" |
height ? | number | "inherit" |
key ? | string |
Returns
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
Parameter | Type |
---|---|
altText | undefined | string |
Returns
void
setSrc()
setSrc(
src
):void
Parameters
Parameter | Type |
---|---|
src | string |
Returns
void
setTitle()
setTitle(
title
):void
Parameters
Parameter | Type |
---|---|
title | undefined | string |
Returns
void
setWidthAndHeight()
setWidthAndHeight(
width
,height
):void
Sets the image dimensions
Parameters
Parameter | Type |
---|---|
width | number | "inherit" |
height | number | "inherit" |
Returns
void