Skip to content

Commit

Permalink
device descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelEinbinder committed Mar 10, 2020
1 parent 29eba96 commit 05f6ac1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3510,10 +3510,10 @@ ResourceType will be one of the following: `document`, `stylesheet`, `image`, `m
<!-- GEN:stop -->

#### response.buffer()
- returns: <Promise<[Buffer]>> Promise which resolves to a buffer with response body.
- returns: <[Promise]<[Buffer]>> Promise which resolves to a buffer with response body.

#### response.finished()
- returns: <Promise[?string]> Waits for this response to finish, throws when corresponding request failed.
- returns: <[Promise]<?[string]>> Waits for this response to finish, throws when corresponding request failed.

#### response.frame()
- returns: <[Frame]> A [Frame] that initiated this response.
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ export const chromium: types.BrowserType<types.ChromiumBrowser>;
export const firefox: types.BrowserType<types.FirefoxBrowser>;
export const errors: types.BrowserTypeErrors;
export const selectors: types.Selectors;
export const devices: types.Devices;
8 changes: 5 additions & 3 deletions utils/generate_types/overrides.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { EventEmitter } from 'events';
/**
* Can be converted to JSON
*/
interface Serializable {}
interface ConnectionTransport {}
type Serializable = {}
type ConnectionTransport = {}

type Boxed<Args extends any[]> = { [Index in keyof Args]: Args[Index] | JSHandle<Args[Index]> };
type PageFunction<Args extends any[], R = any> = string | ((...args: Args) => R | Promise<R>);
Expand Down Expand Up @@ -125,4 +125,6 @@ export interface ChromiumSession {
method: T,
params?: Protocol.CommandParameters[T]
): Promise<Protocol.CommandReturnValues[T]>;
}
}

export type Devices = {[name: string]: {viewport: BrowserNewContextOptionsViewport, userAgent: string}};
1 change: 1 addition & 0 deletions utils/generate_types/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ playwright.chromium.launch().then(async browser => {
(async () => {
playwright.chromium.connect;
playwright.errors.TimeoutError;
const iPhone = playwright.devices['iPhone'];

// Must be a function that evaluates to a selector engine instance.
const createTagNameEngine = () => ({
Expand Down

0 comments on commit 05f6ac1

Please sign in to comment.