|
1 | 1 | import CoreManager from './CoreManager';
|
2 | 2 | import ParseError from './ParseError';
|
3 |
| -import ParseObject from './ParseObject'; |
4 |
| - |
5 |
| -import type { AttributeMap } from './ObjectStateMutations'; |
| 3 | +import ParseObject, { Attributes } from './ParseObject'; |
6 | 4 |
|
7 | 5 | type DeviceInterface = {
|
8 | 6 | IOS: string;
|
@@ -33,11 +31,11 @@ const DEVICE_TYPES: DeviceInterface = {
|
33 | 31 | *
|
34 | 32 | * @alias Parse.Installation
|
35 | 33 | */
|
36 |
| -class ParseInstallation extends ParseObject { |
| 34 | +class ParseInstallation<T extends Attributes = Attributes> extends ParseObject<T> { |
37 | 35 | /**
|
38 | 36 | * @param {object} attributes The initial set of data to store in the object.
|
39 | 37 | */
|
40 |
| - constructor(attributes?: AttributeMap) { |
| 38 | + constructor(attributes?: T) { |
41 | 39 | super('_Installation');
|
42 | 40 | if (attributes && typeof attributes === 'object') {
|
43 | 41 | try {
|
@@ -220,7 +218,7 @@ class ParseInstallation extends ParseObject {
|
220 | 218 | * @param {...any} args
|
221 | 219 | * @returns {Promise}
|
222 | 220 | */
|
223 |
| - async fetch(...args: Array<any>): Promise<ParseInstallation> { |
| 221 | + async fetch(...args: Array<any>): Promise<this> { |
224 | 222 | try {
|
225 | 223 | await super.fetch.apply(this, args);
|
226 | 224 | } catch (e) {
|
@@ -259,7 +257,7 @@ class ParseInstallation extends ParseObject {
|
259 | 257 | this._markAllFieldsDirty();
|
260 | 258 | await super.save.apply(this, args);
|
261 | 259 | }
|
262 |
| - await CoreManager.getInstallationController().updateInstallationOnDisk(this); |
| 260 | + await CoreManager.getInstallationController().updateInstallationOnDisk(this as any); |
263 | 261 | return this;
|
264 | 262 | }
|
265 | 263 |
|
|
0 commit comments