parse 6.1.0-alpha.3 → 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 (53) hide show
  1. package/dist/parse.js +6 -4
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +6 -4
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/CoreManager.js +1 -1
  6. package/lib/browser/ParseObject.js +2 -1
  7. package/lib/browser/ParseOp.js +1 -1
  8. package/lib/browser/TaskQueue.js +1 -0
  9. package/lib/node/CoreManager.js +1 -1
  10. package/lib/node/ParseObject.js +2 -1
  11. package/lib/node/ParseOp.js +1 -1
  12. package/lib/node/TaskQueue.js +1 -0
  13. package/lib/react-native/CoreManager.js +1 -1
  14. package/lib/react-native/ObjectStateMutations.js +13 -13
  15. package/lib/react-native/ParseACL.js +7 -7
  16. package/lib/react-native/ParseCLP.js +15 -15
  17. package/lib/react-native/ParseObject.js +9 -9
  18. package/lib/react-native/ParseUser.js +15 -15
  19. package/lib/weapp/CoreManager.js +1 -1
  20. package/lib/weapp/ParseObject.js +2 -1
  21. package/lib/weapp/ParseOp.js +1 -1
  22. package/lib/weapp/TaskQueue.js +1 -0
  23. package/package.json +8 -8
  24. package/types/Analytics.d.ts +1 -3
  25. package/types/CoreManager.d.ts +56 -62
  26. package/types/LocalDatastore.d.ts +3 -3
  27. package/types/LocalDatastoreController.default.d.ts +1 -1
  28. package/types/LocalDatastoreController.react-native.d.ts +1 -1
  29. package/types/ObjectStateMutations.d.ts +12 -18
  30. package/types/Parse.d.ts +49 -310
  31. package/types/ParseACL.d.ts +2 -6
  32. package/types/ParseCLP.d.ts +2 -6
  33. package/types/ParseConfig.d.ts +3 -11
  34. package/types/ParseFile.d.ts +8 -12
  35. package/types/ParseInstallation.d.ts +4 -4
  36. package/types/ParseObject.d.ts +24 -26
  37. package/types/ParseOp.d.ts +13 -15
  38. package/types/ParsePolygon.d.ts +3 -3
  39. package/types/ParseQuery.d.ts +38 -46
  40. package/types/ParseSchema.d.ts +12 -28
  41. package/types/ParseUser.d.ts +8 -14
  42. package/types/Push.d.ts +2 -2
  43. package/types/RESTController.d.ts +4 -4
  44. package/types/SingleInstanceStateController.d.ts +1 -1
  45. package/types/Storage.d.ts +2 -2
  46. package/types/StorageController.react-native.d.ts +2 -2
  47. package/types/TaskQueue.d.ts +3 -3
  48. package/types/UniqueInstanceStateController.d.ts +1 -1
  49. package/types/arrayContainsObject.d.ts +1 -1
  50. package/types/encode.d.ts +1 -1
  51. package/types/eslint.config.mjs +30 -0
  52. package/types/unique.d.ts +1 -1
  53. package/types/unsavedChildren.d.ts +1 -1
@@ -7,37 +7,35 @@ import type { AttributeMap, OpsMap } from './ObjectStateMutations';
7
7
  import type { RequestOptions, FullOptions } from './RESTController';
8
8
  import type ParseGeoPoint from './ParseGeoPoint';
9
9
  import type ParsePolygon from './ParsePolygon';
10
- export type Pointer = {
10
+ export interface Pointer {
11
11
  __type: string;
12
12
  className: string;
13
13
  objectId?: string;
14
14
  _localId?: string;
15
- };
16
- type SaveParams = {
15
+ }
16
+ interface SaveParams {
17
17
  method: string;
18
18
  path: string;
19
19
  body: AttributeMap;
20
- };
20
+ }
21
21
  export type SaveOptions = FullOptions & {
22
22
  cascadeSave?: boolean;
23
23
  context?: AttributeMap;
24
24
  batchSize?: number;
25
25
  transaction?: boolean;
26
26
  };
