Skip to content

BlockSuite API Documentation / @blocksuite/store / AwarenessStore

Class: AwarenessStore<Flags>

Type Parameters

Flags extends BlockSuiteFlags = BlockSuiteFlags

Constructors

new AwarenessStore()

new AwarenessStore<Flags>(awareness, defaultFlags): AwarenessStore<Flags>

Parameters

awareness: Awareness<RawAwarenessState<Flags>>

defaultFlags: Flags

Returns

AwarenessStore<Flags>

Defined in

packages/framework/store/src/yjs/awareness.ts:76

Properties

awareness

readonly awareness: Awareness<RawAwarenessState<Flags>>

Defined in

packages/framework/store/src/yjs/awareness.ts:70


slots

readonly slots: object

update

update: Slot<AwarenessEvent<Flags>>

Defined in

packages/framework/store/src/yjs/awareness.ts:72

Methods

destroy()

destroy(): void

Returns

void

Defined in

packages/framework/store/src/yjs/awareness.ts:96


getFlag()

getFlag<Key>(field): Flags[Key]

Type Parameters

Key extends string | number | symbol

Parameters

field: Key

Returns

Flags[Key]

Defined in

packages/framework/store/src/yjs/awareness.ts:103


getLocalSelection()

getLocalSelection(selectionManagerId): readonly Record<string, unknown>[]

Parameters

selectionManagerId: string

Returns

readonly Record<string, unknown>[]

Defined in

packages/framework/store/src/yjs/awareness.ts:107


getStates()

getStates(): Map<number, RawAwarenessState<Flags>>

Returns

Map<number, RawAwarenessState<Flags>>

Defined in

packages/framework/store/src/yjs/awareness.ts:116


isReadonly()

isReadonly(blockCollection): boolean

Parameters

blockCollection: BlockCollection

Returns

boolean

Defined in

packages/framework/store/src/yjs/awareness.ts:120


setFlag()

setFlag<Key>(field, value): void

Type Parameters

Key extends string | number | symbol

Parameters

field: Key

value: Flags[Key]

Returns

void

Defined in

packages/framework/store/src/yjs/awareness.ts:129


setLocalSelection()

setLocalSelection(selectionManagerId, selection): void

Parameters

selectionManagerId: string

selection: UserSelection

Returns

void

Defined in

packages/framework/store/src/yjs/awareness.ts:134


setReadonly()

setReadonly(blockCollection, value): void

Parameters

blockCollection: BlockCollection

value: boolean

Returns

void

Defined in

packages/framework/store/src/yjs/awareness.ts:142