[url-join] Update types to v4.0 (#31768)

* [url-join] Move v0 types to sub-dir

* [url-join] Update types to v4.0
This commit is contained in:
Dimitri Benin 2018-12-31 16:02:39 +00:00 committed by Wesley Wigham
parent a4f67d33f8
commit 9ac607c9d8
8 changed files with 65 additions and 91 deletions

View File

@ -1,15 +1,17 @@
// Type definitions for url-join v0.8.3
// Type definitions for url-join 4.0
// Project: https://github.com/jfromaniello/url-join
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>, Mike Deverell <https://github.com/devrelm>
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
// Mike Deverell <https://github.com/devrelm>
// BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* Join all arguments together and normalize the resulting url.
* This works similar to path.join but you shouldn't use path.join for urls since it will work different depending of the operative systems but also doesn't work for some cases.
* This works similar to `path.join` but you shouldn't use `path.join` for urls since it works
* differently depending on the operating system and also doesn't work for some cases.
*/
declare function urljoin(...parts: string[]): string;
declare function urljoin(parts: string[]): string;
declare var urljoin: (...parts: string[]) => string;
declare module "url-join" {
export = urljoin;
}
export = urljoin;
export as namespace urljoin;

View File

@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
@ -20,4 +20,4 @@
"index.d.ts",
"url-join-tests.ts"
]
}
}

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"
}

View File

@ -1,5 +1,4 @@
import urljoin = require("url-join");
import urljoin2 = require("url-join");
import urljoin = require('url-join');
const s: string = urljoin("foo", "bar", "baz");
const s2: string = urljoin2("foo", "bar", "baz");
urljoin('http://www.google.com', 'a', '/b/cd', '?foo=123'); // $ExpectType string
urljoin(['http://www.google.com', 'a', '/b/cd', '?foo=123']); // $ExpectType string

13
types/url-join/v0/index.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// Type definitions for url-join 0.8
// Project: https://github.com/jfromaniello/url-join
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>, Mike Deverell <https://github.com/devrelm>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* Join all arguments together and normalize the resulting url.
* This works similar to path.join but you shouldn't use path.join for urls since it will work different depending of the operative systems but also doesn't work for some cases.
*/
declare function urljoin(...parts: string[]): string;
export = urljoin;

View File

@ -0,0 +1,28 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../../",
"typeRoots": [
"../../"
],
"paths": {
"url-join": [
"url-join/v0"
]
},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"url-join-tests.ts"
]
}

View File

@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}

View File

@ -0,0 +1,5 @@
import urljoin = require("url-join");
import urljoin2 = require("url-join");
const s: string = urljoin("foo", "bar", "baz");
const s2: string = urljoin2("foo", "bar", "baz");