mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #31376 from BendingBender/get-urls
Add types for get-urls
This commit is contained in:
@@ -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<string>
|
||||
getUrls(text);
|
||||
|
||||
// $ExpectType Set<string>
|
||||
getUrls(text, { extractFromQueryString: true });
|
||||
|
||||
// $ExpectType Set<string>
|
||||
getUrls(text, { exclude: ['foo'] });
|
||||
|
||||
// $ExpectType Set<string>
|
||||
getUrls(text, { defaultProtocol: 'ftp' });
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for get-urls 8.0
|
||||
// Project: https://github.com/sindresorhus/get-urls#readme
|
||||
// Definitions by: BendingBender <https://github.com/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<string>;
|
||||
|
||||
declare namespace getUrls {
|
||||
interface Options extends NormalizeUrlOptions {
|
||||
extractFromQueryString?: boolean;
|
||||
exclude?: string[];
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user