27
- type FetchOptions = {
27
+ interface FetchOptions {
28
28
  useMasterKey?: boolean;
29
29
  sessionToken?: string;
30
30
  include?: string | string[];
31
31
  context?: AttributeMap;
32
- };
33
- export type SetOptions = {
32
+ }
33
+ export interface SetOptions {
34
34
  ignoreValidation?: boolean;
35
35
  unset?: boolean;
36
- };
37
- export type AttributeKey<T> = Extract<keyof T, string>;
38
- export interface Attributes {
39
- [key: string]: any;
40
36
  }
37
+ export type AttributeKey<T> = Extract<keyof T, string>;
38
+ export type Attributes = Record<string, any>;
41
39
  interface JSONBaseAttributes {
42
40
  objectId: string;
43
41
  createdAt: string;
@@ -52,7 +50,7 @@ type AtomicKey<T> = {
52
50
  type Encode<T> = T extends ParseObject ? ReturnType<T['toJSON']> | Pointer : T extends ParseACL | ParseGeoPoint | ParsePolygon | ParseRelation | ParseFile ? ReturnType<T['toJSON']> : T extends Date ? {
53
51
  __type: 'Date';
54
52
  iso: string;
55
- } : T extends RegExp ? string : T extends Array<infer R> ? Array<Encode<R>> : T extends object ? ToJSON<T> : T;
53
+ } : T extends RegExp ? string : T extends (infer R)[] ? Encode<R>[] : T extends object ? ToJSON<T> : T;
56
54
  type ToJSON<T> = {
57
55
  [K in keyof T]: Encode<T[K]>;
58
56
  };
@@ -126,14 +124,14 @@ declare class ParseObject<T extends Attributes = Attributes> {
126
124
  };
127
125
  _getServerData(): Attributes;
128
126
  _clearServerData(): void;
129
- _getPendingOps(): Array<OpsMap>;
127
+ _getPendingOps(): OpsMap[];
130
128
  /**
131
129
  * @param {Array<string>} [keysToClear] - if specified, only ops matching
132
130
  * these fields will be cleared
133
131
  */
134
- _clearPendingOps(keysToClear?: Array<string>): void;
132
+ _clearPendingOps(keysToClear?: string[]): void;
135
133
  _getDirtyObjectAttributes(): Attributes;
136
- _toFullJSON(seen?: Array<any>, offline?: boolean): Attributes;
134
+ _toFullJSON(seen?: any[], offline?: boolean): Attributes;
137
135
  _getSaveJSON(): Attributes;
138
136
  _getSaveParams(): SaveParams;
139
137
  _finishFetch(serverData: Attributes): void;
@@ -155,7 +153,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
155
153
  * @param offline
156
154
  * @returns {object}
157
155
  */
158
- toJSON(seen: Array<any> | void, offline?: boolean): ToJSON<T> & JSONBaseAttributes;
156
+ toJSON(seen?: any[], offline?: boolean): ToJSON<T> & JSONBaseAttributes;
159
157
  /**
160
158
  * Determines whether this ParseObject is equal to another ParseObject
161
159
  *
@@ -426,7 +424,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
426
424
  *
427
425
  * @param {string} [keys] - specify which fields to revert
428
426
  */
429
- revert(...keys: Array<Extract<keyof (T & CommonAttributes), string>>): void;
427
+ revert(...keys: Extract<keyof (T & CommonAttributes), string>[]): void;
430
428
  /**
431
429
  * Clears all attributes on a model
432
430
  *
@@ -469,7 +467,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
469
467
  * @returns {Promise} A promise that is fulfilled when the fetch
470
468
  * completes.
471
469
  */
472
- fetchWithInclude(keys: string | Array<string | Array<string>>, options?: RequestOptions): Promise<this>;
470
+ fetchWithInclude(keys: string | (string | string[])[], options?: RequestOptions): Promise<this>;
473
471
  /**
474
472
  * Saves this object to the server at some unspecified time in the future,
475
473
  * even if Parse is currently inaccessible.
@@ -596,7 +594,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
596
594
  * @returns {Promise} A promise that is fulfilled when the destroy
597
595
  * completes.
598
596
  */
599
- destroy(options?: RequestOptions): Promise<void | ParseObject>;
597
+ destroy(options?: RequestOptions): Promise<ParseObject | undefined>;
600
598
  /**
601
599
  * Asynchronously stores the object and every object it points to in the local datastore,
602
600
  * recursively, using a default pin name: _default.
@@ -733,7 +731,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
733
731
  * @static
734
732
  * @returns {Parse.Object[]}
735
733
  */
736
- static fetchAllWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] | Array<keyof T['attributes']>, options?: RequestOptions): Promise<T[]>;
734
+ static fetchAllWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions): Promise<T[]>;
737
735
  /**
738
736
  * Fetches the given list of Parse.Object if needed.
739
737
  * If any error is encountered, stops and calls the error handler.
@@ -764,7 +762,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
764
762
  * @static
765
763
  * @returns {Parse.Object[]}
766
764
  */
