Skip to content

Commit

Permalink
fix(typings): correct overloaded method order (#11727)
Browse files Browse the repository at this point in the history
  • Loading branch information
dancrumb authored and sushantdhiman committed Jan 16, 2020
1 parent 1c49827 commit e1e82ed
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit e1e82ed

Please sign in to comment.