Skip to main content

MockAudience Class

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/test-runtime-utils/legacy.

For more information about our API support guarantees, see here.

Signature

export declare class MockAudience extends TypedEventEmitter<IAudienceEvents> implements IAudienceOwner

Extends: TypedEventEmitter<IAudienceEvents>

Implements: IAudienceOwner

Constructors

Constructor Alerts Description
(constructor)() Beta Constructs a new instance of the MockAudience class

Methods

Method Alerts Return Type Description
addMember(clientId, member) Beta void
getMember(clientId) Beta IClient | undefined
getMembers() Beta Map<string, IClient>
getSelf() Beta ISelf | undefined
removeMember(clientId) Beta boolean
setCurrentClientId(clientId) Beta void

Constructor Details

(constructor)

Constructs a new instance of the MockAudience class

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
constructor();

Method Details

addMember

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
addMember(clientId: string, member: IClient): void;

Parameters

Parameter Type Description
clientId string
member IClient

getMember

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
getMember(clientId: string): IClient | undefined;

Parameters

Parameter Type Description
clientId string

Returns

Return type: IClient | undefined

getMembers

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
getMembers(): Map<string, IClient>;

Returns

Return type: Map<string, IClient>

getSelf

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
getSelf(): ISelf | undefined;

Returns

Return type: ISelf | undefined

removeMember

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
removeMember(clientId: string): boolean;

Parameters

Parameter Type Description
clientId string

Returns

Return type: boolean

setCurrentClientId

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
setCurrentClientId(clientId: string): void;

Parameters

Parameter Type Description
clientId string