767
- static fetchAllIfNeededWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] | Array<keyof T['attributes']>, options?: RequestOptions): Promise<T[]>;
765
+ static fetchAllIfNeededWithInclude<T extends ParseObject>(list: T[], keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions): Promise<T[]>;
768
766
  /**
769
767
  * Fetches the given list of Parse.Object if needed.
770
768
  * If any error is encountered, stops and calls the error handler.
@@ -851,7 +849,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
851
849
  * @returns {Promise} A promise that is fulfilled when the destroyAll
852
850
  * completes.
853
851
  */
854
- static destroyAll(list: Array<ParseObject>, options?: SaveOptions): Promise<ParseObject<Attributes> | ParseObject<Attributes>[]>;
852
+ static destroyAll(list: ParseObject[], options?: SaveOptions): Promise<ParseObject<Attributes> | ParseObject<Attributes>[]>;
855
853
  /**
856
854
  * Saves the given list of Parse.Object.
857
855
  * If any error is encountered, stops and calls the error handler.
@@ -998,7 +996,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
998
996
  * @returns {Promise} A promise that is fulfilled when the pin completes.
999
997
  * @static
1000
998
  */
1001
- static pinAll(objects: Array<ParseObject>): Promise<void>;
999
+ static pinAll(objects: ParseObject[]): Promise<void>;
1002
1000
  /**
1003
1001
  * Asynchronously stores the objects and every object they point to in the local datastore, recursively.
1004
1002
  *
@@ -1017,7 +1015,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
1017
1015
  * @returns {Promise} A promise that is fulfilled when the pin completes.
1018
1016
  * @static
1019
1017
  */
1020
- static pinAllWithName(name: string, objects: Array<ParseObject>): Promise<void>;
1018
+ static pinAllWithName(name: string, objects: ParseObject[]): Promise<void>;
1021
1019
  /**
1022
1020
  * Asynchronously removes the objects and every object they point to in the local datastore,
1023
1021
  * recursively, using a default pin name: _default.
@@ -1030,7 +1028,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
1030
1028
  * @returns {Promise} A promise that is fulfilled when the unPin completes.
1031
1029
  * @static
1032
1030
  */
1033
- static unPinAll(objects: Array<ParseObject>): Promise<void>;
1031
+ static unPinAll(objects: ParseObject[]): Promise<void>;
1034
1032
  /**
1035
1033
  * Asynchronously removes the objects and every object they point to in the local datastore, recursively.
1036
1034
  *
@@ -1043,7 +1041,7 @@ declare class ParseObject<T extends Attributes = Attributes> {
1043
1041
  * @returns {Promise} A promise that is fulfilled when the unPin completes.
1044
1042
  * @static
1045
1043
  */
