不要怂,就是干,撸起袖子干!

Commit e1e82ed3 by Dan Rumney Committed by Sushant

fix(typings): correct overloaded method order (#11727)

1 parent 1c49827f
Showing with 6 additions and 6 deletions
...@@ -1794,24 +1794,24 @@ export abstract class Model<T = any, T2 = any> extends Hooks { ...@@ -1794,24 +1794,24 @@ export abstract class Model<T = any, T2 = any> extends Hooks {
*/ */
public static findByPk<M extends Model>( public static findByPk<M extends Model>(
this: { new (): M } & typeof 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, identifier: Identifier,
options: Omit<NonNullFindOptions, 'where'> options: Omit<NonNullFindOptions, 'where'>
): Promise<M>; ): 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 * Search for a single instance. This applies LIMIT 1, so the listener will always be called with a single
* instance. * instance.
*/ */
public static findOne<M extends Model>(this: { new (): M } & typeof Model, options: NonNullFindOptions): Promise<M>;
public static findOne<M extends Model>( public static findOne<M extends Model>(
this: { new (): M } & typeof Model, this: { new (): M } & typeof Model,
options?: FindOptions options?: FindOptions
): Promise<M | null>; ): 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 * Run an aggregation method on the specified field
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!