Skip to main content
Element describes the common metadata of all visible elements in a note file (and in document annotation scenarios), such as strokes, titles, links, TextBox, geometries, and pictures. An Element uses type to distinguish its category and provides more specific structures under the corresponding fields (e.g. stroke, title, link, textBox, geometry, picture).
If you only care about the element category, read type. If you need to operate on the content, read typed fields such as stroke/title/link/textBox/geometry based on type.

Type Constants

ElementType defines the value range of Element.type.

ElementType

In the table below, the ElementType. prefix is omitted in the Constant column. In code, use the full name: ElementType.XXX.
TypeConstantValueDescriptionDetail Field
StrokeTYPE_STROKE0Handwritten stroke; can be inserted and edited on both main and custom layersstroke
TitleTYPE_TITLE100Title element; can be inserted and edited only on the main layertitle
PictureTYPE_PICTURE200Picture element; can be inserted and edited on both main and custom layerspicture
TextBoxTYPE_TEXT500Regular TextBox; can be inserted and edited on both main and custom layerstextBox
Digest quote TextBoxTYPE_TEXT_DIGEST_QUOTE501Quoted digest TextBox; can be inserted and edited only on the main layertextBox
Digest created TextBoxTYPE_TEXT_DIGEST_CREATE502Created digest TextBox; can be inserted and edited only on the main layertextBox
LinkTYPE_LINK600Text / stroke link; can be inserted and edited only on the main layerlink
GeometryTYPE_GEO700Geometry element; can be inserted and edited on both main and custom layersgeometry
Five-starTYPE_FIVE_STAR800Five-star element; can be inserted and edited only on the main layerfiveStar

Fields

FieldTypeDescription
uuidstringUnique identifier for the element
typenumberElement type. See ElementType
pageNumnumberPage number
layerNumnumberLayer number (common range in notes: 0..3)
thicknessnumberStroke thickness (may be meaningless for some element types)
recognizeResultRecogResultDataRecognition result data
maxXnumberMax X value in the EMR coordinate system. See Coordinate System
maxYnumberMax Y value in the EMR coordinate system. See Coordinate System
userDatastringCustom user data
anglesElementDataAccessor<Point>Angle points. The dataset can be large, so RN holds an accessor/index; raw data is on the Android side
statusnumberElement status
numInPagenumberIndex within the page (starts from 0)
contoursSrcElementDataAccessor<Point[]>Contour points (pixel coordinates). RN holds an accessor/index; raw data is on the Android side
strokeStroke | nullStroke data (only when type === 0)
titleTitle | nullTitle data (only when type === 100)
textBoxTextBox | nullTextBox data (only for TextBox-related types)
geometryGeometry | nullGeometry data (only when type === 700)
linkLink | nullLink data (only when type === 600)
fiveStarFiveStar | nullFive-star data (only when type === 800; see “FiveStar” below)
picturePicture | nullPicture data (only when type === 200)
angles and contoursSrc are accessor objects, not full arrays. Fetch data asynchronously via size()/get()/getRange() to avoid JS memory issues caused by transferring large point sets at once.

FiveStar (Five-star)

When type === 800, the fiveStar field provides the point set of the five-star element.
FieldTypeDescription
pointsPoint[]Five-star point coordinates (EMR)

Methods

MethodReturnsDescription
recycle()Promise<void>Recycle native cached data for this element and clear accessor caches