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

Fixes #11726 - correct the overloaded method order #11727

Merged
merged 2 commits into from
Jan 16, 2020
Merged
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions types/lib/model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1792,26 +1792,26 @@ export abstract class Model<T = any, T2 = any> extends Hooks {
* Search for a single instance by its primary key. This applies LIMIT 1, so the listener will
* always be called with a single instance.
*/
public static findByPk<M extends Model>(
this: { new (): M } & typeof Model,
identifier?: Identifier,
options?: Omit<FindOptions, 'where'>
): Promise<M | null>;
public static findByPk<M extends Model>(
this: { new (): M } & typeof Model,
identifier: Identifier,
options: Omit<NonNullFindOptions, 'where'>
): Promise<M>;
public static findByPk<M extends Model>(
this: { new (): M } & typeof Model,
identifier?: Identifier,
options?: Omit<FindOptions, 'where'>
): Promise<M | null>;

/**
* Search for a single instance. This applies LIMIT 1, so the listener will always be called with a single
* instance.
*/
public static findOne<M extends Model>(this: { new (): M } & typeof Model, options: NonNullFindOptions): Promise<M>;
public static findOne<M extends Model>(
this: { new (): M } & typeof Model,
options?: FindOptions
): Promise<M | null>;
public static findOne<M extends Model>(this: { new (): M } & typeof Model, options: NonNullFindOptions): Promise<M>;

/**
* Run an aggregation method on the specified field
Expand Down