1046
- static unPinAllWithName(name: string, objects: Array<ParseObject>): Promise<void>;
1044
+ static unPinAllWithName(name: string, objects: ParseObject[]): Promise<void>;
1047
1045
  /**
1048
1046
  * Asynchronously removes all objects in the local datastore using a default pin name: _default.
1049
1047
  *
@@ -1,8 +1,6 @@
1
1
  import type ParseObject from './ParseObject';
2
2
  import ParseRelation from './ParseRelation';
3
- export declare function opFromJSON(json: {
4
- [key: string]: any;
5
- }): Op | null;
3
+ export declare function opFromJSON(json: Record<string, any>): Op | null;
6
4
  export declare class Op {
7
5
  applyTo(value: any): any;
8
6
  mergeWith(previous: Op): Op | void;
@@ -33,9 +31,9 @@ export declare class IncrementOp extends Op {
33
31
  };
34
32
  }
35
33
  export declare class AddOp extends Op {
36
- _value: Array<any>;
37
- constructor(value: any | Array<any>);
38
- applyTo(value: any): Array<any>;
34
+ _value: any[];
35
+ constructor(value: any | any[]);
36
+ applyTo(value: any): any[];
39
37
  mergeWith(previous: Op): Op;
40
38
  toJSON(): {
41
39
  __op: string;
@@ -43,9 +41,9 @@ export declare class AddOp extends Op {
43
41
  };
44
42
  }
45
43
  export declare class AddUniqueOp extends Op {
46
- _value: Array<any>;
47
- constructor(value: any | Array<any>);
48
- applyTo(value: any | Array<any>): Array<any>;
44
+ _value: any[];
45
+ constructor(value: any | any[]);
46
+ applyTo(value: any | any[]): any[];
49
47
  mergeWith(previous: Op): Op;
50
48
  toJSON(): {
51
49
  __op: string;
@@ -53,9 +51,9 @@ export declare class AddUniqueOp extends Op {
53
51
  };
54
52
  }
55
53
  export declare class RemoveOp extends Op {
56
- _value: Array<any>;
57
- constructor(value: any | Array<any>);
58
- applyTo(value: any | Array<any>): Array<any>;
54
+ _value: any[];
55
+ constructor(value: any | any[]);
56
+ applyTo(value: any | any[]): any[];
59
57
  mergeWith(previous: Op): Op;
60
58
  toJSON(): {
61
59
  __op: string;
@@ -64,9 +62,9 @@ export declare class RemoveOp extends Op {
64
62
  }
65
63
  export declare class RelationOp extends Op {
66
64
  _targetClassName: string | null;
67
- relationsToAdd: Array<string>;
68
- relationsToRemove: Array<string>;
69
- constructor(adds: Array<ParseObject | string>, removes: Array<ParseObject | string>);
65
+ relationsToAdd: string[];
66
+ relationsToRemove: string[];
67
+ constructor(adds: (ParseObject | string)[], removes: (ParseObject | string)[]);
70
68
  _extractId(obj: string | ParseObject): string;
71
69
  applyTo(value: any, parent?: ParseObject, key?: string): ParseRelation;
72
70
  mergeWith(previous: Op): Op;
@@ -25,7 +25,7 @@ declare class ParsePolygon {
25
25
  /**
26
26
  * @param {(Coordinates | Parse.GeoPoint[])} coordinates An Array of coordinate pairs
27
27
  */
28
- constructor(coordinates: Coordinates | Array<ParseGeoPoint>);
28
+ constructor(coordinates: Coordinates | ParseGeoPoint[]);
29
29
  /**
30
30
  * Coordinates value for this Polygon.
31
31
  * Throws an exception if not valid type.
@@ -34,7 +34,7 @@ declare class ParsePolygon {
34
34
  * @returns {Coordinates}
35
35
  */
36
36
  get coordinates(): Coordinates;
37
- set coordinates(coords: Coordinates | Array<ParseGeoPoint>);
37
+ set coordinates(coords: Coordinates | ParseGeoPoint[]);
38
38
  /**
39
39
  * Returns a JSON representation of the Polygon, suitable for Parse.
40
40
  *
@@ -64,6 +64,6 @@ declare class ParsePolygon {
64
64
  * @throws {TypeError}
65
65
  * @returns {number[][]} Array of coordinates if validated.
66
66
  */
67
- static _validate(coords: Coordinates | Array<ParseGeoPoint>): Coordinates;
67
+ static _validate(coords: Coordinates | ParseGeoPoint[]): Coordinates;
68
68
  }
69
69
  export default ParsePolygon;
@@ -8,28 +8,22 @@ type BatchOptions = FullOptions & {
8
8
  useMasterKey?: boolean;
9
9
  useMaintenanceKey?: boolean;
10
10
  sessionToken?: string;
11
- context?: {
12
- [key: string]: any;
13
- };
11
+ context?: Record<string, any>;
14
12
  json?: boolean;
15
13
  };
