Adds type definitions for 'valid-data-url' (#36158)

Adds type definitions and tests
Adds tsconfig and tslint config
This commit is contained in:
jgeth 2019-06-13 03:24:24 -07:00 committed by Ron Buckton
parent 5749a49e50
commit 79f6b71c16
4 changed files with 40 additions and 0 deletions

13
types/valid-data-url/index.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// Type definitions for valid-data-url 2.0
// Project: https://github.com/killmenot/valid-data-url
// Definitions by: jgeth <https://github.com/jgeth>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export as namespace validDataUrl;
declare const validDataUrl: {
(candidate: string): boolean;
regex: RegExp;
};
export = validDataUrl;

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"valid-data-url-tests.ts"
]
}

View File

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

View File

@ -0,0 +1,3 @@
import * as validDataUrl from "valid-data-url";
validDataUrl("data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D");