From 967abf43b66e4ca6bb3a7fad56771ab2c8a81ab1 Mon Sep 17 00:00:00 2001 From: Dmitry Guketlev Date: Thu, 11 Jul 2019 02:19:46 +0300 Subject: [PATCH] Typings for schema-utils (#36656) --- types/schema-utils/index.d.ts | 12 ++++++++++++ types/schema-utils/schema-utils-tests.ts | 4 ++++ types/schema-utils/tsconfig.json | 23 +++++++++++++++++++++++ types/schema-utils/tslint.json | 1 + 4 files changed, 40 insertions(+) create mode 100644 types/schema-utils/index.d.ts create mode 100644 types/schema-utils/schema-utils-tests.ts create mode 100644 types/schema-utils/tsconfig.json create mode 100644 types/schema-utils/tslint.json diff --git a/types/schema-utils/index.d.ts b/types/schema-utils/index.d.ts new file mode 100644 index 0000000000..8594ffdec1 --- /dev/null +++ b/types/schema-utils/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for schema-utils 1.0 +// Project: https://github.com/webpack-contrib/schema-utils +// Definitions by: Dmitry Guketlev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare function validate( + schema: object | string | boolean, + options: any, + name: string): true; + +export = validate; diff --git a/types/schema-utils/schema-utils-tests.ts b/types/schema-utils/schema-utils-tests.ts new file mode 100644 index 0000000000..6572b1b8d4 --- /dev/null +++ b/types/schema-utils/schema-utils-tests.ts @@ -0,0 +1,4 @@ +import validate = require('schema-utils'); + +validate('path/to/file.json', {loader: 'options'}, 'Demo loader'); +validate({type: 'object'}, {loader: 'options'}, 'Demo loader'); diff --git a/types/schema-utils/tsconfig.json b/types/schema-utils/tsconfig.json new file mode 100644 index 0000000000..5526546659 --- /dev/null +++ b/types/schema-utils/tsconfig.json @@ -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", + "schema-utils-tests.ts" + ] +} diff --git a/types/schema-utils/tslint.json b/types/schema-utils/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/schema-utils/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }