From 4e8033ef387d845abd01bf8b055e910184a36782 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Thu, 6 Dec 2018 00:35:08 +0100 Subject: [PATCH] Update types for findup-sync --- types/findup-sync/findup-sync-tests.ts | 17 +++++++++++++++++ types/findup-sync/index.d.ts | 22 ++++++++++++++++++++++ types/findup-sync/tsconfig.json | 23 +++++++++++++++++++++++ types/findup-sync/tslint.json | 3 +++ 4 files changed, 65 insertions(+) create mode 100644 types/findup-sync/findup-sync-tests.ts create mode 100644 types/findup-sync/index.d.ts create mode 100644 types/findup-sync/tsconfig.json create mode 100644 types/findup-sync/tslint.json diff --git a/types/findup-sync/findup-sync-tests.ts b/types/findup-sync/findup-sync-tests.ts new file mode 100644 index 0000000000..87a334eea6 --- /dev/null +++ b/types/findup-sync/findup-sync-tests.ts @@ -0,0 +1,17 @@ +import findup = require('findup-sync'); + +let str: string; + +str = findup('foo'); +str = findup(['foo', 'bar']); + +str = findup('foo', { + matchBase: true, +}); + +str = findup('foo', { + cwd: 'c:\\', +}); + +str = findup('{a,b}*.txt'); +str = findup('{a,b}*.txt', { cwd: '/some/path', nocase: true }); diff --git a/types/findup-sync/index.d.ts b/types/findup-sync/index.d.ts new file mode 100644 index 0000000000..23df60a22f --- /dev/null +++ b/types/findup-sync/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for findup-sync 2.0 +// Project: https://github.com/cowboy/node-findup-sync +// Definitions by: Bart van der Schoor +// Nathan Brown +// BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import micromatch = require('micromatch'); + +export = findupSync; + +declare function findupSync( + patternOrPatterns: string[] | string, + micromatchOptions?: findupSync.Options +): string; + +declare namespace findupSync { + interface Options extends micromatch.Options { + cwd?: string; + } +} diff --git a/types/findup-sync/tsconfig.json b/types/findup-sync/tsconfig.json new file mode 100644 index 0000000000..fd44ee7c99 --- /dev/null +++ b/types/findup-sync/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "findup-sync-tests.ts" + ] +} \ No newline at end of file diff --git a/types/findup-sync/tslint.json b/types/findup-sync/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/findup-sync/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}