diff --git a/types/amazon-connect-streams/amazon-connect-streams-tests.ts b/types/amazon-connect-streams/amazon-connect-streams-tests.ts index e25f0d4782..b953e2fd13 100644 --- a/types/amazon-connect-streams/amazon-connect-streams-tests.ts +++ b/types/amazon-connect-streams/amazon-connect-streams-tests.ts @@ -3,6 +3,7 @@ connect.core.initCCP(elem, { ccpUrl: "" }); // $ExpectType void // Types for below tests let agentCallback: connect.AgentCallback = () => {}; +let muteCallback: connect.MuteCallback = () => {}; let agentConfiguration: connect.AgentConfiguration; let successFailOptions: connect.SuccessFailOptions; let agentState: connect.AgentState; @@ -20,7 +21,7 @@ connect.agent(agent => { agent.onOffline(agentCallback); // $ExpectType: void agent.onError(agentCallback); // $ExpectType: void agent.onAfterCallWork(agentCallback); // $ExpectType: void - agent.onMuteToggle(agentCallback); // $ExpectType: void + agent.onMuteToggle(muteCallback); // $ExpectType: void agent.getState(); // $ExpectType: AgentState agent.getStateDuration(); // $ExpectType: number agent.getContacts(""); // $ExpectType: connect.Contact[] diff --git a/types/amazon-connect-streams/index.d.ts b/types/amazon-connect-streams/index.d.ts index 73215ab6d5..23ee2bbccc 100644 --- a/types/amazon-connect-streams/index.d.ts +++ b/types/amazon-connect-streams/index.d.ts @@ -13,6 +13,15 @@ declare namespace connect { */ type AgentCallback = (agent: Agent) => void; + /** + * + * A callback to receive agent details + * + * @param agent An Agent object containing information about the currently + * signed-in agent. + */ + type MuteCallback = (muteState: MuteState) => void; + /** * Register a callback to receive agent details * @@ -223,6 +232,10 @@ declare namespace connect { queueARN?: string; } + interface MuteState { + muted: boolean; + } + interface Agent { /** * Subscribe a method to be called whenever Contact information is about to be updated. @@ -273,7 +286,7 @@ declare namespace connect { * * @param callback A callback to receive updates on agent mute state */ - onMuteToggle(callback: AgentCallback): void; + onMuteToggle(callback: MuteCallback): void; /** * Get the agent's current AgentState object indicating their availability state type.