Skip to content
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

Merged
merged 3 commits into from
Sep 26, 2022
Merged

fix: ts type definitions #352

merged 3 commits into from
Sep 26, 2022

Conversation

JimmyDaddy
Copy link
Collaborator

  • 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>];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是否考虑 sequelize 这个文件用 ts 写呀

Copy link
Collaborator Author

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];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@JimmyDaddy JimmyDaddy force-pushed the fix/ts_type_definitions_1 branch from 1d61528 to d7e7bba Compare September 26, 2022 07:20
@cyjake cyjake merged commit 6d82dc6 into master Sep 26, 2022
@cyjake cyjake deleted the fix/ts_type_definitions_1 branch September 26, 2022 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants