Skip to content

Commit a59c560

Browse files
committed
Make some Chrome types optional
1 parent 0379987 commit a59c560

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

DevToolsPlugin.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import type { Step, UserFlow } from "@puppeteer/replay"
1+
import type { UserFlow } from "@puppeteer/replay"
22

33
export class RecorderPlugin {
44
async stringify(recording: UserFlow) {
55
return JSON.stringify(recording, null, 2)
66
}
7-
async stringifyStep(step: Step) {
8-
return JSON.stringify(step, null, 2)
9-
}
107
}
118

129
chrome.devtools.recorder.registerRecorderExtensionPlugin(

types.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ declare global {
1515
* Converts a step of the recording from the Recorder panel format into a string.
1616
* @param step A step of the recording of a user interaction with the page.
1717
*/
18-
stringifyStep(step: Step): Promise<string>
18+
stringifyStep?(step: Step): Promise<string>
1919
}
2020

2121
/**
2222
* Registers a Recorder extension plugin.
2323
* @param plugin An instance implementing the `RecorderExtensionPlugin` interface.
24-
* @param name The name of the plugin.
25-
* @param mediaType The media type of the string content that the plugin produces.
24+
* @param [name] The name of the plugin.
25+
* @param [mediaType="text/plain"] The media type of the string content that the plugin produces.
2626
*/
2727
function registerRecorderExtensionPlugin(
2828
plugin: RecorderExtensionPlugin,
29-
name: string,
30-
mediaType: string,
29+
name?: string,
30+
mediaType?: string,
3131
): void
3232
}
3333
}

0 commit comments

Comments
 (0)