-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Hello. Maybe I don't undestand something, but if I will use ModelStatic methods find*** with options { raw: true }, I get type errors
Example:
const item = await this._model.findOne( { where: { id }, raw: true } );
item should has TModelAttributes type, however it has type Model and looks like it requires call item.get() to receive object
We can find used types is types/model.d.ts where the ReturnValue is fixed M extending Model
public static findOne<M extends Model>(
this: ModelStatic<M>,
options: NonNullFindOptions<Attributes<M>>
): Promise<M>;
It works fine for me after adding overloads like this:
public static findOne<M extends Model>(
this: ModelStatic<M>,
options: NonNullFindOptions<Attributes<M>> & { raw: true }
): Promise<Attributes<M>>;
So, please, describe, am I doing something wrong? I guess a lot of people use this repo, and a lot of them using raw, but nobody meets the same problem? 0_o
Metadata
Metadata
Assignees
Labels
No labels