mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-03 15:37:31 +00:00
Add type for ajv-keywords (#39948)
This commit is contained in:
parent
ea40bbb6b2
commit
efce94ec94
5
types/ajv-keywords/ajv-keywords-tests.ts
Normal file
5
types/ajv-keywords/ajv-keywords-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import Ajv from 'ajv';
|
||||
import defineKeywords = require('ajv-keywords');
|
||||
|
||||
let ajv = new Ajv();
|
||||
ajv = defineKeywords(ajv);
|
||||
19
types/ajv-keywords/index.d.ts
vendored
Normal file
19
types/ajv-keywords/index.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
// Type definitions for ajv-keywords 3.4
|
||||
// Project: https://github.com/epoberezkin/ajv-keywords#readme
|
||||
// Definitions by: Eric Gonzalez <https://github.com/lochiego>
|
||||
// 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<string>): Ajv;
|
||||
|
||||
export = defineKeywords;
|
||||
6
types/ajv-keywords/package.json
Normal file
6
types/ajv-keywords/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"ajv": "^6.9.1"
|
||||
}
|
||||
}
|
||||
24
types/ajv-keywords/tsconfig.json
Normal file
24
types/ajv-keywords/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
1
types/ajv-keywords/tslint.json
Normal file
1
types/ajv-keywords/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user