mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Added type declarations for parseurl.
This commit is contained in:
17
parseurl/index.d.ts
vendored
Normal file
17
parseurl/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for parseurl
|
||||
// Project: https://github.com/pillarjs/parseurl
|
||||
// Definitions by: Stefan Reichel <https://github.com/bomret>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { IncomingMessage } from "http";
|
||||
import { Url } from "url";
|
||||
|
||||
declare function parseurl(req: IncomingMessage): Url | undefined;
|
||||
|
||||
declare namespace parseurl {
|
||||
export function original(req: IncomingMessage): Url | undefined;
|
||||
}
|
||||
|
||||
export = parseurl;
|
||||
6
parseurl/parseurl-tests.ts
Normal file
6
parseurl/parseurl-tests.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import parseurl = require("parseurl");
|
||||
|
||||
const req: any = {};
|
||||
|
||||
const parsedUrl = parseurl(req);
|
||||
const originalParsedUrl = parseurl.original(req);
|
||||
19
parseurl/tsconfig.json
Normal file
19
parseurl/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"parseurl-tests.ts"
|
||||
]
|
||||
}
|
||||
1
parseurl/tslint.json
Normal file
1
parseurl/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user