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(model.d): fix findAndCountAll.count type #13736

Merged
merged 6 commits into from Dec 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions types/lib/model.d.ts
Expand Up @@ -9,6 +9,7 @@ import { Sequelize, SyncOptions } from './sequelize';
import { LOCK, Transaction } from './transaction';
import { Col, Fn, Literal, Where } from './utils';
import Op = require('./operators');
import { SetRequired } from '../type-helpers/set-required'

export interface Logging {
/**
Expand Down Expand Up @@ -1955,12 +1956,12 @@ export abstract class Model<TModelAttributes extends {} = any, TCreationAttribut
*/
public static findAndCountAll<M extends Model>(
this: ModelStatic<M>,
options?: FindAndCountOptions<M['_attributes']> & { group: GroupOption }
): Promise<{ rows: M[]; count: number[] }>;
options?: Omit<FindAndCountOptions<M['_attributes']>, 'group'>
): Promise<{ rows: M[]; count: number }>;
public static findAndCountAll<M extends Model>(
this: ModelStatic<M>,
options?: FindAndCountOptions<M['_attributes']>
): Promise<{ rows: M[]; count: number }>;
options: SetRequired<FindAndCountOptions<M['_attributes']>, 'group'>
): Promise<{ rows: M[]; count: number[] }>;

/**
* Find the maximum value of field
Expand Down