[contains-path] Add types

This commit is contained in:
Dimitri Benin
2018-12-25 02:10:40 +01:00
parent 42e3741a35
commit 899b88955d
4 changed files with 48 additions and 0 deletions
@@ -0,0 +1,5 @@
import containsPath = require('contains-path');
containsPath('foo/bar', 'foo'); // $ExpectType boolean
containsPath('foo/bar', 'FOO', { nocase: true }); // $ExpectType boolean
containsPath('foobar', 'foo', { partialMatch: true }); // $ExpectType boolean
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for contains-path 1.0
// Project: https://github.com/jonschlinkert/contains-path
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = containsPath;
declare function containsPath(
filepath: string,
substr: string,
options?: containsPath.Options
): boolean;
declare namespace containsPath {
interface Options {
nocase?: boolean;
partialMatch?: boolean;
}
}
+23
View File
@@ -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",
"contains-path-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }