diff --git a/packages/lexical-react/src/__tests__/unit/utils.tsx b/packages/lexical-react/src/__tests__/unit/utils.tsx index 66dbfa75084..c5d2f62e1ef 100644 --- a/packages/lexical-react/src/__tests__/unit/utils.tsx +++ b/packages/lexical-react/src/__tests__/unit/utils.tsx @@ -78,7 +78,10 @@ export class Client implements Provider { _awarenessState: UserState | null = null; awareness: { getLocalState: () => UserState | null; - getStates: () => Map; + getStates: >() => Map< + number, + UserState & T + >; off(): void; on(): void; setLocalState: (state: UserState) => void; @@ -94,7 +97,8 @@ export class Client implements Provider { this.awareness = { getLocalState: () => this._awarenessState, - getStates: () => new Map([[0, this._awarenessState!]]), + getStates: >() => + new Map([[0, this._awarenessState!]]) as Map, off: () => { // TODO }, diff --git a/packages/lexical-yjs/src/index.ts b/packages/lexical-yjs/src/index.ts index c06a6f06cb6..5775d207488 100644 --- a/packages/lexical-yjs/src/index.ts +++ b/packages/lexical-yjs/src/index.ts @@ -28,7 +28,10 @@ export const TOGGLE_CONNECT_COMMAND: LexicalCommand = createCommand( ); export type ProviderAwareness = { getLocalState: () => UserState | null; - getStates: () => Map; + getStates: >() => Map< + number, + UserState & T + >; off: (type: 'update', cb: () => void) => void; on: (type: 'update', cb: () => void) => void; setLocalState: (arg0: UserState) => void;