@@ -43,15 +43,15 @@ export abstract class Model<TModelAttributes extends {} = any, TCreationAttribut
43
43
/**
44
44
* Adds relation between specified instances and source instance
45
45
*/
46
- $add < R extends Model < R > > ( propertyKey : string , instances : R | R [ ] | string [ ] | string | number [ ] | number , options ?: AssociationActionOptions ) : Promise < unknown > {
46
+ $add < R extends Model > ( propertyKey : string , instances : R | R [ ] | string [ ] | string | number [ ] | number , options ?: AssociationActionOptions ) : Promise < unknown > {
47
47
return this [ 'add' + capitalize ( propertyKey ) ] ( instances , options ) ;
48
48
}
49
49
50
50
/**
51
51
* Sets relation between specified instances and source instance
52
52
* (replaces old relations)
53
53
*/
54
- $set < R extends Model < R > > ( propertyKey : keyof this, instances : R | R [ ] | string [ ] | string | number [ ] | number | null , options ?: AssociationActionOptions ) : Promise < unknown > {
54
+ $set < R extends Model > ( propertyKey : keyof this, instances : R | R [ ] | string [ ] | string | number [ ] | number | null , options ?: AssociationActionOptions ) : Promise < unknown > {
55
55
return this [ 'set' + capitalize ( propertyKey as string ) ] ( instances , options ) ;
56
56
}
57
57
@@ -65,28 +65,28 @@ export abstract class Model<TModelAttributes extends {} = any, TCreationAttribut
65
65
/**
66
66
* Counts related instances (specified by propertyKey) of source instance
67
67
*/
68
- $count < R extends Model < R > > ( propertyKey : string , options ?: AssociationCountOptions ) : Promise < number > {
68
+ $count < R extends Model > ( propertyKey : string , options ?: AssociationCountOptions ) : Promise < number > {
69
69
return this [ 'count' + capitalize ( propertyKey ) ] ( options ) ;
70
70
}
71
71
72
72
/**
73
73
* Creates instances and relate them to source instance
74
74
*/
75
- $create < R extends Model < R > > ( propertyKey : string , values : any , options ?: AssociationCreateOptions ) : Promise < R > {
75
+ $create < R extends Model > ( propertyKey : string , values : any , options ?: AssociationCreateOptions ) : Promise < R > {
76
76
return this [ 'create' + capitalize ( propertyKey ) ] ( values , options ) ;
77
77
}
78
78
79
79
/**
80
80
* Checks if specified instances is related to source instance
81
81
*/
82
- $has < R extends Model < R > > ( propertyKey : string , instances : R | R [ ] | string [ ] | string | number [ ] | number , options ?: AssociationGetOptions ) : Promise < boolean > {
82
+ $has < R extends Model > ( propertyKey : string , instances : R | R [ ] | string [ ] | string | number [ ] | number , options ?: AssociationGetOptions ) : Promise < boolean > {
83
83
return this [ 'has' + capitalize ( propertyKey ) ] ( instances , options ) ;
84
84
}
85
85
86
86
/**
87
87
* Removes specified instances from source instance
88
88
*/
89
- $remove < R extends Model < R > > ( propertyKey : string , instances : R | R [ ] | string [ ] | string | number [ ] | number , options ?: any ) : Promise < any > {
89
+ $remove < R extends Model > ( propertyKey : string , instances : R | R [ ] | string [ ] | string | number [ ] | number , options ?: any ) : Promise < any > {
90
90
return this [ 'remove' + capitalize ( propertyKey ) ] ( instances , options ) ;
91
91
}
92
92
0 commit comments