diff --git a/types/get-urls/get-urls-tests.ts b/types/get-urls/get-urls-tests.ts new file mode 100644 index 0000000000..a901a2aac2 --- /dev/null +++ b/types/get-urls/get-urls-tests.ts @@ -0,0 +1,16 @@ +import getUrls = require('get-urls'); + +const text = + 'Lorem ipsum dolor sit amet, //sindresorhus.com consectetuer adipiscing http://yeoman.io elit.'; + +// $ExpectType Set +getUrls(text); + +// $ExpectType Set +getUrls(text, { extractFromQueryString: true }); + +// $ExpectType Set +getUrls(text, { exclude: ['foo'] }); + +// $ExpectType Set +getUrls(text, { defaultProtocol: 'ftp' }); diff --git a/types/get-urls/index.d.ts b/types/get-urls/index.d.ts new file mode 100644 index 0000000000..b62c32aa24 --- /dev/null +++ b/types/get-urls/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for get-urls 8.0 +// Project: https://github.com/sindresorhus/get-urls#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Options as NormalizeUrlOptions } from 'normalize-url'; + +export = getUrls; + +declare function getUrls(text: string, options?: getUrls.Options): Set; + +declare namespace getUrls { + interface Options extends NormalizeUrlOptions { + extractFromQueryString?: boolean; + exclude?: string[]; + } +} diff --git a/types/get-urls/tsconfig.json b/types/get-urls/tsconfig.json new file mode 100644 index 0000000000..fd5acf72bd --- /dev/null +++ b/types/get-urls/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "get-urls-tests.ts" + ] +} diff --git a/types/get-urls/tslint.json b/types/get-urls/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/get-urls/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }