Skip to content

Commit

Permalink
fix(index.d.ts): always allow setting type in Schema to a SchemaTyp…
Browse files Browse the repository at this point in the history
…e class or a Schema instance

Fix #10030
  • Loading branch information
vkarpov15 committed Mar 19, 2021
1 parent f2651d7 commit 03905c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Expand Up @@ -1383,9 +1383,9 @@ declare module 'mongoose' {
export class SchemaTypeOptions<T> {
type?:
T extends string | number | Function ? SchemaDefinitionWithBuiltInClass<T> :
T extends Schema<any> ? T :
T extends Schema ? T :
T extends object[] ? Schema<Document<Unpacked<T>>>[] :
T;
T | typeof SchemaType | Schema;

/** Defines a virtual with the given name that gets/sets this path. */
alias?: string;
Expand Down

0 comments on commit 03905c5

Please sign in to comment.