-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ts type definitions #352
Conversation
JimmyDaddy
commented
Sep 26, 2022
- attributeWas
- QueryOptions.transaction support null
- sequelize instance.update
@@ -21,12 +21,17 @@ interface BaseSequelizeConditions<T extends typeof SequelizeBone> extends QueryO | |||
where?: WhereConditions<T>; | |||
order?: OrderOptions<T>; | |||
limit?: number; | |||
attributes?: string | Raw | Array<[keyof Extract<InstanceType<T>, Literal>] | string | Raw> | [keyof Extract<InstanceType<T>, Literal>]; | |||
attributes?: string | Raw | Array<[keyof Extract<CommonValues<InstanceType<T>>, Literal>] | string | Raw> | [keyof Extract<CommonValues<InstanceType<T>>, Literal>]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否考虑 sequelize 这个文件用 ts 写呀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
除非 bone 也用 ts 写,单独改这个用处不大,类型提示反而更难处理
@@ -249,7 +249,7 @@ export class AbstractBone { | |||
* @example | |||
* bone.attributeWas('foo') // => 1 | |||
*/ | |||
attributeWas(name: string): Literal; | |||
attributeWas<T, Key extends keyof Values<T>>(this: T, key: Key): T[Key]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
1d61528
to
d7e7bba
Compare