parse 6.1.0-alpha.2 → 6.1.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +0 -8
  2. package/dist/parse.js +31 -49
  3. package/dist/parse.min.js +2 -2
  4. package/dist/parse.weapp.js +31 -49
  5. package/dist/parse.weapp.min.js +2 -2
  6. package/lib/browser/CoreManager.js +1 -2
  7. package/lib/browser/CryptoController.js +0 -1
  8. package/lib/browser/EventEmitter.js +0 -1
  9. package/lib/browser/EventuallyQueue.js +0 -1
  10. package/lib/browser/IndexedDBStorageController.js +0 -1
  11. package/lib/browser/InstallationController.js +0 -1
  12. package/lib/browser/LocalDatastore.js +0 -1
  13. package/lib/browser/LocalDatastoreController.default.js +0 -1
  14. package/lib/browser/LocalDatastoreController.js +0 -1
  15. package/lib/browser/LocalDatastoreController.react-native.js +0 -1
  16. package/lib/browser/OfflineQuery.js +0 -1
  17. package/lib/browser/ParseInstallation.js +0 -1
  18. package/lib/browser/ParseObject.js +2 -1
  19. package/lib/browser/ParseOp.js +1 -1
  20. package/lib/browser/ParseQuery.js +19 -17
  21. package/lib/browser/RESTController.js +4 -3
  22. package/lib/browser/Socket.weapp.js +0 -1
  23. package/lib/browser/Storage.js +0 -1
  24. package/lib/browser/StorageController.browser.js +0 -1
  25. package/lib/browser/StorageController.default.js +0 -1
  26. package/lib/browser/StorageController.js +0 -1
  27. package/lib/browser/StorageController.react-native.js +0 -1
  28. package/lib/browser/StorageController.weapp.js +0 -1
  29. package/lib/browser/TaskQueue.js +1 -1
  30. package/lib/browser/WebSocketController.js +0 -1
  31. package/lib/browser/Xhr.weapp.js +0 -1
  32. package/lib/browser/uuid.js +0 -1
  33. package/lib/node/CoreManager.js +1 -2
  34. package/lib/node/CryptoController.js +0 -1
  35. package/lib/node/EventEmitter.js +0 -1
  36. package/lib/node/EventuallyQueue.js +0 -1
  37. package/lib/node/IndexedDBStorageController.js +0 -1
  38. package/lib/node/InstallationController.js +0 -1
  39. package/lib/node/LocalDatastore.js +0 -1
  40. package/lib/node/LocalDatastoreController.default.js +0 -1
  41. package/lib/node/LocalDatastoreController.js +0 -1
  42. package/lib/node/LocalDatastoreController.react-native.js +0 -1
  43. package/lib/node/OfflineQuery.js +0 -1
  44. package/lib/node/ParseInstallation.js +0 -1
  45. package/lib/node/ParseObject.js +2 -1
  46. package/lib/node/ParseOp.js +1 -1
  47. package/lib/node/RESTController.js +0 -1
  48. package/lib/node/Socket.weapp.js +0 -1
  49. package/lib/node/Storage.js +0 -1
  50. package/lib/node/StorageController.browser.js +0 -1
  51. package/lib/node/StorageController.default.js +0 -1
  52. package/lib/node/StorageController.js +0 -1
  53. package/lib/node/StorageController.react-native.js +0 -1
  54. package/lib/node/StorageController.weapp.js +0 -1
  55. package/lib/node/TaskQueue.js +1 -1
  56. package/lib/node/WebSocketController.js +0 -1
  57. package/lib/node/Xhr.weapp.js +0 -1
  58. package/lib/node/uuid.js +0 -1
  59. package/lib/react-native/CoreManager.js +1 -2
  60. package/lib/react-native/CryptoController.js +0 -1
  61. package/lib/react-native/EventEmitter.js +0 -1
  62. package/lib/react-native/EventuallyQueue.js +0 -1
  63. package/lib/react-native/IndexedDBStorageController.js +0 -1
  64. package/lib/react-native/InstallationController.js +0 -1
  65. package/lib/react-native/LocalDatastore.js +0 -1
  66. package/lib/react-native/LocalDatastoreController.default.js +0 -1
  67. package/lib/react-native/LocalDatastoreController.js +0 -1
  68. package/lib/react-native/LocalDatastoreController.react-native.js +0 -1
  69. package/lib/react-native/ObjectStateMutations.js +13 -13
  70. package/lib/react-native/OfflineQuery.js +0 -1
  71. package/lib/react-native/ParseACL.js +7 -7
  72. package/lib/react-native/ParseCLP.js +15 -15
  73. package/lib/react-native/ParseInstallation.js +0 -1
  74. package/lib/react-native/ParseObject.js +9 -9
  75. package/lib/react-native/ParseUser.js +15 -15
  76. package/lib/react-native/RESTController.js +0 -1
  77. package/lib/react-native/Socket.weapp.js +0 -1
  78. package/lib/react-native/Storage.js +0 -1
  79. package/lib/react-native/StorageController.browser.js +0 -1
  80. package/lib/react-native/StorageController.default.js +0 -1
  81. package/lib/react-native/StorageController.js +0 -1
  82. package/lib/react-native/StorageController.react-native.js +0 -1
  83. package/lib/react-native/StorageController.weapp.js +0 -1
  84. package/lib/react-native/TaskQueue.js +0 -1
  85. package/lib/react-native/WebSocketController.js +0 -1
  86. package/lib/react-native/Xhr.weapp.js +0 -1
  87. package/lib/react-native/uuid.js +0 -1
  88. package/lib/weapp/CoreManager.js +1 -2
  89. package/lib/weapp/CryptoController.js +0 -1
  90. package/lib/weapp/EventEmitter.js +0 -1
  91. package/lib/weapp/EventuallyQueue.js +0 -1
  92. package/lib/weapp/IndexedDBStorageController.js +0 -1
  93. package/lib/weapp/InstallationController.js +0 -1
  94. package/lib/weapp/LocalDatastore.js +0 -1
  95. package/lib/weapp/LocalDatastoreController.default.js +0 -1
  96. package/lib/weapp/LocalDatastoreController.js +0 -1
  97. package/lib/weapp/LocalDatastoreController.react-native.js +0 -1
  98. package/lib/weapp/OfflineQuery.js +0 -1
  99. package/lib/weapp/ParseInstallation.js +0 -1
  100. package/lib/weapp/ParseObject.js +2 -1
  101. package/lib/weapp/ParseOp.js +1 -1
  102. package/lib/weapp/ParseQuery.js +19 -17
  103. package/lib/weapp/RESTController.js +4 -3
  104. package/lib/weapp/Socket.weapp.js +0 -1
  105. package/lib/weapp/Storage.js +0 -1
  106. package/lib/weapp/StorageController.browser.js +0 -1
  107. package/lib/weapp/StorageController.default.js +0 -1
  108. package/lib/weapp/StorageController.js +0 -1
  109. package/lib/weapp/StorageController.react-native.js +0 -1
  110. package/lib/weapp/StorageController.weapp.js +0 -1
  111. package/lib/weapp/TaskQueue.js +1 -1
  112. package/lib/weapp/WebSocketController.js +0 -1
  113. package/lib/weapp/Xhr.weapp.js +0 -1
  114. package/lib/weapp/uuid.js +0 -1
  115. package/package.json +14 -12
  116. package/types/Analytics.d.ts +40 -0
  117. package/types/AnonymousUtils.d.ts +84 -0
  118. package/types/Cloud.d.ts +65 -0
  119. package/types/CloudCode.d.ts +307 -0
  120. package/types/CoreManager.d.ts +319 -0
  121. package/types/CryptoController.d.ts +5 -0
  122. package/types/EventEmitter.d.ts +5 -0
  123. package/types/EventuallyQueue.d.ts +168 -0
  124. package/types/FacebookUtils.d.ts +107 -0
  125. package/types/IndexedDBStorageController.d.ts +2 -0
  126. package/types/InstallationController.d.ts +10 -0
  127. package/types/LiveQueryClient.d.ts +128 -0
  128. package/types/LiveQuerySubscription.d.ts +103 -0
  129. package/types/LocalDatastore.d.ts +56 -0
  130. package/types/LocalDatastoreController.d.ts +2 -0
  131. package/types/LocalDatastoreController.default.d.ts +9 -0
  132. package/types/LocalDatastoreController.react-native.d.ts +9 -0
  133. package/types/LocalDatastoreUtils.d.ts +5 -0
  134. package/types/ObjectStateMutations.d.ts +22 -0
  135. package/types/OfflineQuery.d.ts +20 -0
  136. package/types/Parse.d.ts +372 -0
  137. package/types/ParseACL.d.ts +137 -0
  138. package/types/ParseCLP.d.ts +289 -0
  139. package/types/ParseConfig.d.ts +69 -0
  140. package/types/ParseError.d.ts +476 -0
  141. package/types/ParseFile.d.ts +188 -0
  142. package/types/ParseGeoPoint.d.ts +104 -0
  143. package/types/ParseHooks.d.ts +27 -0
  144. package/types/ParseInstallation.d.ts +179 -0
  145. package/types/ParseLiveQuery.d.ts +48 -0
  146. package/types/ParseObject.d.ts +1070 -0
  147. package/types/ParseOp.d.ts +76 -0
  148. package/types/ParsePolygon.d.ts +69 -0
  149. package/types/ParseQuery.d.ts +953 -0
  150. package/types/ParseRelation.d.ts +56 -0
  151. package/types/ParseRole.d.ts +79 -0
  152. package/types/ParseSchema.d.ts +270 -0
  153. package/types/ParseSession.d.ts +45 -0
  154. package/types/ParseUser.d.ts +511 -0
  155. package/types/Push.d.ts +62 -0
  156. package/types/RESTController.d.ts +35 -0
  157. package/types/SingleInstanceStateController.d.ts +24 -0
  158. package/types/Socket.weapp.d.ts +10 -0
  159. package/types/Storage.d.ts +14 -0
  160. package/types/StorageController.browser.d.ts +9 -0
  161. package/types/StorageController.d.ts +2 -0
  162. package/types/StorageController.default.d.ts +9 -0
  163. package/types/StorageController.react-native.d.ts +11 -0
  164. package/types/StorageController.weapp.d.ts +9 -0
  165. package/types/TaskQueue.d.ts +11 -0
  166. package/types/UniqueInstanceStateController.d.ts +20 -0
  167. package/types/WebSocketController.d.ts +2 -0
  168. package/types/Xhr.weapp.d.ts +29 -0
  169. package/types/arrayContainsObject.d.ts +2 -0
  170. package/types/canBeSerialized.d.ts +2 -0
  171. package/types/decode.d.ts +1 -0
  172. package/types/encode.d.ts +1 -0
  173. package/types/equals.d.ts +1 -0
  174. package/types/escape.d.ts +1 -0
  175. package/types/eslint.config.mjs +30 -0
  176. package/types/index.d.ts +66 -0
  177. package/types/isRevocableSession.d.ts +1 -0
  178. package/types/node.d.ts +3 -0
  179. package/types/parseDate.d.ts +1 -0
  180. package/types/promiseUtils.d.ts +9 -0
  181. package/types/react-native.d.ts +3 -0
  182. package/types/tests.ts +2256 -0
  183. package/types/tsconfig.json +25 -0
  184. package/types/unique.d.ts +1 -0
  185. package/types/unsavedChildren.d.ts +11 -0
  186. package/types/uuid.d.ts +2 -0
