@ember-data/model 5.4.0-alpha.32 → 5.4.0-alpha.34
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.
- package/addon/-private.js +1 -1
- package/addon/{has-many-Qm5aUQol.js → has-many-Mz5PIxmL.js} +10 -0
- package/addon/{has-many-Qm5aUQol.js.map → has-many-Mz5PIxmL.js.map} +1 -1
- package/addon/index.js +1 -1
- package/addon/model-eXqU5A13.js.map +1 -1
- package/package.json +19 -19
- package/unstable-preview-types/-private/attr.d.ts +170 -168
- package/unstable-preview-types/-private/attr.type-test.d.ts +3 -1
- package/unstable-preview-types/-private/belongs-to.d.ts +179 -178
- package/unstable-preview-types/-private/belongs-to.d.ts.map +1 -1
- package/unstable-preview-types/-private/belongs-to.type-test.d.ts +3 -1
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts +7 -5
- package/unstable-preview-types/-private/errors.d.ts +288 -286
- package/unstable-preview-types/-private/has-many.d.ts +168 -167
- package/unstable-preview-types/-private/has-many.d.ts.map +1 -1
- package/unstable-preview-types/-private/has-many.type-test.d.ts +3 -1
- package/unstable-preview-types/-private/hooks.d.ts +12 -10
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts +60 -58
- package/unstable-preview-types/-private/many-array.d.ts +192 -189
- package/unstable-preview-types/-private/many-array.d.ts.map +1 -1
- package/unstable-preview-types/-private/model-for-mixin.d.ts +5 -3
- package/unstable-preview-types/-private/model-methods.d.ts +32 -30
- package/unstable-preview-types/-private/model.d.ts +103 -100
- package/unstable-preview-types/-private/model.type-test.d.ts +3 -1
- package/unstable-preview-types/-private/notify-changes.d.ts +7 -5
- package/unstable-preview-types/-private/promise-belongs-to.d.ts +45 -43
- package/unstable-preview-types/-private/promise-many-array.d.ts +127 -125
- package/unstable-preview-types/-private/promise-proxy-base.d.ts +35 -32
- package/unstable-preview-types/-private/record-state.d.ts +86 -84
- package/unstable-preview-types/-private/references/belongs-to.d.ts +471 -469
- package/unstable-preview-types/-private/references/has-many.d.ts +486 -484
- package/unstable-preview-types/-private/schema-provider.d.ts +25 -23
- package/unstable-preview-types/-private/util.d.ts +10 -8
- package/unstable-preview-types/-private.d.ts +11 -9
- package/unstable-preview-types/hooks.d.ts +4 -2
- package/unstable-preview-types/index.d.ts +74 -45
- package/unstable-preview-types/migration-support.d.ts +10 -8
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
declare module '@ember-data/model/-private/promise-proxy-base' {
|
|
2
|
+
import ObjectProxy from '@ember/object/proxy';
|
|
3
|
+
|
|
4
|
+
export interface PromiseObject<T> extends Promise<T> {}
|
|
5
|
+
export class PromiseObject<T> extends ObjectProxy<T> {
|
|
6
|
+
declare content?: T | null;
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* If the proxied promise is rejected this will contain the reason
|
|
10
|
+
* provided.
|
|
11
|
+
*/
|
|
12
|
+
reason: string | Error;
|
|
13
|
+
/*
|
|
14
|
+
* Once the proxied promise has settled this will become `false`.
|
|
15
|
+
*/
|
|
16
|
+
isPending: boolean;
|
|
17
|
+
/*
|
|
18
|
+
* Once the proxied promise has settled this will become `true`.
|
|
19
|
+
*/
|
|
20
|
+
isSettled: boolean;
|
|
21
|
+
/*
|
|
22
|
+
* Will become `true` if the proxied promise is rejected.
|
|
23
|
+
*/
|
|
24
|
+
isRejected: boolean;
|
|
25
|
+
/*
|
|
26
|
+
* Will become `true` if the proxied promise is fulfilled.
|
|
27
|
+
*/
|
|
28
|
+
isFulfilled: boolean;
|
|
29
|
+
/*
|
|
30
|
+
* The promise whose fulfillment value is being proxied by this object.
|
|
31
|
+
*/
|
|
32
|
+
promise: Promise<T>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -1,89 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type
|
|
7
|
-
import type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
declare module '@ember-data/model/-private/record-state' {
|
|
2
|
+
import type Store from '@ember-data/store';
|
|
3
|
+
import type RequestStateService from '@ember-data/store/-private/network/request-cache';
|
|
4
|
+
import type { RequestState } from '@ember-data/store/-private/network/request-cache';
|
|
5
|
+
import type { Cache } from '@ember-data/store/-types/q/cache';
|
|
6
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
7
|
+
import type Errors from '@ember-data/model/-private/errors';
|
|
8
|
+
import type { MinimalLegacyRecord } from '@ember-data/model/-private/model-methods';
|
|
9
|
+
/**
|
|
10
|
+
* A decorator that caches a getter while
|
|
11
|
+
* providing the ability to bust that cache
|
|
12
|
+
* when we so choose in a way that notifies
|
|
13
|
+
* tracking systems.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function tagged<T extends object, K extends keyof T & string>(_target: T, key: K, desc: PropertyDescriptor): PropertyDescriptor;
|
|
18
|
+
export declare function notifySignal<T extends object, K extends keyof T & string>(obj: T, key: K): void;
|
|
19
|
+
/**
|
|
20
|
+
Historically EmberData managed a state machine
|
|
21
|
+
for each record, the localState for which
|
|
22
|
+
was reflected onto Model.
|
|
23
|
+
|
|
24
|
+
This implements the flags and stateName for backwards compat
|
|
25
|
+
with the state tree that used to be possible (listed below).
|
|
26
|
+
|
|
27
|
+
stateName and dirtyType are candidates for deprecation.
|
|
28
|
+
|
|
29
|
+
root
|
|
30
|
+
empty
|
|
31
|
+
deleted // hidden from stateName
|
|
32
|
+
preloaded // hidden from stateName
|
|
33
|
+
|
|
34
|
+
loading
|
|
35
|
+
empty // hidden from stateName
|
|
36
|
+
preloaded // hidden from stateName
|
|
37
|
+
|
|
38
|
+
loaded
|
|
39
|
+
saved
|
|
40
|
+
updated
|
|
41
|
+
uncommitted
|
|
42
|
+
invalid
|
|
43
|
+
inFlight
|
|
44
|
+
created
|
|
45
|
+
uncommitted
|
|
46
|
+
invalid
|
|
47
|
+
inFlight
|
|
48
|
+
|
|
49
|
+
deleted
|
|
50
|
+
saved
|
|
51
|
+
new // hidden from stateName
|
|
40
52
|
uncommitted
|
|
41
53
|
invalid
|
|
42
54
|
inFlight
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
get isEmpty(): boolean;
|
|
79
|
-
get isNew(): boolean;
|
|
80
|
-
get isDeleted(): boolean;
|
|
81
|
-
get isValid(): boolean;
|
|
82
|
-
get isDirty(): boolean;
|
|
83
|
-
get isError(): boolean;
|
|
84
|
-
get adapterError(): unknown;
|
|
85
|
-
get isPreloaded(): boolean;
|
|
86
|
-
get stateName(): "root.loading" | "root.empty" | "root.deleted.inFlight" | "root.deleted.saved" | "root.deleted.invalid" | "root.deleted.uncommitted" | "root.loaded.created.inFlight" | "root.loaded.created.invalid" | "root.loaded.created.uncommitted" | "root.loaded.updated.inFlight" | "root.loaded.updated.invalid" | "root.loaded.updated.uncommitted" | "root.loaded.saved";
|
|
87
|
-
get dirtyType(): "" | "deleted" | "created" | "updated";
|
|
55
|
+
|
|
56
|
+
@internal
|
|
57
|
+
*/
|
|
58
|
+
export default class RecordState {
|
|
59
|
+
store: Store;
|
|
60
|
+
identifier: StableRecordIdentifier;
|
|
61
|
+
record: MinimalLegacyRecord;
|
|
62
|
+
rs: RequestStateService;
|
|
63
|
+
pendingCount: number;
|
|
64
|
+
fulfilledCount: number;
|
|
65
|
+
rejectedCount: number;
|
|
66
|
+
cache: Cache;
|
|
67
|
+
_errorRequests: RequestState[];
|
|
68
|
+
_lastError: RequestState | null;
|
|
69
|
+
handler: object;
|
|
70
|
+
constructor(record: MinimalLegacyRecord);
|
|
71
|
+
destroy(): void;
|
|
72
|
+
notify(key: keyof this & string): void;
|
|
73
|
+
updateInvalidErrors(errors: Errors): void;
|
|
74
|
+
cleanErrorRequests(): void;
|
|
75
|
+
isSaving: boolean;
|
|
76
|
+
get isLoading(): boolean;
|
|
77
|
+
get isLoaded(): boolean;
|
|
78
|
+
get isSaved(): boolean;
|
|
79
|
+
get isEmpty(): boolean;
|
|
80
|
+
get isNew(): boolean;
|
|
81
|
+
get isDeleted(): boolean;
|
|
82
|
+
get isValid(): boolean;
|
|
83
|
+
get isDirty(): boolean;
|
|
84
|
+
get isError(): boolean;
|
|
85
|
+
get adapterError(): unknown;
|
|
86
|
+
get isPreloaded(): boolean;
|
|
87
|
+
get stateName(): "root.loading" | "root.empty" | "root.deleted.inFlight" | "root.deleted.saved" | "root.deleted.invalid" | "root.deleted.uncommitted" | "root.loaded.created.inFlight" | "root.loaded.created.invalid" | "root.loaded.created.uncommitted" | "root.loaded.updated.inFlight" | "root.loaded.updated.invalid" | "root.loaded.updated.uncommitted" | "root.loaded.saved";
|
|
88
|
+
get dirtyType(): "" | "deleted" | "created" | "updated";
|
|
89
|
+
}
|
|
88
90
|
}
|
|
89
91
|
//# sourceMappingURL=record-state.d.ts.map
|