diff --git a/src/Call.d.ts b/src/Call.d.ts index 957ff29..3f46bb2 100644 --- a/src/Call.d.ts +++ b/src/Call.d.ts @@ -387,9 +387,21 @@ declare global { * the first playing. Supported formats are: mp3, ogg & flac (mp3, * speex, vorbis and flac codecs respectively). Maximum file size is * 2 MBytes. - * @param loop If it's true, playback will be looped. + * @param options Playback parameters: loop, progressive playback, + * etc. */ - startPlayback(url: string, loop: boolean): void; + startPlayback(url: string, options: { + /** + * If it's true, playback will be looped. + */ + loop: boolean; + /** + * Use progressive playback or not. If true, the file will be + * delivered in chunks which reduces delay before a method call + * and playback. It's false by default. + */ + progressivePlayback: boolean; + }): void; /** * Returns current state of the call. Possible values are: diff --git a/src/Modules/ACD/ACDEvents.d.ts b/src/Modules/ACD/ACDEvents.d.ts index e33b5be..2e49207 100644 --- a/src/Modules/ACD/ACDEvents.d.ts +++ b/src/Modules/ACD/ACDEvents.d.ts @@ -2,6 +2,7 @@ import './ACDEvents/Error'; import './ACDEvents/Offline'; import './ACDEvents/OperatorFailed'; import './ACDEvents/OperatorReached'; +import './ACDEvents/OperatorCallAttempt'; import './ACDEvents/Queued'; import './ACDEvents/QueueFull'; import './ACDEvents/Waiting'; @@ -15,6 +16,7 @@ declare global { export type Offline = () => Offline.Event; export type OperatorFailed = () => OperatorFailed.Event; export type OperatorReached = () => OperatorReached.Event; + export type OperatorCallAttempt = () => OperatorCallAttempt.Event; export type Queued = () => Queued.Event; export type QueueFull = () => QueueFull.Event; export type Waiting = () => Waiting.Event; @@ -23,6 +25,7 @@ declare global { export const Offline: Offline; export const OperatorFailed: OperatorFailed; export const OperatorReached: OperatorReached; + export const OperatorCallAttempt: OperatorCallAttempt; export const Queued: Queued; export const QueueFull: QueueFull; export const Waiting: Waiting; @@ -33,6 +36,7 @@ declare global { ACDEvents.Offline | ACDEvents.OperatorFailed | ACDEvents.OperatorReached | + ACDEvents.OperatorCallAttempt | ACDEvents.Queued | ACDEvents.QueueFull | ACDEvents.Waiting; diff --git a/src/Modules/ACD/ACDEvents/OperatorCallAttempt.d.ts b/src/Modules/ACD/ACDEvents/OperatorCallAttempt.d.ts new file mode 100644 index 0000000..ce8241e --- /dev/null +++ b/src/Modules/ACD/ACDEvents/OperatorCallAttempt.d.ts @@ -0,0 +1,25 @@ +import '../../../Call'; +import {ACDRequestEvent} from './$Implicit/ACDRequestEvent'; +import {EventHandler} from '../../../$Implicit/EventHandler'; + +export = ACDEvents; + +declare global { + export namespace ACDEvents { + export namespace OperatorCallAttempt { + /** + * The event is triggered when an ACD makes a user call + * via the {@link https://voximplant.com/docs/references/voxengine/voxengine/calluser|CallUser} + * method. + */ + export interface Event extends ACDRequestEvent { + /** + * Operator's call + */ + readonly operatorCall: Call; + } + + export interface Handler extends EventHandler {} + } + } +}