Corrected amazon-connect-streams Agent::onMuteToggle and tests. (#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.
This commit is contained in:
Andy Hopper
2019-06-10 22:06:33 -07:00
committed by Ron Buckton
parent 23bfb7e136
commit e94ce0261e
2 changed files with 16 additions and 2 deletions
@@ -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[]
+14 -1
View File
@@ -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.