Skip to main content

Module: @lexical/yjs

Interfaces

Type Aliases

Binding

Ƭ Binding: Object

Type declaration

NameType
clientIDnumber
collabNodeMapMap<NodeKey, CollabElementNode | CollabTextNode | CollabDecoratorNode | CollabLineBreakNode>
cursorsMap<ClientID, Cursor>
cursorsContainernull | HTMLElement
docDoc
docMapMap<string, Doc>
editorLexicalEditor
idstring
nodePropertiesMap<string, string[]>
rootCollabElementNode

Defined in

lexical-yjs/src/Bindings.ts:24


ClientID

Ƭ ClientID: number

Defined in

lexical-yjs/src/Bindings.ts:23


Delta

Ƭ Delta: Operation[]

Defined in

lexical-yjs/src/index.ts:53


Operation

Ƭ Operation: Object

Type declaration

NameType
attributes{ __type: string }
attributes.__typestring
insertstring | Record<string, unknown>

Defined in

lexical-yjs/src/index.ts:47


ProviderAwareness

Ƭ ProviderAwareness: Object

Type declaration

NameType
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:27


UserState

Ƭ UserState: Object

Type declaration

NameType
anchorPosnull | RelativePosition
colorstring
focusPosnull | RelativePosition
focusingboolean
namestring

Defined in

lexical-yjs/src/index.ts:18


YjsEvent

Ƭ YjsEvent: Record<string, unknown>

Defined in

lexical-yjs/src/index.ts:55


YjsNode

Ƭ YjsNode: Record<string, unknown>

Defined in

lexical-yjs/src/index.ts:54

Variables

CONNECTED_COMMAND

Const CONNECTED_COMMAND: LexicalCommand<boolean>

Defined in

lexical-yjs/src/index.ts:25


TOGGLE_CONNECT_COMMAND

Const TOGGLE_CONNECT_COMMAND: LexicalCommand<boolean>

Defined in

lexical-yjs/src/index.ts:26

Functions

createBinding

createBinding(editor, provider, id, doc, docMap): Binding

Parameters

NameType
editorLexicalEditor
providerWebsocketProvider
idstring
docundefined | null | Doc
docMapMap<string, Doc>

Returns

Binding

Defined in

lexical-yjs/src/Bindings.ts:43


createUndoManager

createUndoManager(binding, root): UndoManager

Parameters

NameType
bindingBinding
rootYXmlText

Returns

UndoManager

Defined in

lexical-yjs/src/index.ts:60


initLocalState

initLocalState(provider, name, color, focusing): void

Parameters

NameType
providerWebsocketProvider
namestring
colorstring
focusingboolean

Returns

void

Defined in

lexical-yjs/src/index.ts:69


setLocalStateFocus

setLocalStateFocus(provider, name, color, focusing): void

Parameters

NameType
providerWebsocketProvider
namestring
colorstring
focusingboolean

Returns

void

Defined in

lexical-yjs/src/index.ts:84


syncCursorPositions

syncCursorPositions(binding, provider): void

Parameters

NameType
bindingBinding
providerWebsocketProvider

Returns

void

Defined in

lexical-yjs/src/SyncCursors.ts:365


syncLexicalUpdateToYjs

syncLexicalUpdateToYjs(binding, provider, prevEditorState, currEditorState, dirtyElements, dirtyLeaves, normalizedNodes, tags): void

Parameters

NameType
bindingBinding
providerWebsocketProvider
prevEditorStateEditorState
currEditorStateEditorState
dirtyElementsMap<string, boolean>
dirtyLeavesSet<string>
normalizedNodesSet<string>
tagsSet<string>

Returns

void

Defined in

lexical-yjs/src/SyncEditorStates.ts:220


syncYjsChangesToLexical

syncYjsChangesToLexical(binding, provider, events): void

Parameters

NameType
bindingBinding
providerWebsocketProvider
eventsYEvent<YText>[]

Returns

void

Defined in

lexical-yjs/src/SyncEditorStates.ts:87