use typescript ES2015 for Promise support

master
Evgeny Poberezkin 2016-04-20 21:01:22 +01:00
parent f7bfc49a55
commit a954845be2
2 changed files with 3 additions and 5 deletions

6
lib/ajv.d.ts vendored
View File

@ -21,7 +21,7 @@ declare namespace ajv {
dataPath?: string,
parentData?: Object | Array<any>,
parentDataProperty?: string | number
): boolean | Promise;
): boolean | Promise<boolean>;
errors?: Array<ErrorObject>;
}
@ -84,7 +84,7 @@ declare namespace ajv {
dataPath?: string,
parentData?: Object | Array<any>,
parentDataProperty?: string | number
): boolean | Promise;
): boolean | Promise<boolean>;
errors?: Array<ErrorObject>;
}
@ -93,8 +93,6 @@ declare namespace ajv {
dataVar?: string;
}
type Promise = Object;
interface ErrorObject {
keyword: string;
dataPath: string;

View File

@ -17,7 +17,7 @@
"test-fast": "AJV_FAST_TEST=true npm run test-spec",
"test-debug": "mocha spec/*.spec.js --debug-brk -R spec",
"test-cov": "istanbul cover -x '**/spec/**' node_modules/mocha/bin/_mocha -- spec/*.spec.js -R spec",
"test-ts": "tsc lib/ajv.d.ts",
"test-ts": "tsc --target ES2015 lib/ajv.d.ts",
"bundle": "./scripts/bundle . Ajv pure_getters",
"bundle-regenerator": "./scripts/bundle regenerator",
"bundle-nodent": "./scripts/bundle nodent",