Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #53 Add typescript definitions #106

Merged
merged 2 commits into from Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions ajv-keywords.d.ts
@@ -0,0 +1,28 @@
declare module 'ajv-keywords' {
import { Ajv } from 'ajv';

type AdditionalKeywords =
| 'typeof'
| 'instanceof'
| 'range'
| 'regexp'
| 'formatMinimum'
| 'formatMaximum'
| 'transform'
| 'uniqueItemProperties'
| 'allRequired'
| 'anyRequired'
| 'oneRequired'
| 'patternRequired'
| 'prohibited'
| 'deepProperties'
| 'deepRequired'
| 'switch'
| 'select'
| 'dynamicDefaults'
;

function keywords(ajv: Ajv, include?: AdditionalKeywords | AdditionalKeywords[]): Ajv;
sonallux marked this conversation as resolved.
Show resolved Hide resolved

export = keywords;
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"version": "3.4.1",
"description": "Custom JSON-Schema keywords for Ajv validator",
"main": "index.js",
"typings": "ajv-keywords.d.ts",
"scripts": {
"build": "node node_modules/ajv/scripts/compile-dots.js node_modules/ajv/lib keywords",
"prepublish": "npm run build",
Expand Down