16
- export type WhereClause = {
17
- [attr: string]: any;
18
- };
19
- type QueryOptions = {
14
+ export type WhereClause = Record<string, any>;
15
+ interface QueryOptions {
20
16
  useMasterKey?: boolean;
21
17
  sessionToken?: string;
22
- context?: {
23
- [key: string]: any;
24
- };
18
+ context?: Record<string, any>;
25
19
  json?: boolean;
26
- };
27
- type FullTextQueryOptions = {
20
+ }
21
+ interface FullTextQueryOptions {
28
22
  language?: string;
29
23
  caseSensitive?: boolean;
30
24
  diacriticSensitive?: boolean;
31
- };
32
- export type QueryJSON = {
25
+ }
26
+ export interface QueryJSON {
33
27
  where: WhereClause;
34
28
  watch?: string;
35
29
  include?: string;
@@ -46,7 +40,7 @@ export type QueryJSON = {
46
40
  includeReadPreference?: string;
47
41
  subqueryReadPreference?: string;
48
42
  comment?: string;
49
- };
43
+ }
50
44
  interface BaseAttributes {
51
45
  createdAt: Date;
52
46
  objectId: string;
@@ -101,22 +95,20 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
101
95
  */
102
96
  className: string;
103
97
  _where: any;
104
- _watch: Array<string>;
105
- _include: Array<string>;
106
- _exclude: Array<string>;
107
- _select: Array<string>;
98
+ _watch: string[];
99
+ _include: string[];
100
+ _exclude: string[];
101
+ _select: string[];
108
102
  _limit: number;
109
103
  _skip: number;
110
104
  _count: boolean;
111
- _order: Array<string>;
105
+ _order: string[];
112
106
  _readPreference: string | null;
113
107
  _includeReadPreference: string | null;
114
108
  _subqueryReadPreference: string | null;
115
109
  _queriesLocalDatastore: boolean;
116
110
  _localDatastorePinName: any;
117
- _extraOptions: {
118
- [key: string]: any;
119
- };
111
+ _extraOptions: Record<string, any>;
120
112
  _hint: any;
121
113
  _explain: boolean;
122
114
  _xhrRequest: any;
@@ -131,21 +123,21 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
131
123
  * @param {Array} queries
132
124
  * @returns {Parse.Query} Returns the query, so you can chain this call.
133
125
  */
134
- _orQuery(queries: Array<ParseQuery>): this;
126
+ _orQuery(queries: ParseQuery[]): this;
135
127
  /**
136
128
  * Adds constraint that all of the passed in queries match.
137
129
  *
138
130
  * @param {Array} queries
139
131
  * @returns {Parse.Query} Returns the query, so you can chain this call.
140
132
  */
141
- _andQuery(queries: Array<ParseQuery>): this;
133
+ _andQuery(queries: ParseQuery[]): this;
142
134
  /**
143
135
  * Adds constraint that none of the passed in queries match.
144
136
  *
145
137
  * @param {Array} queries
146
138
  * @returns {Parse.Query} Returns the query, so you can chain this call.
147
139
  */
148
- _norQuery(queries: Array<ParseQuery>): this;
140
+ _norQuery(queries: ParseQuery[]): this;
149
141
  /**
150
142
  * Helper for condition queries
151
143
  *
@@ -290,7 +282,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
290
282
  */
291
283
  aggregate(pipeline: any, options?: {
292
284
  sessionToken?: string;
293
- }): Promise<Array<any>>;
285
+ }): Promise<any[]>;
294
286
  /**
295
287
  * Retrieves at most one Parse.Object that satisfies this query.
296
288
  *
@@ -387,7 +379,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
387
379
  * @returns {Promise} A promise that will be fulfilled once the
388
380
  * iteration has completed.
389
381
  */
390
- map(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => any, options?: BatchOptions): Promise<Array<any>>;
382
+ map(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => any, options?: BatchOptions): Promise<any[]>;
391
383
  /**
392
384
  * Iterates over each result of a query, calling a callback for each one. If
393
385
  * the callback returns a promise, the iteration will not continue until
@@ -411,7 +403,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
411
403
  * @returns {Promise} A promise that will be fulfilled once the
412
404
  * iteration has completed.
413
405
  */
414
- reduce(callback: (accumulator: any, currentObject: ParseObject, index: number) => any, initialValue: any, options?: BatchOptions): Promise<Array<any>>;
406
+ reduce(callback: (accumulator: any, currentObject: ParseObject, index: number) => any, initialValue: any, options?: BatchOptions): Promise<any[]>;
415
407
  /**
416
408
  * Iterates over each result of a query, calling a callback for each one. If
417
409
  * the callback returns a promise, the iteration will not continue until
@@ -434,7 +426,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
434
426
  * @returns {Promise} A promise that will be fulfilled once the
435
427
  * iteration has completed.
436
428
  */
