BlockSuite API Documentation / @blocksuite/store / AwarenessStore
Class: AwarenessStore<Flags>
Type Parameters
• Flags extends Record
<string
, unknown
> = 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:78
Properties
awareness
readonly
awareness:Awareness
<RawAwarenessState
<Flags
>>
Defined in
packages/framework/store/src/yjs/awareness.ts:72
slots
readonly
slots:object
update
update:
Slot
<AwarenessEvent
<Flags
>>
Defined in
packages/framework/store/src/yjs/awareness.ts:74
Methods
destroy()
destroy():
void
Returns
void
Defined in
packages/framework/store/src/yjs/awareness.ts:98
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:105
getLocalSelection()
getLocalSelection(
selectionManagerId
): readonlyRecord
<string
,unknown
>[]
Parameters
• selectionManagerId: string
Returns
readonly Record
<string
, unknown
>[]
Defined in
packages/framework/store/src/yjs/awareness.ts:109
getStates()
getStates():
Map
<number
,RawAwarenessState
<Flags
>>
Returns
Map
<number
, RawAwarenessState
<Flags
>>
Defined in
packages/framework/store/src/yjs/awareness.ts:118
isReadonly()
isReadonly(
blockCollection
):boolean
Parameters
• blockCollection: BlockCollection
Returns
boolean
Defined in
packages/framework/store/src/yjs/awareness.ts:122
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:131
setLocalSelection()
setLocalSelection(
selectionManagerId
,selection
):void
Parameters
• selectionManagerId: string
• selection: UserSelection
Returns
void
Defined in
packages/framework/store/src/yjs/awareness.ts:136
setReadonly()
setReadonly(
blockCollection
,value
):void
Parameters
• blockCollection: BlockCollection
• value: boolean
Returns
void
Defined in
packages/framework/store/src/yjs/awareness.ts:144