Skip to content

Commit 5eccd70

Browse files
committed
make types consistent
1 parent dd476d9 commit 5eccd70

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

types/index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
declare function init(schemaPath: string, options?: ajvValidatorOptions): void;
1010
declare function init(jsonSchema: Record<string, any>, options?: ajvValidatorOptions): void;
1111
export { init };
12+
export { initAsync };
13+
export { validate };
14+
export { getNewMiddleware };
1215

1316
/**
1417
* Initialize the input validation middleware by
@@ -19,7 +22,6 @@ export { init };
1922
*/
2023
declare function initAsync(schemaPath: string, options?: ajvValidatorOptions): Promise<void>;
2124
declare function initAsync(jsonSchema: Record<string, any>, options?: ajvValidatorOptions): Promise<void>;
22-
export { initAsync };
2325

2426
/**
2527
* Middleware that validates the request against the swagger
@@ -28,7 +30,6 @@ export { initAsync };
2830
declare function validate(ctx: Record<string, any>, next: Function): void; // koa
2931
declare function validate(req: Record<string, any>, res: Record<string, any>, next: Function): void; // express
3032
declare function validate(options: FastifyPluginOptions): any; // fastify
31-
export { validate };
3233

3334
export class InputValidationError extends Error {
3435
errors: Array<ErrorDetails | string>;
@@ -84,12 +85,11 @@ declare class MiddlewareClass {
8485
// eslint-disable-next-line no-dupe-class-members
8586
initAsync(jsonSchema: Record<string, any>, options?: ajvValidatorOptions): Promise<void>;
8687

87-
validate(ctx: Object, next: Function): void; // koa
88+
validate(ctx: Record<string, any>, next: Function): void; // koa
8889
// eslint-disable-next-line no-dupe-class-members
89-
validate(req: Object, res: Object, next: Function): void; // express
90+
validate(req: Record<string, any>, res: Record<string, any>, next: Function): void; // express
9091
// eslint-disable-next-line no-dupe-class-members
9192
validate(options: FastifyPluginOptions): any; // fastify
9293
}
9394

9495
declare function getNewMiddleware(schemaPath: string, options?: ajvValidatorOptions): MiddlewareClass;
95-
export { getNewMiddleware };

0 commit comments

Comments
 (0)