forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wait-for-localhost] Update types to v3.0
- Loading branch information
1 parent
b1285da
commit 8fd711f
Showing
2 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
// Type definitions for wait-for-localhost 2.0 | ||
// Type definitions for wait-for-localhost 3.0 | ||
// Project: https://github.com/sindresorhus/wait-for-localhost#readme | ||
// Definitions by: BendingBender <https://github.com/BendingBender> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
export = waitForLocalhost; | ||
|
||
declare function waitForLocalhost(port?: number): Promise<void>; | ||
/** | ||
* Wait for localhost to be ready. | ||
*/ | ||
declare function waitForLocalhost(options?: waitForLocalhost.Options): Promise<void>; | ||
|
||
declare namespace waitForLocalhost { | ||
interface Options { | ||
/** | ||
* @default 80 | ||
*/ | ||
port?: number; | ||
|
||
/** | ||
* Use the `GET` HTTP-method instead of `HEAD` to check if the server is running. | ||
* @default false | ||
*/ | ||
useGet?: boolean; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import waitForLocalhost = require('wait-for-localhost'); | ||
|
||
// $ExpectType Promise<void> | ||
waitForLocalhost(); | ||
waitForLocalhost(8080); | ||
waitForLocalhost(); // $ExpectType Promise<void> | ||
waitForLocalhost({ port: 8080 }); // $ExpectType Promise<void> | ||
waitForLocalhost({ useGet: true }); // $ExpectType Promise<void> |