diff --git a/types/nightmare/index.d.ts b/types/nightmare/index.d.ts index 0796a0f8e1..7be47c2d30 100644 --- a/types/nightmare/index.d.ts +++ b/types/nightmare/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Nightmare 1.6.6 +// Type definitions for Nightmare 2.10.0 // Project: https://github.com/segmentio/nightmare // Definitions by: horiuchi // Sam Yang @@ -147,6 +147,13 @@ declare namespace Nightmare { typeInterval?: number; x?: number; y?: number; + openDevTools?: { + /** + * Opens the devtools with specified dock state, can be right, bottom, undocked, detach. + * https://github.com/electron/electron/blob/master/docs/api/web-contents.md#contentsopendevtoolsoptions + */ + mode?: string; + }; } export interface IRequest { diff --git a/types/nightmare/nightmare-tests.ts b/types/nightmare/nightmare-tests.ts index eea21ae84c..1dfe655c94 100644 --- a/types/nightmare/nightmare-tests.ts +++ b/types/nightmare/nightmare-tests.ts @@ -364,4 +364,6 @@ new Nightmare() new Nightmare() .goto('https://github.com/segmentio/nightmare') .click('a[href="/segmentio/nightmare/archive/master.zip"]') - .download('/some/other/path/master.zip'); \ No newline at end of file + .download('/some/other/path/master.zip'); + +new Nightmare({show: true, openDevTools: {mode: 'detach'}});