437
- filter(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean, options?: BatchOptions): Promise<Array<ParseObject>>;
429
+ filter(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean, options?: BatchOptions): Promise<ParseObject[]>;
438
430
  /**
439
431
  * Adds a constraint to the query that requires a particular key's value to
440
432
  * be equal to the provided value.
@@ -443,7 +435,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
443
435
  * @param value The value that the Parse.Object must contain.
444
436
  * @returns {Parse.Query} Returns the query, so you can chain this call.
445
437
  */
446
- equalTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends Array<infer E> ? E : never)): this;
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;
447
439
  /**
448
440
  * Adds a constraint to the query that requires a particular key's value to
449
441
  * be not equal to the provided value.
@@ -452,7 +444,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
452
444
  * @param value The value that must not be equalled.
453
445
  * @returns {Parse.Query} Returns the query, so you can chain this call.
454
446
  */
455
- notEqualTo<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends Array<infer E> ? E : never)): this;
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;
456
448
  /**
457
449
  * Adds a constraint to the query that requires a particular key's value to
458
450
  * be less than the provided value.
@@ -497,7 +489,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
497
489
  * @param {Array<*>} values The values that will match.
498
490
  * @returns {Parse.Query} Returns the query, so you can chain this call.
499
491
  */
500
- containedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: Array<T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never)>): this;
492
+ containedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[]): this;
501
493
  /**
502
494
  * Adds a constraint to the query that requires a particular key's value to
503
495
  * not be contained in the provided list of values.
@@ -506,7 +498,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
506
498
  * @param {Array<*>} values The values that will not match.
507
499
  * @returns {Parse.Query} Returns the query, so you can chain this call.
508
500
  */
509
- notContainedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: Array<T['attributes'][K]>): this;
501
+ notContainedIn<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: T['attributes'][K][]): this;
510
502
  /**
511
503
  * Adds a constraint to the query that requires a particular key's value to
512
504
  * be contained by the provided list of values. Get objects where all array elements match.
@@ -515,7 +507,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
515
507
  * @param {Array} values The values that will match.
516
508
  * @returns {Parse.Query} Returns the query, so you can chain this call.
517
509
  */
518
- containedBy<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: Array<T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never)>): this;
510
+ containedBy<K extends keyof T['attributes'] | keyof BaseAttributes>(key: K, values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[]): this;
519
511
  /**
520
512
  * Adds a constraint to the query that requires a particular key's value to
521
513
  * contain each one of the provided list of values.
@@ -760,7 +752,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
760
752
  * string of comma separated values, or an Array of keys, or multiple keys.
761
753
  * @returns {Parse.Query} Returns the query, so you can chain this call.
762
754
  */
763
- ascending(...keys: Array<string>): this;
755
+ ascending(...keys: string[]): this;
764
756
  /**
765
757
  * Sorts the results in ascending order by the given key,
766
758
  * but can also add secondary sort descriptors without overwriting _order.
@@ -769,7 +761,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
769
761
  * string of comma separated values, or an Array of keys, or multiple keys.
770
762
  * @returns {Parse.Query} Returns the query, so you can chain this call.
771
763
  */
772
- addAscending(...keys: Array<string>): this;
764
+ addAscending(...keys: string[]): this;
773
765
  /**
774
766
  * Sorts the results in descending order by the given key.
775
767
  *
@@ -777,7 +769,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
777
769
  * string of comma separated values, or an Array of keys, or multiple keys.
778
770
  * @returns {Parse.Query} Returns the query, so you can chain this call.
779
771
  */
780
- descending(...keys: Array<string>): this;
772
+ descending(...keys: string[]): this;
781
773
  /**
782
774
  * Sorts the results in descending order by the given key,
783
775
  * but can also add secondary sort descriptors without overwriting _order.
@@ -786,7 +778,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
786
778
  * string of comma separated values, or an Array of keys, or multiple keys.
787
779
  * @returns {Parse.Query} Returns the query, so you can chain this call.
788
780
  */
