UNPKG

@onereach/step-voice

Version:
67 lines (66 loc) 2.07 kB
import { ITypedEvent } from '@onereach/flow-sdk/dst/types'; import VoiceStep, { IVoiceCall, TODO, VoiceEvent } from './voice'; interface INPUT { asr: TODO; autoPause: boolean; processHangUp: 'user' | 'bot' | 'both' | 'none' | string; recordAfterTransfer: boolean; recordCall: boolean; choices: TODO[]; qualityOfService: 'enabled' | 'enabledWithRaw' | 'disabled'; limitFileTtl: boolean; recordFileTtl: number; limitLinkTtl: boolean; recordLinkTtl: number; } interface OUTPUT { type: string; digit?: string; value?: string; language?: string; interpretation?: TODO[]; callRecording?: TODO; tags?: string[]; out?: string; } interface EVENT extends VoiceEvent { callRecording?: TODO; exitId?: string; digit?: string; digits?: string; phrases?: TODO[]; language?: string; tags?: string[]; out?: string; background?: boolean; zombie?: boolean; ack?: boolean; cause: { callQualityVariables?: Record<string, string>; qualityOfServiceResult?: Record<string, string>; }; } export default class GlobalCommand extends VoiceStep<Partial<INPUT>, OUTPUT, EVENT> { get isGlobal(): boolean; get useQueue(): boolean; runStep(): Promise<void>; initGrammar(call: IVoiceCall): Promise<void>; worker(): Promise<void>; getQualityOfServiceResult(call: IVoiceCall): Record<string, string> | { qosRaw?: Record<string, string> | undefined; qos: { mosValue: number; mosQualification: string; jitterValue: number; jitterQualification: string; pktLostValue: number; pktLostQualification: string; callQualification: string | undefined; } | undefined; } | undefined; hangup(call: IVoiceCall): Promise<unknown>; exitThread(event: ITypedEvent<EVENT>, type: string, stepExit: string): Promise<void>; buildGrammar(call: IVoiceCall, choices: TODO[]): Promise<any>; acceptAck(eventParams: any): void; } export {};