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,953 @@
1
+ import ParseGeoPoint from './ParseGeoPoint';
2
+ import ParseObject from './ParseObject';
3
+ import type LiveQuerySubscription from './LiveQuerySubscription';
4
+ import type { FullOptions } from './RESTController';
5
+ import type { Pointer } from './ParseObject';
6
+ type BatchOptions = FullOptions & {
7
+ batchSize?: number;
8
+ useMasterKey?: boolean;
9
+ useMaintenanceKey?: boolean;
10
+ sessionToken?: string;
11
+ context?: Record<string, any>;
12
+ json?: boolean;
13
+ };
14
+ export type WhereClause = Record<string, any>;
15
+ interface QueryOptions {
16
+ useMasterKey?: boolean;
17
+ sessionToken?: string;
18
+ context?: Record<string, any>;
19
+ json?: boolean;
20
+ }
21
+ interface FullTextQueryOptions {
22
+ language?: string;
23
+ caseSensitive?: boolean;
24
+ diacriticSensitive?: boolean;
25
+ }
26
+ export interface QueryJSON {
27
+ where: WhereClause;
28
+ watch?: string;
29
+ include?: string;
30
+ excludeKeys?: string;
31
+ keys?: string;
32
+ limit?: number;
33
+ skip?: number;
34
+ order?: string;
35
+ className?: string;
36
+ count?: number;
37
+ hint?: any;
38
+ explain?: boolean;
39
+ readPreference?: string;
40
+ includeReadPreference?: string;
41
+ subqueryReadPreference?: string;
42
+ comment?: string;
43
+ }
44
+ interface BaseAttributes {
45
+ createdAt: Date;
46
+ objectId: string;
47
+ updatedAt: Date;
48
+ }
49
+ /**
50
+ * Creates a new parse Parse.Query for the given Parse.Object subclass.
51
+ *
52
+ * <p>Parse.Query defines a query that is used to fetch Parse.Objects. The
53
+ * most common use case is finding all objects that match a query through the
54
+ * <code>find</code> method. for example, this sample code fetches all objects
55
+ * of class <code>myclass</code>. it calls a different function depending on
56
+ * whether the fetch succeeded or not.
57
+ *
58
+ * <pre>
59
+ * var query = new Parse.Query(myclass);
60
+ * query.find().then((results) => {
61
+ * // results is an array of parse.object.
62
+ * }).catch((error) => {
63
+ * // error is an instance of parse.error.
64
+ * });</pre></p>
65
+ *
66
+ * <p>a Parse.Query can also be used to retrieve a single object whose id is
67
+ * known, through the get method. for example, this sample code fetches an
68
+ * object of class <code>myclass</code> and id <code>myid</code>. it calls a
69
+ * different function depending on whether the fetch succeeded or not.
70
+ *
71
+ * <pre>
72
+ * var query = new Parse.Query(myclass);
73
+ * query.get(myid).then((object) => {
74
+ * // object is an instance of parse.object.
75
+ * }).catch((error) => {
76
+ * // error is an instance of parse.error.
77
+ * });</pre></p>
78
+ *
79
+ * <p>a Parse.Query can also be used to count the number of objects that match
80
+ * the query without retrieving all of those objects. for example, this
81
+ * sample code counts the number of objects of the class <code>myclass</code>
82
+ * <pre>
83
+ * var query = new Parse.Query(myclass);
84
+ * query.count().then((number) => {
85
+ * // there are number instances of myclass.
86
+ * }).catch((error) => {
87
+ * // error is an instance of Parse.Error.
88
+ * });</pre></p>
89
+ *
90
+ * @alias Parse.Query
91
+ */
92
+ declare class ParseQuery<T extends ParseObject = ParseObject> {
93
+ /**
94
+ * @property {string} className
95
+ */
96
+ className: string;
97
+ _where: any;
98
+ _watch: string[];
99
+ _include: string[];
100
+ _exclude: string[];
101
+ _select: string[];
102
+ _limit: number;
103
+ _skip: number;
104
+ _count: boolean;
105
+ _order: string[];
106
+ _readPreference: string | null;
107
+ _includeReadPreference: string | null;
108
+ _subqueryReadPreference: string | null;
109
+ _queriesLocalDatastore: boolean;
110
+ _localDatastorePinName: any;
111
+ _extraOptions: Record<string, any>;
112
+ _hint: any;
113
+ _explain: boolean;
114
+ _xhrRequest: any;
115
+ _comment: string;
116
+ /**
117
+ * @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string.
118
+ */
119
+ constructor(objectClass: string | (new (...args: any[]) => T | ParseObject));
120
+ /**
121
+ * Adds constraint that at least one of the passed in queries matches.
122
+ *
123
+ * @param {Array} queries
124
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
125
+ */
126
+ _orQuery(queries: ParseQuery[]): this;
127
+ /**
128
+ * Adds constraint that all of the passed in queries match.
129
+ *
130
+ * @param {Array} queries
131
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
132
+ */
133
+ _andQuery(queries: ParseQuery[]): this;
134
+ /**
135
+ * Adds constraint that none of the passed in queries match.
136
+ *
137
+ * @param {Array} queries
138
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
139
+ */
140
+ _norQuery(queries: ParseQuery[]): this;
141
+ /**
142
+ * Helper for condition queries
143
+ *
144
+ * @param key
145
+ * @param condition
146
+ * @param value
147
+ * @returns {Parse.Query}
148
+ */
149
+ _addCondition<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, condition: string, value: any): this;
150
+ /**
151
+ * Converts string for regular expression at the beginning
152
+ *
153
+ * @param string
154
+ * @returns {string}
155
+ */
156
+ _regexStartWith(string: string): string;
157
+ _handleOfflineQuery(params: QueryJSON): Promise<any>;
158
+ /**
159
+ * Returns a JSON representation of this query.
160
+ *
161
+ * @returns {object} The JSON representation of the query.
162
+ */
163
+ toJSON(): QueryJSON;
164
+ /**
165
+ * Return a query with conditions from json, can be useful to send query from server side to client
166
+ * Not static, all query conditions was set before calling this method will be deleted.
167
+ * For example on the server side we have
168
+ * var query = new Parse.Query("className");
169
+ * query.equalTo(key: value);
170
+ * query.limit(100);
171
+ * ... (others queries)
172
+ * Create JSON representation of Query Object
173
+ * var jsonFromServer = query.fromJSON();
174
+ *
175
+ * On client side getting query:
176
+ * var query = new Parse.Query("className");
177
+ * query.fromJSON(jsonFromServer);
178
+ *
179
+ * and continue to query...
180
+ * query.skip(100).find().then(...);
181
+ *
182
+ * @param {QueryJSON} json from Parse.Query.toJSON() method
183
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
184
+ */
185
+ withJSON(json: QueryJSON): this;
186
+ /**
187
+ * Static method to restore Parse.Query by json representation
188
+ * Internally calling Parse.Query.withJSON
189
+ *
190
+ * @param {string} className
191
+ * @param {QueryJSON} json from Parse.Query.toJSON() method
192
+ * @returns {Parse.Query} new created query
193
+ */
194
+ static fromJSON(className: string, json: QueryJSON): ParseQuery;
195
+ /**
196
+ * Constructs a Parse.Object whose id is already known by fetching data from
197
+ * the server. Unlike the <code>first</code> method, it never returns undefined.
198
+ *
199
+ * @param {string} objectId The id of the object to be fetched.
200
+ * @param {object} options
201
+ * Valid options are:<ul>
202
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
203
+ * be used for this request.
204
+ * <li>sessionToken: A valid session token, used for making a request on
205
+ * behalf of a specific user.
206
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
207
+ * <li>json: Return raw json without converting to Parse.Object
208
+ * </ul>
209
+ * @returns {Promise} A promise that is resolved with the result when
210
+ * the query completes.
211
+ */
212
+ get(objectId: string, options?: QueryOptions): Promise<T>;
213
+ /**
214
+ * Retrieves a list of ParseObjects that satisfy this query.
215
+ *
216
+ * @param {object} options Valid options
217
+ * are:<ul>
218
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
219
+ * be used for this request.
220
+ * <li>sessionToken: A valid session token, used for making a request on
221
+ * behalf of a specific user.
222
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
223
+ * <li>json: Return raw json without converting to Parse.Object
224
+ * </ul>
225
+ * @returns {Promise} A promise that is resolved with the results when
226
+ * the query completes.
227
+ */
228
+ find(options?: QueryOptions): Promise<T[]>;
229
+ /**
230
+ * Retrieves a complete list of ParseObjects that satisfy this query.
231
+ * Using `eachBatch` under the hood to fetch all the valid objects.
232
+ *
233
+ * @param {object} options Valid options are:<ul>
234
+ * <li>batchSize: How many objects to yield in each batch (default: 100)
235
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
236
+ * be used for this request.
237
+ * <li>sessionToken: A valid session token, used for making a request on
238
+ * behalf of a specific user.
239
+ * <li>json: Return raw JSON without converting to Parse.Object.
240
+ * </ul>
241
+ * @returns {Promise} A promise that is resolved with the results when
242
+ * the query completes.
243
+ */
244
+ findAll(options?: BatchOptions): Promise<T[]>;
245
+ /**
246
+ * Counts the number of objects that match this query.
247
+ *
248
+ * @param {object} options
249
+ * @param {boolean} [options.useMasterKey]
250
+ * @param {string} [options.sessionToken]
251
+ * Valid options are:<ul>
252
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
253
+ * be used for this request.
254
+ * <li>sessionToken: A valid session token, used for making a request on
255
+ * behalf of a specific user.
256
+ * </ul>
257
+ * @returns {Promise} A promise that is resolved with the count when
258
+ * the query completes.
259
+ */
260
+ count(options?: {
261
+ useMasterKey?: boolean;
262
+ sessionToken?: string;
263
+ }): Promise<number>;
264
+ /**
265
+ * Executes a distinct query and returns unique values
266
+ *
267
+ * @param {string} key A field to find distinct values
268
+ * @param {object} options
269
+ * @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
270
+ * @returns {Promise} A promise that is resolved with the query completes.
271
+ */
272
+ distinct<K extends keyof T['attributes'], V = T['attributes'][K]>(key: K, options?: {
273
+ sessionToken?: string;
274
+ }): Promise<V[]>;
275
+ /**
276
+ * Executes an aggregate query and returns aggregate results
277
+ *
278
+ * @param {(Array|object)} pipeline Array or Object of stages to process query
279
+ * @param {object} options
280
+ * @param {string} [options.sessionToken] A valid session token, used for making a request on behalf of a specific user.
281
+ * @returns {Promise} A promise that is resolved with the query completes.
282
+ */
283
+ aggregate(pipeline: any, options?: {
284
+ sessionToken?: string;
285
+ }): Promise<any[]>;
286
+ /**
287
+ * Retrieves at most one Parse.Object that satisfies this query.
288
+ *
289
+ * Returns the object if there is one, otherwise undefined.
290
+ *
291
+ * @param {object} options Valid options are:<ul>
292
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
293
+ * be used for this request.
294
+ * <li>sessionToken: A valid session token, used for making a request on
295
+ * behalf of a specific user.
296
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
297
+ * <li>json: Return raw json without converting to Parse.Object
298
+ * </ul>
299
+ * @returns {Promise} A promise that is resolved with the object when
300
+ * the query completes.
301
+ */
302
+ first(options?: QueryOptions): Promise<T | undefined>;
303
+ /**
304
+ * Iterates over objects matching a query, calling a callback for each batch.
305
+ * If the callback returns a promise, the iteration will not continue until
306
+ * that promise has been fulfilled. If the callback returns a rejected
307
+ * promise, then iteration will stop with that error. The items are processed
308
+ * in an unspecified order. The query may not have any sort order, and may
309
+ * not use limit or skip.
310
+ *
311
+ * @param {Function} callback Callback that will be called with each result
312
+ * of the query.
313
+ * @param {object} options Valid options are:<ul>
314
+ * <li>batchSize: How many objects to yield in each batch (default: 100)
315
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
316
+ * be used for this request.
317
+ * <li>sessionToken: A valid session token, used for making a request on
318
+ * behalf of a specific user.
319
+ * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
320
+ * </ul>
321
+ * @returns {Promise} A promise that will be fulfilled once the
322
+ * iteration has completed.
323
+ */
324
+ eachBatch(callback: (objs: T[]) => PromiseLike<void> | void, options?: BatchOptions): Promise<void>;
325
+ /**
326
+ * Iterates over each result of a query, calling a callback for each one. If
327
+ * the callback returns a promise, the iteration will not continue until
328
+ * that promise has been fulfilled. If the callback returns a rejected
329
+ * promise, then iteration will stop with that error. The items are
330
+ * processed in an unspecified order. The query may not have any sort order,
331
+ * and may not use limit or skip.
332
+ *
333
+ * @param {Function} callback Callback that will be called with each result
334
+ * of the query.
335
+ * @param {object} options Valid options are:<ul>
336
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
337
+ * be used for this request.
338
+ * <li>sessionToken: A valid session token, used for making a request on
339
+ * behalf of a specific user.
340
+ * <li>json: Return raw json without converting to Parse.Object
341
+ * </ul>
342
+ * @returns {Promise} A promise that will be fulfilled once the
343
+ * iteration has completed.
344
+ */
345
+ each(callback: (obj: T) => PromiseLike<void> | void, options?: BatchOptions): Promise<void>;
346
+ /**
347
+ * Adds a hint to force index selection. (https://docs.mongodb.com/manual/reference/operator/meta/hint/)
348
+ *
349
+ * @param {(string|object)} value String or Object of index that should be used when executing query
350
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
351
+ */
352
+ hint(value: any): this;
353
+ /**
354
+ * Investigates the query execution plan. Useful for optimizing queries. (https://docs.mongodb.com/manual/reference/operator/meta/explain/)
355
+ *
356
+ * @param {boolean} explain Used to toggle the information on the query plan.
357
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
358
+ */
359
+ explain(explain?: boolean): this;
360
+ /**
361
+ * Iterates over each result of a query, calling a callback for each one. If
362
+ * the callback returns a promise, the iteration will not continue until
363
+ * that promise has been fulfilled. If the callback returns a rejected
364
+ * promise, then iteration will stop with that error. The items are
365
+ * processed in an unspecified order. The query may not have any sort order,
366
+ * and may not use limit or skip.
367
+ *
368
+ * @param {Function} callback Callback <ul>
369
+ * <li>currentObject: The current Parse.Object being processed in the array.</li>
370
+ * <li>index: The index of the current Parse.Object being processed in the array.</li>
371
+ * <li>query: The query map was called upon.</li>
372
+ * </ul>
373
+ * @param {object} options Valid options are:<ul>
374
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
375
+ * be used for this request.
376
+ * <li>sessionToken: A valid session token, used for making a request on
377
+ * behalf of a specific user.
378
+ * </ul>
379
+ * @returns {Promise} A promise that will be fulfilled once the
380
+ * iteration has completed.
381
+ */
382
+ map(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => any, options?: BatchOptions): Promise<any[]>;
383
+ /**
384
+ * Iterates over each result of a query, calling a callback for each one. If
385
+ * the callback returns a promise, the iteration will not continue until
386
+ * that promise has been fulfilled. If the callback returns a rejected
387
+ * promise, then iteration will stop with that error. The items are
388
+ * processed in an unspecified order. The query may not have any sort order,
389
+ * and may not use limit or skip.
390
+ *
391
+ * @param {Function} callback Callback <ul>
392
+ * <li>accumulator: The accumulator accumulates the callback's return values. It is the accumulated value previously returned in the last invocation of the callback.</li>
393
+ * <li>currentObject: The current Parse.Object being processed in the array.</li>
394
+ * <li>index: The index of the current Parse.Object being processed in the array.</li>
395
+ * </ul>
396
+ * @param {*} initialValue A value to use as the first argument to the first call of the callback. If no initialValue is supplied, the first object in the query will be used and skipped.
397
+ * @param {object} options Valid options are:<ul>
398
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
399
+ * be used for this request.
400
+ * <li>sessionToken: A valid session token, used for making a request on
401
+ * behalf of a specific user.
402
+ * </ul>
403
+ * @returns {Promise} A promise that will be fulfilled once the
404
+ * iteration has completed.
405
+ */
406
+ reduce(callback: (accumulator: any, currentObject: ParseObject, index: number) => any, initialValue: any, options?: BatchOptions): Promise<any[]>;
407
+ /**
408
+ * Iterates over each result of a query, calling a callback for each one. If
409
+ * the callback returns a promise, the iteration will not continue until
410
+ * that promise has been fulfilled. If the callback returns a rejected
411
+ * promise, then iteration will stop with that error. The items are
412
+ * processed in an unspecified order. The query may not have any sort order,
413
+ * and may not use limit or skip.
414
+ *
415
+ * @param {Function} callback Callback <ul>
416
+ * <li>currentObject: The current Parse.Object being processed in the array.</li>
417
+ * <li>index: The index of the current Parse.Object being processed in the array.</li>
418
+ * <li>query: The query filter was called upon.</li>
419
+ * </ul>
420
+ * @param {object} options Valid options are:<ul>
421
+ * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
422
+ * be used for this request.
423
+ * <li>sessionToken: A valid session token, used for making a request on
424
+ * behalf of a specific user.
425
+ * </ul>
426
+ * @returns {Promise} A promise that will be fulfilled once the
427
+ * iteration has completed.
428
+ */
429
+ filter(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean, options?: BatchOptions): Promise<ParseObject[]>;
430
+ /**
431
+ * Adds a constraint to the query that requires a particular key's value to
432
+ * be equal to the provided value.
433
+ *
434
+ * @param {string} key The key to check.
435
+ * @param value The value that the Parse.Object must contain.
436
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
437
+ */
438
+ equalTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends (infer E)[] ? E : never)): this;
439
+ /**
440
+ * Adds a constraint to the query that requires a particular key's value to
441
+ * be not equal to the provided value.
442
+ *
443
+ * @param {string} key The key to check.
444
+ * @param value The value that must not be equalled.
445
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
446
+ */
447
+ notEqualTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends (infer E)[] ? E : never)): this;
448
+ /**
449
+ * Adds a constraint to the query that requires a particular key's value to
450
+ * be less than the provided value.
451
+ *
452
+ * @param {string} key The key to check.
453
+ * @param value The value that provides an upper bound.
454
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
455
+ */
456
+ lessThan<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K]): this;
457
+ /**
458
+ * Adds a constraint to the query that requires a particular key's value to
459
+ * be greater than the provided value.
460
+ *
461
+ * @param {string} key The key to check.
462
+ * @param value The value that provides an lower bound.
463
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
464
+ */
465
+ greaterThan<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K]): this;
466
+ /**
467
+ * Adds a constraint to the query that requires a particular key's value to
468
+ * be less than or equal to the provided value.
469
+ *
470
+ * @param {string} key The key to check.
471
+ * @param value The value that provides an upper bound.
472
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
473
+ */
474
+ lessThanOrEqualTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K]): this;
475
+ /**
476
+ * Adds a constraint to the query that requires a particular key's value to
477
+ * be greater than or equal to the provided value.
478
+ *
479
+ * @param {string} key The key to check.
480
+ * @param {*} value The value that provides an lower bound.
481
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
482
+ */
483
+ greaterThanOrEqualTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K]): this;
484
+ /**
485
+ * Adds a constraint to the query that requires a particular key's value to
486
+ * be contained in the provided list of values.
487
+ *
488
+ * @param {string} key The key to check.
489
+ * @param {Array<*>} values The values that will match.
490
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
491
+ */
492
+ containedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[]): this;
493
+ /**
494
+ * Adds a constraint to the query that requires a particular key's value to
495
+ * not be contained in the provided list of values.
496
+ *
497
+ * @param {string} key The key to check.
498
+ * @param {Array<*>} values The values that will not match.
499
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
500
+ */
501
+ notContainedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: T['attributes'][K][]): this;
502
+ /**
503
+ * Adds a constraint to the query that requires a particular key's value to
504
+ * be contained by the provided list of values. Get objects where all array elements match.
505
+ *
506
+ * @param {string} key The key to check.
507
+ * @param {Array} values The values that will match.
508
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
509
+ */
510
+ containedBy<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[]): this;
511
+ /**
512
+ * Adds a constraint to the query that requires a particular key's value to
513
+ * contain each one of the provided list of values.
514
+ *
515
+ * @param {string} key The key to check. This key's value must be an array.
516
+ * @param {Array} values The values that will match.
517
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
518
+ */
519
+ containsAll<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: any[]): this;
520
+ /**
521
+ * Adds a constraint to the query that requires a particular key's value to
522
+ * contain each one of the provided list of values starting with given strings.
523
+ *
524
+ * @param {string} key The key to check. This key's value must be an array.
525
+ * @param {Array<string>} values The string values that will match as starting string.
526
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
527
+ */
528
+ containsAllStartingWith<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: any[]): this;
529
+ /**
530
+ * Adds a constraint for finding objects that contain the given key.
531
+ *
532
+ * @param {string} key The key that should exist.
533
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
534
+ */
535
+ exists<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K): this;
536
+ /**
537
+ * Adds a constraint for finding objects that do not contain a given key.
538
+ *
539
+ * @param {string} key The key that should not exist
540
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
541
+ */
542
+ doesNotExist<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K): this;
543
+ /**
544
+ * Adds a regular expression constraint for finding string values that match
545
+ * the provided regular expression.
546
+ * This may be slow for large datasets.
547
+ *
548
+ * @param {string} key The key that the string to match is stored in.
549
+ * @param {RegExp | string} regex The regular expression pattern to match.
550
+ * @param {string} modifiers The regular expression mode.
551
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
552
+ */
553
+ matches<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, regex: RegExp | string, modifiers?: string): this;
554
+ /**
555
+ * Adds a constraint that requires that a key's value matches a Parse.Query
556
+ * constraint.
557
+ *
558
+ * @param {string} key The key that the contains the object to match the
559
+ * query.
560
+ * @param {Parse.Query} query The query that should match.
561
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
562
+ */
563
+ matchesQuery<U extends ParseObject, K extends keyof T['attributes']>(key: K, query: ParseQuery<U>): this;
564
+ /**
565
+ * Adds a constraint that requires that a key's value not matches a
566
+ * Parse.Query constraint.
567
+ *
568
+ * @param {string} key The key that the contains the object to match the
569
+ * query.
570
+ * @param {Parse.Query} query The query that should not match.
571
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
572
+ */
573
+ doesNotMatchQuery<U extends ParseObject, K extends keyof T['attributes']>(key: K, query: ParseQuery<U>): this;
574
+ /**
575
+ * Adds a constraint that requires that a key's value matches a value in
576
+ * an object returned by a different Parse.Query.
577
+ *
578
+ * @param {string} key The key that contains the value that is being
579
+ * matched.
580
+ * @param {string} queryKey The key in the objects returned by the query to
581
+ * match against.
582
+ * @param {Parse.Query} query The query to run.
583
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
584
+ */
585
+ matchesKeyInQuery<U extends ParseObject, K extends keyof T['attributes'], X extends Extract<keyof U['attributes'], string>>(key: K, queryKey: X, query: ParseQuery<U>): this;
586
+ /**
587
+ * Adds a constraint that requires that a key's value not match a value in
588
+ * an object returned by a different Parse.Query.
589
+ *
590
+ * @param {string} key The key that contains the value that is being
591
+ * excluded.
592
+ * @param {string} queryKey The key in the objects returned by the query to
593
+ * match against.
594
+ * @param {Parse.Query} query The query to run.
595
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
596
+ */
597
+ doesNotMatchKeyInQuery<U extends ParseObject, K extends keyof T['attributes'] | keyof BaseAttributes, X extends Extract<keyof U['attributes'], string>>(key: K, queryKey: X, query: ParseQuery<U>): this;
598
+ /**
599
+ * Adds a constraint for finding string values that contain a provided
600
+ * string. This may be slow for large datasets.
601
+ *
602
+ * @param {string} key The key that the string to match is stored in.
603
+ * @param {string} substring The substring that the value must contain.
604
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
605
+ */
606
+ contains<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, substring: string): this;
607
+ /**
608
+ * Adds a constraint for finding string values that contain a provided
609
+ * string. This may be slow for large datasets. Requires Parse-Server > 2.5.0
610
+ *
611
+ * In order to sort you must use select and ascending ($score is required)
612
+ * <pre>
613
+ * query.fullText('field', 'term');
614
+ * query.ascending('$score');
615
+ * query.select('$score');
616
+ * </pre>
617
+ *
618
+ * To retrieve the weight / rank
619
+ * <pre>
620
+ * object->get('score');
621
+ * </pre>
622
+ *
623
+ * You can define optionals by providing an object as a third parameter
624
+ * <pre>
625
+ * query.fullText('field', 'term', { language: 'es', diacriticSensitive: true });
626
+ * </pre>
627
+ *
628
+ * @param {string} key The key that the string to match is stored in.
629
+ * @param {string} value The string to search
630
+ * @param {object} options (Optional)
631
+ * @param {string} options.language The language that determines the list of stop words for the search and the rules for the stemmer and tokenizer.
632
+ * @param {boolean} options.caseSensitive A boolean flag to enable or disable case sensitive search.
633
+ * @param {boolean} options.diacriticSensitive A boolean flag to enable or disable diacritic sensitive search.
634
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
635
+ */
636
+ fullText<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: string, options?: FullTextQueryOptions): this;
637
+ /**
638
+ * Method to sort the full text search by text score
639
+ *
640
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
641
+ */
642
+ sortByTextScore(): this;
643
+ /**
644
+ * Adds a constraint for finding string values that start with a provided
645
+ * string. This query will use the backend index, so it will be fast even
646
+ * for large datasets.
647
+ *
648
+ * @param {string} key The key that the string to match is stored in.
649
+ * @param {string} prefix The substring that the value must start with.
650
+ * @param {string} modifiers The regular expression mode.
651
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
652
+ */
653
+ startsWith<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, prefix: string, modifiers?: string): this;
654
+ /**
655
+ * Adds a constraint for finding string values that end with a provided
656
+ * string. This will be slow for large datasets.
657
+ *
658
+ * @param {string} key The key that the string to match is stored in.
659
+ * @param {string} suffix The substring that the value must end with.
660
+ * @param {string} modifiers The regular expression mode.
661
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
662
+ */
663
+ endsWith<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, suffix: string, modifiers?: string): this;
664
+ /**
665
+ * Adds a proximity based constraint for finding objects with key point
666
+ * values near the point given.
667
+ *
668
+ * @param {string} key The key that the Parse.GeoPoint is stored in.
669
+ * @param {Parse.GeoPoint} point The reference Parse.GeoPoint that is used.
670
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
671
+ */
672
+ near<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, point: ParseGeoPoint): this;
673
+ /**
674
+ * Adds a proximity based constraint for finding objects with key point
675
+ * values near the point given and within the maximum distance given.
676
+ *
677
+ * @param {string} key The key that the Parse.GeoPoint is stored in.
678
+ * @param {Parse.GeoPoint} point The reference Parse.GeoPoint that is used.
679
+ * @param {number} maxDistance Maximum distance (in radians) of results to return.
680
+ * @param {boolean} sorted A Bool value that is true if results should be
681
+ * sorted by distance ascending, false is no sorting is required,
682
+ * defaults to true.
683
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
684
+ */
685
+ withinRadians<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, point: ParseGeoPoint, maxDistance: number, sorted?: boolean): this;
686
+ /**
687
+ * Adds a proximity based constraint for finding objects with key point
688
+ * values near the point given and within the maximum distance given.
689
+ * Radius of earth used is 3958.8 miles.
690
+ *
691
+ * @param {string} key The key that the Parse.GeoPoint is stored in.
692
+ * @param {Parse.GeoPoint} point The reference Parse.GeoPoint that is used.
693
+ * @param {number} maxDistance Maximum distance (in miles) of results to return.
694
+ * @param {boolean} sorted A Bool value that is true if results should be
695
+ * sorted by distance ascending, false is no sorting is required,
696
+ * defaults to true.
697
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
698
+ */
699
+ withinMiles<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, point: ParseGeoPoint, maxDistance: number, sorted?: boolean): this;
700
+ /**
701
+ * Adds a proximity based constraint for finding objects with key point
702
+ * values near the point given and within the maximum distance given.
703
+ * Radius of earth used is 6371.0 kilometers.
704
+ *
705
+ * @param {string} key The key that the Parse.GeoPoint is stored in.
706
+ * @param {Parse.GeoPoint} point The reference Parse.GeoPoint that is used.
707
+ * @param {number} maxDistance Maximum distance (in kilometers) of results to return.
708
+ * @param {boolean} sorted A Bool value that is true if results should be
709
+ * sorted by distance ascending, false is no sorting is required,
710
+ * defaults to true.
711
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
712
+ */
713
+ withinKilometers<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, point: ParseGeoPoint, maxDistance: number, sorted?: boolean): this;
714
+ /**
715
+ * Adds a constraint to the query that requires a particular key's
716
+ * coordinates be contained within a given rectangular geographic bounding
717
+ * box.
718
+ *
719
+ * @param {string} key The key to be constrained.
720
+ * @param {Parse.GeoPoint} southwest
721
+ * The lower-left inclusive corner of the box.
722
+ * @param {Parse.GeoPoint} northeast
723
+ * The upper-right inclusive corner of the box.
724
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
725
+ */
726
+ withinGeoBox<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, southwest: ParseGeoPoint, northeast: ParseGeoPoint): this;
727
+ /**
728
+ * Adds a constraint to the query that requires a particular key's
729
+ * coordinates be contained within and on the bounds of a given polygon.
730
+ * Supports closed and open (last point is connected to first) paths
731
+ *
732
+ * Polygon must have at least 3 points
733
+ *
734
+ * @param {string} key The key to be constrained.
735
+ * @param {Array} points Array of Coordinates / GeoPoints
736
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
737
+ */
738
+ withinPolygon<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, points: number[][]): this;
739
+ /**
740
+ * Add a constraint to the query that requires a particular key's
741
+ * coordinates that contains a ParseGeoPoint
742
+ *
743
+ * @param {string} key The key to be constrained.
744
+ * @param {Parse.GeoPoint} point
745
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
746
+ */
747
+ polygonContains<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, point: ParseGeoPoint): this;
748
+ /**
749
+ * Sorts the results in ascending order by the given key.
750
+ *
751
+ * @param {(string|string[])} keys The key to order by, which is a
752
+ * string of comma separated values, or an Array of keys, or multiple keys.
753
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
754
+ */
755
+ ascending(...keys: string[]): this;
756
+ /**
757
+ * Sorts the results in ascending order by the given key,
758
+ * but can also add secondary sort descriptors without overwriting _order.
759
+ *
760
+ * @param {(string|string[])} keys The key to order by, which is a
761
+ * string of comma separated values, or an Array of keys, or multiple keys.
762
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
763
+ */
764
+ addAscending(...keys: string[]): this;
765
+ /**
766
+ * Sorts the results in descending order by the given key.
767
+ *
768
+ * @param {(string|string[])} keys The key to order by, which is a
769
+ * string of comma separated values, or an Array of keys, or multiple keys.
770
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
771
+ */
772
+ descending(...keys: string[]): this;
773
+ /**
774
+ * Sorts the results in descending order by the given key,
775
+ * but can also add secondary sort descriptors without overwriting _order.
776
+ *
777
+ * @param {(string|string[])} keys The key to order by, which is a
778
+ * string of comma separated values, or an Array of keys, or multiple keys.
779
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
780
+ */
781
+ addDescending(...keys: string[]): this;
782
+ /**
783
+ * Sets the number of results to skip before returning any results.
784
+ * This is useful for pagination.
785
+ * Default is to skip zero results.
786
+ *
787
+ * @param {number} n the number of results to skip.
788
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
789
+ */
790
+ skip(n: number): this;
791
+ /**
792
+ * Sets the limit of the number of results to return. The default limit is 100.
793
+ *
794
+ * @param {number} n the number of results to limit to.
795
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
796
+ */
797
+ limit(n: number): this;
798
+ /**
799
+ * Sets the flag to include with response the total number of objects satisfying this query,
800
+ * despite limits/skip. Might be useful for pagination.
801
+ * Note that result of this query will be wrapped as an object with
802
+ * `results`: holding {ParseObject} array and `count`: integer holding total number
803
+ *
804
+ * @param {boolean} includeCount false - disable, true - enable.
805
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
806
+ */
807
+ withCount(includeCount?: boolean): this;
808
+ /**
809
+ * Includes nested Parse.Objects for the provided key. You can use dot
810
+ * notation to specify which fields in the included object are also fetched.
811
+ *
812
+ * You can include all nested Parse.Objects by passing in '*'.
813
+ * Requires Parse Server 3.0.0+
814
+ * <pre>query.include('*');</pre>
815
+ *
816
+ * @param {...string|Array<string>} keys The name(s) of the key(s) to include.
817
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
818
+ */
819
+ include<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
820
+ /**
821
+ * Includes all nested Parse.Objects one level deep.
822
+ *
823
+ * Requires Parse Server 3.0.0+
824
+ *
825
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
826
+ */
827
+ includeAll(): this;
828
+ /**
829
+ * Restricts the fields of the returned Parse.Objects to include only the
830
+ * provided keys. If this is called multiple times, then all of the keys
831
+ * specified in each of the calls will be included.
832
+ *
833
+ * @param {...string|Array<string>} keys The name(s) of the key(s) to include.
834
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
835
+ */
836
+ select<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
837
+ /**
838
+ * Restricts the fields of the returned Parse.Objects to all keys except the
839
+ * provided keys. Exclude takes precedence over select and include.
840
+ *
841
+ * Requires Parse Server 3.6.0+
842
+ *
843
+ * @param {...string|Array<string>} keys The name(s) of the key(s) to exclude.
844
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
845
+ */
846
+ exclude<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
847
+ /**
848
+ * Restricts live query to trigger only for watched fields.
849
+ *
850
+ * Requires Parse Server 6.0.0+
851
+ *
852
+ * @param {...string|Array<string>} keys The name(s) of the key(s) to watch.
853
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
854
+ */
855
+ watch<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
856
+ /**
857
+ * Changes the read preference that the backend will use when performing the query to the database.
858
+ *
859
+ * @param {string} readPreference The read preference for the main query.
860
+ * @param {string} includeReadPreference The read preference for the queries to include pointers.
861
+ * @param {string} subqueryReadPreference The read preference for the sub queries.
862
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
863
+ */
864
+ readPreference(readPreference: string, includeReadPreference?: string, subqueryReadPreference?: string): this;
865
+ /**
866
+ * Subscribe this query to get liveQuery updates
867
+ *
868
+ * @param {string} sessionToken (optional) Defaults to the currentUser
869
+ * @returns {Promise<LiveQuerySubscription>} Returns the liveQuerySubscription, it's an event emitter
870
+ * which can be used to get liveQuery updates.
871
+ */
872
+ subscribe(sessionToken?: string | null): Promise<LiveQuerySubscription>;
873
+ /**
874
+ * Constructs a Parse.Query that is the OR of the passed in queries. For
875
+ * example:
876
+ * <pre>var compoundQuery = Parse.Query.or(query1, query2, query3);</pre>
877
+ *
878
+ * will create a compoundQuery that is an or of the query1, query2, and
879
+ * query3.
880
+ *
881
+ * @param {...Parse.Query} queries The list of queries to OR.
882
+ * @static
883
+ * @returns {Parse.Query} The query that is the OR of the passed in queries.
884
+ */
885
+ static or(...queries: ParseQuery[]): ParseQuery;
886
+ /**
887
+ * Constructs a Parse.Query that is the AND of the passed in queries. For
888
+ * example:
889
+ * <pre>var compoundQuery = Parse.Query.and(query1, query2, query3);</pre>
890
+ *
891
+ * will create a compoundQuery that is an and of the query1, query2, and
892
+ * query3.
893
+ *
894
+ * @param {...Parse.Query} queries The list of queries to AND.
895
+ * @static
896
+ * @returns {Parse.Query} The query that is the AND of the passed in queries.
897
+ */
898
+ static and(...queries: ParseQuery[]): ParseQuery;
899
+ /**
900
+ * Constructs a Parse.Query that is the NOR of the passed in queries. For
901
+ * example:
902
+ * <pre>const compoundQuery = Parse.Query.nor(query1, query2, query3);</pre>
903
+ *
904
+ * will create a compoundQuery that is a nor of the query1, query2, and
905
+ * query3.
906
+ *
907
+ * @param {...Parse.Query} queries The list of queries to NOR.
908
+ * @static
909
+ * @returns {Parse.Query} The query that is the NOR of the passed in queries.
910
+ */
911
+ static nor(...queries: ParseQuery[]): ParseQuery;
912
+ /**
913
+ * Change the source of this query to the server.
914
+ *
915
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
916
+ */
917
+ fromNetwork(): this;
918
+ /**
919
+ * Changes the source of this query to all pinned objects.
920
+ *
921
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
922
+ */
923
+ fromLocalDatastore(): this;
924
+ /**
925
+ * Changes the source of this query to the default group of pinned objects.
926
+ *
927
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
928
+ */
929
+ fromPin(): this;
930
+ /**
931
+ * Changes the source of this query to a specific group of pinned objects.
932
+ *
933
+ * @param {string} name The name of query source.
934
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
935
+ */
936
+ fromPinWithName(name?: string | null): this;
937
+ /**
938
+ * Cancels the current network request (if any is running).
939
+ *
940
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
941
+ */
942
+ cancel(): this;
943
+ _setRequestTask(options: any): void;
944
+ /**
945
+ * Sets a comment to the query so that the query
946
+ * can be identified when using a the profiler for MongoDB.
947
+ *
948
+ * @param {string} value a comment can make your profile data easier to interpret and trace.
949
+ * @returns {Parse.Query} Returns the query, so you can chain this call.
950
+ */
951
+ comment(value: string): this;
952
+ }
953
+ export default ParseQuery;