Skip to content

Commit e94ce02

Browse files
andyhopprbuckton
authored andcommitted
Corrected amazon-connect-streams Agent::onMuteToggle and tests. (DefinitelyTyped#36065)
* Added amazon-connect-streams from v1.3 * Updated Project header to URL for Amazon Connect Streams * Set strictNullChecks to 'true' * Corrected amazon-connect-streams onMuteToggle callback object.
1 parent 23bfb7e commit e94ce02

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

types/amazon-connect-streams/amazon-connect-streams-tests.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ connect.core.initCCP(elem, { ccpUrl: "" }); // $ExpectType void
33

44
// Types for below tests
55
let agentCallback: connect.AgentCallback = () => {};
6+
let muteCallback: connect.MuteCallback = () => {};
67
let agentConfiguration: connect.AgentConfiguration;
78
let successFailOptions: connect.SuccessFailOptions;
89
let agentState: connect.AgentState;
@@ -20,7 +21,7 @@ connect.agent(agent => {
2021
agent.onOffline(agentCallback); // $ExpectType: void
2122
agent.onError(agentCallback); // $ExpectType: void
2223
agent.onAfterCallWork(agentCallback); // $ExpectType: void
23-
agent.onMuteToggle(agentCallback); // $ExpectType: void
24+
agent.onMuteToggle(muteCallback); // $ExpectType: void
2425
agent.getState(); // $ExpectType: AgentState
2526
agent.getStateDuration(); // $ExpectType: number
2627
agent.getContacts(""); // $ExpectType: connect.Contact[]

types/amazon-connect-streams/index.d.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ declare namespace connect {
1313
*/
1414
type AgentCallback = (agent: Agent) => void;
1515

16+
/**
17+
*
18+
* A callback to receive agent details
19+
*
20+
* @param agent An Agent object containing information about the currently
21+
* signed-in agent.
22+
*/
23+
type MuteCallback = (muteState: MuteState) => void;
24+
1625
/**
1726
* Register a callback to receive agent details
1827
*
@@ -223,6 +232,10 @@ declare namespace connect {
223232
queueARN?: string;
224233
}
225234

235+
interface MuteState {
236+
muted: boolean;
237+
}
238+
226239
interface Agent {
227240
/**
228241
* Subscribe a method to be called whenever Contact information is about to be updated.
@@ -273,7 +286,7 @@ declare namespace connect {
273286
*
274287
* @param callback A callback to receive updates on agent mute state
275288
*/
276-
onMuteToggle(callback: AgentCallback): void;
289+
onMuteToggle(callback: MuteCallback): void;
277290

278291
/**
279292
* Get the agent's current AgentState object indicating their availability state type.

0 commit comments

Comments
 (0)