mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #33391 from BendingBender/wait-for-localhost
[wait-for-localhost] Update types to v3.0
This commit is contained in:
Vendored
+20
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user