From fee60a7ddcdbbe68b4f0dfef4453877cc7514510 Mon Sep 17 00:00:00 2001 From: Sun Knudsen Date: Sun, 7 Apr 2019 07:33:49 -0400 Subject: [PATCH] Add `background` option for macOS --- types/open/index.d.ts | 11 +++++++++-- types/open/open-tests.ts | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/types/open/index.d.ts b/types/open/index.d.ts index 7a5ba02b59..4ae15ddac6 100644 --- a/types/open/index.d.ts +++ b/types/open/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for open 6.0 +// Type definitions for open 6.1 // Project: https://github.com/sindresorhus/open // Definitions by: Shinnosuke Watanabe , // Maxime LUCE , // Tommy Lent , -// Florian Keller +// Florian Keller , +// Sun Knudsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -40,6 +41,12 @@ declare namespace Open { */ wait?: boolean; + /** + * Do not bring the app to the foreground (macOS only). + * Defaults to `false`. + */ + background?: boolean; + /** * Specify the app to open the `target` with, or an array with the app and app arguments. * The app name is platform dependent. Don't hard code it in reusable modules. diff --git a/types/open/open-tests.ts b/types/open/open-tests.ts index c23846c10e..8540f02673 100644 --- a/types/open/open-tests.ts +++ b/types/open/open-tests.ts @@ -5,4 +5,6 @@ open('foo'); // $ExpectType Promise open('foo', { app: 'bar' }); // $ExpectType Promise open('foo', { app: ['bar', '--arg'] }); // $ExpectType Promise open('foo', { app: 'bar', wait: false }); // $ExpectType Promise +open('foo', { app: 'bar', background: false }); // $ExpectType Promise open('foo', { app: ['bar', '--arg'], wait: false }); // $ExpectType Promise +open('foo', { app: ['bar', '--arg'], background: false }); // $ExpectType Promise