diff --git a/types/github-url-to-object/github-url-to-object-tests.ts b/types/github-url-to-object/github-url-to-object-tests.ts new file mode 100644 index 0000000000..a6de7f1355 --- /dev/null +++ b/types/github-url-to-object/github-url-to-object-tests.ts @@ -0,0 +1,5 @@ +import gh = require('github-url-to-object'); + +gh('github:monkey/business'); // $ExpectType Result | null +gh('https://ghe.example.com:heroku/heroku-flags.git', {enterprise: true}); // $ExpectType Result | null +gh({url: 'git+https://github.com/monkey/business.git'}); // $ExpectType Result | null diff --git a/types/github-url-to-object/index.d.ts b/types/github-url-to-object/index.d.ts new file mode 100644 index 0000000000..a46ca93dd7 --- /dev/null +++ b/types/github-url-to-object/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for github-url-to-object 4.0 +// Project: https://github.com/zeke/github-url-to-object#readme +// Definitions by: Klaus Meinhardt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace gh { + interface Options { + enterprise?: boolean; + } + interface Result { + user: string; + repo: string; + branch: string; + https_url: string; + tarball_url: string; + clone_url: string; + travis_url: string; + api_url: string; + zip_url: string; + } +} + +declare function gh(url: string | {url: string}, options?: gh.Options): gh.Result | null; + +export = gh; diff --git a/types/github-url-to-object/tsconfig.json b/types/github-url-to-object/tsconfig.json new file mode 100644 index 0000000000..d25b3d0527 --- /dev/null +++ b/types/github-url-to-object/tsconfig.json @@ -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", + "github-url-to-object-tests.ts" + ] +} diff --git a/types/github-url-to-object/tslint.json b/types/github-url-to-object/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/github-url-to-object/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }