/** * @file 照片数字人端渲染方案 * @author zhangyue49 */ import { TextRenderBody, ErrorType, FinishData, PROGRESS } from './interface'; interface StatusType { code: number; status?: { value: PROGRESS; progress: number; }; message?: string; } interface PictureHumanPropsType { canvasId: string; modelUrl: string; licenseUrl: string; licenseKey: string; reportUrl?: string; reportInterval?: number; showLog?: boolean; statusCallback: (status: StatusType) => void; } interface CaseObjType { url: string; dirName: string; common?: boolean; progress?: number; buffer?: null | ArrayBuffer; } type FinishListenerType = (data?: FinishData) => void; interface TextRenderData { msg: TextRenderBody; finishListener: FinishListenerType; } interface AudioRenderData { audioBuffer: ArrayBuffer; sample: 16000 | 24000; first?: boolean; last?: boolean; interrupted?: boolean; finishListener: FinishListenerType; } export interface PictureHumanType extends InstanceType { onSynthesizeStart: (sample: number) => Promise; onSynthesizeDataArrived: (item: ArrayBuffer) => Promise; onSynthesizeFinish: () => Promise; isPlay: () => boolean; isPause: () => boolean; isStop: () => boolean; play: () => Promise; pause: () => Promise; stop: () => Promise; finish: () => void; } type PictureHumanConstructor = new (props: PictureHumanPropsType) => PictureHumanType; declare class PictureHuman { private dhServer; private humanInstance; private readonly canvasId; private readonly licenseUrl; private readonly licenseKey; private readonly showLog; private readonly statusCallback; private isReady; private hasErr; private readonly caseArr; private readonly progressMap; private audioQueue; private textResQueue; private textReqQueue; private isIntertupted; private readonly bencon; constructor(props: PictureHumanPropsType); ready: () => Promise<(CaseObjType[] | (() => void))[]>; errorHandler: (err: ErrorType) => void; waitStop: () => Promise; init(): void; pushAudioDataToSdk: (bufferData: ArrayBuffer) => any; textRenderListener: (isLasted: boolean | undefined, finishListener: FinishListenerType, res: any, off?: () => void) => Promise; stop: () => Promise; finish: () => void; log: (...params: any[]) => void; audioRender: (data: AudioRenderData) => Promise; _textRender: (data: TextRenderData) => Promise; textRender: (data: TextRenderData) => Promise; } declare const _default: PictureHumanConstructor; export default _default;