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:102


getLocalSelection()

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

Parameters

selectionManagerId

string

Returns

readonly Record<string, unknown>[]

Defined in

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


getStates()

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

Returns

Map<number, RawAwarenessState<Flags>>

Defined in

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


isReadonly()

isReadonly(blockCollection): boolean

Parameters

blockCollection

BlockCollection

Returns

boolean

Defined in

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


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:128


setLocalSelection()

setLocalSelection(selectionManagerId, selection): void

Parameters

selectionManagerId

string

selection

UserSelection

Returns

void

Defined in

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


setReadonly()

setReadonly(blockCollection, value): void

Parameters

blockCollection

BlockCollection

value

boolean

Returns

void

Defined in

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