Skip to content

Commit 5682cca

Browse files
committed
Merge branch 'model-cast-bug' (#14)
Fixes #20
2 parents ea54b73 + 5ef93db commit 5682cca

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3578,7 +3578,7 @@ declare module sequelize {
35783578
* @return Model A reference to the model, with the scope(s) applied. Calling scope again on the returned
35793579
* model will clear the previous scope.
35803580
*/
3581-
scope(options?: string | Array<string> | ScopeOptions | WhereOptions): this;
3581+
scope(options?: string | Array<string> | ScopeOptions | WhereOptions): Model<TInstance, TAttributes>;
35823582

35833583
/**
35843584
* Search for multiple instances.

test/cast.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import {Model, Instance, Connection} from 'sequelize';
2+
3+
let sequelize: Connection;
4+
5+
interface Thing {
6+
id?: number;
7+
}
8+
interface ThingInstance extends Instance<ThingInstance, Thing> {
9+
id: number;
10+
}
11+
let Thing: Model<ThingInstance, Thing> = sequelize.define<ThingInstance, Thing>('thing', {});
12+
Thing = sequelize.model<ThingInstance, Thing>('thing');

test/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
],
99
"files": [
1010
"../dist/index.d.ts",
11+
"./cast.ts",
1112
"./promise.ts",
1213
"./test.ts"
1314
],

0 commit comments

Comments
 (0)