mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
21 lines
716 B
TypeScript
21 lines
716 B
TypeScript
declare module 'y-protocols/awareness.js' {
|
|
import { Awareness as _Awareness } from 'y-protocols/awareness';
|
|
type UnknownRecord = Record<string, unknown>;
|
|
export class Awareness<
|
|
State extends UnknownRecord = UnknownRecord,
|
|
> extends _Awareness {
|
|
constructor<State extends UnknownRecord = UnknownRecord>(
|
|
doc: Y.Doc
|
|
): Awareness<State>;
|
|
|
|
getLocalState(): State;
|
|
getStates(): Map<number, State>;
|
|
setLocalState(state: State): void;
|
|
setLocalStateField<Field extends keyof State>(
|
|
field: Field,
|
|
value: State[Field]
|
|
): void;
|
|
}
|
|
export { applyAwarenessUpdate, encodeAwarenessUpdate, modifyAwarenessUpdate, removeAwarenessStates } from 'y-protocols/awareness'
|
|
}
|