UNPKG

3 kBTypeScriptView Raw
1import Taro from '@tarojs/api';
2import { CallbackManager } from "../../../utils/handler";
3declare class BackgroundAudioManager implements Taro.BackgroundAudioManager {
4 Instance?: HTMLAudioElement;
5 errorStack: CallbackManager;
6 stopStack: CallbackManager;
7 __startTime: number;
8 constructor();
9 set src(e: string);
10 get src(): string;
11 set startTime(e: number);
12 get startTime(): number;
13 set title(e: string);
14 get title(): string;
15 set epname(e: string);
16 get epname(): string;
17 set singer(e: string);
18 get singer(): string;
19 set coverImgUrl(e: string);
20 get coverImgUrl(): string;
21 set webUrl(e: string);
22 get webUrl(): string;
23 set protocol(e: string);
24 get protocol(): string;
25 set playbackRate(e: number);
26 get playbackRate(): number;
27 get duration(): number;
28 get currentTime(): number;
29 get paused(): boolean;
30 get buffered(): number;
31 set referrerPolicy(e: string);
32 get referrerPolicy(): string;
33 private setProperty;
34 private dataset;
35 play: () => Promise<void> | undefined;
36 pause: () => void | undefined;
37 seek: (position: number) => void;
38 stop: () => void;
39 onCanplay: (callback?: () => void) => void | undefined;
40 onWaiting: (callback?: () => void) => void | undefined;
41 onError: (callback?: ((res: Taro.InnerAudioContext.onErrorDetail) => void) | undefined) => void;
42 onPlay: (callback?: () => void) => void | undefined;
43 onPause: (callback?: () => void) => void | undefined;
44 onSeeking: (callback?: () => void) => void | undefined;
45 onSeeked: (callback?: () => void) => void | undefined;
46 onEnded: (callback?: () => void) => void | undefined;
47 onStop: (callback?: () => void) => void;
48 onTimeUpdate: (callback?: () => void) => void | undefined;
49 onPrev: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
50 onNext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
51 offCanplay: (callback?: () => void) => void | undefined;
52 offWaiting: (callback?: () => void) => void | undefined;
53 offError: (callback?: () => void) => void;
54 offPlay: (callback?: () => void) => void | undefined;
55 offPause: (callback?: () => void) => void | undefined;
56 offSeeking: (callback?: () => void) => void | undefined;
57 offSeeked: (callback?: () => void) => void | undefined;
58 offEnded: (callback?: () => void) => void | undefined;
59 offStop: (callback?: () => void) => void;
60 offTimeUpdate: (callback?: () => void) => void | undefined;
61 offPrev: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
62 offNext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
63}
64export { BackgroundAudioManager };