diff --git a/types/ajv-keywords/ajv-keywords-tests.ts b/types/ajv-keywords/ajv-keywords-tests.ts new file mode 100644 index 0000000000..2e2a984302 --- /dev/null +++ b/types/ajv-keywords/ajv-keywords-tests.ts @@ -0,0 +1,5 @@ +import Ajv from 'ajv'; +import defineKeywords = require('ajv-keywords'); + +let ajv = new Ajv(); +ajv = defineKeywords(ajv); diff --git a/types/ajv-keywords/index.d.ts b/types/ajv-keywords/index.d.ts new file mode 100644 index 0000000000..4a79780fd9 --- /dev/null +++ b/types/ajv-keywords/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for ajv-keywords 3.4 +// Project: https://github.com/epoberezkin/ajv-keywords#readme +// Definitions by: Eric Gonzalez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import { Ajv } from "ajv"; + +export { }; + +/** + * Defines one or several keywords in ajv instance + * @param ajv validator instance + * @param keywords keyword(s) to define + * @return ajv instance (for chaining) + */ +declare function defineKeywords(ajv: Ajv, keywords?: string | ReadonlyArray): Ajv; + +export = defineKeywords; diff --git a/types/ajv-keywords/package.json b/types/ajv-keywords/package.json new file mode 100644 index 0000000000..61a2ab2af5 --- /dev/null +++ b/types/ajv-keywords/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "ajv": "^6.9.1" + } +} diff --git a/types/ajv-keywords/tsconfig.json b/types/ajv-keywords/tsconfig.json new file mode 100644 index 0000000000..e97a410185 --- /dev/null +++ b/types/ajv-keywords/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "ajv-keywords-tests.ts" + ] +} diff --git a/types/ajv-keywords/tslint.json b/types/ajv-keywords/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ajv-keywords/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }