Skip to content

Commit

Permalink
[lexical-yjs] Bug Fix: Add missing setLocalStateField method to Provi…
Browse files Browse the repository at this point in the history
…derAwareness type (#6683)
  • Loading branch information
collierrgbsitisfise authored Sep 30, 2024
1 parent a5fad08 commit fd44490
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe(`LexicalCollaborationPlugin`, () => {
off: () => {},
on: () => {},
setLocalState: () => {},
setLocalStateField: () => {},
},
connect: () => {},
disconnect: () => {},
Expand Down
4 changes: 4 additions & 0 deletions packages/lexical-react/src/__tests__/unit/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class Client implements Provider {
off(): void;
on(): void;
setLocalState: (state: UserState) => void;
setLocalStateField: (field: string, value: unknown) => void;
};

constructor(id: Client['_id'], connection: Client['_connection']) {
Expand All @@ -105,6 +106,9 @@ export class Client implements Provider {
setLocalState: (state) => {
this._awarenessState = state;
},
setLocalStateField: (field: string, value: unknown) => {
// TODO
},
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/lexical-yjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type ProviderAwareness = {
off: (type: 'update', cb: () => void) => void;
on: (type: 'update', cb: () => void) => void;
setLocalState: (arg0: UserState) => void;
setLocalStateField: (field: string, value: unknown) => void;
};
declare interface Provider {
awareness: ProviderAwareness;
Expand Down

0 comments on commit fd44490

Please sign in to comment.