@ember-data-types/store 5.6.0-alpha.5 → 5.6.0-beta.1
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/package.json +1 -1
- package/unstable-preview-types/-private.d.ts +3 -29
- package/unstable-preview-types/configure.d.ts +14 -14
- package/unstable-preview-types/index.d.ts +4 -225
- package/unstable-preview-types/types.d.ts +3 -6
- package/unstable-preview-types/-private/cache-handler/handler.d.ts +0 -59
- package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +0 -1
- package/unstable-preview-types/-private/cache-handler/types.d.ts +0 -101
- package/unstable-preview-types/-private/cache-handler/types.d.ts.map +0 -1
- package/unstable-preview-types/-private/cache-handler/utils.d.ts +0 -34
- package/unstable-preview-types/-private/cache-handler/utils.d.ts.map +0 -1
- package/unstable-preview-types/-private/caches/cache-utils.d.ts +0 -11
- package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +0 -1
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts +0 -171
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +0 -1
- package/unstable-preview-types/-private/caches/instance-cache.d.ts +0 -63
- package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +0 -1
- package/unstable-preview-types/-private/caches/resource-utils.d.ts +0 -12
- package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +0 -1
- package/unstable-preview-types/-private/debug/utils.d.ts +0 -9
- package/unstable-preview-types/-private/debug/utils.d.ts.map +0 -1
- package/unstable-preview-types/-private/document.d.ts +0 -149
- package/unstable-preview-types/-private/document.d.ts.map +0 -1
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +0 -166
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +0 -1
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +0 -19
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +0 -28
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
- package/unstable-preview-types/-private/managers/cache-manager.d.ts +0 -430
- package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +0 -1
- package/unstable-preview-types/-private/managers/notification-manager.d.ts +0 -95
- package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +0 -1
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts +0 -100
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +0 -1
- package/unstable-preview-types/-private/network/request-cache.d.ts +0 -106
- package/unstable-preview-types/-private/network/request-cache.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts +0 -257
- package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts +0 -91
- package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts +0 -172
- package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts +0 -32
- package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts +0 -256
- package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts.map +0 -1
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +0 -143
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +0 -1
- package/unstable-preview-types/-private/record-arrays/many-array.d.ts +0 -202
- package/unstable-preview-types/-private/record-arrays/many-array.d.ts.map +0 -1
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +0 -118
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
- package/unstable-preview-types/-private/store-service.d.ts +0 -1597
- package/unstable-preview-types/-private/store-service.d.ts.map +0 -1
- package/unstable-preview-types/-private/store-service.type-test.d.ts +0 -4
- package/unstable-preview-types/-private/store-service.type-test.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/coerce-id.d.ts +0 -7
- package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/construct-resource.d.ts +0 -9
- package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +0 -4
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +0 -4
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +0 -4
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +0 -1
- package/unstable-preview-types/-private.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +0 -102
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/ds-model.d.ts +0 -24
- package/unstable-preview-types/-types/q/ds-model.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/identifier.d.ts +0 -175
- package/unstable-preview-types/-types/q/identifier.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/promise-proxies.d.ts +0 -4
- package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts +0 -33
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/record-instance.d.ts +0 -24
- package/unstable-preview-types/-types/q/record-instance.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/schema-service.d.ts +0 -334
- package/unstable-preview-types/-types/q/schema-service.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/store.d.ts +0 -37
- package/unstable-preview-types/-types/q/store.d.ts.map +0 -1
- package/unstable-preview-types/configure.d.ts.map +0 -1
- package/unstable-preview-types/index.d.ts.map +0 -1
- package/unstable-preview-types/types.d.ts.map +0 -1
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/network/request-cache' {
|
|
2
|
-
import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
|
-
import type { FindRecordOptions } from '@ember-data/store/-types/q/store';
|
|
4
|
-
import type { Store } from '@ember-data/store/-private/store-service';
|
|
5
|
-
const Touching: "___(unique) Symbol(Touching)";
|
|
6
|
-
export const RequestPromise: "___(unique) Symbol(RequestPromise)";
|
|
7
|
-
export interface Operation {
|
|
8
|
-
op: string;
|
|
9
|
-
options: FindRecordOptions | undefined;
|
|
10
|
-
recordIdentifier: StableRecordIdentifier;
|
|
11
|
-
}
|
|
12
|
-
export interface FindRecordQuery extends Operation {
|
|
13
|
-
op: 'findRecord';
|
|
14
|
-
}
|
|
15
|
-
export interface SaveRecordMutation extends Operation {
|
|
16
|
-
op: 'saveRecord';
|
|
17
|
-
}
|
|
18
|
-
export interface Request {
|
|
19
|
-
data: Operation[];
|
|
20
|
-
options?: Record<string, unknown>;
|
|
21
|
-
}
|
|
22
|
-
export type RequestStates = 'pending' | 'fulfilled' | 'rejected';
|
|
23
|
-
export interface RequestCacheRequestState {
|
|
24
|
-
state: RequestStates;
|
|
25
|
-
type: 'query' | 'mutation';
|
|
26
|
-
request: Request;
|
|
27
|
-
response?: Response;
|
|
28
|
-
}
|
|
29
|
-
export interface Response {
|
|
30
|
-
data: unknown;
|
|
31
|
-
}
|
|
32
|
-
interface InternalRequest extends RequestCacheRequestState {
|
|
33
|
-
[Touching]: StableRecordIdentifier[];
|
|
34
|
-
[RequestPromise]?: Promise<unknown>;
|
|
35
|
-
}
|
|
36
|
-
export type RequestSubscription = (requestState: RequestCacheRequestState) => void;
|
|
37
|
-
/**
|
|
38
|
-
* The RequestStateService is used to track the state of requests
|
|
39
|
-
* for fetching or updating known resource identifies that are inflight.
|
|
40
|
-
*
|
|
41
|
-
* @class RequestStateService
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
export class RequestStateService {
|
|
45
|
-
_pending: Map<StableRecordIdentifier, InternalRequest[]>;
|
|
46
|
-
_done: Map<StableRecordIdentifier, InternalRequest[]>;
|
|
47
|
-
_subscriptions: Map<StableRecordIdentifier, RequestSubscription[]>;
|
|
48
|
-
_toFlush: InternalRequest[];
|
|
49
|
-
_store: Store;
|
|
50
|
-
constructor(store: Store);
|
|
51
|
-
_clearEntries(identifier: StableRecordIdentifier): void;
|
|
52
|
-
_enqueue<T>(promise: Promise<T>, queryRequest: Request): Promise<T>;
|
|
53
|
-
_triggerSubscriptions(req: InternalRequest): void;
|
|
54
|
-
_flush(): void;
|
|
55
|
-
_flushRequest(req: InternalRequest): void;
|
|
56
|
-
_dequeue(identifier: StableRecordIdentifier, request: InternalRequest): void;
|
|
57
|
-
_addDone(request: InternalRequest): void;
|
|
58
|
-
/**
|
|
59
|
-
* Subscribe to requests for a given resource identity.
|
|
60
|
-
*
|
|
61
|
-
* The callback will receive the current state of the request.
|
|
62
|
-
*
|
|
63
|
-
* ```ts
|
|
64
|
-
* interface RequestState {
|
|
65
|
-
* state: 'pending' | 'fulfilled' | 'rejected';
|
|
66
|
-
* type: 'query' | 'mutation';
|
|
67
|
-
* request: Request;
|
|
68
|
-
* response?: { data: unknown };
|
|
69
|
-
* }
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* Note: It should be considered dangerous to use this API for more than simple
|
|
73
|
-
* state derivation or debugging. The `request` and `response` properties are poorly
|
|
74
|
-
* spec'd and may change unexpectedly when shifting what Handlers are in use or how
|
|
75
|
-
* requests are issued from the Store.
|
|
76
|
-
*
|
|
77
|
-
* We expect to revisit this API in the near future as we continue to refine the
|
|
78
|
-
* RequestManager ergonomics, as a simpler but more powerful direct integration
|
|
79
|
-
* with the RequestManager for these purposes is likely to be a better long-term
|
|
80
|
-
* design.
|
|
81
|
-
*
|
|
82
|
-
* @public
|
|
83
|
-
* @param {StableRecordIdentifier} identifier
|
|
84
|
-
* @param {(state: RequestCacheRequestState) => void} callback
|
|
85
|
-
*/
|
|
86
|
-
subscribeForRecord(identifier: StableRecordIdentifier, callback: RequestSubscription): void;
|
|
87
|
-
/**
|
|
88
|
-
* Retrieve all active requests for a given resource identity.
|
|
89
|
-
*
|
|
90
|
-
* @public
|
|
91
|
-
* @param {StableRecordIdentifier} identifier
|
|
92
|
-
* @return {RequestCacheRequestState[]} an array of request states for any pending requests for the given identifier
|
|
93
|
-
*/
|
|
94
|
-
getPendingRequestsForRecord(identifier: StableRecordIdentifier): RequestCacheRequestState[];
|
|
95
|
-
/**
|
|
96
|
-
* Retrieve the last completed request for a given resource identity.
|
|
97
|
-
*
|
|
98
|
-
* @public
|
|
99
|
-
* @param {StableRecordIdentifier} identifier
|
|
100
|
-
* @return {RequestCacheRequestState | null} the state of the most recent request for the given identifier
|
|
101
|
-
*/
|
|
102
|
-
getLastRequestForRecord(identifier: StableRecordIdentifier): RequestCacheRequestState | null;
|
|
103
|
-
}
|
|
104
|
-
export {};
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=request-cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-cache.d.ts","sourceRoot":"","sources":["../../../src/-private/network/request-cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,QAAA,MAAM,QAAQ,gCAAiD,CAAC;AAChE,eAAO,MAAM,cAAc,sCAAsD,CAAC;AAGlF,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACvC,gBAAgB,EAAE,sBAAsB,CAAC;CAC1C;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,EAAE,EAAE,YAAY,CAAC;CAClB;AAED,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,EAAE,EAAE,YAAY,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAEjE,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IAEvB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,UAAU,eAAgB,SAAQ,wBAAwB;IACxD,CAAC,QAAQ,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACrC,CAAC,cAAc,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CACrC;AAGD,MAAM,MAAM,mBAAmB,GAAG,CAAC,YAAY,EAAE,wBAAwB,KAAK,IAAI,CAAC;AAMnF;;;;;;GAMG;AACH,qBAAa,mBAAmB;IAC9B,QAAQ,EAAE,GAAG,CAAC,sBAAsB,EAAE,eAAe,EAAE,CAAC,CAAa;IACrE,KAAK,EAAE,GAAG,CAAC,sBAAsB,EAAE,eAAe,EAAE,CAAC,CAAa;IAClE,cAAc,EAAE,GAAG,CAAC,sBAAsB,EAAE,mBAAmB,EAAE,CAAC,CAAa;IAC/E,QAAQ,EAAE,eAAe,EAAE,CAAM;IACjC,MAAM,EAAE,KAAK,CAAC;gBAEF,KAAK,EAAE,KAAK;IAIxB,aAAa,CAAC,UAAU,EAAE,sBAAsB;IAIhD,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAiDnE,qBAAqB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAcjD,MAAM,IAAI,IAAI;IAOd,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IASzC,QAAQ,CAAC,UAAU,EAAE,sBAAsB,EAAE,OAAO,EAAE,eAAe;IAQrE,QAAQ,CAAC,OAAO,EAAE,eAAe;IAwBjC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,kBAAkB,CAAC,UAAU,EAAE,sBAAsB,EAAE,QAAQ,EAAE,mBAAmB;IASpF;;;;;;OAMG;IACH,2BAA2B,CAAC,UAAU,EAAE,sBAAsB,GAAG,wBAAwB,EAAE;IAI3F;;;;;;OAMG;IACH,uBAAuB,CAAC,UAAU,EAAE,sBAAsB,GAAG,wBAAwB,GAAG,IAAI;CAO7F"}
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/new-core-tmp/promise-state' {
|
|
2
|
-
import type { Awaitable } from '@ember-data/request';
|
|
3
|
-
/**
|
|
4
|
-
* The state of a promise in the "pending"
|
|
5
|
-
* state. This is the default initial state.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export interface PendingPromise {
|
|
9
|
-
/**
|
|
10
|
-
* The status of the promise.
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
status: 'pending';
|
|
14
|
-
/**
|
|
15
|
-
* Whether the promise is pending.
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
isPending: true;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the promise is pending.
|
|
21
|
-
*
|
|
22
|
-
* @deprecated use `isPending` instead
|
|
23
|
-
*/
|
|
24
|
-
isLoading: true;
|
|
25
|
-
/**
|
|
26
|
-
* Whether the promise has resolved
|
|
27
|
-
* successfully.
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
isSuccess: false;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the promise has rejected
|
|
33
|
-
* with an error.
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
isError: false;
|
|
37
|
-
/**
|
|
38
|
-
* Once the promise has resolved, this will
|
|
39
|
-
* be the value the promise resolved to.
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
value: null;
|
|
43
|
-
/**
|
|
44
|
-
* Once the promise has resolved, this will
|
|
45
|
-
* be the value the promise resolved to.
|
|
46
|
-
*
|
|
47
|
-
* @deprecated use `value` instead
|
|
48
|
-
*/
|
|
49
|
-
result: null;
|
|
50
|
-
/**
|
|
51
|
-
* Once the promise has rejected, this will
|
|
52
|
-
* be the error the promise rejected with.
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @deprecated use `reason` instead
|
|
56
|
-
*/
|
|
57
|
-
error: null;
|
|
58
|
-
/**
|
|
59
|
-
* Once the promise has rejected, this will
|
|
60
|
-
* be the error the promise rejected with.
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
reason: null;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* The state of a promise in the "fulfilled" state.
|
|
67
|
-
* This is the state of a promise that has resolved
|
|
68
|
-
* successfully.
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
export interface ResolvedPromise<T> {
|
|
72
|
-
/**
|
|
73
|
-
* The status of the promise.
|
|
74
|
-
*
|
|
75
|
-
*/
|
|
76
|
-
status: 'fulfilled';
|
|
77
|
-
/**
|
|
78
|
-
* Whether the promise is pending.
|
|
79
|
-
*
|
|
80
|
-
*/
|
|
81
|
-
isPending: false;
|
|
82
|
-
/**
|
|
83
|
-
* Whether the promise is pending.
|
|
84
|
-
*
|
|
85
|
-
* @deprecated use `isPending` instead
|
|
86
|
-
*/
|
|
87
|
-
isLoading: false;
|
|
88
|
-
/**
|
|
89
|
-
* Whether the promise has resolved
|
|
90
|
-
* successfully.
|
|
91
|
-
*
|
|
92
|
-
*/
|
|
93
|
-
isSuccess: true;
|
|
94
|
-
/**
|
|
95
|
-
* Whether the promise has rejected
|
|
96
|
-
* with an error.
|
|
97
|
-
*
|
|
98
|
-
*/
|
|
99
|
-
isError: false;
|
|
100
|
-
/**
|
|
101
|
-
* Once the promise has resolved, this will
|
|
102
|
-
* be the value the promise resolved to.
|
|
103
|
-
*
|
|
104
|
-
*/
|
|
105
|
-
value: T;
|
|
106
|
-
/**
|
|
107
|
-
* Once the promise has resolved, this will
|
|
108
|
-
* be the value the promise resolved to.
|
|
109
|
-
*
|
|
110
|
-
* @deprecated use `value` instead
|
|
111
|
-
*/
|
|
112
|
-
result: T;
|
|
113
|
-
/**
|
|
114
|
-
* Once the promise has rejected, this will
|
|
115
|
-
* be the error the promise rejected with.
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* @deprecated use `reason` instead
|
|
119
|
-
*/
|
|
120
|
-
error: null;
|
|
121
|
-
/**
|
|
122
|
-
* Once the promise has rejected, this will
|
|
123
|
-
* be the error the promise rejected with.
|
|
124
|
-
*
|
|
125
|
-
*/
|
|
126
|
-
reason: null;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* The state of a promise in the "rejected" state.
|
|
130
|
-
* This is the state of a promise that has rejected
|
|
131
|
-
* with an error.
|
|
132
|
-
*
|
|
133
|
-
*/
|
|
134
|
-
export interface RejectedPromise<E> {
|
|
135
|
-
/**
|
|
136
|
-
* The status of the promise.
|
|
137
|
-
*
|
|
138
|
-
*/
|
|
139
|
-
status: 'rejected';
|
|
140
|
-
/**
|
|
141
|
-
* Whether the promise is pending.
|
|
142
|
-
*
|
|
143
|
-
*/
|
|
144
|
-
isPending: false;
|
|
145
|
-
/**
|
|
146
|
-
* Whether the promise is pending.
|
|
147
|
-
*
|
|
148
|
-
* @deprecated use `isPending` instead
|
|
149
|
-
*/
|
|
150
|
-
isLoading: false;
|
|
151
|
-
/**
|
|
152
|
-
* Whether the promise has resolved
|
|
153
|
-
* successfully.
|
|
154
|
-
*
|
|
155
|
-
*/
|
|
156
|
-
isSuccess: false;
|
|
157
|
-
/**
|
|
158
|
-
* Whether the promise has rejected
|
|
159
|
-
* with an error.
|
|
160
|
-
*
|
|
161
|
-
*/
|
|
162
|
-
isError: true;
|
|
163
|
-
/**
|
|
164
|
-
* Once the promise has resolved, this will
|
|
165
|
-
* be the value the promise resolved to.
|
|
166
|
-
*
|
|
167
|
-
*/
|
|
168
|
-
value: null;
|
|
169
|
-
/**
|
|
170
|
-
* Once the promise has resolved, this will
|
|
171
|
-
* be the value the promise resolved to.
|
|
172
|
-
*
|
|
173
|
-
* @deprecated use `value` instead
|
|
174
|
-
*/
|
|
175
|
-
result: null;
|
|
176
|
-
/**
|
|
177
|
-
* Once the promise has rejected, this will
|
|
178
|
-
* be the error the promise rejected with.
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* @deprecated use `reason` instead
|
|
182
|
-
*/
|
|
183
|
-
error: E;
|
|
184
|
-
/**
|
|
185
|
-
* Once the promise has rejected, this will
|
|
186
|
-
* be the error the promise rejected with.
|
|
187
|
-
*
|
|
188
|
-
*/
|
|
189
|
-
reason: E;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* The state of a promise. This is the type that is returned
|
|
193
|
-
* from `getPromiseState`.
|
|
194
|
-
*
|
|
195
|
-
* See also:
|
|
196
|
-
* - {@link PendingPromise}
|
|
197
|
-
* - {@link ResolvedPromise}
|
|
198
|
-
* - {@link RejectedPromise}
|
|
199
|
-
*
|
|
200
|
-
*/
|
|
201
|
-
export type PromiseState<T = unknown, E = unknown> = PendingPromise | ResolvedPromise<T> | RejectedPromise<E>;
|
|
202
|
-
export function createPromiseState<T, E>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>>;
|
|
203
|
-
/**
|
|
204
|
-
* Returns a reactive state-machine for the provided promise or awaitable.
|
|
205
|
-
*
|
|
206
|
-
* Repeat calls to `getPromiseState` with the same promise will return the same state object
|
|
207
|
-
* making is safe and easy to use in templates and JavaScript code to produce reactive
|
|
208
|
-
* behaviors around promises.
|
|
209
|
-
*
|
|
210
|
-
* `getPromiseState` can be used in both JavaScript and Template contexts.
|
|
211
|
-
*
|
|
212
|
-
* ```ts
|
|
213
|
-
* import { getPromiseState } from '@warp-drive/ember';
|
|
214
|
-
*
|
|
215
|
-
* const state = getPromiseState(promise);
|
|
216
|
-
* ```
|
|
217
|
-
*
|
|
218
|
-
* For instance, we could write a getter on a component that updates whenever
|
|
219
|
-
* the promise state advances or the promise changes, by combining the function
|
|
220
|
-
* with the use of `@cached`
|
|
221
|
-
*
|
|
222
|
-
* ```ts
|
|
223
|
-
* class Component {
|
|
224
|
-
* @cached
|
|
225
|
-
* get title() {
|
|
226
|
-
* const state = getPromiseState(this.args.request);
|
|
227
|
-
* if (state.isPending) {
|
|
228
|
-
* return 'loading...';
|
|
229
|
-
* }
|
|
230
|
-
* if (state.isError) { return null; }
|
|
231
|
-
* return state.result.title;
|
|
232
|
-
* }
|
|
233
|
-
* }
|
|
234
|
-
* ```
|
|
235
|
-
*
|
|
236
|
-
* Or in a template as a helper:
|
|
237
|
-
*
|
|
238
|
-
* ```gjs
|
|
239
|
-
* import { getPromiseState } from '@warp-drive/ember';
|
|
240
|
-
*
|
|
241
|
-
* <template>
|
|
242
|
-
* {{#let (getPromiseState @request) as |state|}}
|
|
243
|
-
* {{#if state.isPending}} <Spinner />
|
|
244
|
-
* {{else if state.isError}} <ErrorForm @error={{state.error}} />
|
|
245
|
-
* {{else}}
|
|
246
|
-
* <h1>{{state.result.title}}</h1>
|
|
247
|
-
* {{/if}}
|
|
248
|
-
* {{/let}}
|
|
249
|
-
* </template>
|
|
250
|
-
* ```
|
|
251
|
-
*
|
|
252
|
-
* If looking to use in a template, consider also the `<Await />` component.
|
|
253
|
-
*
|
|
254
|
-
*/
|
|
255
|
-
export function getPromiseState<T = unknown, E = unknown>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>>;
|
|
256
|
-
}
|
|
257
|
-
//# sourceMappingURL=promise-state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promise-state.d.ts","sourceRoot":"","sources":["../../../src/-private/new-core-tmp/promise-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAOrD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,MAAM,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;;;OAIG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;;;OAIG;IACH,SAAS,EAAE,KAAK,CAAC;IAEjB;;;;OAIG;IACH,OAAO,EAAE,KAAK,CAAC;IAEf;;;;OAIG;IACH,KAAK,EAAE,IAAI,CAAC;IACZ;;;;;OAKG;IACH,MAAM,EAAE,IAAI,CAAC;IAEb;;;;;;OAMG;IACH,KAAK,EAAE,IAAI,CAAC;IAEZ;;;;OAIG;IACH,MAAM,EAAE,IAAI,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC;;;OAGG;IACH,MAAM,EAAE,WAAW,CAAC;IAEpB;;;OAGG;IACH,SAAS,EAAE,KAAK,CAAC;IAEjB;;;;OAIG;IACH,SAAS,EAAE,KAAK,CAAC;IACjB;;;;OAIG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;;;OAIG;IACH,OAAO,EAAE,KAAK,CAAC;IAEf;;;;OAIG;IACH,KAAK,EAAE,CAAC,CAAC;IAET;;;;;OAKG;IACH,MAAM,EAAE,CAAC,CAAC;IAEV;;;;;;OAMG;IACH,KAAK,EAAE,IAAI,CAAC;IAEZ;;;;OAIG;IACH,MAAM,EAAE,IAAI,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC;;;OAGG;IACH,MAAM,EAAE,UAAU,CAAC;IAEnB;;;OAGG;IACH,SAAS,EAAE,KAAK,CAAC;IAEjB;;;;OAIG;IACH,SAAS,EAAE,KAAK,CAAC;IAEjB;;;;OAIG;IACH,SAAS,EAAE,KAAK,CAAC;IAEjB;;;;OAIG;IACH,OAAO,EAAE,IAAI,CAAC;IAEd;;;;OAIG;IACH,KAAK,EAAE,IAAI,CAAC;IAEZ;;;;;OAKG;IACH,MAAM,EAAE,IAAI,CAAC;IAEb;;;;;;OAMG;IACH,KAAK,EAAE,CAAC,CAAC;IAET;;;;OAIG;IACH,MAAM,EAAE,CAAC,CAAC;CACX;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,cAAc,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;AAgB9G,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CA4C5G;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EACtD,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAU9B"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/new-core-tmp/reactivity/configure' {
|
|
2
|
-
export const ARRAY_SIGNAL: "___(unique) Symbol(#[])";
|
|
3
|
-
export const OBJECT_SIGNAL: "___(unique) Symbol(#{})";
|
|
4
|
-
/**
|
|
5
|
-
* Requirements:
|
|
6
|
-
*
|
|
7
|
-
* Signal:
|
|
8
|
-
*
|
|
9
|
-
* - signal: a way of creating a reference that we can dirty when we desire to notify
|
|
10
|
-
* - @signal: a way of creating an accessor on an object that subscribes to a signal on access
|
|
11
|
-
* and notifies the signal on set, or of upgrading a descriptor to be such an accessor
|
|
12
|
-
* - defineSignal: a way of creating a signal on an object
|
|
13
|
-
* - notifySignal: a way of notifying the underlying signal that it has been dirtied
|
|
14
|
-
* - peekSignal: a way of inspecting the signal without notifying it
|
|
15
|
-
*
|
|
16
|
-
* - gate: a memoized getter function that re-runs when on access if its signal is dirty
|
|
17
|
-
* conceptually, a gate is a tightly coupled signal and memo
|
|
18
|
-
* - @gate: a way of creating a gate on an object or upgrading a descriptor with a getter
|
|
19
|
-
* to be a gate
|
|
20
|
-
* - defineGate: a way of creating a gate on an object
|
|
21
|
-
* - notifySignal: a way of notifying the signal for a gate that it has been dirtied
|
|
22
|
-
*
|
|
23
|
-
* - memo:
|
|
24
|
-
* - @memo: a way of creating a memoized getter on an object or upgrading a descriptor with a getter
|
|
25
|
-
* to be a memo
|
|
26
|
-
* - defineMemo: a way of creating a memo on an object
|
|
27
|
-
*
|
|
28
|
-
* - signalStore: storage bucket for signals associated to an object
|
|
29
|
-
* - withSignalStore: a way of pre-creating a signal store on an object
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* An Opaque type that represents a framework specific or TC39 signal.
|
|
36
|
-
*
|
|
37
|
-
* It may be an array of signals or a single signal.
|
|
38
|
-
*
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export type SignalRef = unknown;
|
|
42
|
-
/**
|
|
43
|
-
* The hooks which MUST be configured in order to use this library,
|
|
44
|
-
* either for framework specfic signals or TC39 signals.
|
|
45
|
-
*
|
|
46
|
-
* Support for multiple frameworks simultaneously can be done via
|
|
47
|
-
* this abstraction by returning multiple signals from the `createSignal`
|
|
48
|
-
* method, and consuming the correct one via the correct framework via
|
|
49
|
-
* the `consumeSignal` and `notifySignal` methods.
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
export interface SignalHooks<T = SignalRef> {
|
|
53
|
-
createSignal: (obj: object, key: string | symbol) => T;
|
|
54
|
-
consumeSignal: (signal: T) => void;
|
|
55
|
-
notifySignal: (signal: T) => void;
|
|
56
|
-
createMemo: <F>(obj: object, key: string | symbol, fn: () => F) => () => F;
|
|
57
|
-
willSyncFlushWatchers: () => boolean;
|
|
58
|
-
}
|
|
59
|
-
export interface HooksOptions {
|
|
60
|
-
wellknown: {
|
|
61
|
-
Array: symbol | string;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* The public API for configuring the signal hooks.
|
|
66
|
-
*
|
|
67
|
-
* @internal
|
|
68
|
-
*/
|
|
69
|
-
export function setupSignals<T>(buildConfig: (options: HooksOptions) => SignalHooks<T>): void;
|
|
70
|
-
/**
|
|
71
|
-
* Internal method for consuming the configured `createSignal` hook
|
|
72
|
-
*
|
|
73
|
-
* @internal
|
|
74
|
-
*/
|
|
75
|
-
export function createSignal(obj: object, key: string | symbol): SignalRef;
|
|
76
|
-
/**
|
|
77
|
-
* Internal method for consuming the configured `consumeSignal` hook
|
|
78
|
-
*
|
|
79
|
-
* @internal
|
|
80
|
-
*/
|
|
81
|
-
export function consumeSignal(signal: SignalRef): void;
|
|
82
|
-
/**
|
|
83
|
-
* Internal method for consuming the configured `notifySignal` hook
|
|
84
|
-
*
|
|
85
|
-
* @internal
|
|
86
|
-
*/
|
|
87
|
-
export function notifySignal(signal: SignalRef): void;
|
|
88
|
-
export function createMemo<T>(object: object, key: string | symbol, fn: () => T): () => T;
|
|
89
|
-
export function willSyncFlushWatchers(): boolean;
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=configure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/-private/new-core-tmp/reactivity/configure.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,2BAAuC,CAAC;AACjE,eAAO,MAAM,aAAa,2BAAuC,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC;AAChC;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,SAAS;IACxC,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,KAAK,CAAC,CAAC;IACvD,aAAa,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,CAAC;IAC3E,qBAAqB,EAAE,MAAM,OAAO,CAAC;CACtC;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,QAWrF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIzE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,QAK9C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,QAI7C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAIxF;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAI/C"}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/new-core-tmp/reactivity/internal' {
|
|
2
|
-
import { ARRAY_SIGNAL, OBJECT_SIGNAL, type SignalRef } from '@ember-data/store/-private/new-core-tmp/reactivity/configure';
|
|
3
|
-
export type { SignalRef };
|
|
4
|
-
export { ARRAY_SIGNAL, OBJECT_SIGNAL };
|
|
5
|
-
/**
|
|
6
|
-
* A WarpDriveSignal is a wrapper around a framework specific or TC39 signal
|
|
7
|
-
* that enables us to store and manage the signal in a universal way.
|
|
8
|
-
*
|
|
9
|
-
* WarpDrive uses signals to manage three separate concepts:
|
|
10
|
-
*
|
|
11
|
-
* - as a `storage` for a value local to the object that we want to be reactive
|
|
12
|
-
* (see `@local` schema field for an example)
|
|
13
|
-
* - as a `gate` for a memoized getter that we want to act as a reactive property
|
|
14
|
-
* but whose value is computed/pulled from a non-reactive source elsewhere
|
|
15
|
-
* and whose latest value is stored in the signal
|
|
16
|
-
* (see `field` schema field for an example)
|
|
17
|
-
* - as a `gate` with a manually managed value updated on pull when `isStale` is true
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* It offers
|
|
21
|
-
*
|
|
22
|
-
* - a non-reactive way to access/update the current value
|
|
23
|
-
* - a non-reactive way to mark the signal as dirtied
|
|
24
|
-
* - a non-reactive way to store content for why the signal was dirtied
|
|
25
|
-
* - access to the underlying Signal(s) in-use
|
|
26
|
-
*
|
|
27
|
-
* For debugging:
|
|
28
|
-
* - the "key" or "name" of the signal
|
|
29
|
-
* - the "object identity" or "context" to which the signal is attached
|
|
30
|
-
*
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
export interface WarpDriveSignal {
|
|
34
|
-
/**
|
|
35
|
-
* The "key" or "name" of the signal.
|
|
36
|
-
* This is usually (but not always) the name of a property
|
|
37
|
-
* on the object to which the signal is attached.
|
|
38
|
-
*
|
|
39
|
-
* This is used for debugging purposes.
|
|
40
|
-
* It is not used for any other purpose.
|
|
41
|
-
*
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
key: string | symbol;
|
|
45
|
-
/**
|
|
46
|
-
* The "object identity" or "context" to which the
|
|
47
|
-
* signal is attached.
|
|
48
|
-
*
|
|
49
|
-
* This is used for debugging purposes.
|
|
50
|
-
* It is not used for any other purpose.
|
|
51
|
-
*
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
context: object;
|
|
55
|
-
/**
|
|
56
|
-
* The underlying signal(s) in-use.
|
|
57
|
-
*
|
|
58
|
-
* Generally, this is a single signal.
|
|
59
|
-
*
|
|
60
|
-
* In some cases multiple signals need to be condensed,
|
|
61
|
-
* such as to support legacy Ember Array APIs or to
|
|
62
|
-
* support reactive-objects shared between the code of
|
|
63
|
-
* multiple frameworks.
|
|
64
|
-
*
|
|
65
|
-
* In such cases, this value may be an array.
|
|
66
|
-
*
|
|
67
|
-
* e.g. (pseudo-code for Ember):
|
|
68
|
-
*
|
|
69
|
-
* setupSignals({
|
|
70
|
-
* createSignal: (obj, key, initialValue) => {
|
|
71
|
-
* if (isArraySignal(key)) {
|
|
72
|
-
* return [
|
|
73
|
-
* tagForProperty(obj, key),
|
|
74
|
-
* tagForProperty(obj, '[]'),
|
|
75
|
-
* tagForProperty(obj, 'length'),
|
|
76
|
-
* ];
|
|
77
|
-
* }
|
|
78
|
-
* return tagForProperty(obj, key);
|
|
79
|
-
* },
|
|
80
|
-
*
|
|
81
|
-
* consumeSignal: (signal) => {
|
|
82
|
-
* if (Array.isArray(signal)) {
|
|
83
|
-
* signal.forEach((s) => consumeTag(s));
|
|
84
|
-
* } else {
|
|
85
|
-
* consumeTag(signal);
|
|
86
|
-
* }
|
|
87
|
-
* },
|
|
88
|
-
*
|
|
89
|
-
* dirtySignal: (signal) => {
|
|
90
|
-
* if (Array.isArray(signal)) {
|
|
91
|
-
* signal.forEach((s) => dirtyTag(s));
|
|
92
|
-
* } else {
|
|
93
|
-
* dirtyTag(signal);
|
|
94
|
-
* }
|
|
95
|
-
* },
|
|
96
|
-
* });
|
|
97
|
-
*
|
|
98
|
-
* @internal
|
|
99
|
-
*/
|
|
100
|
-
signal: SignalRef;
|
|
101
|
-
/**
|
|
102
|
-
* The last "value" computed for this signal when
|
|
103
|
-
* a signal is also used for storage.
|
|
104
|
-
*
|
|
105
|
-
* @internal
|
|
106
|
-
*/
|
|
107
|
-
value: unknown;
|
|
108
|
-
/**
|
|
109
|
-
* Whether ths signal is known to have been dirtied.
|
|
110
|
-
* This is useful *both* when manually managing the
|
|
111
|
-
* `value` cache and when using the signal as a
|
|
112
|
-
* "gate"
|
|
113
|
-
*
|
|
114
|
-
* @internal
|
|
115
|
-
*/
|
|
116
|
-
isStale: boolean;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* We attach signals to their context object via
|
|
120
|
-
* a Map attached to the object via this symbol.
|
|
121
|
-
*
|
|
122
|
-
* This allows us to store multiple signals
|
|
123
|
-
* on the same object with smaller memory
|
|
124
|
-
* overhead and no WeakMap lookups.
|
|
125
|
-
*
|
|
126
|
-
* Performance sensitive objects should
|
|
127
|
-
* pre-warm their shape by assigning this
|
|
128
|
-
* during initialization.
|
|
129
|
-
*
|
|
130
|
-
* ```ts
|
|
131
|
-
* initializeSignalStore(obj);
|
|
132
|
-
* ```
|
|
133
|
-
*
|
|
134
|
-
* @internal
|
|
135
|
-
*/
|
|
136
|
-
export const Signals: "___(unique) Symbol(Signals)";
|
|
137
|
-
export type SignalStore = Map<string | symbol, WarpDriveSignal>;
|
|
138
|
-
/**
|
|
139
|
-
* A type util to recast the object as having a signal store.
|
|
140
|
-
*
|
|
141
|
-
* @internal
|
|
142
|
-
*/
|
|
143
|
-
export function upgradeWithSignals<T extends object>(obj: T): asserts obj is T & {
|
|
144
|
-
[Signals]: SignalStore;
|
|
145
|
-
};
|
|
146
|
-
/**
|
|
147
|
-
* A util that will create a signal store on the object
|
|
148
|
-
* if it does not already exist and returns the associated
|
|
149
|
-
* signal store.
|
|
150
|
-
*
|
|
151
|
-
* @internal
|
|
152
|
-
*/
|
|
153
|
-
export function withSignalStore<T extends object>(obj: T): SignalStore;
|
|
154
|
-
/**
|
|
155
|
-
* A util that will create a signal store on the object
|
|
156
|
-
* if it does not already exist.
|
|
157
|
-
*
|
|
158
|
-
* Useful for pre-warming the shape of an object to ensure
|
|
159
|
-
* a key-transition to add it is not required later.
|
|
160
|
-
*
|
|
161
|
-
* @internal
|
|
162
|
-
*/
|
|
163
|
-
export function initializeSignalStore<T extends object>(obj: T): asserts obj is T & {
|
|
164
|
-
[Signals]: SignalStore;
|
|
165
|
-
};
|
|
166
|
-
export function createInternalSignal(signals: SignalStore, obj: object, key: string | symbol, initialValue: unknown): WarpDriveSignal;
|
|
167
|
-
export function getOrCreateInternalSignal(signals: SignalStore, obj: object, key: string | symbol, initialValue: unknown): WarpDriveSignal;
|
|
168
|
-
export function peekInternalSignal(signals: SignalStore | undefined, key: string | symbol): WarpDriveSignal | undefined;
|
|
169
|
-
export function consumeInternalSignal(signal: WarpDriveSignal): void;
|
|
170
|
-
export function notifyInternalSignal(signal: WarpDriveSignal | undefined): void;
|
|
171
|
-
}
|
|
172
|
-
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../src/-private/new-core-tmp/reactivity/internal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAA6C,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAErH,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;OASG;IACH,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAErB;;;;;;;;OAQG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACH,MAAM,EAAE,SAAS,CAAC;IAElB;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;;;;;;OAOG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,OAAO,+BAA+C,CAAC;AACpE,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,eAAe,CAAC,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG;IAAE,CAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,CAAG;AAE9G;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,eAMvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG;IAAE,CAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,CAI7G;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,YAAY,EAAE,OAAO,GACpB,eAAe,CAYjB;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,YAAY,EAAE,OAAO,GACpB,eAAe,CAMjB;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,GAAG,SAAS,EAChC,GAAG,EAAE,MAAM,GAAG,MAAM,GACnB,eAAe,GAAG,SAAS,CAE7B;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,QAE5D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,QAKvE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/new-core-tmp/reactivity/signal' {
|
|
2
|
-
import type { SignalStore, WarpDriveSignal } from '@ember-data/store/-private/new-core-tmp/reactivity/internal';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a signal for the key/object pairing and subscribes to the signal.
|
|
5
|
-
*
|
|
6
|
-
* Use when you need to ensure a signal exists and is subscribed to.
|
|
7
|
-
*
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export function entangleSignal<T extends object>(signals: SignalStore, obj: T, key: string | symbol, initialValue: unknown): WarpDriveSignal;
|
|
11
|
-
/**
|
|
12
|
-
* define an enumerable signal property.
|
|
13
|
-
*
|
|
14
|
-
* Akin to Object.defineProperty.
|
|
15
|
-
*
|
|
16
|
-
* The signal will be lazily created when accessed and scoped to the
|
|
17
|
-
* instance of the object.
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
export function defineSignal<T extends object>(obj: T, key: string, v?: unknown): void;
|
|
22
|
-
/**
|
|
23
|
-
* Define a non-enumerable signal property.
|
|
24
|
-
*
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
export function defineNonEnumerableSignal<T extends object>(obj: T, key: string, v?: unknown): void;
|
|
28
|
-
export function memoized<T extends object, K extends keyof T & string>(target: T, key: K, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
29
|
-
export function gate<T extends object, K extends keyof T & string>(_target: T, key: K, desc: PropertyDescriptor): PropertyDescriptor;
|
|
30
|
-
export function defineGate<T extends object>(obj: T, key: string, desc: PropertyDescriptor): void;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=signal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../../../src/-private/new-core-tmp/reactivity/signal.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAW,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAUxE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAC7C,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,YAAY,EAAE,OAAO,GACpB,eAAe,CAQjB;AAsBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,QAE9E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,QAI3F;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EACnE,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,CAAC,EACN,UAAU,EAAE,kBAAkB,sBAoC/B;AAED,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,sBAqC9G;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,QAGzF"}
|