@@ -21,7 +21,7 @@ import GeoPoint from './ParseGeoPoint'
2121import Polygon from './ParsePolygon'
2222import Installation from './ParseInstallation'
2323import LocalDatastore from './LocalDatastore'
24- import Object from './ParseObject'
24+ import ParseObject from './ParseObject' ;
2525import * as Push from './Push'
2626import Query from './ParseQuery'
2727import Relation from './ParseRelation'
@@ -50,7 +50,10 @@ interface ParseType {
5050 Parse ?: ParseType ,
5151 Analytics : typeof Analytics ,
5252 AnonymousUtils : typeof AnonymousUtils ,
53- Cloud : typeof Cloud ,
53+ Cloud : typeof Cloud & {
54+ /** only available in server environments */
55+ useMasterKey ?: ( ) => void
56+ } ,
5457 CLP : typeof CLP ,
5558 CoreManager : typeof CoreManager ,
5659 Config : typeof Config ,
@@ -63,7 +66,7 @@ interface ParseType {
6366 Polygon : typeof Polygon ,
6467 Installation : typeof Installation ,
6568 LocalDatastore : typeof LocalDatastore ,
66- Object : typeof Object ,
69+ Object : typeof ParseObject ,
6770 Op : {
6871 Set : typeof ParseOp . SetOp ,
6972 Unset : typeof ParseOp . UnsetOp ,
@@ -81,7 +84,7 @@ interface ParseType {
8184 Session : typeof Session ,
8285 Storage : typeof Storage ,
8386 User : typeof User ,
84- LiveQuery : ParseLiveQuery ,
87+ LiveQuery : typeof ParseLiveQuery ,
8588 LiveQueryClient : typeof LiveQueryClient ,
8689
8790 initialize ( applicationId : string , javaScriptKey : string ) : void ,
@@ -106,7 +109,7 @@ interface ParseType {
106109 _ajax ( ...args : any [ ] ) : void ,
107110 _decode ( ...args : any [ ] ) : void ,
108111 _encode ( ...args : any [ ] ) : void ,
109- _getInstallationId ?( ) : string ,
112+ _getInstallationId ?( ) : Promise < string > ,
110113 enableLocalDatastore ( polling : boolean , ms : number ) : void ,
111114 isLocalDatastoreEnabled ( ) : boolean ,
112115 dumpLocalDatastore ( ) : void ,
@@ -117,37 +120,37 @@ interface ParseType {
117120const Parse : ParseType = {
118121 ACL : ACL ,
119122 Analytics : Analytics ,
120- AnonymousUtils : AnonymousUtils ,
123+ AnonymousUtils : AnonymousUtils ,
121124 Cloud : Cloud ,
122125 CLP : CLP ,
123- CoreManager : CoreManager ,
124- Config : Config ,
125- Error : ParseError ,
126+ CoreManager : CoreManager ,
127+ Config : Config ,
128+ Error : ParseError ,
126129 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 ,
133136 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 ,
151154 IndexedDB : undefined ,
152155 Hooks : undefined ,
153156 Parse : undefined ,
@@ -181,7 +184,7 @@ const Parse: ParseType = {
181184 /* eslint-disable no-console */
182185 console . log (
183186 "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."
185188 ) ;
186189 /* eslint-enable no-console */
187190 }
@@ -389,7 +392,7 @@ const Parse: ParseType = {
389392 return encode ( value , disallowObjects ) ;
390393 } ,
391394
392- _getInstallationId ( ) {
395+ _getInstallationId ( ) {
393396 return CoreManager . getInstallationController ( ) . currentInstallationId ( ) ;
394397 } ,
395398 /**
@@ -418,7 +421,7 @@ const Parse: ParseType = {
418421 * @static
419422 * @returns {boolean }
420423 */
421- isLocalDatastoreEnabled ( ) {
424+ isLocalDatastoreEnabled ( ) {
422425 return this . LocalDatastore . isEnabled ;
423426 } ,
424427 /**
@@ -446,7 +449,7 @@ const Parse: ParseType = {
446449 *
447450 * @static
448451 */
449- enableEncryptedUser ( ) {
452+ enableEncryptedUser ( ) {
450453 this . encryptedUser = true ;
451454 } ,
452455
@@ -456,7 +459,7 @@ const Parse: ParseType = {
456459 * @static
457460 * @returns {boolean }
458461 */
459- isEncryptedUserEnabled ( ) {
462+ isEncryptedUserEnabled ( ) {
460463 return this . encryptedUser ;
461464 } ,
462465} ;
@@ -466,7 +469,7 @@ CoreManager.setRESTController(RESTController);
466469
467470if ( process . env . PARSE_BUILD === 'node' ) {
468471 Parse . initialize = Parse . _initialize ;
469- Parse . Cloud = Parse . Cloud || { } ;
472+ Parse . Cloud = Parse . Cloud || { } as any ;
470473 Parse . Cloud . useMasterKey = function ( ) {
471474 CoreManager . set ( 'USE_MASTER_KEY' , true ) ;
472475 } ;
0 commit comments