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
excludedPropertiesExcludedProperties
idstring
nodePropertiesMap<string, string[]>
rootCollabElementNode

Defined in

packages/lexical-yjs/src/Bindings.ts:25


ClientID

Ƭ ClientID: number

Defined in

packages/lexical-yjs/src/Bindings.ts:24


Delta

Ƭ Delta: Operation[]

Defined in

packages/lexical-yjs/src/index.ts:57


ExcludedProperties

Ƭ ExcludedProperties: Map<Klass<LexicalNode>, Set<string>>

Defined in

packages/lexical-yjs/src/Bindings.ts:44


Operation

Ƭ Operation: Object

Type declaration

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

Defined in

packages/lexical-yjs/src/index.ts:51


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
setLocalStateField(field: string, value: unknown) => void

Defined in

packages/lexical-yjs/src/index.ts:30


UserState

Ƭ UserState: Object

Index signature

▪ [key: string]: unknown

Type declaration

NameType
anchorPosnull | RelativePosition
awarenessDataobject
colorstring
focusPosnull | RelativePosition
focusingboolean
namestring

Defined in

packages/lexical-yjs/src/index.ts:16


YjsEvent

Ƭ YjsEvent: Record<string, unknown>

Defined in

packages/lexical-yjs/src/index.ts:59


YjsNode

Ƭ YjsNode: Record<string, unknown>

Defined in

packages/lexical-yjs/src/index.ts:58

Variables

CONNECTED_COMMAND

Const CONNECTED_COMMAND: LexicalCommand<boolean>

Defined in

packages/lexical-yjs/src/index.ts:25


TOGGLE_CONNECT_COMMAND

Const TOGGLE_CONNECT_COMMAND: LexicalCommand<boolean>

Defined in

packages/lexical-yjs/src/index.ts:27

Functions

createBinding

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

Parameters

NameType
editorLexicalEditor
providerProvider
idstring
docundefined | null | Doc
docMapMap<string, Doc>
excludedProperties?ExcludedProperties

Returns

Binding

Defined in

packages/lexical-yjs/src/Bindings.ts:46


createUndoManager

createUndoManager(binding, root): UndoManager

Parameters

NameType
bindingBinding
rootYXmlText

Returns

UndoManager

Defined in

packages/lexical-yjs/src/index.ts:64


getAnchorAndFocusCollabNodesForUserState

getAnchorAndFocusCollabNodesForUserState(binding, userState): Object

Parameters

NameType
bindingBinding
userStateUserState

Returns

Object

NameType
anchorCollabNodenull | AnyCollabNode
anchorOffsetnumber
focusCollabNodenull | AnyCollabNode
focusOffsetnumber

Defined in

packages/lexical-yjs/src/SyncCursors.ts:304


initLocalState

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

Parameters

NameType
providerProvider
namestring
colorstring
focusingboolean
awarenessDataobject

Returns

void

Defined in

packages/lexical-yjs/src/index.ts:73


setLocalStateFocus

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

Parameters

NameType
providerProvider
namestring
colorstring
focusingboolean
awarenessDataobject

Returns

void

Defined in

packages/lexical-yjs/src/index.ts:90


syncCursorPositions

syncCursorPositions(binding, provider): void

Parameters

NameType
bindingBinding
providerProvider

Returns

void

Defined in

packages/lexical-yjs/src/SyncCursors.ts:424


syncLexicalUpdateToYjs

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

Parameters

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

Returns

void

Defined in

packages/lexical-yjs/src/SyncEditorStates.ts:197


syncYjsChangesToLexical

syncYjsChangesToLexical(binding, provider, events, isFromUndoManger): void

Parameters

NameType
bindingBinding
providerProvider
eventsYEvent<YText>[]
isFromUndoMangerboolean

Returns

void

Defined in

packages/lexical-yjs/src/SyncEditorStates.ts:81