@@ -10,11 +10,11 @@ declare module 'redux-orm' {
1010 meta : Meta
1111 }
1212
13- interface IResourceCommonState {
13+ interface IORMCommonState {
1414 [ index : string ] : ITableState
1515 }
1616
17- type ISession < State extends IResourceCommonState > = Session < State > & { [ P in keyof State ] : typeof Model }
17+ type ISession < State extends IORMCommonState > = Session < State > & { [ P in keyof State ] : typeof Model }
1818
1919 type IModel < Fields , Additional = { } , VirtualFields = { } > = Model < Fields , Additional , VirtualFields > & Fields & VirtualFields & Additional & IORMId
2020
@@ -47,7 +47,7 @@ declare module 'redux-orm' {
4747 [ index : string ] : any
4848 }
4949
50- export class ORM < State extends IResourceCommonState = IResourceCommonState > {
50+ export class ORM < State extends IORMCommonState = IORMCommonState > {
5151 constructor ( opts ?: IORMOpts )
5252 register ( ...model : Array < typeof Model > ) : void
5353 register < M > ( ...model : Array < M [ keyof M ] > ) : void
@@ -70,7 +70,7 @@ declare module 'redux-orm' {
7070 static readonly idAttribute : string
7171 static readonly session : ISession < any >
7272 static readonly _sessionData : any // TODO
73- static readonly query : QuerySet < any , any >
73+ static readonly query : QuerySet < any >
7474
7575 static modelName : string
7676 static fields : IModelFields
@@ -81,17 +81,17 @@ declare module 'redux-orm' {
8181 static options < T = object > ( ) : T
8282 static _getTableOpts < T = object > ( ) : T
8383 static markAccessed ( ) : void
84- static connect < State extends IResourceCommonState > ( session : Session < State > ) : void
85- static getQuerySet < T extends QuerySet < any , any > = QuerySet < any , any > > ( ) : T
84+ static connect < State extends IORMCommonState > ( session : Session < State > ) : void
85+ static getQuerySet < T extends QuerySet < any > = QuerySet < any > > ( ) : T
8686 static invalidateClassCache ( ) : void
87- static all < QueryModelType , Fields , Additional = { } , VirtualFields = { } > ( ) : QuerySet < QueryModelType , Fields , Additional , VirtualFields >
87+ static all < Fields , Additional = { } , VirtualFields = { } > ( ) : QuerySet < Fields , Additional , VirtualFields >
8888 static create < Fields , Additional = { } , VirtualFields = { } > ( props : Fields ) : IModel < Fields , Additional , VirtualFields >
8989 static upsert < Fields , Additional = { } , VirtualFields = { } > ( props : Partial < Fields > ) : IModel < Fields , Additional , VirtualFields >
9090 static withId < Fields , Additional = { } , VirtualFields = { } > ( id : string ) : IModel < Fields , Additional , VirtualFields >
9191 static hasId ( id : string ) : boolean
9292 static _findDatabaseRows ( lookupObj : object ) : any // TODO
9393 static get < Fields , Additional = { } , VirtualFields = { } > ( lookupObj : Object ) : IModel < Fields , Additional , VirtualFields >
94- static reducer < State extends IResourceCommonState > ( session : ISession < State > , action : any ) : any
94+ static reducer < State extends IORMCommonState > ( session : ISession < State > , action : any ) : any
9595
9696 readonly ref : Fields & Additional & IORMId
9797
@@ -114,31 +114,31 @@ declare module 'redux-orm' {
114114 type IQuerySetClauses = any // TODO
115115 type IQuerySetOpts = any // TODO
116116
117- class QuerySet < QueryModelType , Fields , Additional = { } , VirtualFields = { } > {
117+ class QuerySet < Fields , Additional = { } , VirtualFields = { } > {
118118 static addSharedMethod ( methodName : string ) : void
119119
120- constructor ( modelClass : QueryModelType , clauses : IQuerySetClauses , opts : IQuerySetOpts )
120+ constructor ( modelClass : typeof Model , clauses : IQuerySetClauses , opts : IQuerySetOpts )
121121
122122 toString ( ) : string
123123 toRefArray ( ) : Array < Fields & Additional & IORMId >
124- toModelArray ( ) : Array < QueryModelType >
124+ toModelArray ( ) : Array < IModel < Fields , Additional , VirtualFields > >
125125 count ( ) : number
126126 exists ( ) : boolean
127127 at ( index : string ) : IModel < Fields , Additional , VirtualFields > | undefined
128128 first ( ) : IModel < Fields , Additional , VirtualFields > | undefined
129129 last ( ) : IModel < Fields , Additional , VirtualFields > | undefined
130- all ( ) : QuerySet < QueryModelType , Fields , Additional , VirtualFields >
131- filter ( lookupObj : object ) : QuerySet < QueryModelType , Fields , Additional , VirtualFields > // TODO
132- exclude ( lookupObj : object ) : QuerySet < QueryModelType , Fields , Additional , VirtualFields > // TODO
133- orderBy ( iteratees : any , orders : any ) : QuerySet < QueryModelType , Fields , Additional , VirtualFields > // TODO
130+ all ( ) : QuerySet < Fields , Additional , VirtualFields >
131+ filter ( lookupObj : object ) : QuerySet < Fields , Additional , VirtualFields > // TODO
132+ exclude ( lookupObj : object ) : QuerySet < Fields , Additional , VirtualFields > // TODO
133+ orderBy ( iteratees : any , orders : any ) : QuerySet < Fields , Additional , VirtualFields > // TODO
134134 update ( mergeObj : Partial < Fields & Additional > ) : void
135135 delete ( ) : void
136136
137137 private _evaluate ( ) : void
138- private _new ( clauses : IQuerySetClauses , userOpts : IQuerySetOpts ) : QuerySet < QueryModelType , Fields , Additional , VirtualFields >
138+ private _new ( clauses : IQuerySetClauses , userOpts : IQuerySetOpts ) : QuerySet < Fields , Additional , VirtualFields >
139139 }
140140
141- export class Session < State extends IResourceCommonState > {
141+ export class Session < State extends IORMCommonState > {
142142 readonly accessedModels : string [ ]
143143 schema : ORM < State >
144144 db : IDB
@@ -204,11 +204,11 @@ declare module 'redux-orm' {
204204 export function oneToOne ( toModelName : string , relatedName ?: string ) : OneToOne
205205 export function oneToOne ( opts : IRelationalFieldOpts ) : OneToOne
206206
207- type IUpdater < State extends IResourceCommonState > = ( session : ISession < State > , action : any ) => any
207+ type IUpdater < State extends IORMCommonState > = ( session : ISession < State > , action : any ) => any
208208
209- export function createReducer < State extends IResourceCommonState = IResourceCommonState > ( orm : ORM < State > , updater ?: IUpdater < State > ) : State
209+ export function createReducer < State extends IORMCommonState = IORMCommonState > ( orm : ORM < State > , updater ?: IUpdater < State > ) : State
210210
211- type IORMSelector < State extends IResourceCommonState , Result = any > = ( session : ISession < State > , ...args : any [ ] ) => Result
211+ type IORMSelector < State extends IORMCommonState , Result = any > = ( session : ISession < State > , ...args : any [ ] ) => Result
212212
213- export function createSelector < State extends IResourceCommonState = IResourceCommonState , Result = any > ( orm : ORM < State > , ...args : IORMSelector < State > [ ] ) : Result
213+ export function createSelector < State extends IORMCommonState = IORMCommonState , Result = any > ( orm : ORM < State > , ...args : IORMSelector < State > [ ] ) : Result
214214}
0 commit comments