@@ -0,0 +1,1070 @@
1
+ import ParseACL from './ParseACL';
2
+ import ParseError from './ParseError';
3
+ import ParseFile from './ParseFile';
4
+ import { Op } from './ParseOp';
5
+ import ParseRelation from './ParseRelation';
6
+ import type { AttributeMap, OpsMap } from './ObjectStateMutations';
7
+ import type { RequestOptions, FullOptions } from './RESTController';
8
+ import type ParseGeoPoint from './ParseGeoPoint';
9
+ import type ParsePolygon from './ParsePolygon';
10
+ export interface Pointer {
11
+ __type: string;
12
+ className: string;
13
+ objectId?: string;
14
+ _localId?: string;
15
+ }
16
+ interface SaveParams {
17
+ method: string;
18
+ path: string;
19
+ body: AttributeMap;
20
+ }
21
+ export type SaveOptions = FullOptions & {
22
+ cascadeSave?: boolean;
23
+ context?: AttributeMap;
24
+ batchSize?: number;
25
+ transaction?: boolean;
26
+ };
27
+ interface FetchOptions {
28
+ useMasterKey?: boolean;
29
+ sessionToken?: string;
30
+ include?: string | string[];
31
+ context?: AttributeMap;
32
+ }
33
+ export interface SetOptions {
34
+ ignoreValidation?: boolean;
35
+ unset?: boolean;
36
+ }
37
+ export type AttributeKey<T> = Extract<keyof T, string>;
38
+ export type Attributes = Record<string, any>;
39
+ interface JSONBaseAttributes {
40
+ objectId: string;
41
+ createdAt: string;
42
+ updatedAt: string;
43
+ }
44
+ interface CommonAttributes {
45
+ ACL: ParseACL;
46
+ }
47
+ type AtomicKey<T> = {
48
+ [K in keyof T]: NonNullable<T[K]> extends any[] ? K : never;
49
+ };
50
+ type Encode<T> = T extends ParseObject ? ReturnType<T['toJSON']> | Pointer : T extends ParseACL | ParseGeoPoint | ParsePolygon | ParseRelation | ParseFile ? ReturnType<T['toJSON']> : T extends Date ? {
51
+ __type: 'Date';
52
+ iso: string;
53
+ } : T extends RegExp ? string : T extends (infer R)[] ? Encode<R>[] : T extends object ? ToJSON<T> : T;
54
+ type ToJSON<T> = {
55
+ [K in keyof T]: Encode<T[K]>;
56
+ };
57
+ /**
58
+ * Creates a new model with defined attributes.
59
+ *
60
+ * <p>You won't normally call this method directly. It is recommended that
61
+ * you use a subclass of <code>Parse.Object</code> instead, created by calling
62
+ * <code>extend</code>.</p>
63
+ *
64
+ * <p>However, if you don't want to use a subclass, or aren't sure which
65
+ * subclass is appropriate, you can use this form:<pre>
66
+ * var object = new Parse.Object("ClassName");
67
+ * </pre>
68
+ * That is basically equivalent to:<pre>
69
+ * var MyClass = Parse.Object.extend("ClassName");
70
+ * var object = new MyClass();
71
+ * </pre></p>
72
+ *
73
+ * @alias Parse.Object
74
+ */
75
+ declare class ParseObject<T extends Attributes = Attributes> {
76
+ /**
77
+ * @param {string} className The class name for the object
78
+ * @param {object} attributes The initial set of data to store in the object.
79
+ * @param {object} options The options for this object instance.
80
+ * @param {boolean} [options.ignoreValidation] Set to `true` ignore any attribute validation errors.
81
+ */
82
+ constructor(className?: string | {
83
+ className: string;
84
+ [attr: string]: any;
85
+ }, attributes?: T, options?: SetOptions);
86
+ /**
87
+ * The ID of this object, unique within its class.
88
+ *
89
+ * @property {string} id
90
+ */
91
+ id?: string;
92
+ _localId?: string;
93
+ _objCount: number;
94
+ className: string;
95
+ get attributes(): T;
96
+ /**
97
+ * The first time this object was saved on the server.
98
+ *
99
+ * @property {Date} createdAt
100
+ * @returns {Date}
101
+ */
102
+ get createdAt(): Date | undefined;
103
+ /**
104
+ * The last time this object was updated on the server.
105
+ *
106
+ * @property {Date} updatedAt
107
+ * @returns {Date}
108
+ */
109
+ get updatedAt(): Date | undefined;
110
+ /**
111
+ * Returns a local or server Id used uniquely identify this object
112
+ *
113
+ * @returns {string}
114
+ */
115
+ _getId(): string;
116
+ /**
117
+ * Returns a unique identifier used to pull data from the State Controller.
118
+ *
119
+ * @returns {Parse.Object|object}
120
+ */
121
+ _getStateIdentifier(): ParseObject | {
122
+ id: string;
123
+ className: string;
124
+ };
125
+ _getServerData(): Attributes;
126
+ _clearServerData(): void;
127
+ _getPendingOps(): OpsMap[];
128
+ /**
129
+ * @param {Array<string>} [keysToClear] - if specified, only ops matching
130
+ * these fields will be cleared
131
+ */
132
+ _clearPendingOps(keysToClear?: string[]): void;
133
+ _getDirtyObjectAttributes(): Attributes;
134
+ _toFullJSON(seen?: any[], offline?: boolean): Attributes;
135
+ _getSaveJSON(): Attributes;
136
+ _getSaveParams(): SaveParams;
137
+ _finishFetch(serverData: Attributes): void;
138
+ _setExisted(existed: boolean): void;
139
+ _migrateId(serverId: string): void;
140
+ _handleSaveResponse(response: Attributes, status: number): void;
141
+ _handleSaveError(): void;
142
+ static _getClassMap(): AttributeMap;
143
+ static _getRequestOptions(options?: RequestOptions & FullOptions & {
144
+ json?: boolean;
145
+ }): RequestOptions & FullOptions & {
146
+ json?: boolean;
147
+ };
148
+ initialize(): void;
149
+ /**
150
+ * Returns a JSON version of the object suitable for saving to Parse.
151
+ *
152
+ * @param seen
153
+ * @param offline
154
+ * @returns {object}
155
+ */
156
+ toJSON(seen?: any[], offline?: boolean): ToJSON<T> & JSONBaseAttributes;
157
+ /**
158
+ * Determines whether this ParseObject is equal to another ParseObject
159
+ *
160
+ * @param {object} other - An other object ot compare
161
+ * @returns {boolean}
162
+ */
163
+ equals<T extends ParseObject>(other: T): boolean;
164
+ /**
165
+ * Returns true if this object has been modified since its last
166
+ * save/refresh. If an attribute is specified, it returns true only if that
167
+ * particular attribute has been modified since the last save/refresh.
168
+ *
169
+ * @param {string} attr An attribute name (optional).
170
+ * @returns {boolean}
171
+ */
172
+ dirty<K extends AttributeKey<T>>(attr?: K): boolean;
173
+ /**
174
+ * Returns an array of keys that have been modified since last save/refresh
175
+ *
176
+ * @returns {string[]}
177
+ */
178
+ dirtyKeys(): string[];
179
+ /**
180
+ * Returns true if the object has been fetched.
181
+ *
182
+ * @returns {boolean}
183
+ */
184
+ isDataAvailable(): boolean;
185
+ /**
186
+ * Gets a Pointer referencing this Object.
187
+ *
188
+ * @returns {Pointer}
189
+ */
190
+ toPointer(): Pointer;
191
+ /**
192
+ * Gets a Pointer referencing this Object.
193
+ *
194
+ * @returns {Pointer}
195
+ */
196
+ toOfflinePointer(): Pointer;
197
+ /**
198
+ * Gets the value of an attribute.
199
+ *
200
+ * @param {string} attr The string name of an attribute.
201
+ * @returns {*}
202
+ */
203
+ get<K extends AttributeKey<T>>(attr: K): T[K];
204
+ /**
205
+ * Gets a relation on the given class for the attribute.
206
+ *
207
+ * @param {string} attr The attribute to get the relation for.
208
+ * @returns {Parse.Relation}
209
+ */
210
+ relation<R extends ParseObject, K extends AttributeKey<T> = AttributeKey<T>>(attr: T[K] extends ParseRelation ? K : never): ParseRelation<this, R>;
211
+ /**
212
+ * Gets the HTML-escaped value of an attribute.
213
+ *
214
+ * @param {string} attr The string name of an attribute.
215
+ * @returns {string}
216
+ */
217
+ escape<K extends AttributeKey<T>>(attr: K): string;
218
+ /**
219
+ * Returns <code>true</code> if the attribute contains a value that is not
220
+ * null or undefined.
221
+ *
222
+ * @param {string} attr The string name of the attribute.
223
+ * @returns {boolean}
224
+ */
225
+ has<K extends AttributeKey<T>>(attr: K): boolean;
226
+ /**
227
+ * Sets a hash of model attributes on the object.
228
+ *
229
+ * <p>You can call it with an object containing keys and values, with one
230
+ * key and value, or dot notation. For example:<pre>
231
+ * gameTurn.set({
232
+ * player: player1,
233
+ * diceRoll: 2
234
+ * }, {
235
+ * error: function(gameTurnAgain, error) {
236
+ * // The set failed validation.
237
+ * }
238
+ * });
239
+ *
240
+ * game.set("currentPlayer", player2, {
241
+ * error: function(gameTurnAgain, error) {
242
+ * // The set failed validation.
243
+ * }
244
+ * });
245
+ *
246
+ * game.set("finished", true);</pre></p>
247
+ *
248
+ * game.set("player.score", 10);</pre></p>
249
+ *
250
+ * @param {(string|object)} key The key to set.
251
+ * @param {(string|object)} value The value to give it.
252
+ * @param {object} options A set of options for the set.
253
+ * The only supported option is <code>error</code>.
254
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
255
+ */
256
+ set<K extends AttributeKey<T>>(key: K | (Pick<T, K> | T), value?: SetOptions | (T[K] extends undefined ? never : T[K]), options?: SetOptions): this;
257
+ /**
258
+ * Remove an attribute from the model. This is a noop if the attribute doesn't
259
+ * exist.
260
+ *
261
+ * @param {string} attr The string name of an attribute.
262
+ * @param options
263
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
264
+ */
265
+ unset<K extends AttributeKey<T>>(attr: K, options?: SetOptions): this;
266
+ /**
267
+ * Atomically increments the value of the given attribute the next time the
268
+ * object is saved. If no amount is specified, 1 is used by default.
269
+ *
270
+ * @param attr {String} The key.
271
+ * @param amount {Number} The amount to increment by (optional).
272
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
273
+ */
274
+ increment<K extends AttributeKey<T>>(attr: K, amount?: number): this;
275
+ /**
276
+ * Atomically decrements the value of the given attribute the next time the
277
+ * object is saved. If no amount is specified, 1 is used by default.
278
+ *
279
+ * @param attr {String} The key.
280
+ * @param amount {Number} The amount to decrement by (optional).
281
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
282
+ */
283
+ decrement<K extends AttributeKey<T>>(attr: K, amount?: number): this;
284
+ /**
285
+ * Atomically add an object to the end of the array associated with a given
286
+ * key.
287
+ *
288
+ * @param attr {String} The key.
289
+ * @param item {} The item to add.
290
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
291
+ */
292
+ add<K extends AtomicKey<T>[keyof T]>(attr: K, item: NonNullable<T[K]>[number]): this;
293
+ /**
294
+ * Atomically add the objects to the end of the array associated with a given
295
+ * key.
296
+ *
297
+ * @param attr {String} The key.
298
+ * @param items {Object[]} The items to add.
299
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
300
+ */
301
+ addAll<K extends AtomicKey<T>[keyof T]>(attr: K, items: NonNullable<T[K]>): this;
302
+ /**
303
+ * Atomically add an object to the array associated with a given key, only
304
+ * if it is not already present in the array. The position of the insert is
305
+ * not guaranteed.
306
+ *
307
+ * @param attr {String} The key.
308
+ * @param item {} The object to add.
309
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
310
+ */
311
+ addUnique<K extends AtomicKey<T>[keyof T]>(attr: K, item: NonNullable<T[K]>[number]): this;
312
+ /**
313
+ * Atomically add the objects to the array associated with a given key, only
314
+ * if it is not already present in the array. The position of the insert is
315
+ * not guaranteed.
316
+ *
317
+ * @param attr {String} The key.
318
+ * @param items {Object[]} The objects to add.
319
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
320
+ */
321
+ addAllUnique<K extends AtomicKey<T>[keyof T]>(attr: K, items: NonNullable<T[K]>): this;
322
+ /**
323
+ * Atomically remove all instances of an object from the array associated
324
+ * with a given key.
325
+ *
326
+ * @param attr {String} The key.
327
+ * @param item {} The object to remove.
328
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
329
+ */
330
+ remove<K extends AtomicKey<T>[keyof T]>(attr: K, item: NonNullable<T[K]>[number]): this;
331
+ /**
332
+ * Atomically remove all instances of the objects from the array associated
333
+ * with a given key.
334
+ *
335
+ * @param attr {String} The key.
336
+ * @param items {Object[]} The object to remove.
337
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
338
+ */
339
+ removeAll<K extends AtomicKey<T>[keyof T]>(attr: K, items: NonNullable<T[K]>): this;
340
+ /**
341
+ * Returns an instance of a subclass of Parse.Op describing what kind of
342
+ * modification has been performed on this field since the last time it was
343
+ * saved. For example, after calling object.increment("x"), calling
344
+ * object.op("x") would return an instance of Parse.Op.Increment.
345
+ *
346
+ * @param attr {String} The key.
347
+ * @returns {Parse.Op | undefined} The operation, or undefined if none.
348
+ */
349
+ op<K extends AttributeKey<T>>(attr: K): Op | undefined;
350
+ /**
351
+ * Creates a new model with identical attributes to this one.
352
+ *
353
+ * @returns {Parse.Object}
354
+ */
355
+ clone(): any;
356
+ /**
357
+ * Creates a new instance of this object. Not to be confused with clone()
358
+ *
359
+ * @returns {Parse.Object}
360
+ */
361
+ newInstance(): this;
362
+ /**
363
+ * Returns true if this object has never been saved to Parse.
364
+ *
365
+ * @returns {boolean}
366
+ */
367
+ isNew(): boolean;
368
+ /**
369
+ * Returns true if this object was created by the Parse server when the
370
+ * object might have already been there (e.g. in the case of a Facebook
371
+ * login)
372
+ *
373
+ * @returns {boolean}
374
+ */
375
+ existed(): boolean;
376
+ /**
377
+ * Returns true if this object exists on the Server
378
+ *
379
+ * @param {object} options
380
+ * Valid options are:<ul>
381
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
382
+ * be used for this request.
383
+ * <li>sessionToken: A valid session token, used for making a request on
384
+ * behalf of a specific user.
385
+ * </ul>
386
+ * @returns {Promise<boolean>} A boolean promise that is fulfilled if object exists.
387
+ */
388
+ exists(options?: RequestOptions): Promise<boolean>;
389
+ /**
390
+ * Checks if the model is currently in a valid state.
391
+ *
392
+ * @returns {boolean}
393
+ */
394
+ isValid(): boolean;
395
+ /**
396
+ * You should not call this function directly unless you subclass
397
+ * <code>Parse.Object</code>, in which case you can override this method
398
+ * to provide additional validation on <code>set</code> and
399
+ * <code>save</code>. Your implementation should return
400
+ *
401
+ * @param {object} attrs The current data to validate.
402
+ * @returns {Parse.Error|boolean} False if the data is valid. An error object otherwise.
403
+ * @see Parse.Object#set
404
+ */
405
+ validate(attrs: Attributes): ParseError | boolean;
406
+ /**
407
+ * Returns the ACL for this object.
408
+ *
409
+ * @returns {Parse.ACL|null} An instance of Parse.ACL.
410
+ * @see Parse.Object#get
411
+ */
412
+ getACL(): ParseACL | null;
413
+ /**
414
+ * Sets the ACL to be used for this object.
415
+ *
416
+ * @param {Parse.ACL} acl An instance of Parse.ACL.
417
+ * @param {object} options
418
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
419
+ * @see Parse.Object#set
420
+ */
421
+ setACL(acl: ParseACL, options?: any): this;
422
+ /**
423
+ * Clears any (or specific) changes to this object made since the last call to save()
424
+ *
425
+ * @param {string} [keys] - specify which fields to revert
426
+ */
427
+ revert(...keys: Extract<keyof (T & CommonAttributes), string>[]): void;
428
+ /**
429
+ * Clears all attributes on a model
430
+ *
431
+ * @returns {Parse.Object} Returns the object, so you can chain this call.
432
+ */
433
+ clear(): this;
434
+ /**
435
+ * Fetch the model from the server. If the server's representation of the
436
+ * model differs from its current attributes, they will be overriden.
437
+ *
438
+ * @param {object} options
439
+ * Valid options are:<ul>
440
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
441
+ * be used for this request.
442
+ * <li>sessionToken: A valid session token, used for making a request on
443
+ * behalf of a specific user.
444
+ * <li>include: The name(s) of the key(s) to include. Can be a string, an array of strings,
445
+ * or an array of array of strings.
446
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
447
+ * </ul>
448
+ * @returns {Promise} A promise that is fulfilled when the fetch
449
+ * completes.
450
+ */
451
+ fetch(options: FetchOptions): Promise<this>;
452
+ /**
453
+ * Fetch the model from the server. If the server's representation of the
454
+ * model differs from its current attributes, they will be overriden.
455
+ *
456
+ * Includes nested Parse.Objects for the provided key. You can use dot
457
+ * notation to specify which fields in the included object are also fetched.
458
+ *
459
+ * @param {string | Array<string | Array<string>>} keys The name(s) of the key(s) to include.
460
+ * @param {object} options
461
+ * Valid options are:<ul>
462
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
463
+ * be used for this request.
464
+ * <li>sessionToken: A valid session token, used for making a request on
465
+ * behalf of a specific user.
466
+ * </ul>
467
+ * @returns {Promise} A promise that is fulfilled when the fetch
468
+ * completes.
469
+ */
470
+ fetchWithInclude(keys: string | (string | string[])[], options?: RequestOptions): Promise<this>;
471
+ /**
472
+ * Saves this object to the server at some unspecified time in the future,
473
+ * even if Parse is currently inaccessible.
474
+ *
475
+ * Use this when you may not have a solid network connection, and don't need to know when the save completes.
476
+ * If there is some problem with the object such that it can't be saved, it will be silently discarded.
477
+ *
478
+ * Objects saved with this method will be stored locally in an on-disk cache until they can be delivered to Parse.
479
+ * They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection is
480
+ * available. Objects saved this way will persist even after the app is closed, in which case they will be sent the
481
+ * next time the app is opened.
482
+ *
483
+ * @param {object} [options]
484
+ * Used to pass option parameters to method if arg1 and arg2 were both passed as strings.
485
+ * Valid options are:
486
+ * <ul>
487
+ * <li>sessionToken: A valid session token, used for making a request on
488
+ * behalf of a specific user.
489
+ * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).
490
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.
491
+ * </ul>
492
+ * @returns {Promise} A promise that is fulfilled when the save
493
+ * completes.
494
+ */
495
+ saveEventually(options?: SaveOptions): Promise<this>;
496
+ /**
497
+ * Set a hash of model attributes, and save the model to the server.
498
+ * updatedAt will be updated when the request returns.
499
+ * You can either call it as:<pre>
500
+ * object.save();</pre>
501
+ * or<pre>
502
+ * object.save(attrs);</pre>
503
+ * or<pre>
504
+ * object.save(null, options);</pre>
505
+ * or<pre>
506
+ * object.save(attrs, options);</pre>
507
+ * or<pre>
508
+ * object.save(key, value);</pre>
509
+ * or<pre>
510
+ * object.save(key, value, options);</pre>
511
+ *
512
+ * Example 1: <pre>
513
+ * gameTurn.save({
514
+ * player: "Jake Cutter",
515
+ * diceRoll: 2
516
+ * }).then(function(gameTurnAgain) {
517
+ * // The save was successful.
518
+ * }, function(error) {
519
+ * // The save failed. Error is an instance of Parse.Error.
520
+ * });</pre>
521
+ *
522
+ * Example 2: <pre>
523
+ * gameTurn.save("player", "Jake Cutter");</pre>
524
+ *
525
+ * @param {string | object | null} [arg1]
526
+ * Valid options are:<ul>
527
+ * <li>`Object` - Key/value pairs to update on the object.</li>
528
+ * <li>`String` Key - Key of attribute to update (requires arg2 to also be string)</li>
529
+ * <li>`null` - Passing null for arg1 allows you to save the object with options passed in arg2.</li>
530
+ * </ul>
531
+ * @param {string | object} [arg2]
532
+ * <ul>
533
+ * <li>`String` Value - If arg1 was passed as a key, arg2 is the value that should be set on that key.</li>
534
+ * <li>`Object` Options - Valid options are:
535
+ * <ul>
536
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
537
+ * be used for this request.
538
+ * <li>sessionToken: A valid session token, used for making a request on
539
+ * behalf of a specific user.
540
+ * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).
541
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.
542
+ * </ul>
543
+ * </li>
544
+ * </ul>
545
+ * @param {object} [arg3]
546
+ * Used to pass option parameters to method if arg1 and arg2 were both passed as strings.
547
+ * Valid options are:
548
+ * <ul>
549
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
550
+ * be used for this request.
551
+ * <li>sessionToken: A valid session token, used for making a request on
552
+ * behalf of a specific user.
553
+ * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).
554
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.
555
+ * </ul>
556
+ * @returns {Promise} A promise that is fulfilled when the save
557
+ * completes.
558
+ */
559
+ save<K extends AttributeKey<T>>(arg1?: Pick<T, K> | T | null, arg2?: SaveOptions): Promise<this>;
560
+ /**
561
+ * Deletes this object from the server at some unspecified time in the future,
562
+ * even if Parse is currently inaccessible.
563
+ *
564
+ * Use this when you may not have a solid network connection,
565
+ * and don't need to know when the delete completes. If there is some problem with the object
566
+ * such that it can't be deleted, the request will be silently discarded.
567
+ *
568
+ * Delete instructions made with this method will be stored locally in an on-disk cache until they can be transmitted
569
+ * to Parse. They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection
570
+ * is available. Delete requests will persist even after the app is closed, in which case they will be sent the
571
+ * next time the app is opened.
572
+ *
573
+ * @param {object} [options]
574
+ * Valid options are:<ul>
575
+ * <li>sessionToken: A valid session token, used for making a request on
576
+ * behalf of a specific user.
577
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers.
578
+ * </ul>
579
+ * @returns {Promise} A promise that is fulfilled when the destroy
580
+ * completes.
581
+ */
582
+ destroyEventually(options?: RequestOptions): Promise<this>;
583
+ /**
584
+ * Destroy this model on the server if it was already persisted.
585
+ *
586
+ * @param {object} options
587
+ * Valid options are:<ul>
588
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
589
+ * be used for this request.
590
+ * <li>sessionToken: A valid session token, used for making a request on
591
+ * behalf of a specific user.
592
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers.
593
+ * </ul>
594
+ * @returns {Promise} A promise that is fulfilled when the destroy
595
+ * completes.
596
+ */
597
+ destroy(options?: RequestOptions): Promise<ParseObject | undefined>;
598
+ /**
599
+ * Asynchronously stores the object and every object it points to in the local datastore,
600
+ * recursively, using a default pin name: _default.
601
+ *
602
+ * If those other objects have not been fetched from Parse, they will not be stored.
603
+ * However, if they have changed data, all the changes will be retained.
604
+ *
605
+ * <pre>
606
+ * await object.pin();
607
+ * </pre>
608
+ *
609
+ * To retrieve object:
610
+ * <code>query.fromLocalDatastore()</code> or <code>query.fromPin()</code>
611
+ *
612
+ * @returns {Promise} A promise that is fulfilled when the pin completes.
613
+ */
614
+ pin(): Promise<void>;
615
+ /**
616
+ * Asynchronously removes the object and every object it points to in the local datastore,
617
+ * recursively, using a default pin name: _default.
618
+ *
619
+ * <pre>
620
+ * await object.unPin();
621
+ * </pre>
622
+ *
623
+ * @returns {Promise} A promise that is fulfilled when the unPin completes.
624
+ */
625
+ unPin(): Promise<void>;
626
+ /**
627
+ * Asynchronously returns if the object is pinned
628
+ *
629
+ * <pre>
630
+ * const isPinned = await object.isPinned();
631
+ * </pre>
632
+ *
633
+ * @returns {Promise<boolean>} A boolean promise that is fulfilled if object is pinned.
634
+ */
635
+ isPinned(): Promise<boolean>;
636
+ /**
637
+ * Asynchronously stores the objects and every object they point to in the local datastore, recursively.
638
+ *
639
+ * If those other objects have not been fetched from Parse, they will not be stored.
640
+ * However, if they have changed data, all the changes will be retained.
641
+ *
642
+ * <pre>
643
+ * await object.pinWithName(name);
644
+ * </pre>
645
+ *
646
+ * To retrieve object:
647
+ * <code>query.fromLocalDatastore()</code> or <code>query.fromPinWithName(name)</code>
648
+ *
649
+ * @param {string} name Name of Pin.
650
+ * @returns {Promise} A promise that is fulfilled when the pin completes.
651
+ */
652
+ pinWithName(name: string): Promise<void>;
653
+ /**
654
+ * Asynchronously removes the object and every object it points to in the local datastore, recursively.
655
+ *
656
+ * <pre>
657
+ * await object.unPinWithName(name);
658
+ * </pre>
659
+ *
660
+ * @param {string} name Name of Pin.
661
+ * @returns {Promise} A promise that is fulfilled when the unPin completes.
662
+ */
663
+ unPinWithName(name: string): Promise<void>;
664
+ /**
665
+ * Asynchronously loads data from the local datastore into this object.
666
+ *
667
+ * <pre>
668
+ * await object.fetchFromLocalDatastore();
669
+ * </pre>
670
+ *
671
+ * You can create an unfetched pointer with <code>Parse.Object.createWithoutData()</code>
672
+ * and then call <code>fetchFromLocalDatastore()</code> on it.
673
+ *
674
+ * @returns {Promise} A promise that is fulfilled when the fetch completes.
675
+ */
676
+ fetchFromLocalDatastore(): Promise<ParseObject>;
677
+ static _clearAllState(): void;
678
+ /**
679
+ * Fetches the given list of Parse.Object.
680
+ * If any error is encountered, stops and calls the error handler.
681
+ *
682
+ * <pre>
683
+ * Parse.Object.fetchAll([object1, object2, ...])
684
+ * .then((list) => {
685
+ * // All the objects were fetched.
686
+ * }, (error) => {
687
+ * // An error occurred while fetching one of the objects.
688
+ * });
689
+ * </pre>
690
+ *
691
+ * @param {Array} list A list of <code>Parse.Object</code>.
692
+ * @param {object} options
693
+ * Valid options are:<ul>
694
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
695
+ * be used for this request.
696
+ * <li>sessionToken: A valid session token, used for making a request on
697
+ * behalf of a specific user.
698
+ * <li>include: The name(s) of the key(s) to include. Can be a string, an array of strings,
699
+ * or an array of array of strings.
700
+ * </ul>
701
+ * @static
702
+ * @returns {Parse.Object[]}
703
+ */
704
+ static fetchAll<T extends ParseObject>(list: T[], options?: RequestOptions): Promise<T[]>;
705
+ /**
706
+ * Fetches the given list of Parse.Object.
707
+ *
708
+ * Includes nested Parse.Objects for the provided key. You can use dot
709
+ * notation to specify which fields in the included object are also fetched.
710
+ *
711
+ * If any error is encountered, stops and calls the error handler.
712
+ *
713
+ * <pre>
714
+ * Parse.Object.fetchAllWithInclude([object1, object2, ...], [pointer1, pointer2, ...])
715
+ * .then((list) => {
716
+ * // All the objects were fetched.
717
+ * }, (error) => {
718
+ * // An error occurred while fetching one of the objects.
719
+ * });
720
+ * </pre>
721
+ *
722
+ * @param {Array} list A list of <code>Parse.Object</code>.
723
+ * @param {string | Array<string | Array<string>>} keys The name(s) of the key(s) to include.
724
+ * @param {object} options
725
+ * Valid options are:<ul>
726
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
727
+ * be used for this request.
728
+ * <li>sessionToken: A valid session token, used for making a request on
729
+ * behalf of a specific user.
730
+ * </ul>
731
+ * @static
732
+ * @returns {Parse.Object[]}
733
+ */
734
+ static fetchAllWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions): Promise<T[]>;
735
+ /**
736
+ * Fetches the given list of Parse.Object if needed.
737
+ * If any error is encountered, stops and calls the error handler.
738
+ *
739
+ * Includes nested Parse.Objects for the provided key. You can use dot
740
+ * notation to specify which fields in the included object are also fetched.
741
+ *
742
+ * If any error is encountered, stops and calls the error handler.
743
+ *
744
+ * <pre>
745
+ * Parse.Object.fetchAllIfNeededWithInclude([object1, object2, ...], [pointer1, pointer2, ...])
746
+ * .then((list) => {
747
+ * // All the objects were fetched.
748
+ * }, (error) => {
749
+ * // An error occurred while fetching one of the objects.
750
+ * });
751
+ * </pre>
752
+ *
753
+ * @param {Array} list A list of <code>Parse.Object</code>.
754
+ * @param {string | Array<string | Array<string>>} keys The name(s) of the key(s) to include.
755
+ * @param {object} options
756
+ * Valid options are:<ul>
757
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
758
+ * be used for this request.
759
+ * <li>sessionToken: A valid session token, used for making a request on
760
+ * behalf of a specific user.
761
+ * </ul>
762
+ * @static
763
+ * @returns {Parse.Object[]}
764
+ */
765
+ static fetchAllIfNeededWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions): Promise<T[]>;
766
+ /**
767
+ * Fetches the given list of Parse.Object if needed.
768
+ * If any error is encountered, stops and calls the error handler.
769
+ *
770
+ * <pre>
771
+ * Parse.Object.fetchAllIfNeeded([object1, ...])
772
+ * .then((list) => {
773
+ * // Objects were fetched and updated.
774
+ * }, (error) => {
775
+ * // An error occurred while fetching one of the objects.
776
+ * });
777
+ * </pre>
778
+ *
779
+ * @param {Array} list A list of <code>Parse.Object</code>.
780
+ * @param {object} options
781
+ * Valid options are:<ul>
782
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
783
+ * be used for this request.
784
+ * <li>sessionToken: A valid session token, used for making a request on
785
+ * behalf of a specific user.
786
+ * <li>include: The name(s) of the key(s) to include. Can be a string, an array of strings,
787
+ * or an array of array of strings.
788
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
789
+ * </ul>
790
+ * @static
791
+ * @returns {Parse.Object[]}
792
+ */
793
+ static fetchAllIfNeeded<T extends ParseObject>(list: T[], options?: FetchOptions): Promise<T[]>;
794
+ static handleIncludeOptions(options: {
795
+ include?: string | string[];
796
+ }): any[];
797
+ /**
798
+ * Destroy the given list of models on the server if it was already persisted.
799
+ *
800
+ * <p>Unlike saveAll, if an error occurs while deleting an individual model,
801
+ * this method will continue trying to delete the rest of the models if
802
+ * possible, except in the case of a fatal error like a connection error.
803
+ *
804
+ * <p>In particular, the Parse.Error object returned in the case of error may
805
+ * be one of two types:
806
+ *
807
+ * <ul>
808
+ * <li>A Parse.Error.AGGREGATE_ERROR. This object's "errors" property is an
809
+ * array of other Parse.Error objects. Each error object in this array
810
+ * has an "object" property that references the object that could not be
811
+ * deleted (for instance, because that object could not be found).</li>
812
+ * <li>A non-aggregate Parse.Error. This indicates a serious error that
813
+ * caused the delete operation to be aborted partway through (for
814
+ * instance, a connection failure in the middle of the delete).</li>
815
+ * </ul>
816
+ *
817
+ * <pre>
818
+ * Parse.Object.destroyAll([object1, object2, ...])
819
+ * .then((list) => {
820
+ * // All the objects were deleted.
821
+ * }, (error) => {
822
+ * // An error occurred while deleting one or more of the objects.
823
+ * // If this is an aggregate error, then we can inspect each error
824
+ * // object individually to determine the reason why a particular
825
+ * // object was not deleted.
826
+ * if (error.code === Parse.Error.AGGREGATE_ERROR) {
827
+ * for (var i = 0; i < error.errors.length; i++) {
828
+ * console.log("Couldn't delete " + error.errors[i].object.id +
829
+ * "due to " + error.errors[i].message);
830
+ * }
831
+ * } else {
832
+ * console.log("Delete aborted because of " + error.message);
833
+ * }
834
+ * });
835
+ * </pre>
836
+ *
837
+ * @param {Array} list A list of <code>Parse.Object</code>.
838
+ * @param {object} options
839
+ * Valid options are:<ul>
840
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
841
+ * be used for this request.
842
+ * <li>sessionToken: A valid session token, used for making a request on
843
+ * behalf of a specific user.
844
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers.
845
+ * <li>transaction: Set to true to enable transactions
846
+ * <li>batchSize: How many objects to yield in each batch (default: 20)
847
+ * </ul>
848
+ * @static
849
+ * @returns {Promise} A promise that is fulfilled when the destroyAll
850
+ * completes.
851
+ */
852
+ static destroyAll(list: ParseObject[], options?: SaveOptions): Promise<ParseObject<Attributes> | ParseObject<Attributes>[]>;
853
+ /**
854
+ * Saves the given list of Parse.Object.
855
+ * If any error is encountered, stops and calls the error handler.
856
+ *
857
+ * <pre>
858
+ * Parse.Object.saveAll([object1, object2, ...])
859
+ * .then((list) => {
860
+ * // All the objects were saved.
861
+ * }, (error) => {
862
+ * // An error occurred while saving one of the objects.
863
+ * });
864
+ * </pre>
865
+ *
866
+ * @param {Array} list A list of <code>Parse.Object</code>.
867
+ * @param {object} options
868
+ * Valid options are:
869
+ * <ul>
870
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
871
+ * be used for this request.
872
+ * <li>sessionToken: A valid session token, used for making a request on
873
+ * behalf of a specific user.
874
+ * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).
875
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.
876
+ * <li>transaction: Set to true to enable transactions
877
+ * <li>batchSize: How many objects to yield in each batch (default: 20)
878
+ * </ul>
879
+ * @static
880
+ * @returns {Parse.Object[]}
881
+ */
882
+ static saveAll<T extends ParseObject[]>(list: T, options?: SaveOptions): Promise<T>;
883
+ /**
884
+ * Creates a reference to a subclass of Parse.Object with the given id. This
885
+ * does not exist on Parse.Object, only on subclasses.
886
+ *
887
+ * <p>A shortcut for: <pre>
888
+ * var Foo = Parse.Object.extend("Foo");
889
+ * var pointerToFoo = new Foo();
890
+ * pointerToFoo.id = "myObjectId";
891
+ * </pre>
892
+ *
893
+ * @param {string} id The ID of the object to create a reference to.
894
+ * @static
895
+ * @returns {Parse.Object} A Parse.Object reference.
896
+ */
897
+ static createWithoutData(id: string): ParseObject;
898
+ /**
899
+ * Creates a new instance of a Parse Object from a JSON representation.
900
+ *
901
+ * @param {object} json The JSON map of the Object's data
902
+ * @param {boolean} override In single instance mode, all old server data
903
+ * is overwritten if this is set to true
904
+ * @param {boolean} dirty Whether the Parse.Object should set JSON keys to dirty
905
+ * @static
906
+ * @returns {Parse.Object} A Parse.Object reference
907
+ */
908
+ static fromJSON<T extends ParseObject>(json: any, override?: boolean, dirty?: boolean): T;
909
+ /**
910
+ * Registers a subclass of Parse.Object with a specific class name.
911
+ * When objects of that class are retrieved from a query, they will be
912
+ * instantiated with this subclass.
913
+ * This is only necessary when using ES6 subclassing.
914
+ *
915
+ * @param {string} className The class name of the subclass
916
+ * @param {Function} constructor The subclass
917
+ */
918
+ static registerSubclass(className: string, constructor: any): void;
919
+ /**
920
+ * Unegisters a subclass of Parse.Object with a specific class name.
921
+ *
922
+ * @param {string} className The class name of the subclass
923
+ */
924
+ static unregisterSubclass(className: string): void;
925
+ /**
926
+ * Creates a new subclass of Parse.Object for the given Parse class name.
927
+ *
928
+ * <p>Every extension of a Parse class will inherit from the most recent
929
+ * previous extension of that class. When a Parse.Object is automatically
930
+ * created by parsing JSON, it will use the most recent extension of that
931
+ * class.</p>
932
+ *
933
+ * <p>You should call either:<pre>
934
+ * var MyClass = Parse.Object.extend("MyClass", {
935
+ * <i>Instance methods</i>,
936
+ * initialize: function(attrs, options) {
937
+ * this.someInstanceProperty = [],
938
+ * <i>Other instance properties</i>
939
+ * }
940
+ * }, {
941
+ * <i>Class properties</i>
942
+ * });</pre>
943
+ * or, for Backbone compatibility:<pre>
944
+ * var MyClass = Parse.Object.extend({
945
+ * className: "MyClass",
946
+ * <i>Instance methods</i>,
947
+ * initialize: function(attrs, options) {
948
+ * this.someInstanceProperty = [],
949
+ * <i>Other instance properties</i>
950
+ * }
951
+ * }, {
952
+ * <i>Class properties</i>
953
+ * });</pre></p>
954
+ *
955
+ * @param {string} className The name of the Parse class backing this model.
956
+ * @param {object} [protoProps] Instance properties to add to instances of the
957
+ * class returned from this method.
958
+ * @param {object} [classProps] Class properties to add the class returned from
959
+ * this method.
960
+ * @returns {Parse.Object} A new subclass of Parse.Object.
961
+ */
962
+ static extend(className: any, protoProps?: any, classProps?: any): any;
963
+ /**
964
+ * Enable single instance objects, where any local objects with the same Id
965
+ * share the same attributes, and stay synchronized with each other.
966
+ * This is disabled by default in server environments, since it can lead to
967
+ * security issues.
968
+ *
969
+ * @static
970
+ */
971
+ static enableSingleInstance(): void;
972
+ /**
973
+ * Disable single instance objects, where any local objects with the same Id
974
+ * share the same attributes, and stay synchronized with each other.
975
+ * When disabled, you can have two instances of the same object in memory
976
+ * without them sharing attributes.
977
+ *
978
+ * @static
979
+ */
980
+ static disableSingleInstance(): void;
981
+ /**
982
+ * Asynchronously stores the objects and every object they point to in the local datastore,
983
+ * recursively, using a default pin name: _default.
984
+ *
985
+ * If those other objects have not been fetched from Parse, they will not be stored.
986
+ * However, if they have changed data, all the changes will be retained.
987
+ *
988
+ * <pre>
989
+ * await Parse.Object.pinAll([...]);
990
+ * </pre>
991
+ *
992
+ * To retrieve object:
993
+ * <code>query.fromLocalDatastore()</code> or <code>query.fromPin()</code>
994
+ *
995
+ * @param {Array} objects A list of <code>Parse.Object</code>.
996
+ * @returns {Promise} A promise that is fulfilled when the pin completes.
997
+ * @static
998
+ */
999
+ static pinAll(objects: ParseObject[]): Promise<void>;
1000
+ /**
1001
+ * Asynchronously stores the objects and every object they point to in the local datastore, recursively.
1002
+ *
1003
+ * If those other objects have not been fetched from Parse, they will not be stored.
1004
+ * However, if they have changed data, all the changes will be retained.
1005
+ *
1006
+ * <pre>
1007
+ * await Parse.Object.pinAllWithName(name, [obj1, obj2, ...]);
1008
+ * </pre>
1009
+ *
1010
+ * To retrieve object:
1011
+ * <code>query.fromLocalDatastore()</code> or <code>query.fromPinWithName(name)</code>
1012
+ *
1013
+ * @param {string} name Name of Pin.
1014
+ * @param {Array} objects A list of <code>Parse.Object</code>.
1015
+ * @returns {Promise} A promise that is fulfilled when the pin completes.
1016
+ * @static
1017
+ */
1018
+ static pinAllWithName(name: string, objects: ParseObject[]): Promise<void>;
1019
+ /**
1020
+ * Asynchronously removes the objects and every object they point to in the local datastore,
1021
+ * recursively, using a default pin name: _default.
1022
+ *
1023
+ * <pre>
1024
+ * await Parse.Object.unPinAll([...]);
1025
+ * </pre>
1026
+ *
1027
+ * @param {Array} objects A list of <code>Parse.Object</code>.
1028
+ * @returns {Promise} A promise that is fulfilled when the unPin completes.
1029
+ * @static
1030
+ */
1031
+ static unPinAll(objects: ParseObject[]): Promise<void>;
1032
+ /**
1033
+ * Asynchronously removes the objects and every object they point to in the local datastore, recursively.
1034
+ *
1035
+ * <pre>
1036
+ * await Parse.Object.unPinAllWithName(name, [obj1, obj2, ...]);
1037
+ * </pre>
1038
+ *
1039
+ * @param {string} name Name of Pin.
1040
+ * @param {Array} objects A list of <code>Parse.Object</code>.
1041
+ * @returns {Promise} A promise that is fulfilled when the unPin completes.
1042
+ * @static
1043
+ */
1044
+ static unPinAllWithName(name: string, objects: ParseObject[]): Promise<void>;
1045
+ /**
1046
+ * Asynchronously removes all objects in the local datastore using a default pin name: _default.
1047
+ *
1048
+ * <pre>
1049
+ * await Parse.Object.unPinAllObjects();
1050
+ * </pre>
1051
+ *
1052
+ * @returns {Promise} A promise that is fulfilled when the unPin completes.
1053
+ * @static
1054
+ */
1055
+ static unPinAllObjects(): Promise<void>;
1056
+ /**
1057
+ * Asynchronously removes all objects with the specified pin name.
1058
+ * Deletes the pin name also.
1059
+ *
1060
+ * <pre>
1061
+ * await Parse.Object.unPinAllObjectsWithName(name);
1062
+ * </pre>
1063
+ *
1064
+ * @param {string} name Name of Pin.
1065
+ * @returns {Promise} A promise that is fulfilled when the unPin completes.
1066
+ * @static
1067
+ */
1068
+ static unPinAllObjectsWithName(name: string): Promise<void>;
1069
+ }
1070
+ export default ParseObject;