fix: make Serializable type any (#9059)
This commit is contained in:
parent
40ae28e3bb
commit
89aace688f
|
|
@ -102,7 +102,7 @@ Request's post body in a binary form, if any.
|
||||||
|
|
||||||
## method: Request.postDataJSON
|
## method: Request.postDataJSON
|
||||||
* langs: js, python
|
* langs: js, python
|
||||||
- returns: <[null]|[any]>
|
- returns: <[null]|[Serializable]>
|
||||||
|
|
||||||
Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any.
|
Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any.
|
||||||
|
|
||||||
|
|
|
||||||
2
types/structs.d.ts
vendored
2
types/structs.d.ts
vendored
|
|
@ -19,7 +19,7 @@ import { JSHandle, ElementHandle, Frame, Page, BrowserContext, Locator } from '.
|
||||||
/**
|
/**
|
||||||
* Can be converted to JSON
|
* Can be converted to JSON
|
||||||
*/
|
*/
|
||||||
export type Serializable = {};
|
export type Serializable = any;
|
||||||
/**
|
/**
|
||||||
* Can be converted to JSON, but may also contain JSHandles.
|
* Can be converted to JSON, but may also contain JSHandles.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
2
types/types.d.ts
vendored
2
types/types.d.ts
vendored
|
|
@ -13420,7 +13420,7 @@ export interface Request {
|
||||||
* When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned.
|
* When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned.
|
||||||
* Otherwise it will be parsed as JSON.
|
* Otherwise it will be parsed as JSON.
|
||||||
*/
|
*/
|
||||||
postDataJSON(): null|any;
|
postDataJSON(): null|Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request that was redirected by the server to this one, if any.
|
* Request that was redirected by the server to this one, if any.
|
||||||
|
|
|
||||||
|
|
@ -793,10 +793,11 @@ playwright.chromium.launch().then(async browser => {
|
||||||
(async () => {
|
(async () => {
|
||||||
const browser = await playwright.chromium.launch();
|
const browser = await playwright.chromium.launch();
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
await Promise.all([
|
const [response] = await Promise.all([
|
||||||
page.waitForResponse(response => response.url().includes('example.com')),
|
page.waitForResponse(response => response.url().includes('example.com')),
|
||||||
page.goto('https://example.com')
|
page.goto('https://example.com')
|
||||||
]);
|
]);
|
||||||
|
console.log((await response!.json()).foobar); // JSON return value should be any
|
||||||
|
|
||||||
await browser.close();
|
await browser.close();
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue