Skip to content

Commit

Permalink
refactor: refactor types
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed May 2, 2024
1 parent 85fb105 commit ce2740d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,10 @@ class QueryParser {
}


class Schema<T> {
class Schema<T = any> {
paths: Record<string, SchemaType<any>> = {};
statics: Record<string, (this: Model<T>, ...args: any[]) => any> = {};
methods: Record<string, (this: Document<T>, ...args: any[]) => any> = {};
methods: Record<string, (this: T, ...args: any[]) => any> = {};
hooks: {
pre: {
save: ((...args: any[]) => BluebirdPromise<any>)[]
Expand Down Expand Up @@ -600,7 +600,7 @@ class Schema<T> {
* @param {String} name
* @param {Function} fn
*/
method(name: string, fn: (this: Document<T>, ...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') {
Expand Down

0 comments on commit ce2740d

Please sign in to comment.