Added type declarations for parseurl.

This commit is contained in:
Stefan Reichel
2016-11-27 03:11:39 +01:00
parent 3e9ed9d35f
commit 7049104b45
4 changed files with 43 additions and 0 deletions

17
parseurl/index.d.ts vendored Normal file
View 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;

View 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
View 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
View File

@@ -0,0 +1 @@
{ "extends": "../tslint.json" }