From cb77aeaff243e6f0d13ae8ac4de2761ffc1a08f8 Mon Sep 17 00:00:00 2001 From: frogcjn Date: Fri, 24 Jun 2016 11:09:55 +0800 Subject: [PATCH] merge overloads for errorCb --- mongoose/mongoose.d.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 74d3663a76..b0f3dcdacd 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -274,14 +274,10 @@ declare module "mongoose" { pathType(path: string): string; plugin(plugin: (schema: Schema, options?: Object) => void, options?: Object): Schema; - pre(method: string, fn: HookSyncCallback): Schema; - pre(method: string, fn: HookSyncCallback, errorCb: HookErrorCallback): Schema; - pre(method: string, isAsync: boolean, fn: HookAsyncCallback): Schema; - pre(method: string, isAsync: boolean, fn: HookAsyncCallback, errorCb: HookErrorCallback): Schema; - post(method: string, fn: HookSyncCallback): Schema; - post(method: string, fn: HookSyncCallback, errorCb: HookErrorCallback): Schema; - post(method: string, isAsync: boolean, fn: HookAsyncCallback): Schema; - post(method: string, isAsync: boolean, fn: HookAsyncCallback, errorCb: HookErrorCallback): Schema; + pre(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): Schema; + pre(method: string, isAsync: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): Schema; + post(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): Schema; + post(method: string, isAsync: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): Schema; requiredPaths(): string[]; set(key: string, value: any): void;