LatestMap Interface
State that provides a Map of latest known values from this client to others and read access to their values. Entries in the map may vary over time and by client, but all values are expected to be of the same type, which may be a union type.
This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.
Signature
/** @sealed */
export interface LatestMap<T, Keys extends string = string, TRemoteAccessor extends ValueAccessor<T> = ProxiedValueAccessor<T>>
Type Parameters
| Parameter | Constraint | Default | Description |
|---|---|---|---|
| T | |||
| Keys | string | string | |
| TRemoteAccessor | ValueAccessor<T> | ProxiedValueAccessor<T> |
Remarks
Create using @fluidframework/presence#StateFactory.latestMap registered to StatesWorkspace.
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| controls | readonly | BroadcastControls | Controls for management of sending updates. |
| events | readonly | Listenable<LatestMapEvents<T, Keys, TRemoteAccessor>> | Events for LatestMap. |
| local | readonly | StateMap<Keys, T> | Current value map for this client. |
| presence | readonly | Presence | Containing Presence |
Methods
| Method | Return Type | Description |
|---|---|---|
| getRemote(attendee) | ReadonlyMap<Keys, LatestData<T, TRemoteAccessor>> | Access to a specific client's map of values. |
| getRemotes() | IterableIterator<LatestMapClientData<T, Keys, TRemoteAccessor>> | Iterable access to remote clients' map of values. |
| getStateAttendees() | Attendee[] | Array of Attendees that have provided states. |
Property Details
controls
Controls for management of sending updates.
Signature
readonly controls: BroadcastControls;
Type: BroadcastControls
events
Events for LatestMap.
Signature
readonly events: Listenable<LatestMapEvents<T, Keys, TRemoteAccessor>>;
Type: Listenable<LatestMapEvents<T, Keys, TRemoteAccessor>>
local
Current value map for this client.
Signature
readonly local: StateMap<Keys, T>;
Type: StateMap<Keys, T>
presence
Containing Presence
Signature
readonly presence: Presence;
Type: Presence
Method Details
getRemote
Access to a specific client's map of values.
Signature
getRemote(attendee: Attendee): ReadonlyMap<Keys, LatestData<T, TRemoteAccessor>>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| attendee | Attendee |
Returns
Return type: ReadonlyMap<Keys, LatestData<T, TRemoteAccessor>>
getRemotes
Iterable access to remote clients' map of values.
Signature
getRemotes(): IterableIterator<LatestMapClientData<T, Keys, TRemoteAccessor>>;
Returns
Return type: IterableIterator<LatestMapClientData<T, Keys, TRemoteAccessor>>
getStateAttendees
Array of Attendees that have provided states.
Signature
getStateAttendees(): Attendee[];
Returns
Return type: Attendee[]