Skip to main content

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.

Sealed

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

ParameterConstraintDefaultDescription
T
Keysstringstring
TRemoteAccessorValueAccessor<T>ProxiedValueAccessor<T>

Remarks

Create using @fluidframework/presence#StateFactory.latestMap registered to StatesWorkspace.

Properties

PropertyModifiersTypeDescription
controlsreadonlyBroadcastControlsControls for management of sending updates.
eventsreadonlyListenable<LatestMapEvents<T, Keys, TRemoteAccessor>>Events for LatestMap.
localreadonlyStateMap<Keys, T>Current value map for this client.
presencereadonlyPresenceContaining Presence

Methods

MethodReturn TypeDescription
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

ParameterTypeDescription
attendeeAttendee

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[]