@lexical/yjs
Interfaces
BaseBinding
Defined in: packages/lexical-yjs/src/Bindings.ts:26
Extended by
Properties
clientID
clientID:
number
Defined in: packages/lexical-yjs/src/Bindings.ts:27
cursors
cursors:
Map<number,Cursor>
Defined in: packages/lexical-yjs/src/Bindings.ts:28
cursorsContainer
cursorsContainer:
null|HTMLElement
Defined in: packages/lexical-yjs/src/Bindings.ts:29
doc
doc:
Doc
Defined in: packages/lexical-yjs/src/Bindings.ts:30
docMap
docMap:
Map<string,Doc>
Defined in: packages/lexical-yjs/src/Bindings.ts:31
editor
editor:
LexicalEditor
Defined in: packages/lexical-yjs/src/Bindings.ts:32
excludedProperties
excludedProperties:
ExcludedProperties
Defined in: packages/lexical-yjs/src/Bindings.ts:35
id
id:
string
Defined in: packages/lexical-yjs/src/Bindings.ts:33
nodeProperties
nodeProperties:
Map<string, {[property:string]:unknown; }>
Defined in: packages/lexical-yjs/src/Bindings.ts:34
Binding
Defined in: packages/lexical-yjs/src/Bindings.ts:38
Extends
Properties
clientID
clientID:
number
Defined in: packages/lexical-yjs/src/Bindings.ts:27
Inherited from
collabNodeMap
collabNodeMap:
Map<string,CollabLineBreakNode|CollabElementNode|CollabTextNode|CollabDecoratorNode>
Defined in: packages/lexical-yjs/src/Bindings.ts:39
cursors
cursors:
Map<number,Cursor>
Defined in: packages/lexical-yjs/src/Bindings.ts:28
Inherited from
cursorsContainer
cursorsContainer:
null|HTMLElement
Defined in: packages/lexical-yjs/src/Bindings.ts:29
Inherited from
doc
doc:
Doc
Defined in: packages/lexical-yjs/src/Bindings.ts:30
Inherited from
docMap
docMap:
Map<string,Doc>
Defined in: packages/lexical-yjs/src/Bindings.ts:31
Inherited from
editor
editor:
LexicalEditor
Defined in: packages/lexical-yjs/src/Bindings.ts:32
Inherited from
excludedProperties
excludedProperties:
ExcludedProperties
Defined in: packages/lexical-yjs/src/Bindings.ts:35
Inherited from
BaseBinding.excludedProperties
id
id:
string
Defined in: packages/lexical-yjs/src/Bindings.ts:33
Inherited from
nodeProperties
nodeProperties:
Map<string, {[property:string]:unknown; }>
Defined in: packages/lexical-yjs/src/Bindings.ts:34
Inherited from
root
root:
CollabElementNode
Defined in: packages/lexical-yjs/src/Bindings.ts:46
BindingV2
Defined in: packages/lexical-yjs/src/Bindings.ts:49
Extends
Properties
clientID
clientID:
number
Defined in: packages/lexical-yjs/src/Bindings.ts:27
Inherited from
cursors
cursors:
Map<number,Cursor>
Defined in: packages/lexical-yjs/src/Bindings.ts:28
Inherited from
cursorsContainer
cursorsContainer:
null|HTMLElement
Defined in: packages/lexical-yjs/src/Bindings.ts:29
Inherited from
doc
doc:
Doc
Defined in: packages/lexical-yjs/src/Bindings.ts:30
Inherited from
docMap
docMap:
Map<string,Doc>
Defined in: packages/lexical-yjs/src/Bindings.ts:31
Inherited from
editor
editor:
LexicalEditor
Defined in: packages/lexical-yjs/src/Bindings.ts:32
Inherited from
excludedProperties
excludedProperties:
ExcludedProperties
Defined in: packages/lexical-yjs/src/Bindings.ts:35
Inherited from
BaseBinding.excludedProperties
id
id:
string
Defined in: packages/lexical-yjs/src/Bindings.ts:33
Inherited from
mapping
mapping:
CollabV2Mapping
Defined in: packages/lexical-yjs/src/Bindings.ts:50
nodeProperties
nodeProperties:
Map<string, {[property:string]:unknown; }>
Defined in: packages/lexical-yjs/src/Bindings.ts:34
Inherited from
root
root:
YXmlElement
Defined in: packages/lexical-yjs/src/Bindings.ts:51
Provider
Defined in: packages/lexical-yjs/src/index.ts:58
Properties
awareness
awareness:
ProviderAwareness
Defined in: packages/lexical-yjs/src/index.ts:59
Methods
connect()
connect():
void|Promise<void>
Defined in: packages/lexical-yjs/src/index.ts:60
Returns
void | Promise<void>
disconnect()
disconnect():
void
Defined in: packages/lexical-yjs/src/index.ts:61
Returns
void
off()
Call Signature
off(
type,cb):void
Defined in: packages/lexical-yjs/src/index.ts:62
Parameters
type
"sync"
cb
(isSynced) => void
Returns
void
Call Signature
off(
type,cb):void
Defined in: packages/lexical-yjs/src/index.ts:63
Parameters
type
"update"
cb
(arg0) => void
Returns
void
Call Signature
off(
type,cb):void
Defined in: packages/lexical-yjs/src/index.ts:64
Parameters
type
"status"
cb
(arg0) => void
Returns
void
Call Signature
off(
type,cb):void
Defined in: packages/lexical-yjs/src/index.ts:65
Parameters
type
"reload"
cb
(doc) => void
Returns
void
on()
Call Signature
on(
type,cb):void
Defined in: packages/lexical-yjs/src/index.ts:66
Parameters
type
"sync"
cb
(isSynced) => void
Returns
void
Call Signature
on(
type,cb):void
Defined in: packages/lexical-yjs/src/index.ts:67
Parameters
type
"status"
cb
(arg0) => void
Returns
void
Call Signature
on(
type,cb):void
Defined in: packages/lexical-yjs/src/index.ts:68
Parameters
type
"update"
cb
(arg0) => void
Returns
void
Call Signature
on(
type,cb):void
Defined in: packages/lexical-yjs/src/index.ts:69
Parameters
type
"reload"
cb
(doc) => void
Returns
void
Type Aliases
ClientID
ClientID =
number
Defined in: packages/lexical-yjs/src/Bindings.ts:25
Delta
Delta =
Operation[]
Defined in: packages/lexical-yjs/src/index.ts:77
ExcludedProperties
ExcludedProperties =
Map<Klass<LexicalNode>,Set<string>>
Defined in: packages/lexical-yjs/src/Bindings.ts:56
Operation
Operation =
object
Defined in: packages/lexical-yjs/src/index.ts:71
Properties
attributes
attributes:
object
Defined in: packages/lexical-yjs/src/index.ts:72
__type
__type:
string
insert
insert:
string|Record<string,unknown>
Defined in: packages/lexical-yjs/src/index.ts:75
ProviderAwareness
ProviderAwareness =
object
Defined in: packages/lexical-yjs/src/index.ts:50
Properties
getLocalState()
getLocalState: () =>
UserState|null
Defined in: packages/lexical-yjs/src/index.ts:51
Returns
UserState | null
getStates()
getStates: () =>
Map<number,UserState>
Defined in: packages/lexical-yjs/src/index.ts:52
Returns
Map<number, UserState>
off()
off: (
type,cb) =>void
Defined in: packages/lexical-yjs/src/index.ts:53
Parameters
type
"update"
cb
() => void
Returns
void
on()
on: (
type,cb) =>void
Defined in: packages/lexical-yjs/src/index.ts:54
Parameters
type
"update"
cb
() => void
Returns
void
setLocalState()
setLocalState: (
arg0) =>void
Defined in: packages/lexical-yjs/src/index.ts:55
Parameters
arg0
Returns
void
setLocalStateField()
setLocalStateField: (
field,value) =>void
Defined in: packages/lexical-yjs/src/index.ts:56
Parameters
field
string
value
unknown
Returns
void
SyncCursorPositionsFn()
SyncCursorPositionsFn = (
binding,provider,options?) =>void
Defined in: packages/lexical-yjs/src/SyncCursors.ts:599
Parameters
binding
AnyBinding
provider
options?
SyncCursorPositionsOptions
Returns
void
UserState
UserState =
object
Defined in: packages/lexical-yjs/src/index.ts:25
Indexable
[key: string]: unknown
Properties
anchorPos
anchorPos:
null|RelativePosition
Defined in: packages/lexical-yjs/src/index.ts:26
awarenessData
awarenessData:
object
Defined in: packages/lexical-yjs/src/index.ts:31
color
color:
string
Defined in: packages/lexical-yjs/src/index.ts:27
focusing
focusing:
boolean
Defined in: packages/lexical-yjs/src/index.ts:28
focusPos
focusPos:
null|RelativePosition
Defined in: packages/lexical-yjs/src/index.ts:29
name
name:
string
Defined in: packages/lexical-yjs/src/index.ts:30
YjsEvent
YjsEvent =
Record<string,unknown>
Defined in: packages/lexical-yjs/src/index.ts:79
YjsNode
YjsNode =
Record<string,unknown>
Defined in: packages/lexical-yjs/src/index.ts:78
Variables
CLEAR_DIFF_VERSIONS_COMMAND__EXPERIMENTAL
constCLEAR_DIFF_VERSIONS_COMMAND__EXPERIMENTAL:LexicalCommand<void>
Defined in: packages/lexical-yjs/src/index.ts:46
CONNECTED_COMMAND
constCONNECTED_COMMAND:LexicalCommand<boolean>
Defined in: packages/lexical-yjs/src/index.ts:34
DIFF_VERSIONS_COMMAND__EXPERIMENTAL
constDIFF_VERSIONS_COMMAND__EXPERIMENTAL:LexicalCommand<{prevSnapshot?:Snapshot;snapshot?:Snapshot; }>
Defined in: packages/lexical-yjs/src/index.ts:40
TOGGLE_CONNECT_COMMAND
constTOGGLE_CONNECT_COMMAND:LexicalCommand<boolean>
Defined in: packages/lexical-yjs/src/index.ts:36
Functions
$getYChangeState()
$getYChangeState<
UserT>(node):null|YChange<UserT>
Defined in: packages/lexical-yjs/src/RenderSnapshot.ts:36
Type Parameters
UserT
UserT = unknown
Parameters
node
Returns
null | YChange<UserT>
createBinding()
createBinding(
editor,provider,id,doc,docMap,excludedProperties?):Binding
Defined in: packages/lexical-yjs/src/Bindings.ts:84
Parameters
editor
provider
id
string
doc
undefined | null | Doc
docMap
Map<string, Doc>
excludedProperties?
Returns
createBindingV2__EXPERIMENTAL()
createBindingV2__EXPERIMENTAL(
editor,id,doc,docMap,options):BindingV2
Defined in: packages/lexical-yjs/src/Bindings.ts:110
Parameters
editor
id
string
doc
undefined | null | Doc
docMap
Map<string, Doc>
options
excludedProperties?
rootName?
string
Returns
createUndoManager()
createUndoManager(
binding,root):UndoManager
Defined in: packages/lexical-yjs/src/index.ts:90
Parameters
binding
root
YXmlText | YXmlElement<{[key: string]: string; }>
Returns
UndoManager
getAnchorAndFocusCollabNodesForUserState()
getAnchorAndFocusCollabNodesForUserState(
binding,userState):object
Defined in: packages/lexical-yjs/src/SyncCursors.ts:361
Parameters
binding
userState
Returns
object
anchorCollabNode
anchorCollabNode:
null|AnyCollabNode
anchorOffset
anchorOffset:
number
focusCollabNode
focusCollabNode:
null|AnyCollabNode
focusOffset
focusOffset:
number
Deprecated
Use $getAnchorAndFocusForUserState instead.
initLocalState()
initLocalState(
provider,name,color,focusing,awarenessData):void
Defined in: packages/lexical-yjs/src/index.ts:99
Parameters
provider
name
string
color
string
focusing
boolean
awarenessData
object
Returns
void
renderSnapshot__EXPERIMENTAL()
renderSnapshot__EXPERIMENTAL(
binding,snapshot,prevSnapshot):void
Defined in: packages/lexical-yjs/src/RenderSnapshot.ts:52
Replaces the editor content with a view that compares the state between two given snapshots. Any added or removed nodes between the two snapshots will have YChange attached to them.
Parameters
binding
Yjs binding
snapshot
Snapshot = ...
Ending snapshot state (default: current state of the Yjs document)
prevSnapshot
Snapshot = emptySnapshot
Starting snapshot state (default: empty snapshot)
Returns
void
setLocalStateFocus()
setLocalStateFocus(
provider,name,color,focusing,awarenessData):void
Defined in: packages/lexical-yjs/src/index.ts:116
Parameters
provider
name
string
color
string
focusing
boolean
awarenessData
object
Returns
void
syncCursorPositions()
syncCursorPositions(
binding,provider,options?):void
Defined in: packages/lexical-yjs/src/SyncCursors.ts:619
Parameters
binding
AnyBinding
provider
options?
SyncCursorPositionsOptions
Returns
void
syncLexicalUpdateToYjs()
syncLexicalUpdateToYjs(
binding,provider,prevEditorState,currEditorState,dirtyElements,dirtyLeaves,normalizedNodes,tags):void
Defined in: packages/lexical-yjs/src/SyncEditorStates.ts:272
Parameters
binding
provider
prevEditorState
currEditorState
dirtyElements
Map<string, boolean>
dirtyLeaves
Set<string>
normalizedNodes
Set<string>
tags
Set<string>
Returns
void
syncLexicalUpdateToYjsV2__EXPERIMENTAL()
syncLexicalUpdateToYjsV2__EXPERIMENTAL(
binding,provider,prevEditorState,currEditorState,dirtyElements,normalizedNodes,tags):void
Defined in: packages/lexical-yjs/src/SyncEditorStates.ts:433
Parameters
binding
provider
prevEditorState
currEditorState
dirtyElements
Map<string, boolean>
normalizedNodes
Set<string>
tags
Set<string>
Returns
void
syncYjsChangesToLexical()
syncYjsChangesToLexical(
binding,provider,events,isFromUndoManger,syncCursorPositionsFn):void
Defined in: packages/lexical-yjs/src/SyncEditorStates.ts:135
Parameters
binding
provider
events
YEvent<YText>[]
isFromUndoManger
boolean
syncCursorPositionsFn
SyncCursorPositionsFn = syncCursorPositions
Returns
void
syncYjsChangesToLexicalV2__EXPERIMENTAL()
syncYjsChangesToLexicalV2__EXPERIMENTAL(
binding,provider,events,transaction,isFromUndoManger):void
Defined in: packages/lexical-yjs/src/SyncEditorStates.ts:350
Parameters
binding
provider
events
YEvent<YXmlText | YXmlElement<{[key: string]: string; }>>[]
transaction
Transaction
isFromUndoManger
boolean
Returns
void
syncYjsStateToLexicalV2__EXPERIMENTAL()
syncYjsStateToLexicalV2__EXPERIMENTAL(
binding,provider):void
Defined in: packages/lexical-yjs/src/SyncEditorStates.ts:407
Parameters
binding
provider
Returns
void