LexicalDTO
Datalayer Core / LexicalDTO
Class: LexicalDTO
Defined in: src/models/LexicalDTO.ts:139
Lexical domain model that extends the base Item class. Provides lexical document functionality for managing rich text documents.
Example
const lexical = await sdk.createLexical(formData);
await lexical.update({ name: 'Updated Documentation' });
Extends
Item<LexicalData>
Constructors
Constructor
new LexicalDTO(
data,sdk):LexicalDTO
Defined in: src/models/LexicalDTO.ts:146
Create a Lexical instance.
Parameters
data
LexicalData
Lexical data from API
sdk
SDK instance
Returns
LexicalDTO
Overrides
Properties
_data
protected_data:LexicalData
Defined in: src/models/ItemDTO.ts:23
Inherited from
Accessors
content
Get Signature
get content():
any
Defined in: src/models/LexicalDTO.ts:182
The cached content.
Returns
any
Overrides
createdAt
Get Signature
get createdAt():
Date
Defined in: src/models/ItemDTO.ts:105
When the item was created.
Returns
Date
Inherited from
description
Get Signature
get description():
string
Defined in: src/models/LexicalDTO.ts:195
Description of the lexical document.
Returns
string
extension
Get Signature
get extension():
string
Defined in: src/models/LexicalDTO.ts:201
Get the document extension.
Returns
string
id
Get Signature
get id():
string
Defined in: src/models/ItemDTO.ts:63
Item ID.
Returns
string
Inherited from
isDeleted
Get Signature
get isDeleted():
boolean
Defined in: src/models/ItemDTO.ts:42
Check if this item has been deleted.
Returns
boolean
Inherited from
name
Get Signature
get name():
string
Defined in: src/models/LexicalDTO.ts:161
The cached name of the document.
Returns
string
Overrides
ownerId
Get Signature
get ownerId():
string
Defined in: src/models/ItemDTO.ts:97
Owner user ID.
Returns
string
Inherited from
spaceId
Get Signature
get spaceId():
string
Defined in: src/models/ItemDTO.ts:75
Parent space ID.
Returns
string
Inherited from
type
Get Signature
get type():
string
Defined in: src/models/LexicalDTO.ts:155
Document type identifier.
Returns
string
Overrides
uid
Get Signature
get uid():
string
Defined in: src/models/ItemDTO.ts:69
Unique identifier for the item.
Returns
string
Inherited from
updatedAt
Get Signature
get updatedAt():
Date
Defined in: src/models/ItemDTO.ts:118
The cached update time.
Returns
Date
Inherited from
Methods
_checkDeleted()
protected_checkDeleted():void
Defined in: src/models/ItemDTO.ts:50
Check if this item has been deleted and throw error if so.
Returns
void
Throws
Error if deleted
Inherited from
_getSpacerRunUrl()
protected_getSpacerRunUrl():string
Defined in: src/models/ItemDTO.ts:251
Get spacer API URL for API calls.
Returns
string
Inherited from
_getToken()
protected_getToken():string
Defined in: src/models/ItemDTO.ts:246
Get SDK token for API calls.
Returns
string
Inherited from
_updateData()
protected_updateData(newData):void
Defined in: src/models/ItemDTO.ts:256
Update internal data after API call.
Parameters
newData
LexicalData
Returns
void
Inherited from
delete()
delete():
Promise<void>
Defined in: src/models/ItemDTO.ts:163
Delete this item permanently. After deletion, all subsequent method calls will throw errors.
Returns
Promise<void>
Inherited from
getContent()
getContent():
Promise<any>
Defined in: src/models/ItemDTO.ts:172
Get the document content from API.
Returns
Promise<any>
Inherited from
getName()
getName():
Promise<string>
Defined in: src/models/LexicalDTO.ts:167
Get the current name of the document from API.
Returns
Promise<string>
Overrides
getUpdatedAt()
getUpdatedAt():
Promise<Date>
Defined in: src/models/LexicalDTO.ts:208
Get when the document was last updated from API.
Returns
Promise<Date>
Overrides
rawData()
rawData():
LexicalData
Defined in: src/models/LexicalDTO.ts:288
Get the raw lexical data exactly as received from the API. This preserves the original snake_case naming from the API response.
Returns
LexicalData
Raw lexical data from API
Overrides
toJSON()
toJSON():
LexicalJSON
Defined in: src/models/LexicalDTO.ts:265
Get lexical document data in camelCase format. Returns only the core fields that consumers need. This provides a stable interface regardless of API changes.
Returns
LexicalJSON
Core lexical data with camelCase properties
Overrides
toString()
toString():
string
Defined in: src/models/ItemDTO.ts:235
String representation of the item.
Returns
string
Inherited from
update()
update(
name?,description?):Promise<LexicalDTO>
Defined in: src/models/LexicalDTO.ts:239
Update the document.
Parameters
name?
string
description?
string
Returns
Promise<LexicalDTO>