@@ -19,10 +19,10 @@ type AnalyticsController = {
1919 track : ( name : string , dimensions : { [ key : string ] : string } ) => Promise < any > ;
2020} ;
2121type CloudController = {
22- run : ( name : string , data : any , options : RequestOptions ) => Promise < any > ;
23- getJobsData : ( options : RequestOptions ) => Promise < any > ;
22+ run : ( name : string , data : any , options ? : RequestOptions ) => Promise < any > ;
23+ getJobsData : ( options ? : RequestOptions ) => Promise < any > ;
2424 /** Returns promise which resolves with JobStatusId of the job */
25- startJob : ( name : string , data : any , options : RequestOptions ) => Promise < string > ;
25+ startJob : ( name : string , data : any , options ? : RequestOptions ) => Promise < string > ;
2626} ;
2727type ConfigController = {
2828 current : ( ) => Promise < ParseConfig > | ParseConfig ;
@@ -55,15 +55,15 @@ type ObjectController = {
5555 fetch : (
5656 object : ParseObject | Array < ParseObject > ,
5757 forceFetch : boolean ,
58- options : RequestOptions
58+ options ? : RequestOptions
5959 ) => Promise < Array < ParseObject | undefined > | ParseObject | undefined > ;
6060 save : (
6161 object : ParseObject | Array < ParseObject | ParseFile > | null ,
62- options : RequestOptions
62+ options ? : RequestOptions
6363 ) => Promise < ParseObject | Array < ParseObject > | ParseFile | undefined > ;
6464 destroy : (
6565 object : ParseObject | Array < ParseObject > ,
66- options : RequestOptions
66+ options ? : RequestOptions
6767 ) => Promise < ParseObject | Array < ParseObject > > ;
6868} ;
6969type ObjectStateController = {
@@ -92,18 +92,52 @@ type QueryController = {
9292 find (
9393 className : string ,
9494 params : QueryJSON ,
95- options : RequestOptions
95+ options ? : RequestOptions
9696 ) : Promise < { results ?: Array < ParseObject > ; className ?: string ; count ?: number } > ;
9797 aggregate (
9898 className : string ,
9999 params : any ,
100- options : RequestOptions
100+ options ? : RequestOptions
101101 ) : Promise < { results ?: Array < any > } > ;
102102} ;
103- type EventuallyQueue = {
104- save : ( object : ParseObject , serverOptions : SaveOptions ) => Promise < any > ;
105- destroy : ( object : ParseObject , serverOptions : RequestOptions ) => Promise < any > ;
106- poll : ( ms ?: number ) => void ;
103+ export type QueueObject = {
104+ queueId : string ;
105+ action : string ;
106+ object : ParseObject ;
107+ serverOptions : SaveOptions | RequestOptions ;
108+ id : string ;
109+ className : string ;
110+ hash : string ;
111+ createdAt : Date ;
112+ } ;
113+ export type Queue = Array < QueueObject > ;
114+ export type EventuallyQueue = {
115+ save : ( object : ParseObject , serverOptions ?: SaveOptions ) => Promise < void > ;
116+ destroy : ( object : ParseObject , serverOptions ?: RequestOptions ) => Promise < void > ;
117+ generateQueueId : ( action : string , object : ParseObject ) => string ;
118+ enqueue (
119+ action : string ,
120+ object : ParseObject ,
121+ serverOptions ?: SaveOptions | RequestOptions
122+ ) : Promise < void > ;
123+ store ( data : Queue ) : Promise < void > ;
124+ load ( ) : Promise < string | null > ;
125+ getQueue ( ) : Promise < Queue > ;
126+ setQueue ( queue : Queue ) : Promise < void > ;
127+ remove ( queueId : string ) : Promise < void > ;
128+ clear ( ) : Promise < void > ;
129+ queueItemExists ( queue : Queue , queueId : string ) : number ;
130+ length ( ) : Promise < number > ;
131+ sendQueue ( ) : Promise < boolean > ;
132+ sendQueueCallback ( object : ParseObject , queueObject : QueueObject ) : Promise < void > ;
133+ poll ( ms ?: number ) : void ;
134+ stopPoll ( ) : void ;
135+ isPolling ( ) : boolean ;
136+ process : {
137+ create ( ObjectType : any , queueObject : any ) : Promise < void > ;
138+ byId ( ObjectType : any , queueObject : any ) : Promise < void > ;
139+ byHash ( ObjectType : any , queueObject : any ) : Promise < void > ;
140+ } ;
107141} ;
108142type RESTController = {
109143 request : ( method : string , path : string , data ?: any , options ?: RequestOptions ) => Promise < any > ;
@@ -122,10 +156,10 @@ type SchemaController = {
122156 delete : ( className : string , options ?: RequestOptions ) => Promise < void > ;
123157 create : ( className : string , params : any , options ?: RequestOptions ) => Promise < any > ;
124158 update : ( className : string , params : any , options ?: RequestOptions ) => Promise < any > ;
125- send ( className : string , method : string , params : any , options : RequestOptions ) : Promise < any > ;
159+ send ( className : string , method : string , params : any , options ? : RequestOptions ) : Promise < any > ;
126160} ;
127161type SessionController = {
128- getSession : ( token : RequestOptions ) => Promise < ParseSession > ;
162+ getSession : ( options ? : RequestOptions ) => Promise < ParseSession > ;
129163} ;
130164type StorageController =
131165 | {
@@ -165,24 +199,24 @@ type UserController = {
165199 setCurrentUser : ( user : ParseUser ) => Promise < void > ;
166200 currentUser : ( ) => ParseUser | null ;
167201 currentUserAsync : ( ) => Promise < ParseUser | null > ;
168- signUp : ( user : ParseUser , attrs : AttributeMap , options : RequestOptions ) => Promise < ParseUser > ;
169- logIn : ( user : ParseUser , options : RequestOptions ) => Promise < ParseUser > ;
202+ signUp : ( user : ParseUser , attrs : AttributeMap , options ? : RequestOptions ) => Promise < ParseUser > ;
203+ logIn : ( user : ParseUser , options ? : RequestOptions ) => Promise < ParseUser > ;
170204 loginAs : ( user : ParseUser , userId : string ) => Promise < ParseUser > ;
171- become : ( user : ParseUser , options : RequestOptions ) => Promise < ParseUser > ;
205+ become : ( user : ParseUser , options ? : RequestOptions ) => Promise < ParseUser > ;
172206 hydrate : ( user : ParseUser , userJSON : AttributeMap ) => Promise < ParseUser > ;
173- logOut : ( options : RequestOptions ) => Promise < void > ;
174- me : ( user : ParseUser , options : RequestOptions ) => Promise < ParseUser > ;
175- requestPasswordReset : ( email : string , options : RequestOptions ) => Promise < void > ;
207+ logOut : ( options ? : RequestOptions ) => Promise < void > ;
208+ me : ( user : ParseUser , options ? : RequestOptions ) => Promise < ParseUser > ;
209+ requestPasswordReset : ( email : string , options ? : RequestOptions ) => Promise < void > ;
176210 updateUserOnDisk : ( user : ParseUser ) => Promise < ParseUser > ;
177- upgradeToRevocableSession : ( user : ParseUser , options : RequestOptions ) => Promise < void > ;
211+ upgradeToRevocableSession : ( user : ParseUser , options ? : RequestOptions ) => Promise < void > ;
178212 linkWith : ( user : ParseUser , authData : AuthData , options ?: FullOptions ) => Promise < ParseUser > ;
179213 removeUserFromDisk : ( ) => Promise < ParseUser | void > ;
180214 verifyPassword : (
181215 username : string ,
182216 password : string ,
183- options : RequestOptions
217+ options ? : RequestOptions
184218 ) => Promise < ParseUser > ;
185- requestEmailVerification : ( email : string , options : RequestOptions ) => Promise < void > ;
219+ requestEmailVerification : ( email : string , options ? : RequestOptions ) => Promise < void > ;
186220} ;
187221type HooksController = {
188222 get : ( type : string , functionName ?: string , triggerName ?: string ) => Promise < any > ;
0 commit comments