10
10
*/
11
11
12
12
import type { AttributeMap , ObjectCache , OpsMap , State } from './ObjectStateMutations' ;
13
+ import type ParseFile from './ParseFile' ;
13
14
import type { FileSource } from './ParseFile' ;
14
15
import type { Op } from './ParseOp' ;
15
16
import type ParseObject from './ParseObject' ;
16
17
import type ParsePromise from './ParsePromise' ;
17
18
import type { QueryJSON } from './ParseQuery' ;
18
- import type { ParseUser , AuthData } from './ParseUser' ;
19
+ import type ParseUser from './ParseUser' ;
20
+ import type { AuthData } from './ParseUser' ;
19
21
import type { PushData } from './Push' ;
20
22
21
23
type RequestOptions = {
@@ -41,9 +43,9 @@ type InstallationController = {
41
43
currentInstallationId : ( ) => ParsePromise ;
42
44
} ;
43
45
type ObjectController = {
44
- fetch : ( object : ParseObject , forceFetch : boolean , options : RequestOptions ) => ParsePromise ;
45
- save : ( object : ParseObject , options : RequestOptions ) = > ParsePromise ;
46
- destroy: ( object : ParseObject , options : RequestOptions ) => ParsePromise ;
46
+ fetch : ( object : ParseObject | Array < ParseObject > , forceFetch : boolean , options : RequestOptions ) => ParsePromise ;
47
+ save: ( object : ParseObject | Array < ParseObject | ParseFile > , options : RequestOptions ) => ParsePromise ;
48
+ destroy: ( object : ParseObject | Array < ParseObject > , options : RequestOptions ) => ParsePromise ;
47
49
} ;
48
50
type ObjectStateController = {
49
51
getState : ( obj : any ) => ?State ;
@@ -62,6 +64,7 @@ type ObjectStateController = {
62
64
commitServerChanges: ( obj : any , changes : AttributeMap ) => void ;
63
65
enqueueTask: ( obj : any , task : ( ) => ParsePromise ) => ParsePromise ;
64
66
clearAllState: ( ) => void ;
67
+ duplicateState: ( source : any , dest : any ) => void ;
65
68
} ;
66
69
type PushController = {
67
70
send : ( data : PushData , options : RequestOptions ) => ParsePromise ;
@@ -107,21 +110,39 @@ type UserController = {
107
110
updateUserOnDisk: ( user : ParseUser ) => ParsePromise ;
108
111
upgradeToRevocableSession: ( user : ParseUser , options : RequestOptions ) => ParsePromise ;
109
112
linkWith: ( user : ParseUser , authData : AuthData ) => ParsePromise ;
113
+ removeUserFromDisk: ( ) => ParsePromise ;
110
114
} ;
111
115
type HooksController = {
112
116
get : ( type : string , functionName ? : string , triggerName ? : string ) => ParsePromise ;
113
117
create: ( hook : mixed ) => ParsePromise ;
114
118
delete : ( hook : mixed ) => ParsePromise ;
115
119
update: ( hook : mixed ) => ParsePromise ;
116
120
send: ( method : string , path : string , body ? : mixed ) => ParsePromise ;
117
- }
121
+ } ;
122
+
123
+ type Config = {
124
+ AnalyticsController ?: AnalyticsController ,
125
+ CloudController ?: CloudController ,
126
+ ConfigController ?: ConfigController ,
127
+ FileController ?: FileController ,
128
+ InstallationController ?: InstallationController ,
129
+ ObjectController ?: ObjectController ,
130
+ ObjectStateController ?: ObjectStateController ,
131
+ PushController ?: PushController ,
132
+ QueryController ?: QueryController ,
133
+ RESTController ?: RESTController ,
134
+ SessionController ?: SessionController ,
135
+ StorageController ?: StorageController ,
136
+ UserController ?: UserController ,
137
+ HooksController ?: HooksController ,
138
+ } ;
118
139
119
- var config : { [ key : string ] : mixed } = {
140
+ var config : Config & { [ key : string ] : mixed } = {
120
141
// Defaults
121
142
IS_NODE : ( typeof process !== 'undefined' &&
122
143
! ! process . versions &&
123
144
! ! process . versions . node &&
124
- ! process . version . electron ) ,
145
+ ! process . versions . electron ) ,
125
146
REQUEST_ATTEMPT_LIMIT : 5 ,
126
147
SERVER_URL : 'https://api.parse.com/1' ,
127
148
LIVEQUERY_SERVER_URL : null ,
0 commit comments