789
- addDescending(...keys: Array<string>): this;
781
+ addDescending(...keys: string[]): this;
790
782
  /**
791
783
  * Sets the number of results to skip before returning any results.
792
784
  * This is useful for pagination.
@@ -824,7 +816,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
824
816
  * @param {...string|Array<string>} keys The name(s) of the key(s) to include.
825
817
  * @returns {Parse.Query} Returns the query, so you can chain this call.
826
818
  */
827
- include<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: Array<K | Array<K>>): this;
819
+ include<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
828
820
  /**
829
821
  * Includes all nested Parse.Objects one level deep.
830
822
  *
@@ -841,7 +833,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
841
833
  * @param {...string|Array<string>} keys The name(s) of the key(s) to include.
842
834
  * @returns {Parse.Query} Returns the query, so you can chain this call.
843
835
  */
844
- select<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: Array<K | Array<K>>): this;
836
+ select<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
845
837
  /**
846
838
  * Restricts the fields of the returned Parse.Objects to all keys except the
847
839
  * provided keys. Exclude takes precedence over select and include.
@@ -851,7 +843,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
851
843
  * @param {...string|Array<string>} keys The name(s) of the key(s) to exclude.
852
844
  * @returns {Parse.Query} Returns the query, so you can chain this call.
853
845
  */
854
- exclude<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: Array<K | Array<K>>): this;
846
+ exclude<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
855
847
  /**
856
848
  * Restricts live query to trigger only for watched fields.
857
849
  *
@@ -860,7 +852,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
860
852
  * @param {...string|Array<string>} keys The name(s) of the key(s) to watch.
861
853
  * @returns {Parse.Query} Returns the query, so you can chain this call.
862
854
  */
863
- watch<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: Array<K | Array<K>>): this;
855
+ watch<K extends keyof T['attributes'] | keyof BaseAttributes>(...keys: (K | K[])[]): this;
864
856
  /**
865
857
  * Changes the read preference that the backend will use when performing the query to the database.
866
858
  *
@@ -890,7 +882,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
890
882
  * @static
891
883
  * @returns {Parse.Query} The query that is the OR of the passed in queries.
892
884
  */
893
- static or(...queries: Array<ParseQuery>): ParseQuery;
885
+ static or(...queries: ParseQuery[]): ParseQuery;
894
886
  /**
895
887
  * Constructs a Parse.Query that is the AND of the passed in queries. For
896
888
  * example:
@@ -903,7 +895,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
903
895
  * @static
904
896
  * @returns {Parse.Query} The query that is the AND of the passed in queries.
905
897
  */
906
- static and(...queries: Array<ParseQuery>): ParseQuery;
898
+ static and(...queries: ParseQuery[]): ParseQuery;
907
899
  /**
908
900
  * Constructs a Parse.Query that is the NOR of the passed in queries. For
909
901
  * example:
@@ -916,7 +908,7 @@ declare class ParseQuery<T extends ParseObject = ParseObject> {
916
908
  * @static
917
909
  * @returns {Parse.Query} The query that is the NOR of the passed in queries.
918
910
  */
919
- static nor(...queries: Array<ParseQuery>): ParseQuery;
911
+ static nor(...queries: ParseQuery[]): ParseQuery;
920
912
  /**
921
913
  * Change the source of this query to the server.
922
914
  *
@@ -16,9 +16,7 @@ interface FieldOptions<T extends string | number | boolean | Bytes | Date | Pars
16
16
  defaultValue?: T | undefined;
17
17
  targetClass?: string | undefined;
18
18
  }
19
- interface Index {
20
- [fieldName: string]: number | string;
21
- }
19
+ type Index = Record<string, number | string>;
22
20
  interface CLPField {
23
21
  '*'?: boolean | undefined;
24
22
  requiresAuthentication?: boolean | undefined;
@@ -34,26 +32,18 @@ interface CLP {
34
32
  addField?: CLPField | undefined;
35
33
  readUserFields?: string[] | undefined;
36
34
  writeUserFields?: string[] | undefined;
37
- protectedFields?: {
38
- [userIdOrRoleName: string]: string[];
39
- };
35
+ protectedFields?: Record<string, string[]>;
40
36
  }
41
37
  interface RestSchema {
42
38
  className: string;
43
- fields: {
44
- [key: string]: {
45
- type: string;
46
- targetClass?: string;
47
- required?: boolean;
48
- defaultValue?: string;
49
- };
50
- };
39
+ fields: Record<string, {
40
+ type: string;
41
+ targetClass?: string;
42
+ required?: boolean;
43
+ defaultValue?: string;
44
+ }>;
51
45
  classLevelPermissions: CLP;
52
- indexes?: {
53
- [key: string]: {
54
- [key: string]: any;
55
- };
56
- };
46
+ indexes?: Record<string, Record<string, any>>;
57
47
  }
58
48
  /**
59
49
  * A Parse.Schema object is for handling schema data from Parse.
@@ -74,15 +64,9 @@ interface RestSchema {
74
64
  */
