@@ -21,7 +21,7 @@ import GeoPoint from './ParseGeoPoint'
21
21
import Polygon from './ParsePolygon'
22
22
import Installation from './ParseInstallation'
23
23
import LocalDatastore from './LocalDatastore'
24
- import Object from './ParseObject'
24
+ import ParseObject from './ParseObject' ;
25
25
import * as Push from './Push'
26
26
import Query from './ParseQuery'
27
27
import Relation from './ParseRelation'
@@ -50,7 +50,10 @@ interface ParseType {
50
50
Parse ?: ParseType ,
51
51
Analytics : typeof Analytics ,
52
52
AnonymousUtils : typeof AnonymousUtils ,
53
- Cloud : typeof Cloud ,
53
+ Cloud : typeof Cloud & {
54
+ /** only available in server environments */
55
+ useMasterKey ?: ( ) => void
56
+ } ,
54
57
CLP : typeof CLP ,
55
58
CoreManager : typeof CoreManager ,
56
59
Config : typeof Config ,
@@ -63,7 +66,7 @@ interface ParseType {
63
66
Polygon : typeof Polygon ,
64
67
Installation : typeof Installation ,
65
68
LocalDatastore : typeof LocalDatastore ,
66
- Object : typeof Object ,
69
+ Object : typeof ParseObject ,
67
70
Op : {
68
71
Set : typeof ParseOp . SetOp ,
69
72
Unset : typeof ParseOp . UnsetOp ,
@@ -81,7 +84,7 @@ interface ParseType {
81
84
Session : typeof Session ,
82
85
Storage : typeof Storage ,
83
86
User : typeof User ,
84
- LiveQuery : ParseLiveQuery ,
87
+ LiveQuery : typeof ParseLiveQuery ,
85
88
LiveQueryClient : typeof LiveQueryClient ,
86
89
87
90
initialize ( applicationId : string , javaScriptKey : string ) : void ,
@@ -106,7 +109,7 @@ interface ParseType {
106
109
_ajax ( ...args : any [ ] ) : void ,
107
110
_decode ( ...args : any [ ] ) : void ,
108
111
_encode ( ...args : any [ ] ) : void ,
109
- _getInstallationId ?( ) : string ,
112
+ _getInstallationId ?( ) : Promise < string > ,
110
113
enableLocalDatastore ( polling : boolean , ms : number ) : void ,
111
114
isLocalDatastoreEnabled ( ) : boolean ,
112
115
dumpLocalDatastore ( ) : void ,
@@ -117,37 +120,37 @@ interface ParseType {
117
120
const Parse : ParseType = {
118
121
ACL : ACL ,
119
122
Analytics : Analytics ,
120
- AnonymousUtils : AnonymousUtils ,
123
+ AnonymousUtils : AnonymousUtils ,
121
124
Cloud : Cloud ,
122
125
CLP : CLP ,
123
- CoreManager : CoreManager ,
124
- Config : Config ,
125
- Error : ParseError ,
126
+ CoreManager : CoreManager ,
127
+ Config : Config ,
128
+ Error : ParseError ,
126
129
FacebookUtils : FacebookUtils ,
127
- File : File ,
128
- GeoPoint : GeoPoint ,
129
- Polygon : Polygon ,
130
- Installation : Installation ,
131
- LocalDatastore : LocalDatastore ,
132
- Object : Object ,
130
+ File : File ,
131
+ GeoPoint : GeoPoint ,
132
+ Polygon : Polygon ,
133
+ Installation : Installation ,
134
+ LocalDatastore : LocalDatastore ,
135
+ Object : ParseObject ,
133
136
Op : {
134
- Set : ParseOp . SetOp ,
135
- Unset : ParseOp . UnsetOp ,
136
- Increment : ParseOp . IncrementOp ,
137
- Add : ParseOp . AddOp ,
138
- Remove : ParseOp . RemoveOp ,
139
- AddUnique : ParseOp . AddUniqueOp ,
140
- Relation : ParseOp . RelationOp ,
141
- } ,
142
- Push : Push ,
143
- Query : Query ,
144
- Relation : Relation ,
145
- Role : Role ,
146
- Schema : Schema ,
147
- Session : Session ,
148
- Storage : Storage ,
149
- User : User ,
150
- LiveQueryClient : LiveQueryClient ,
137
+ Set : ParseOp . SetOp ,
138
+ Unset : ParseOp . UnsetOp ,
139
+ Increment : ParseOp . IncrementOp ,
140
+ Add : ParseOp . AddOp ,
141
+ Remove : ParseOp . RemoveOp ,
142
+ AddUnique : ParseOp . AddUniqueOp ,
143
+ Relation : ParseOp . RelationOp ,
144
+ } ,
145
+ Push : Push ,
146
+ Query : Query ,
147
+ Relation : Relation ,
148
+ Role : Role ,
149
+ Schema : Schema ,
150
+ Session : Session ,
151
+ Storage : Storage ,
152
+ User : User ,
153
+ LiveQueryClient : LiveQueryClient ,
151
154
IndexedDB : undefined ,
152
155
Hooks : undefined ,
153
156
Parse : undefined ,
@@ -181,7 +184,7 @@ const Parse: ParseType = {
181
184
/* eslint-disable no-console */
182
185
console . log (
183
186
"It looks like you're using the browser version of the SDK in a " +
184
- "node.js environment. You should require('parse/node') instead."
187
+ "node.js environment. You should require('parse/node') instead."
185
188
) ;
186
189
/* eslint-enable no-console */
187
190
}
@@ -389,7 +392,7 @@ const Parse: ParseType = {
389
392
return encode ( value , disallowObjects ) ;
390
393
} ,
391
394
392
- _getInstallationId ( ) {
395
+ _getInstallationId ( ) {
393
396
return CoreManager . getInstallationController ( ) . currentInstallationId ( ) ;
394
397
} ,
395
398
/**
@@ -418,7 +421,7 @@ const Parse: ParseType = {
418
421
* @static
419
422
* @returns {boolean }
420
423
*/
421
- isLocalDatastoreEnabled ( ) {
424
+ isLocalDatastoreEnabled ( ) {
422
425
return this . LocalDatastore . isEnabled ;
423
426
} ,
424
427
/**
@@ -446,7 +449,7 @@ const Parse: ParseType = {
446
449
*
447
450
* @static
448
451
*/
449
- enableEncryptedUser ( ) {
452
+ enableEncryptedUser ( ) {
450
453
this . encryptedUser = true ;
451
454
} ,
452
455
@@ -456,7 +459,7 @@ const Parse: ParseType = {
456
459
* @static
457
460
* @returns {boolean }
458
461
*/
459
- isEncryptedUserEnabled ( ) {
462
+ isEncryptedUserEnabled ( ) {
460
463
return this . encryptedUser ;
461
464
} ,
462
465
} ;
@@ -466,7 +469,7 @@ CoreManager.setRESTController(RESTController);
466
469
467
470
if ( process . env . PARSE_BUILD === 'node' ) {
468
471
Parse . initialize = Parse . _initialize ;
469
- Parse . Cloud = Parse . Cloud || { } ;
472
+ Parse . Cloud = Parse . Cloud || { } as any ;
470
473
Parse . Cloud . useMasterKey = function ( ) {
471
474
CoreManager . set ( 'USE_MASTER_KEY' , true ) ;
472
475
} ;
0 commit comments