forked from heygen-com/hyperframes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdp-headless-experimental.d.ts
More file actions
54 lines (50 loc) · 1.69 KB
/
Copy pathcdp-headless-experimental.d.ts
File metadata and controls
54 lines (50 loc) · 1.69 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* Type augmentation for Chrome's HeadlessExperimental CDP domain.
*
* Puppeteer's CDPSession.send() is typed against devtools-protocol's
* ProtocolMapping.Commands, which does not include HeadlessExperimental.
* This module augmentation adds proper types so we can call these methods
* without unsafe `as any` casts.
*/
/** Parameters for HeadlessExperimental.beginFrame */
interface HeadlessExperimentalBeginFrameRequest {
/** Timestamp in milliseconds since epoch for the frame */
frameTimeTicks: number;
/** Interval in milliseconds between frames */
interval: number;
/** If true, do not produce display updates (warmup mode) */
noDisplayUpdates?: boolean;
/** Optional screenshot configuration */
screenshot?: {
format: "jpeg" | "png";
quality?: number;
optimizeForSpeed?: boolean;
};
}
/** Response from HeadlessExperimental.beginFrame */
interface HeadlessExperimentalBeginFrameResponse {
/** Whether the compositor reported visual damage */
hasDamage: boolean;
/** Base64-encoded screenshot data (present only when screenshot was requested and hasDamage is true) */
screenshotData?: string;
}
export {};
declare module "devtools-protocol/types/protocol-mapping.js" {
// Merge into the existing ProtocolMapping namespace
export namespace ProtocolMapping {
interface Commands {
"HeadlessExperimental.enable": {
paramsType: [];
returnType: void;
};
"HeadlessExperimental.disable": {
paramsType: [];
returnType: void;
};
"HeadlessExperimental.beginFrame": {
paramsType: [HeadlessExperimentalBeginFrameRequest];
returnType: HeadlessExperimentalBeginFrameResponse;
};
}
}
}