75
65
  declare class ParseSchema<T extends ParseObject = any> {
76
66
  className: string;
77
- _fields: {
78
- [key: string]: any;
79
- };
80
- _indexes: {
81
- [key: string]: any;
82
- };
83
- _clp: {
84
- [key: string]: any;
85
- };
67
+ _fields: Record<string, any>;
68
+ _indexes: Record<string, any>;
69
+ _clp: Record<string, any>;
86
70
  /**
87
71
  * @param {string} className Parse Class string.
88
72
  */
@@ -1,9 +1,7 @@
1
1
  import ParseObject, { Attributes } from './ParseObject';
2
2
  import type { RequestOptions, FullOptions } from './RESTController';
3
- export type AuthData = {
4
- [key: string]: any;
5
- };
6
- export type AuthProvider = {
3
+ export type AuthData = Record<string, any>;
4
+ export interface AuthProvider {
7
5
  authenticate?(options: {
8
6
  error?: (provider: AuthProvider, error: string | any) => void;
9
7
  success?: (provider: AuthProvider, result: AuthData) => void;
@@ -11,7 +9,7 @@ export type AuthProvider = {
11
9
  restoreAuthentication(authData: any): boolean;
12
10
  getAuthType(): string;
13
11
  deauthenticate?(): void;
14
- };
12
+ }
15
13
  /**
16
14
  * <p>A Parse.User object is a local representation of a user persisted to the
17
15
  * Parse cloud. This class is a subclass of a Parse.Object, and retains the
@@ -227,7 +225,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
227
225
  * @param {...any} args
228
226
  * @returns {Promise}
229
227
  */
230
- save(...args: Array<any>): Promise<this>;
228
+ save(...args: any[]): Promise<this>;
231
229
  /**
232
230
  * Wrap the default destroy behavior with functionality that logs out
233
231
  * the current user when it is destroyed
@@ -235,7 +233,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
235
233
  * @param {...any} args
236
234
  * @returns {Parse.User}
237
235
  */
238
- destroy(...args: Array<any>): Promise<ParseUser | void>;
236
+ destroy(...args: any[]): Promise<this>;
239
237
  /**
240
238
  * Wrap the default fetch behavior with functionality to save to local
241
239
  * storage if this is current user.
@@ -243,7 +241,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
243
241
  * @param {...any} args
244
242
  * @returns {Parse.User}
245
243
  */
246
- fetch(...args: Array<any>): Promise<this>;
244
+ fetch(...args: any[]): Promise<this>;
247
245
  /**
248
246
  * Wrap the default fetchWithInclude behavior with functionality to save to local
249
247
  * storage if this is current user.
@@ -251,7 +249,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
251
249
  * @param {...any} args
252
250
  * @returns {Parse.User}
253
251
  */
254
- fetchWithInclude(...args: Array<any>): Promise<this>;
252
+ fetchWithInclude(...args: any[]): Promise<this>;
255
253
  /**
256
254
  * Verify whether a given password is the password of the current user.
257
255
  *
@@ -271,11 +269,7 @@ declare class ParseUser<T extends Attributes = Attributes> extends ParseObject<T
271
269
  * @static
272
270
  * @returns {Parse.User} The newly extended Parse.User class
273
271
  */
274
- static extend(protoProps: {
275
- [prop: string]: any;
276
- }, classProps: {
277
- [prop: string]: any;
278
- }): typeof ParseUser;
272
+ static extend(protoProps: Record<string, any>, classProps: Record<string, any>): typeof ParseUser;
279
273
  /**
280
274
  * Retrieves the currently logged in ParseUser with a valid session,
281
275
  * either from memory or localStorage, if necessary.