Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#34538 from sunknudsen/background-o…
Browse files Browse the repository at this point in the history
…ption

Add `background` option for macOS
  • Loading branch information
DanielRosenwasser authored Apr 8, 2019
2 parents 817c0ce + fee60a7 commit 0bb3d18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions types/open/index.d.ts
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/shinnn>,
// Maxime LUCE <https://github.com/SomaticIT>,
// Tommy Lent <https://github.com/tlent>,
// Florian Keller <https://github.com/ffflorian>
// Florian Keller <https://github.com/ffflorian>,
// Sun Knudsen <https://github.com/sunknudsen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions types/open/open-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ open('foo'); // $ExpectType Promise<ChildProcess>
open('foo', { app: 'bar' }); // $ExpectType Promise<ChildProcess>
open('foo', { app: ['bar', '--arg'] }); // $ExpectType Promise<ChildProcess>
open('foo', { app: 'bar', wait: false }); // $ExpectType Promise<ChildProcess>
open('foo', { app: 'bar', background: false }); // $ExpectType Promise<ChildProcess>
open('foo', { app: ['bar', '--arg'], wait: false }); // $ExpectType Promise<ChildProcess>
open('foo', { app: ['bar', '--arg'], background: false }); // $ExpectType Promise<ChildProcess>

0 comments on commit 0bb3d18

Please sign in to comment.