Lexical
Datalayer Core / Lexical
Class: Lexical
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:57
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 Lexical(
data
,sdk
):Lexical
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:64
Create a Lexical instance.
Parameters
data
Lexical
Lexical data from API
sdk
SDK instance
Returns
Lexical
Overrides
Properties
_data
protected
_data:Lexical
Defined in: tech/datalayer/core/src/client/models/Item.ts:23
Inherited from
Accessors
content
Get Signature
get content():
any
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:100
The cached content.
Returns
any
Overrides
createdAt
Get Signature
get createdAt():
Date
Defined in: tech/datalayer/core/src/client/models/Item.ts:105
When the item was created.
Returns
Date
Inherited from
description
Get Signature
get description():
string
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:113
Description of the lexical document.
Returns
string
extension
Get Signature
get extension():
string
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:119
Get the document extension.
Returns
string
id
Get Signature
get id():
string
Defined in: tech/datalayer/core/src/client/models/Item.ts:63
Item ID.
Returns
string
Inherited from
isDeleted
Get Signature
get isDeleted():
boolean
Defined in: tech/datalayer/core/src/client/models/Item.ts:42
Check if this item has been deleted.
Returns
boolean
Inherited from
name
Get Signature
get name():
string
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:79
The cached name of the document.
Returns
string
Overrides
ownerId
Get Signature
get ownerId():
string
Defined in: tech/datalayer/core/src/client/models/Item.ts:97
Owner user ID.
Returns
string
Inherited from
spaceId
Get Signature
get spaceId():
string
Defined in: tech/datalayer/core/src/client/models/Item.ts:75
Parent space ID.
Returns
string
Inherited from
type
Get Signature
get type():
string
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:73
Document type identifier.
Returns
string
Overrides
uid
Get Signature
get uid():
string
Defined in: tech/datalayer/core/src/client/models/Item.ts:69
Unique identifier for the item.
Returns
string
Inherited from
updatedAt
Get Signature
get updatedAt():
Date
Defined in: tech/datalayer/core/src/client/models/Item.ts:118
The cached update time.
Returns
Date
Inherited from
Methods
_checkDeleted()
protected
_checkDeleted():void
Defined in: tech/datalayer/core/src/client/models/Item.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: tech/datalayer/core/src/client/models/Item.ts:251
Get spacer API URL for API calls.
Returns
string
Inherited from
_getToken()
protected
_getToken():string
Defined in: tech/datalayer/core/src/client/models/Item.ts:246
Get SDK token for API calls.
Returns
string
Inherited from
_updateData()
protected
_updateData(newData
):void
Defined in: tech/datalayer/core/src/client/models/Item.ts:256
Update internal data after API call.
Parameters
newData
Lexical
Returns
void
Inherited from
delete()
delete():
Promise
<void
>
Defined in: tech/datalayer/core/src/client/models/Item.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: tech/datalayer/core/src/client/models/Item.ts:172
Get the document content from API.
Returns
Promise
<any
>
Inherited from
getName()
getName():
Promise
<string
>
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:85
Get the current name of the document from API.
Returns
Promise
<string
>
Overrides
getUpdatedAt()
getUpdatedAt():
Promise
<Date
>
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:126
Get when the document was last updated from API.
Returns
Promise
<Date
>
Overrides
rawData()
rawData():
Lexical
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:204
Get the raw lexical data exactly as received from the API. This preserves the original snake_case naming from the API response.
Returns
Lexical
Raw lexical data from API
Overrides
toJSON()
toJSON():
LexicalJSON
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:183
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: tech/datalayer/core/src/client/models/Item.ts:235
String representation of the item.
Returns
string
Inherited from
update()
update(
name?
,description?
):Promise
<Lexical
>
Defined in: tech/datalayer/core/src/client/models/Lexical.ts:157
Update the document.
Parameters
name?
string
description?
string
Returns
Promise
<Lexical
>