diff --git a/src/schema.ts b/src/schema.ts index 1ae0e03..f6814a5 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -381,10 +381,10 @@ class QueryParser { } -class Schema { +class Schema { paths: Record> = {}; statics: Record, ...args: any[]) => any> = {}; - methods: Record, ...args: any[]) => any> = {}; + methods: Record any> = {}; hooks: { pre: { save: ((...args: any[]) => BluebirdPromise)[] @@ -600,7 +600,7 @@ class Schema { * @param {String} name * @param {Function} fn */ - method(name: string, fn: (this: Document, ...args: any[]) => any) { + method(name: string, fn: (this: T, ...args: any[]) => any) { if (!name) throw new TypeError('Method name is required!'); if (typeof fn !== 'function') {