strictly typed Schema set arguments

This commit is contained in:
idan.d
2018-08-17 01:21:01 +03:00
parent 2fb17d9cb7
commit e5a5972e6f
+2 -2
View File
@@ -769,8 +769,8 @@ declare module "mongoose" {
* @param key option name
* @param value if not passed, the current option value is returned
*/
set(key: string): any;
set(key: string, value: any): this;
set<T extends keyof SchemaOptions>(key: T): SchemaOptions[T];
set<T extends keyof SchemaOptions>(key: T, value: SchemaOptions[T]): this;
/**
* Adds static "class" methods to Models compiled from this schema.