-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.d.ts
39 lines (36 loc) · 1020 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
export type P5CaptureState = "idle" | "capturing" | "encoding";
export type P5CaptureFormat = "webm" | "gif" | "mp4" | "png" | "jpg" | "webp";
export type P5CaptureOptions = {
format?: P5CaptureFormat;
framerate?: number;
bitrate?: number;
quality?: number;
width?: number;
height?: number;
duration?: number | null;
autoSaveDuration?: number | null;
baseFilename?: (date: Date) => string;
imageFilename?: (index: number) => string;
beforeDownload?: (
blob: Blob,
context: {
filename: string;
format: P5CaptureFormat;
},
next: () => void,
) => Promise<void> | void;
verbose?: boolean;
};
export type P5CaptureGlobalOptions = P5CaptureOptions & {
disableUi?: boolean;
disableScaling?: boolean;
};
declare global {
class P5Capture {
static setDefaultOptions(options: P5CaptureGlobalOptions): void;
static getInstance(): P5Capture;
get state(): P5CaptureState;
start(options?: P5CaptureOptions): Promise<void>;
stop(): Promise<void>;
}
}