1010 */
1111
1212import type { AttributeMap , ObjectCache , OpsMap , State } from './ObjectStateMutations' ;
13+ import type ParseFile from './ParseFile' ;
1314import type { FileSource } from './ParseFile' ;
1415import type { Op } from './ParseOp' ;
1516import type ParseObject from './ParseObject' ;
1617import type ParsePromise from './ParsePromise' ;
1718import type { QueryJSON } from './ParseQuery' ;
18- import type { ParseUser , AuthData } from './ParseUser' ;
19+ import type ParseUser from './ParseUser' ;
20+ import type { AuthData } from './ParseUser' ;
1921import type { PushData } from './Push' ;
2022
2123type RequestOptions = {
@@ -41,9 +43,9 @@ type InstallationController = {
4143 currentInstallationId : ( ) => ParsePromise ;
4244} ;
4345type 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 ;
4749} ;
4850type ObjectStateController = {
4951 getState : ( obj : any ) => ?State ;
@@ -62,6 +64,7 @@ type ObjectStateController = {
6264 commitServerChanges: ( obj : any , changes : AttributeMap ) => void ;
6365 enqueueTask: ( obj : any , task : ( ) => ParsePromise ) => ParsePromise ;
6466 clearAllState: ( ) => void ;
67+ duplicateState: ( source : any , dest : any ) => void ;
6568} ;
6669type PushController = {
6770 send : ( data : PushData , options : RequestOptions ) => ParsePromise ;
@@ -107,21 +110,39 @@ type UserController = {
107110 updateUserOnDisk: ( user : ParseUser ) => ParsePromise ;
108111 upgradeToRevocableSession: ( user : ParseUser , options : RequestOptions ) => ParsePromise ;
109112 linkWith: ( user : ParseUser , authData : AuthData ) => ParsePromise ;
113+ removeUserFromDisk: ( ) => ParsePromise ;
110114} ;
111115type HooksController = {
112116 get : ( type : string , functionName ? : string , triggerName ? : string ) => ParsePromise ;
113117 create: ( hook : mixed ) => ParsePromise ;
114118 delete : ( hook : mixed ) => ParsePromise ;
115119 update: ( hook : mixed ) => ParsePromise ;
116120 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+ } ;
118139
119- var config : { [ key : string ] : mixed } = {
140+ var config : Config & { [ key : string ] : mixed } = {
120141 // Defaults
121142 IS_NODE : ( typeof process !== 'undefined' &&
122143 ! ! process . versions &&
123144 ! ! process . versions . node &&
124- ! process . version . electron ) ,
145+ ! process . versions . electron ) ,
125146 REQUEST_ATTEMPT_LIMIT : 5 ,
126147 SERVER_URL : 'https://api.parse.com/1' ,
127148 LIVEQUERY_SERVER_URL : null ,
0 commit comments