Merge pull request #31424 from BendingBender/get-port

[get-port] Various fixes
This commit is contained in:
Nathan Shively-Sanders
2018-12-17 09:41:00 -08:00
committed by GitHub
4 changed files with 21 additions and 98 deletions
+9 -12
View File
@@ -1,13 +1,10 @@
import * as getPort from "get-port";
import getPort = require('get-port');
getPort().then(port => {
console.log(port);
});
getPort({ port: 3000 }).then(port => {
console.log(port);
});
getPort({ port: [3000, 3001] }).then(port => {
console.log(port);
});
// $ExpectType Promise<number>
getPort();
// $ExpectType Promise<number>
getPort({ port: 3000 });
// $ExpectType Promise<number>
getPort({ port: [3000, 3001] });
// $ExpectType Promise<number>
getPort({ host: 'foo.local' });
+8 -5
View File
@@ -1,9 +1,12 @@
// Type definitions for get-port 4.0
// Project: https://github.com/sindresorhus/get-port
// Definitions by: York Yao <https://github.com/plantain-00/>
// Definitions by: York Yao <https://github.com/plantain-00>
// BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "get-port" {
var getPort: (options?: { port?: number | ReadonlyArray<number>, host?: string }) => PromiseLike<number>
export = getPort;
}
declare function getPort(options?: {
port?: number | ReadonlyArray<number>;
host?: string;
}): Promise<number>;
export = getPort;
+3 -4
View File
@@ -2,12 +2,11 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
@@ -21,4 +20,4 @@
"index.d.ts",
"get-port-tests.ts"
]
}
}
+1 -77
View File
@@ -1,79 +1,3 @@
{
"extends": "dtslint/dt.json",
"rules": {
"adjacent-overload-signatures": false,
"array-type": false,
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
"comment-format": false,
"dt-header": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
"interface-name": false,
"interface-over-type-literal": false,
"jsdoc-format": false,
"max-line-length": false,
"member-access": false,
"new-parens": false,
"no-any-union": false,
"no-boolean-literal-compare": false,
"no-conditional-assignment": false,
"no-consecutive-blank-lines": false,
"no-construct": false,
"no-declare-current-package": false,
"no-duplicate-imports": false,
"no-duplicate-variable": false,
"no-empty-interface": false,
"no-for-in-array": false,
"no-inferrable-types": false,
"no-internal-module": false,
"no-irregular-whitespace": false,
"no-mergeable-namespace": false,
"no-misused-new": false,
"no-namespace": false,
"no-object-literal-type-assertion": false,
"no-padding": false,
"no-redundant-jsdoc": false,
"no-redundant-jsdoc-2": false,
"no-redundant-undefined": false,
"no-reference-import": false,
"no-relative-import-in-test": false,
"no-self-import": false,
"no-single-declare-module": false,
"no-string-throw": false,
"no-unnecessary-callback-wrapper": false,
"no-unnecessary-class": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false,
"no-unnecessary-type-assertion": false,
"no-useless-files": false,
"no-var-keyword": false,
"no-var-requires": false,
"no-void-expression": false,
"no-trailing-whitespace": false,
"object-literal-key-quotes": false,
"object-literal-shorthand": false,
"one-line": false,
"one-variable-per-declaration": false,
"only-arrow-functions": false,
"prefer-conditional-expression": false,
"prefer-const": false,
"prefer-declare-function": false,
"prefer-for-of": false,
"prefer-method-signature": false,
"prefer-template": false,
"radix": false,
"semicolon": false,
"space-before-function-paren": false,
"space-within-parens": false,
"strict-export-declare-modifiers": false,
"trim-file": false,
"triple-equals": false,
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
}
"extends": "dtslint/dt.json"
}