Module: lexical-yjs/src
Interfaces
Type Aliases
Binding
Ƭ Binding: Object
Type declaration
Name | Type |
---|---|
clientID | number |
collabNodeMap | Map <NodeKey , CollabElementNode | CollabTextNode | CollabDecoratorNode | CollabLineBreakNode > |
cursors | Map <ClientID , Cursor > |
cursorsContainer | null | HTMLElement |
doc | Doc |
docMap | Map <string , Doc > |
editor | LexicalEditor |
id | string |
nodeProperties | Map <string , string []> |
root | CollabElementNode |
Defined in
lexical-yjs/src/Bindings.ts:23
ClientID
Ƭ ClientID: number
Defined in
lexical-yjs/src/Bindings.ts:22
Delta
Ƭ Delta: Operation
[]
Defined in
lexical-yjs/src/index.ts:52
Operation
Ƭ Operation: Object
Type declaration
Name | Type |
---|---|
attributes | { __type : string } |
attributes.__type | string |
insert | string | Record <string , unknown > |
Defined in
lexical-yjs/src/index.ts:46
ProviderAwareness
Ƭ ProviderAwareness: Object
Type declaration
Name | Type |
---|---|
getLocalState | () => UserState | null |
getStates | () => Map <number , UserState > |
off | (type : "update" , cb : () => void ) => void |
on | (type : "update" , cb : () => void ) => void |
setLocalState | (arg0 : UserState ) => void |
Defined in
lexical-yjs/src/index.ts:26
UserState
Ƭ UserState: Object
Type declaration
Name | Type |
---|---|
anchorPos | null | RelativePosition |
color | string |
focusPos | null | RelativePosition |
focusing | boolean |
name | string |
Defined in
lexical-yjs/src/index.ts:17
YjsEvent
Ƭ YjsEvent: Record
<string
, unknown
>
Defined in
lexical-yjs/src/index.ts:54
YjsNode
Ƭ YjsNode: Record
<string
, unknown
>
Defined in
lexical-yjs/src/index.ts:53
Variables
CONNECTED_COMMAND
• Const
CONNECTED_COMMAND: LexicalCommand
<boolean
>
Defined in
lexical-yjs/src/index.ts:24
TOGGLE_CONNECT_COMMAND
• Const
TOGGLE_CONNECT_COMMAND: LexicalCommand
<boolean
>
Defined in
lexical-yjs/src/index.ts:25
Functions
createBinding
▸ createBinding(editor
, provider
, id
, doc
, docMap
): Binding
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
provider | WebsocketProvider |
id | string |
doc | undefined | null | Doc |
docMap | Map <string , Doc > |
Returns
Defined in
lexical-yjs/src/Bindings.ts:42
createUndoManager
▸ createUndoManager(binding
, root
): UndoManager
Parameters
Name | Type |
---|---|
binding | Binding |
root | YXmlText |
Returns
UndoManager
Defined in
lexical-yjs/src/index.ts:59
initLocalState
▸ initLocalState(provider
, name
, color
, focusing
): void
Parameters
Name | Type |
---|---|
provider | WebsocketProvider |
name | string |
color | string |
focusing | boolean |
Returns
void
Defined in
lexical-yjs/src/index.ts:68
setLocalStateFocus
▸ setLocalStateFocus(provider
, name
, color
, focusing
): void
Parameters
Name | Type |
---|---|
provider | WebsocketProvider |
name | string |
color | string |
focusing | boolean |
Returns
void
Defined in
lexical-yjs/src/index.ts:83
syncCursorPositions
▸ syncCursorPositions(binding
, provider
): void
Parameters
Name | Type |
---|---|
binding | Binding |
provider | WebsocketProvider |
Returns
void
Defined in
lexical-yjs/src/SyncCursors.ts:357
syncLexicalUpdateToYjs
▸ syncLexicalUpdateToYjs(binding
, provider
, prevEditorState
, currEditorState
, dirtyElements
, dirtyLeaves
, normalizedNodes
, tags
): void
Parameters
Name | Type |
---|---|
binding | Binding |
provider | WebsocketProvider |
prevEditorState | EditorState |
currEditorState | EditorState |
dirtyElements | Map <string , boolean > |
dirtyLeaves | Set <string > |
normalizedNodes | Set <string > |
tags | Set <string > |
Returns
void
Defined in
lexical-yjs/src/SyncEditorStates.ts:219
syncYjsChangesToLexical
▸ syncYjsChangesToLexical(binding
, provider
, events
): void
Parameters
Name | Type |
---|---|
binding | Binding |
provider | WebsocketProvider |
events | YEvent <YText >[] |
Returns
void
Defined in
lexical-yjs/src/SyncEditorStates.ts:86