[wildstring]: Add v1 types (#39110)

This commit is contained in:
inglec-arista
2019-10-15 15:37:11 -07:00
committed by Andrew Branch
parent 8e022c857b
commit e1b26ffc11
4 changed files with 52 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for wildstring 1.0
// Project: https://github.com/deltreey/wildstring#readme
// Definitions by: Ciarán Ingle <https://github.com/inglec-arista>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare const wildstring: {
wildcard: string;
caseSensitive: boolean;
match: (pattern: string, string: string) => boolean;
replace: (pattern: string, strings: string | ReadonlyArray<string>) => string;
};
export {};
export = wildstring;
+23
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",
"wildstring-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}
+9
View File
@@ -0,0 +1,9 @@
import wildstring = require('wildstring');
wildstring.wildcard = '*';
wildstring.caseSensitive = true;
wildstring.match('Test*', 'Testing');
wildstring.replace('I * node.*', 'script');
wildstring.replace('I * node.*', [ 'love', 'js' ]);