mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
add parse-github-url (#27230)
Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). - [x] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [x] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [x] Create it with `dts-gen --dt`, not by basing it on an existing project. - [x] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`.
This commit is contained in:
committed by
Ryan Cavanaugh
parent
d37a85553f
commit
6c93547985
23
types/parse-github-url/index.d.ts
vendored
Normal file
23
types/parse-github-url/index.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// Type definitions for parse-github-url 1.0
|
||||
// Project: https://github.com/jonschlinkert/parse-github-url
|
||||
// Definitions by: Klaus Meinhardt <https://github.com/ajafff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Url } from 'url';
|
||||
|
||||
declare namespace gh {
|
||||
interface Result extends Url {
|
||||
filepath: string | null;
|
||||
owner: string | null;
|
||||
name: string | null;
|
||||
repo: string | null;
|
||||
repository: string | null;
|
||||
branch: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare function gh(url: string): gh.Result | null;
|
||||
|
||||
export = gh;
|
||||
3
types/parse-github-url/parse-github-url-tests.ts
Normal file
3
types/parse-github-url/parse-github-url-tests.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import gh = require('parse-github-url');
|
||||
|
||||
gh('github:monkey/business'); // $ExpectType Result | null
|
||||
23
types/parse-github-url/tsconfig.json
Normal file
23
types/parse-github-url/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"parse-github-url-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/parse-github-url/tslint.json
Normal file
1
types/parse-github-url/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user