Skip to content

Commit e54c185

Browse files
Merge pull request #64 from kingjerod/patch-2
Fixing findOrCreate and findCreateFind
2 parents 3e0ea5e + 9a54f22 commit e54c185

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/models/Model.d.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -327,14 +327,16 @@ export declare class Model<T> extends Hooks {
327327
* an instance of sequelize.TimeoutError will be thrown instead. If a transaction is created, a savepoint
328328
* will be created instead, and any unique constraint violation will be handled internally.
329329
*/
330-
static findOrCreate<T extends Model<T>>(options: IFindOrInitializeOptions<T>): Promise<[T, boolean]>;
331-
330+
static findOrCreate<T extends Model<T>>(options: IFindOrInitializeOptions<any>): Promise<[T, boolean]>;
331+
static findOrCreate<T extends Model<T>, A>(options: IFindOrInitializeOptions<A>): Promise<[T, boolean]>;
332+
332333
/**
333334
* A more performant findOrCreate that will not work under a transaction (at least not in postgres)
334335
* Will execute a find call, if empty then attempt to create, if unique constraint then attempt to find again
335336
*/
336-
static findCreateFind<T extends Model<T>>(options: IFindCreateFindOptions<T>): Promise<T>;
337-
337+
static findCreateFind<T extends Model<T>>(options: IFindCreateFindOptions<any>): Promise<[T, boolean]>;
338+
static findCreateFind<T extends Model<T>, A>(options: IFindCreateFindOptions<A>): Promise<[T, boolean]>;
339+
338340
/**
339341
* Insert or update a single row. An update will be executed if a row which matches the supplied values on
340342
* either the primary key or a unique key is found. Note that the unique index must be defined in your

0 commit comments

Comments
 (0)