mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[wildstring]: Add v1 types (#39110)
This commit is contained in:
parent
8e022c857b
commit
e1b26ffc11
17
types/wildstring/index.d.ts
vendored
Normal file
17
types/wildstring/index.d.ts
vendored
Normal 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
types/wildstring/tsconfig.json
Normal file
23
types/wildstring/tsconfig.json
Normal 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
types/wildstring/tslint.json
Normal file
3
types/wildstring/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
9
types/wildstring/wildstring-tests.ts
Normal file
9
types/wildstring/wildstring-tests.ts
Normal 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' ]);
|
||||
Loading…
Reference in New Issue
Block a user