Skip to content

Commit ea54b73

Browse files
authored
Add FindAttributeOptions interface (#17)
1 parent bc2025c commit ea54b73

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

index.d.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,7 +2911,7 @@ declare module sequelize {
29112911
/**
29122912
* A list of attributes to select from the join model for belongsToMany relations
29132913
*/
2914-
attributes?: Array<string>;
2914+
attributes?: FindAttributeOptions;
29152915

29162916
}
29172917

@@ -2945,7 +2945,7 @@ declare module sequelize {
29452945
/**
29462946
* A list of attributes to select from the child model
29472947
*/
2948-
attributes?: Array<string>;
2948+
attributes?: FindAttributeOptions;
29492949

29502950
/**
29512951
* If true, converts to an inner join, which means that the parent model will only be loaded if it has any
@@ -2972,6 +2972,13 @@ declare module sequelize {
29722972
[Model<any, any>, Model<any, any>, string, string];
29732973
export type Order = string | fn | col | literal | OrderItem[];
29742974

2975+
export type FindAttributeOptions =
2976+
Array<string | [string | fn, string]> |
2977+
{
2978+
exclude?: Array<string>,
2979+
include?: Array<string | [string | fn, string]>
2980+
};
2981+
29752982
/**
29762983
* Options that are passed to any model creating a SELECT query
29772984
*
@@ -2989,12 +2996,7 @@ declare module sequelize {
29892996
* `Sequelize.literal`, `Sequelize.fn` and so on), and the second is the name you want the attribute to
29902997
* have in the returned instance
29912998
*/
2992-
attributes?:
2993-
Array<string | [string | fn, string]> |
2994-
{
2995-
exclude?: Array<string>,
2996-
include?: Array<string | [string | fn, string]>
2997-
};
2999+
attributes?: FindAttributeOptions;
29983000

29993001
/**
30003002
* If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will
@@ -3085,7 +3087,7 @@ declare module sequelize {
30853087
/**
30863088
* Used in conjustion with `group`
30873089
*/
3088-
attributes?: Array<string | [string, string]>;
3090+
attributes?: FindAttributeOptions;
30893091

30903092
/**
30913093
* GROUP BY in sql

0 commit comments

Comments
 (0)