API > @blocksuite/store > AwarenessStore
Class: AwarenessStore<Flags>
​
Constructors ​
constructor ​
new AwarenessStore<
Flags
>(store
,awareness
,defaultFlags
):AwarenessStore
<Flags
>
Type parameters ​
Parameter | Default |
---|---|
Flags extends Record < string , unknown > | BlockSuiteFlags |
Parameters ​
Parameter | Type |
---|---|
store | Store |
awareness | Awareness < RawAwarenessState < Flags > > |
defaultFlags | Flags |
Returns ​
AwarenessStore
< Flags
>
Defined In ​
packages/store/src/yjs/awareness.ts:40
Properties ​
awareness ​
readonly
awareness:Awareness
<RawAwarenessState
<Flags
> >
Defined In ​
packages/store/src/yjs/awareness.ts:33
slots ​
readonly
slots:object
Type declaration ​
slots.update
​update:
Slot
<AwarenessEvent
<Flags
> >
Defined In ​
packages/store/src/yjs/awareness.ts:36
store ​
readonly
store:Store
Defined In ​
packages/store/src/yjs/awareness.ts:34
Methods ​
_initFlags ​
private
_initFlags(defaultFlags
):void
Parameters ​
Parameter | Type |
---|---|
defaultFlags | Flags |
Returns ​
void
Defined In ​
packages/store/src/yjs/awareness.ts:52
_onAwarenessChange ​
private
_onAwarenessChange(diff
):void
Parameters ​
Parameter | Type |
---|---|
diff | object |
diff.added | number [] |
diff.removed | number [] |
diff.updated | number [] |
Returns ​
void
Defined In ​
packages/store/src/yjs/awareness.ts:99
destroy ​
destroy():
void
Returns ​
void
Defined In ​
packages/store/src/yjs/awareness.ts:129
getFlag ​
getFlag<
Key
>(field
):undefined
|Flags
[Key
]
Type parameters ​
Parameter |
---|
Key extends string | number | symbol |
Parameters ​
Parameter | Type |
---|---|
field | Key |
Returns ​
undefined
| Flags
[Key
]
Defined In ​
packages/store/src/yjs/awareness.ts:65
getLocalSelection ​
getLocalSelection(): readonly
Record
<string
,unknown
>[]
Returns ​
readonly Record
< string
, unknown
>[]
Defined In ​
packages/store/src/yjs/awareness.ts:91
getStates ​
getStates():
Map
<number
,RawAwarenessState
<Flags
> >
Returns ​
Map
< number
, RawAwarenessState
< Flags
> >
Defined In ​
packages/store/src/yjs/awareness.ts:95
isReadonly ​
isReadonly(
space
):boolean
Parameters ​
Parameter | Type |
---|---|
space | Space < Record < string , any > > |
Returns ​
boolean
Defined In ​
packages/store/src/yjs/awareness.ts:78
setFlag ​
setFlag<
Key
>(field
,value
):void
Type parameters ​
Parameter |
---|
Key extends string | number | symbol |
Parameters ​
Parameter | Type |
---|---|
field | Key |
value | Flags [Key ] |
Returns ​
void
Defined In ​
packages/store/src/yjs/awareness.ts:60
setLocalSelection ​
setLocalSelection(
selection
):void
Parameters ​
Parameter | Type |
---|---|
selection | Record < string , unknown >[] |
Returns ​
void
Defined In ​
packages/store/src/yjs/awareness.ts:87
setReadonly ​
setReadonly(
space
,value
):void
Parameters ​
Parameter | Type |
---|---|
space | Space < Record < string , any > > |
value | boolean |
Returns ​
void
Defined In ​
packages/store/src/yjs/awareness.ts:70