9
9
* @flow
10
10
*/
11
11
12
- import type { AttributeMap } from './ObjectStateMutations' ;
12
+ import type { AttributeMap , ObjectCache , OpsMap , State } from './ObjectStateMutations' ;
13
13
import type { FileSource } from './ParseFile' ;
14
+ import type { Op } from './ParseOp' ;
14
15
import type ParseObject from './ParseObject' ;
15
16
import type ParsePromise from './ParsePromise' ;
16
17
import type { QueryJSON } from './ParseQuery' ;
@@ -44,21 +45,21 @@ type ObjectController = {
44
45
destroy: ( object : ParseObject , options : RequestOptions ) => ParsePromise ;
45
46
} ;
46
47
type ObjectStateController = {
47
- getState : ( obj : ParseObject ) => ?State ;
48
- initializeState: ( obj : ParseObject , initial ? : State ) => State ;
49
- removeState: ( obj : ParseObject ) => ?State ;
50
- getServerData: ( obj : ParseObject ) => AttributeMap ;
51
- setServerData: ( obj : ParseObject , attributes : AttributeMap ) => void ;
52
- getPendingOps: ( obj : ParseObject ) => Array < OpsMap > ;
53
- setPendingOp: ( obj : ParseObject , attr : string , op : ?Op ) => void ;
54
- pushPendingState: ( obj : ParseObject ) => void ;
55
- popPendingState: ( obj : ParseObject ) => OpsMap ;
56
- mergeFirstPendingState: ( obj : ParseObject ) => void ;
57
- getObjectCache: ( obj : ParseObject ) => ObjectCache ;
58
- estimateAttribute: ( obj : ParseObject , attr : string ) => mixed ;
59
- estimateAttributes: ( obj : ParseObject ) => AttributeMap ;
60
- commitServerChanges: ( obj : ParseObject , changes : AttributeMap ) => void ;
61
- enqueueTask: ( obj : ParseObject , task : ( ) => ParsePromise ) => void ;
48
+ getState : ( obj : any ) => ?State ;
49
+ initializeState: ( obj : any , initial ? : State ) => State ;
50
+ removeState: ( obj : any ) => ?State ;
51
+ getServerData: ( obj : any ) => AttributeMap ;
52
+ setServerData: ( obj : any , attributes : AttributeMap ) => void ;
53
+ getPendingOps: ( obj : any ) => Array < OpsMap > ;
54
+ setPendingOp: ( obj : any , attr : string , op : ?Op ) => void ;
55
+ pushPendingState: ( obj : any ) => void ;
56
+ popPendingState: ( obj : any ) => OpsMap ;
57
+ mergeFirstPendingState: ( obj : any ) => void ;
58
+ getObjectCache: ( obj : any ) => ObjectCache ;
59
+ estimateAttribute: ( obj : any , attr : string ) => mixed ;
60
+ estimateAttributes: ( obj : any ) => AttributeMap ;
61
+ commitServerChanges: ( obj : any , changes : AttributeMap ) => void ;
62
+ enqueueTask: ( obj : any , task : ( ) => ParsePromise ) => ParsePromise ;
62
63
clearAllState: ( ) => void ;
63
64
} ;
64
65
type PushController = {
@@ -82,6 +83,7 @@ type StorageController = {
82
83
getItemAsync ?: ( path : string ) => ParsePromise ;
83
84
setItemAsync ?: ( path : string , value : string ) => ParsePromise ;
84
85
removeItemAsync ?: ( path : string ) => ParsePromise ;
86
+ clear : ( ) => void ;
85
87
} | {
86
88
async : 1 ;
87
89
getItem ?: ( path : string ) => ?string ;
@@ -90,6 +92,7 @@ type StorageController = {
90
92
getItemAsync : ( path : string ) => ParsePromise ;
91
93
setItemAsync: ( path : string , value : string ) => ParsePromise ;
92
94
removeItemAsync: ( path : string ) => ParsePromise ;
95
+ clear: ( ) => void ;
93
96
} ;
94
97
type UserController = {
95
98
setCurrentUser : ( user : ParseUser ) => ParsePromise ;
@@ -100,6 +103,7 @@ type UserController = {
100
103
become: ( options : RequestOptions ) => ParsePromise ;
101
104
logOut: ( ) => ParsePromise ;
102
105
requestPasswordReset: ( email : string , options : RequestOptions ) => ParsePromise ;
106
+ updateUserOnDisk: ( user : ParseUser ) => ParsePromise ;
103
107
upgradeToRevocableSession: ( user : ParseUser , options : RequestOptions ) => ParsePromise ;
104
108
linkWith: ( user : ParseUser , authData : AuthData ) => ParsePromise ;
105
109
} ;
0 commit comments