@warp-drive/core 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/README.md +8 -7
- package/cjs-dist/addon-shim.cjs +1 -0
- package/cjs-dist/cjs-set-config.cjs +1 -0
- package/declarations/build-config/babel-macros.d.ts +1 -0
- package/declarations/build-config/canary-features.d.ts +1 -0
- package/declarations/build-config/debugging.d.ts +1 -0
- package/declarations/build-config/deprecations.d.ts +1 -0
- package/declarations/build-config/env.d.ts +1 -0
- package/declarations/build-config/macros.d.ts +1 -0
- package/declarations/build-config.d.ts +1 -0
- package/declarations/configure.d.ts +7 -0
- package/declarations/graph/-private/-diff.d.ts +32 -0
- package/declarations/graph/-private/-edge-definition.d.ts +148 -0
- package/declarations/graph/-private/-state.d.ts +96 -0
- package/declarations/graph/-private/-utils.d.ts +31 -0
- package/declarations/graph/-private/coerce-id.d.ts +10 -0
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +18 -0
- package/declarations/graph/-private/edges/collection.d.ts +39 -0
- package/declarations/graph/-private/edges/implicit.d.ts +43 -0
- package/declarations/graph/-private/edges/resource.d.ts +24 -0
- package/declarations/graph/-private/graph.d.ts +90 -0
- package/declarations/graph/-private/normalize-link.d.ts +8 -0
- package/declarations/graph/-private/operations/add-to-related-records.d.ts +4 -0
- package/declarations/graph/-private/operations/merge-identifier.d.ts +3 -0
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts +4 -0
- package/declarations/graph/-private/operations/replace-related-record.d.ts +3 -0
- package/declarations/graph/-private/operations/replace-related-records.d.ts +62 -0
- package/declarations/graph/-private/operations/update-relationship.d.ts +13 -0
- package/declarations/graph/-private.d.ts +13 -0
- package/declarations/index.d.ts +14 -3
- package/declarations/reactive/-private/document.d.ts +146 -0
- package/declarations/reactive/-private/fields/compute.d.ts +43 -0
- package/declarations/reactive/-private/fields/extension.d.ts +8 -0
- package/declarations/reactive/-private/fields/managed-array.d.ts +22 -0
- package/declarations/reactive/-private/fields/managed-object.d.ts +21 -0
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +19 -0
- package/declarations/reactive/-private/hooks.d.ts +5 -0
- package/declarations/reactive/-private/record.d.ts +64 -0
- package/declarations/reactive/-private/schema.d.ts +271 -0
- package/declarations/reactive/-private/symbols.d.ts +36 -0
- package/declarations/reactive/-private.d.ts +1 -0
- package/declarations/reactive.d.ts +4 -0
- package/declarations/request/-private/context.d.ts +34 -35
- package/declarations/request/-private/debug.d.ts +2 -3
- package/declarations/request/-private/fetch.d.ts +24 -36
- package/declarations/request/-private/future.d.ts +3 -4
- package/declarations/request/-private/manager.d.ts +159 -132
- package/declarations/request/-private/promise-cache.d.ts +21 -13
- package/declarations/request/-private/types.d.ts +124 -123
- package/declarations/request/-private/utils.d.ts +8 -9
- package/declarations/request.d.ts +5 -433
- package/declarations/store/-private/cache-handler/handler.d.ts +62 -0
- package/declarations/store/-private/cache-handler/types.d.ts +98 -0
- package/declarations/store/-private/cache-handler/utils.d.ts +32 -0
- package/declarations/store/-private/caches/cache-utils.d.ts +12 -0
- package/declarations/store/-private/caches/identifier-cache.d.ts +304 -0
- package/declarations/store/-private/caches/instance-cache.d.ts +65 -0
- package/declarations/store/-private/caches/resource-utils.d.ts +9 -0
- package/declarations/store/-private/debug/utils.d.ts +6 -0
- package/declarations/store/-private/default-cache-policy.d.ts +384 -0
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts +159 -0
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +17 -0
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +25 -0
- package/declarations/store/-private/managers/cache-manager.d.ts +443 -0
- package/declarations/store/-private/managers/notification-manager.d.ts +98 -0
- package/declarations/store/-private/managers/record-array-manager.d.ts +97 -0
- package/declarations/store/-private/network/request-cache.d.ts +107 -0
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts +263 -0
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +176 -0
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +169 -0
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +35 -0
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +277 -0
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +261 -0
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +147 -0
- package/declarations/store/-private/record-arrays/many-array.d.ts +197 -0
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +126 -0
- package/declarations/store/-private/store-service.d.ts +1605 -0
- package/declarations/store/-private/utils/coerce-id.d.ts +10 -0
- package/declarations/store/-private/utils/construct-resource.d.ts +6 -0
- package/declarations/store/-private/utils/is-non-empty-string.d.ts +1 -0
- package/declarations/store/-private/utils/normalize-model-name.d.ts +1 -0
- package/declarations/store/-private/utils/uuid-polyfill.d.ts +1 -0
- package/declarations/store/-private.d.ts +31 -0
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +99 -0
- package/declarations/store/-types/q/ds-model.d.ts +21 -0
- package/declarations/store/-types/q/identifier.d.ts +20 -0
- package/declarations/store/-types/q/record-instance.d.ts +23 -0
- package/declarations/store/-types/q/schema-service.d.ts +354 -0
- package/declarations/store/-types/q/store.d.ts +32 -0
- package/declarations/store.d.ts +1 -0
- package/declarations/types/-private.d.ts +16 -8
- package/declarations/types/cache/aliases.d.ts +11 -1
- package/declarations/types/cache/change.d.ts +4 -5
- package/declarations/types/cache/mutations.d.ts +51 -28
- package/declarations/types/cache/operations.d.ts +60 -47
- package/declarations/types/cache/relationship.d.ts +11 -9
- package/declarations/types/cache.d.ts +495 -484
- package/declarations/types/graph.d.ts +31 -40
- package/declarations/types/identifier.d.ts +83 -82
- package/declarations/types/json/raw.d.ts +1 -2
- package/declarations/types/params.d.ts +4 -5
- package/declarations/types/record.d.ts +117 -76
- package/declarations/types/request.d.ts +289 -266
- package/declarations/types/runtime.d.ts +8 -9
- package/declarations/types/schema/concepts.d.ts +19 -13
- package/declarations/types/schema/fields.d.ts +1712 -1741
- package/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/declarations/types/spec/document.d.ts +28 -22
- package/declarations/types/spec/error.d.ts +16 -17
- package/declarations/types/spec/json-api-raw.d.ts +102 -102
- package/declarations/types/symbols.d.ts +74 -75
- package/declarations/types/utils.d.ts +5 -5
- package/declarations/types.d.ts +10 -7
- package/declarations/utils/string.d.ts +48 -0
- package/dist/build-config/babel-macros.js +1 -0
- package/dist/build-config/canary-features.js +1 -0
- package/dist/build-config/debugging.js +1 -0
- package/dist/build-config/deprecations.js +1 -0
- package/dist/build-config/env.js +1 -0
- package/dist/build-config/macros.js +1 -0
- package/dist/build-config.js +1 -0
- package/dist/configure-B48bFHOl.js +181 -0
- package/dist/configure.js +1 -0
- package/dist/{context-DE5sFezZ.js → context-COmAnXUQ.js} +2 -2
- package/dist/graph/-private.js +3372 -0
- package/dist/handler-C2T-IyJK.js +339 -0
- package/dist/index.js +37 -104
- package/dist/reactive/-private.js +1 -0
- package/dist/reactive.js +1988 -0
- package/dist/request-state-CjLph1LP.js +8139 -0
- package/dist/request.js +1 -1
- package/dist/store/-private.js +3 -0
- package/dist/store.js +545 -0
- package/dist/symbols-SIstXMLI.js +44 -0
- package/dist/types/-private.js +3 -3
- package/dist/types/record.js +1 -1
- package/dist/types/request.js +2 -2
- package/dist/types/runtime.js +1 -1
- package/dist/types/schema/fields.js +8 -41
- package/dist/types/symbols.js +3 -3
- package/dist/utils/string.js +92 -0
- package/logos/NCC-1701-a-blue.svg +4 -0
- package/logos/NCC-1701-a-gold.svg +4 -0
- package/logos/NCC-1701-a-gold_100.svg +1 -0
- package/logos/NCC-1701-a-gold_base-64.txt +1 -0
- package/logos/NCC-1701-a.svg +4 -0
- package/logos/README.md +4 -0
- package/logos/docs-badge.svg +2 -0
- package/logos/ember-data-logo-dark.svg +12 -0
- package/logos/ember-data-logo-light.svg +12 -0
- package/logos/github-header.svg +444 -0
- package/logos/social1.png +0 -0
- package/logos/social2.png +0 -0
- package/logos/warp-drive-logo-dark.svg +4 -0
- package/logos/warp-drive-logo-gold.svg +4 -0
- package/package.json +11 -8
- package/declarations/index.d.ts.map +0 -1
- package/declarations/request/-private/context.d.ts.map +0 -1
- package/declarations/request/-private/debug.d.ts.map +0 -1
- package/declarations/request/-private/fetch.d.ts.map +0 -1
- package/declarations/request/-private/future.d.ts.map +0 -1
- package/declarations/request/-private/manager.d.ts.map +0 -1
- package/declarations/request/-private/promise-cache.d.ts.map +0 -1
- package/declarations/request/-private/types.d.ts.map +0 -1
- package/declarations/request/-private/utils.d.ts.map +0 -1
- package/declarations/request.d.ts.map +0 -1
- package/declarations/types/-private.d.ts.map +0 -1
- package/declarations/types/cache/aliases.d.ts.map +0 -1
- package/declarations/types/cache/change.d.ts.map +0 -1
- package/declarations/types/cache/mutations.d.ts.map +0 -1
- package/declarations/types/cache/operations.d.ts.map +0 -1
- package/declarations/types/cache/relationship.d.ts.map +0 -1
- package/declarations/types/cache.d.ts.map +0 -1
- package/declarations/types/graph.d.ts.map +0 -1
- package/declarations/types/identifier.d.ts.map +0 -1
- package/declarations/types/json/raw.d.ts.map +0 -1
- package/declarations/types/params.d.ts.map +0 -1
- package/declarations/types/record.d.ts.map +0 -1
- package/declarations/types/record.type-test.d.ts +0 -2
- package/declarations/types/record.type-test.d.ts.map +0 -1
- package/declarations/types/request.d.ts.map +0 -1
- package/declarations/types/request.type-test.d.ts +0 -2
- package/declarations/types/request.type-test.d.ts.map +0 -1
- package/declarations/types/runtime.d.ts.map +0 -1
- package/declarations/types/schema/concepts.d.ts.map +0 -1
- package/declarations/types/schema/fields.d.ts.map +0 -1
- package/declarations/types/schema/fields.type-test.d.ts.map +0 -1
- package/declarations/types/spec/document.d.ts.map +0 -1
- package/declarations/types/spec/error.d.ts.map +0 -1
- package/declarations/types/spec/json-api-raw.d.ts.map +0 -1
- package/declarations/types/symbols.d.ts.map +0 -1
- package/declarations/types/utils.d.ts.map +0 -1
- package/declarations/types.d.ts.map +0 -1
- package/dist/context-DE5sFezZ.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/request.js.map +0 -1
- package/dist/types/-private.js.map +0 -1
- package/dist/types/cache/aliases.js.map +0 -1
- package/dist/types/cache/change.js.map +0 -1
- package/dist/types/cache/mutations.js.map +0 -1
- package/dist/types/cache/operations.js.map +0 -1
- package/dist/types/cache/relationship.js.map +0 -1
- package/dist/types/cache.js.map +0 -1
- package/dist/types/graph.js.map +0 -1
- package/dist/types/identifier.js.map +0 -1
- package/dist/types/json/raw.js.map +0 -1
- package/dist/types/params.js.map +0 -1
- package/dist/types/record.js.map +0 -1
- package/dist/types/request.js.map +0 -1
- package/dist/types/runtime.js.map +0 -1
- package/dist/types/schema/concepts.js.map +0 -1
- package/dist/types/schema/fields.js.map +0 -1
- package/dist/types/schema/fields.type-test.js.map +0 -1
- package/dist/types/spec/document.js.map +0 -1
- package/dist/types/spec/error.js.map +0 -1
- package/dist/types/spec/json-api-raw.js.map +0 -1
- package/dist/types/symbols.js.map +0 -1
- package/dist/types/utils.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { StableRecordIdentifier } from "../../../types/identifier.js";
|
|
2
|
+
import type { FindRecordOptions } from "../../-types/q/store.js";
|
|
3
|
+
import type { Store } from "../store-service.js";
|
|
4
|
+
declare const Touching: "___(unique) Symbol(Touching)";
|
|
5
|
+
export declare const RequestPromise: "___(unique) Symbol(RequestPromise)";
|
|
6
|
+
export interface Operation {
|
|
7
|
+
op: string;
|
|
8
|
+
options: FindRecordOptions | undefined;
|
|
9
|
+
recordIdentifier: StableRecordIdentifier;
|
|
10
|
+
}
|
|
11
|
+
export interface FindRecordQuery extends Operation {
|
|
12
|
+
op: "findRecord";
|
|
13
|
+
}
|
|
14
|
+
export interface SaveRecordMutation extends Operation {
|
|
15
|
+
op: "saveRecord";
|
|
16
|
+
}
|
|
17
|
+
export interface Request {
|
|
18
|
+
data: Operation[];
|
|
19
|
+
options?: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
export type RequestStates = "pending" | "fulfilled" | "rejected";
|
|
22
|
+
export interface RequestCacheRequestState {
|
|
23
|
+
state: RequestStates;
|
|
24
|
+
type: "query" | "mutation";
|
|
25
|
+
request: Request;
|
|
26
|
+
response?: Response;
|
|
27
|
+
}
|
|
28
|
+
export interface Response {
|
|
29
|
+
// rawData: unknown;
|
|
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
|
+
* @hideconstructor
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare class RequestStateService {
|
|
45
|
+
/** @internal */
|
|
46
|
+
_pending: Map<StableRecordIdentifier, InternalRequest[]>;
|
|
47
|
+
private _done;
|
|
48
|
+
private _subscriptions;
|
|
49
|
+
private _toFlush;
|
|
50
|
+
private _store;
|
|
51
|
+
constructor(store: Store);
|
|
52
|
+
/** @internal */
|
|
53
|
+
_clearEntries(identifier: StableRecordIdentifier): void;
|
|
54
|
+
/** @internal */
|
|
55
|
+
_enqueue<T>(promise: Promise<T>, queryRequest: Request): Promise<T>;
|
|
56
|
+
private _triggerSubscriptions;
|
|
57
|
+
private _flush;
|
|
58
|
+
private _flushRequest;
|
|
59
|
+
private _dequeue;
|
|
60
|
+
private _addDone;
|
|
61
|
+
/**
|
|
62
|
+
* Subscribe to requests for a given resource identity.
|
|
63
|
+
*
|
|
64
|
+
* The callback will receive the current state of the request.
|
|
65
|
+
*
|
|
66
|
+
* ```ts
|
|
67
|
+
* interface RequestState {
|
|
68
|
+
* state: 'pending' | 'fulfilled' | 'rejected';
|
|
69
|
+
* type: 'query' | 'mutation';
|
|
70
|
+
* request: Request;
|
|
71
|
+
* response?: { data: unknown };
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* Note: It should be considered dangerous to use this API for more than simple
|
|
76
|
+
* state derivation or debugging. The `request` and `response` properties are poorly
|
|
77
|
+
* spec'd and may change unexpectedly when shifting what Handlers are in use or how
|
|
78
|
+
* requests are issued from the Store.
|
|
79
|
+
*
|
|
80
|
+
* We expect to revisit this API in the near future as we continue to refine the
|
|
81
|
+
* RequestManager ergonomics, as a simpler but more powerful direct integration
|
|
82
|
+
* with the RequestManager for these purposes is likely to be a better long-term
|
|
83
|
+
* design.
|
|
84
|
+
*
|
|
85
|
+
* @public
|
|
86
|
+
* @param {StableRecordIdentifier} identifier
|
|
87
|
+
* @param {(state: RequestCacheRequestState) => void} callback
|
|
88
|
+
*/
|
|
89
|
+
subscribeForRecord(identifier: StableRecordIdentifier, callback: RequestSubscription): void;
|
|
90
|
+
/**
|
|
91
|
+
* Retrieve all active requests for a given resource identity.
|
|
92
|
+
*
|
|
93
|
+
* @public
|
|
94
|
+
* @param {StableRecordIdentifier} identifier
|
|
95
|
+
* @return {RequestCacheRequestState[]} an array of request states for any pending requests for the given identifier
|
|
96
|
+
*/
|
|
97
|
+
getPendingRequestsForRecord(identifier: StableRecordIdentifier): RequestCacheRequestState[];
|
|
98
|
+
/**
|
|
99
|
+
* Retrieve the last completed request for a given resource identity.
|
|
100
|
+
*
|
|
101
|
+
* @public
|
|
102
|
+
* @param {StableRecordIdentifier} identifier
|
|
103
|
+
* @return {RequestCacheRequestState | null} the state of the most recent request for the given identifier
|
|
104
|
+
*/
|
|
105
|
+
getLastRequestForRecord(identifier: StableRecordIdentifier): RequestCacheRequestState | null;
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import type { Awaitable } from "../../../request.js";
|
|
2
|
+
/**
|
|
3
|
+
* The state of a promise in the "pending"
|
|
4
|
+
* state. This is the default initial state.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export interface PendingPromise {
|
|
8
|
+
/**
|
|
9
|
+
* The status of the promise.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
status: "pending";
|
|
13
|
+
/**
|
|
14
|
+
* Whether the promise is pending.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
isPending: true;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the promise is pending.
|
|
20
|
+
*
|
|
21
|
+
* @deprecated use `isPending` instead
|
|
22
|
+
*/
|
|
23
|
+
isLoading: true;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the promise has resolved
|
|
26
|
+
* successfully.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
isSuccess: false;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the promise has rejected
|
|
32
|
+
* with an error.
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
isError: false;
|
|
36
|
+
/**
|
|
37
|
+
* Once the promise has resolved, this will
|
|
38
|
+
* be the value the promise resolved to.
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
value: null;
|
|
42
|
+
/**
|
|
43
|
+
* Once the promise has resolved, this will
|
|
44
|
+
* be the value the promise resolved to.
|
|
45
|
+
*
|
|
46
|
+
* @deprecated use `value` instead
|
|
47
|
+
*/
|
|
48
|
+
result: null;
|
|
49
|
+
/**
|
|
50
|
+
* Once the promise has rejected, this will
|
|
51
|
+
* be the error the promise rejected with.
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
* @deprecated use `reason` instead
|
|
55
|
+
*/
|
|
56
|
+
error: null;
|
|
57
|
+
/**
|
|
58
|
+
* Once the promise has rejected, this will
|
|
59
|
+
* be the error the promise rejected with.
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
reason: null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The state of a promise in the "fulfilled" state.
|
|
66
|
+
* This is the state of a promise that has resolved
|
|
67
|
+
* successfully.
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
export interface ResolvedPromise<T> {
|
|
71
|
+
/**
|
|
72
|
+
* The status of the promise.
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
status: "fulfilled";
|
|
76
|
+
/**
|
|
77
|
+
* Whether the promise is pending.
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
isPending: false;
|
|
81
|
+
/**
|
|
82
|
+
* Whether the promise is pending.
|
|
83
|
+
*
|
|
84
|
+
* @deprecated use `isPending` instead
|
|
85
|
+
*/
|
|
86
|
+
isLoading: false;
|
|
87
|
+
/**
|
|
88
|
+
* Whether the promise has resolved
|
|
89
|
+
* successfully.
|
|
90
|
+
*
|
|
91
|
+
*/
|
|
92
|
+
isSuccess: true;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the promise has rejected
|
|
95
|
+
* with an error.
|
|
96
|
+
*
|
|
97
|
+
*/
|
|
98
|
+
isError: false;
|
|
99
|
+
/**
|
|
100
|
+
* Once the promise has resolved, this will
|
|
101
|
+
* be the value the promise resolved to.
|
|
102
|
+
*
|
|
103
|
+
*/
|
|
104
|
+
value: T;
|
|
105
|
+
/**
|
|
106
|
+
* Once the promise has resolved, this will
|
|
107
|
+
* be the value the promise resolved to.
|
|
108
|
+
*
|
|
109
|
+
* @deprecated use `value` instead
|
|
110
|
+
*/
|
|
111
|
+
result: T;
|
|
112
|
+
/**
|
|
113
|
+
* Once the promise has rejected, this will
|
|
114
|
+
* be the error the promise rejected with.
|
|
115
|
+
*
|
|
116
|
+
*
|
|
117
|
+
* @deprecated use `reason` instead
|
|
118
|
+
*/
|
|
119
|
+
error: null;
|
|
120
|
+
/**
|
|
121
|
+
* Once the promise has rejected, this will
|
|
122
|
+
* be the error the promise rejected with.
|
|
123
|
+
*
|
|
124
|
+
*/
|
|
125
|
+
reason: null;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The state of a promise in the "rejected" state.
|
|
129
|
+
* This is the state of a promise that has rejected
|
|
130
|
+
* with an error.
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
133
|
+
export interface RejectedPromise<E> {
|
|
134
|
+
/**
|
|
135
|
+
* The status of the promise.
|
|
136
|
+
*
|
|
137
|
+
*/
|
|
138
|
+
status: "rejected";
|
|
139
|
+
/**
|
|
140
|
+
* Whether the promise is pending.
|
|
141
|
+
*
|
|
142
|
+
*/
|
|
143
|
+
isPending: false;
|
|
144
|
+
/**
|
|
145
|
+
* Whether the promise is pending.
|
|
146
|
+
*
|
|
147
|
+
* @deprecated use `isPending` instead
|
|
148
|
+
*/
|
|
149
|
+
isLoading: false;
|
|
150
|
+
/**
|
|
151
|
+
* Whether the promise has resolved
|
|
152
|
+
* successfully.
|
|
153
|
+
*
|
|
154
|
+
*/
|
|
155
|
+
isSuccess: false;
|
|
156
|
+
/**
|
|
157
|
+
* Whether the promise has rejected
|
|
158
|
+
* with an error.
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
isError: true;
|
|
162
|
+
/**
|
|
163
|
+
* Once the promise has resolved, this will
|
|
164
|
+
* be the value the promise resolved to.
|
|
165
|
+
*
|
|
166
|
+
*/
|
|
167
|
+
value: null;
|
|
168
|
+
/**
|
|
169
|
+
* Once the promise has resolved, this will
|
|
170
|
+
* be the value the promise resolved to.
|
|
171
|
+
*
|
|
172
|
+
* @deprecated use `value` instead
|
|
173
|
+
*/
|
|
174
|
+
result: null;
|
|
175
|
+
/**
|
|
176
|
+
* Once the promise has rejected, this will
|
|
177
|
+
* be the error the promise rejected with.
|
|
178
|
+
*
|
|
179
|
+
*
|
|
180
|
+
* @deprecated use `reason` instead
|
|
181
|
+
*/
|
|
182
|
+
error: E;
|
|
183
|
+
/**
|
|
184
|
+
* Once the promise has rejected, this will
|
|
185
|
+
* be the error the promise rejected with.
|
|
186
|
+
*
|
|
187
|
+
*/
|
|
188
|
+
reason: E;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The state of a promise. This is the type that is returned
|
|
192
|
+
* from `getPromiseState`.
|
|
193
|
+
*
|
|
194
|
+
* See also:
|
|
195
|
+
* - {@link PendingPromise}
|
|
196
|
+
* - {@link ResolvedPromise}
|
|
197
|
+
* - {@link RejectedPromise}
|
|
198
|
+
*
|
|
199
|
+
*/
|
|
200
|
+
export type PromiseState<
|
|
201
|
+
T = unknown,
|
|
202
|
+
E = unknown
|
|
203
|
+
> = PendingPromise | ResolvedPromise<T> | RejectedPromise<E>;
|
|
204
|
+
export declare function createPromiseState<
|
|
205
|
+
T,
|
|
206
|
+
E
|
|
207
|
+
>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>>;
|
|
208
|
+
/**
|
|
209
|
+
* Returns a reactive state-machine for the provided promise or awaitable.
|
|
210
|
+
*
|
|
211
|
+
* Repeat calls to `getPromiseState` with the same promise will return the same state object
|
|
212
|
+
* making is safe and easy to use in templates and JavaScript code to produce reactive
|
|
213
|
+
* behaviors around promises.
|
|
214
|
+
*
|
|
215
|
+
* `getPromiseState` can be used in both JavaScript and Template contexts.
|
|
216
|
+
*
|
|
217
|
+
* ```ts
|
|
218
|
+
* import { getPromiseState } from '@warp-drive/ember';
|
|
219
|
+
*
|
|
220
|
+
* const state = getPromiseState(promise);
|
|
221
|
+
* ```
|
|
222
|
+
*
|
|
223
|
+
* For instance, we could write a getter on a component that updates whenever
|
|
224
|
+
* the promise state advances or the promise changes, by combining the function
|
|
225
|
+
* with the use of `@cached`
|
|
226
|
+
*
|
|
227
|
+
* ```ts
|
|
228
|
+
* class Component {
|
|
229
|
+
* @cached
|
|
230
|
+
* get title() {
|
|
231
|
+
* const state = getPromiseState(this.args.request);
|
|
232
|
+
* if (state.isPending) {
|
|
233
|
+
* return 'loading...';
|
|
234
|
+
* }
|
|
235
|
+
* if (state.isError) { return null; }
|
|
236
|
+
* return state.result.title;
|
|
237
|
+
* }
|
|
238
|
+
* }
|
|
239
|
+
* ```
|
|
240
|
+
*
|
|
241
|
+
* Or in a template as a helper:
|
|
242
|
+
*
|
|
243
|
+
* ```gjs
|
|
244
|
+
* import { getPromiseState } from '@warp-drive/ember';
|
|
245
|
+
*
|
|
246
|
+
* <template>
|
|
247
|
+
* {{#let (getPromiseState @request) as |state|}}
|
|
248
|
+
* {{#if state.isPending}} <Spinner />
|
|
249
|
+
* {{else if state.isError}} <ErrorForm @error={{state.error}} />
|
|
250
|
+
* {{else}}
|
|
251
|
+
* <h1>{{state.result.title}}</h1>
|
|
252
|
+
* {{/if}}
|
|
253
|
+
* {{/let}}
|
|
254
|
+
* </template>
|
|
255
|
+
* ```
|
|
256
|
+
*
|
|
257
|
+
* If looking to use in a template, consider also the `<Await />` component.
|
|
258
|
+
*
|
|
259
|
+
*/
|
|
260
|
+
export declare function getPromiseState<
|
|
261
|
+
T = unknown,
|
|
262
|
+
E = unknown
|
|
263
|
+
>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>>;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
export declare const ARRAY_SIGNAL: "___(unique) Symbol(#[])";
|
|
2
|
+
export declare const OBJECT_SIGNAL: "___(unique) Symbol(#{})";
|
|
3
|
+
/**
|
|
4
|
+
* Requirements:
|
|
5
|
+
*
|
|
6
|
+
* Signal:
|
|
7
|
+
*
|
|
8
|
+
* - signal: a way of creating a reference that we can dirty when we desire to notify
|
|
9
|
+
* - @signal: a way of creating an accessor on an object that subscribes to a signal on access
|
|
10
|
+
* and notifies the signal on set, or of upgrading a descriptor to be such an accessor
|
|
11
|
+
* - defineSignal: a way of creating a signal on an object
|
|
12
|
+
* - notifySignal: a way of notifying the underlying signal that it has been dirtied
|
|
13
|
+
* - peekSignal: a way of inspecting the signal without notifying it
|
|
14
|
+
*
|
|
15
|
+
* - gate: a memoized getter function that re-runs when on access if its signal is dirty
|
|
16
|
+
* conceptually, a gate is a tightly coupled signal and memo
|
|
17
|
+
* - @gate: a way of creating a gate on an object or upgrading a descriptor with a getter
|
|
18
|
+
* to be a gate
|
|
19
|
+
* - defineGate: a way of creating a gate on an object
|
|
20
|
+
* - notifySignal: a way of notifying the signal for a gate that it has been dirtied
|
|
21
|
+
*
|
|
22
|
+
* - memo:
|
|
23
|
+
* - @memo: a way of creating a memoized getter on an object or upgrading a descriptor with a getter
|
|
24
|
+
* to be a memo
|
|
25
|
+
* - defineMemo: a way of creating a memo on an object
|
|
26
|
+
*
|
|
27
|
+
* - signalStore: storage bucket for signals associated to an object
|
|
28
|
+
* - withSignalStore: a way of pre-creating a signal store on an object
|
|
29
|
+
*
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* An Opaque type that represents a framework specific or TC39 signal.
|
|
35
|
+
*
|
|
36
|
+
* It may be an array of signals or a single signal.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export type SignalRef = unknown;
|
|
41
|
+
/**
|
|
42
|
+
* The hooks which MUST be configured in order to use reactive arrays,
|
|
43
|
+
* resources and documents with framework specfic signals or TC39 signals.
|
|
44
|
+
*
|
|
45
|
+
* Support for multiple frameworks simultaneously can be done via
|
|
46
|
+
* this abstraction by returning multiple signals from the `createSignal`
|
|
47
|
+
* method, and consuming the correct one via the correct framework via
|
|
48
|
+
* the `consumeSignal` and `notifySignal` methods.
|
|
49
|
+
*
|
|
50
|
+
* Unlike many signals implementations, WarpDrive does not wrap values as
|
|
51
|
+
* signals directly, but instead uses signals to alert the reactive layer
|
|
52
|
+
* to changes in the underlying cache. E.g. a signal is associated to a value,
|
|
53
|
+
* but does not serve as the cache for that value directly. We refer to this as
|
|
54
|
+
* a "gate", the pattern has also been called "side-signals".
|
|
55
|
+
*
|
|
56
|
+
* A no-op implementation is allowed, though it may lead to performance issues
|
|
57
|
+
* in locations that use createMemo as no memoization would be done. This is
|
|
58
|
+
* typically desirable only when integrating with a framework that does its own
|
|
59
|
+
* memoization and does not integrate with any signals-like primitive. For these
|
|
60
|
+
* scenarios you may also be interested in integrating with the {@link NotificationManager}
|
|
61
|
+
* more directly.
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export interface SignalHooks<T = SignalRef> {
|
|
66
|
+
/**
|
|
67
|
+
* Create a signal for the given key associated to the given object.
|
|
68
|
+
*
|
|
69
|
+
* This method does *not* need to cache the signal, it will only be
|
|
70
|
+
* called once for a given object and key. However, if your framework
|
|
71
|
+
* will look for a signal cache on the object in a given location or may
|
|
72
|
+
* have created its own signal on the object for some reason it may be
|
|
73
|
+
* useful to ensure such cache is properly updated.
|
|
74
|
+
*/
|
|
75
|
+
createSignal: (obj: object, key: string | symbol) => T;
|
|
76
|
+
/**
|
|
77
|
+
* Consume (mark as acccessed) a signal previously created via createSignal.
|
|
78
|
+
*/
|
|
79
|
+
consumeSignal: (signal: T) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Alert a signal previously created via createSignal that its associated value has changed.
|
|
82
|
+
*/
|
|
83
|
+
notifySignal: (signal: T) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Take the given function and wrap it in signals-based memoization. Analagous
|
|
86
|
+
* to a Computed in the TC39 spec.
|
|
87
|
+
*
|
|
88
|
+
* Should return a function which when run provides the latest value of the original
|
|
89
|
+
* function.
|
|
90
|
+
*/
|
|
91
|
+
createMemo: <F>(obj: object, key: string | symbol, fn: () => F) => () => F;
|
|
92
|
+
/**
|
|
93
|
+
* If the signals implementation allows synchronous flushing of watchers, and
|
|
94
|
+
* has scheduled such a flush (e.g. watchers will run before the current calling
|
|
95
|
+
* context yields) this should return "true".
|
|
96
|
+
*
|
|
97
|
+
* This is generally something that should return false for anything but the few
|
|
98
|
+
* frameworks that extensively handle their own reactivity => render scheduling.
|
|
99
|
+
*
|
|
100
|
+
* For an example, see EmberJS's backburner scheduler which functioned as a microtask
|
|
101
|
+
* polyfill.
|
|
102
|
+
*/
|
|
103
|
+
willSyncFlushWatchers: () => boolean;
|
|
104
|
+
/**
|
|
105
|
+
* An optional method that allows wrapping key promises within WarpDrive
|
|
106
|
+
* for things like test-waiters.
|
|
107
|
+
*/
|
|
108
|
+
waitFor?: <K>(promise: Promise<K>) => Promise<K>;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Contains information a {@link SignalHooks} implementation may want
|
|
112
|
+
* to use, such as the specialized key used for the signal
|
|
113
|
+
* representing an array's contents / length.
|
|
114
|
+
*
|
|
115
|
+
* ```ts
|
|
116
|
+
* interface HooksOptions {
|
|
117
|
+
* wellknown: {
|
|
118
|
+
* Array: symbol | string;
|
|
119
|
+
* }
|
|
120
|
+
* }
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
export interface HooksOptions {
|
|
126
|
+
/**
|
|
127
|
+
* A list of specialized symbols/strings
|
|
128
|
+
* used by WarpDrive to encapsulate key
|
|
129
|
+
* reactivity concerns.
|
|
130
|
+
*/
|
|
131
|
+
wellknown: {
|
|
132
|
+
/**
|
|
133
|
+
* The key used when the signal provides reactivity for the
|
|
134
|
+
* `length` or "contents" of an array.
|
|
135
|
+
*
|
|
136
|
+
* Arrays only use a single signal for all accesses, regardless
|
|
137
|
+
* of index, property or method: this one.
|
|
138
|
+
*/
|
|
139
|
+
Array: symbol | string;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Configures the signals implementation to use. Supports multiple
|
|
144
|
+
* implementations simultaneously.
|
|
145
|
+
*
|
|
146
|
+
* See {@link HooksOptions} for the options passed to the provided function
|
|
147
|
+
* when called.
|
|
148
|
+
*
|
|
149
|
+
* See {@link SignalHooks} for the implementation the callback function should
|
|
150
|
+
* return.
|
|
151
|
+
*
|
|
152
|
+
* @public
|
|
153
|
+
* @param buildConfig - a function that takes options and returns a configuration object
|
|
154
|
+
*/
|
|
155
|
+
export declare function setupSignals<T>(buildConfig: (options: HooksOptions) => SignalHooks<T>): void;
|
|
156
|
+
/**
|
|
157
|
+
* Internal method for consuming the configured `createSignal` hook
|
|
158
|
+
*
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
export declare function createSignal(obj: object, key: string | symbol): SignalRef;
|
|
162
|
+
/**
|
|
163
|
+
* Internal method for consuming the configured `consumeSignal` hook
|
|
164
|
+
*
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
export declare function consumeSignal(signal: SignalRef): void;
|
|
168
|
+
/**
|
|
169
|
+
* Internal method for consuming the configured `notifySignal` hook
|
|
170
|
+
*
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
export declare function notifySignal(signal: SignalRef): void;
|
|
174
|
+
export declare function createMemo<T>(object: object, key: string | symbol, fn: () => T): () => T;
|
|
175
|
+
export declare function willSyncFlushWatchers(): boolean;
|
|
176
|
+
export declare function waitFor<K>(promise: Promise<K>): Promise<K>;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { ARRAY_SIGNAL, OBJECT_SIGNAL, type SignalRef } from "./configure.js";
|
|
2
|
+
export type { SignalRef };
|
|
3
|
+
export { ARRAY_SIGNAL, OBJECT_SIGNAL };
|
|
4
|
+
/**
|
|
5
|
+
* A WarpDriveSignal is a wrapper around a framework specific or TC39 signal
|
|
6
|
+
* that enables us to store and manage the signal in a universal way.
|
|
7
|
+
*
|
|
8
|
+
* WarpDrive uses signals to manage three separate concepts:
|
|
9
|
+
*
|
|
10
|
+
* - as a `storage` for a value local to the object that we want to be reactive
|
|
11
|
+
* (see `@local` schema field for an example)
|
|
12
|
+
* - as a `gate` for a memoized getter that we want to act as a reactive property
|
|
13
|
+
* but whose value is computed/pulled from a non-reactive source elsewhere
|
|
14
|
+
* and whose latest value is stored in the signal
|
|
15
|
+
* (see `field` schema field for an example)
|
|
16
|
+
* - as a `gate` with a manually managed value updated on pull when `isStale` is true
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
* It offers
|
|
20
|
+
*
|
|
21
|
+
* - a non-reactive way to access/update the current value
|
|
22
|
+
* - a non-reactive way to mark the signal as dirtied
|
|
23
|
+
* - a non-reactive way to store content for why the signal was dirtied
|
|
24
|
+
* - access to the underlying Signal(s) in-use
|
|
25
|
+
*
|
|
26
|
+
* For debugging:
|
|
27
|
+
* - the "key" or "name" of the signal
|
|
28
|
+
* - the "object identity" or "context" to which the signal is attached
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export interface WarpDriveSignal {
|
|
33
|
+
/**
|
|
34
|
+
* The "key" or "name" of the signal.
|
|
35
|
+
* This is usually (but not always) the name of a property
|
|
36
|
+
* on the object to which the signal is attached.
|
|
37
|
+
*
|
|
38
|
+
* This is used for debugging purposes.
|
|
39
|
+
* It is not used for any other purpose.
|
|
40
|
+
*
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
key: string | symbol;
|
|
44
|
+
/**
|
|
45
|
+
* The "object identity" or "context" to which the
|
|
46
|
+
* signal is attached.
|
|
47
|
+
*
|
|
48
|
+
* This is used for debugging purposes.
|
|
49
|
+
* It is not used for any other purpose.
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
context: object;
|
|
54
|
+
/**
|
|
55
|
+
* The underlying signal(s) in-use.
|
|
56
|
+
*
|
|
57
|
+
* Generally, this is a single signal.
|
|
58
|
+
*
|
|
59
|
+
* In some cases multiple signals need to be condensed,
|
|
60
|
+
* such as to support legacy Ember Array APIs or to
|
|
61
|
+
* support reactive-objects shared between the code of
|
|
62
|
+
* multiple frameworks.
|
|
63
|
+
*
|
|
64
|
+
* In such cases, this value may be an array.
|
|
65
|
+
*
|
|
66
|
+
* e.g. (pseudo-code for Ember):
|
|
67
|
+
*
|
|
68
|
+
* setupSignals({
|
|
69
|
+
* createSignal: (obj, key, initialValue) => {
|
|
70
|
+
* if (isArraySignal(key)) {
|
|
71
|
+
* return [
|
|
72
|
+
* tagForProperty(obj, key),
|
|
73
|
+
* tagForProperty(obj, '[]'),
|
|
74
|
+
* tagForProperty(obj, 'length'),
|
|
75
|
+
* ];
|
|
76
|
+
* }
|
|
77
|
+
* return tagForProperty(obj, key);
|
|
78
|
+
* },
|
|
79
|
+
*
|
|
80
|
+
* consumeSignal: (signal) => {
|
|
81
|
+
* if (Array.isArray(signal)) {
|
|
82
|
+
* signal.forEach((s) => consumeTag(s));
|
|
83
|
+
* } else {
|
|
84
|
+
* consumeTag(signal);
|
|
85
|
+
* }
|
|
86
|
+
* },
|
|
87
|
+
*
|
|
88
|
+
* dirtySignal: (signal) => {
|
|
89
|
+
* if (Array.isArray(signal)) {
|
|
90
|
+
* signal.forEach((s) => dirtyTag(s));
|
|
91
|
+
* } else {
|
|
92
|
+
* dirtyTag(signal);
|
|
93
|
+
* }
|
|
94
|
+
* },
|
|
95
|
+
* });
|
|
96
|
+
*
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
signal: SignalRef;
|
|
100
|
+
/**
|
|
101
|
+
* The last "value" computed for this signal when
|
|
102
|
+
* a signal is also used for storage.
|
|
103
|
+
*
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
value: unknown;
|
|
107
|
+
/**
|
|
108
|
+
* Whether ths signal is known to have been dirtied.
|
|
109
|
+
* This is useful *both* when manually managing the
|
|
110
|
+
* `value` cache and when using the signal as a
|
|
111
|
+
* "gate"
|
|
112
|
+
*
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
isStale: boolean;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* We attach signals to their context object via
|
|
119
|
+
* a Map attached to the object via this symbol.
|
|
120
|
+
*
|
|
121
|
+
* This allows us to store multiple signals
|
|
122
|
+
* on the same object with smaller memory
|
|
123
|
+
* overhead and no WeakMap lookups.
|
|
124
|
+
*
|
|
125
|
+
* Performance sensitive objects should
|
|
126
|
+
* pre-warm their shape by assigning this
|
|
127
|
+
* during initialization.
|
|
128
|
+
*
|
|
129
|
+
* ```ts
|
|
130
|
+
* initializeSignalStore(obj);
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @internal
|
|
134
|
+
*/
|
|
135
|
+
export declare const Signals: "___(unique) Symbol(Signals)";
|
|
136
|
+
export type SignalStore = Map<string | symbol, WarpDriveSignal>;
|
|
137
|
+
/**
|
|
138
|
+
* A type util to recast the object as having a signal store.
|
|
139
|
+
*
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
export declare function upgradeWithSignals<T extends object>(obj: T): asserts obj is T & {
|
|
143
|
+
[Signals]: SignalStore;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* A util that will create a signal store on the object
|
|
147
|
+
* if it does not already exist and returns the associated
|
|
148
|
+
* signal store.
|
|
149
|
+
*
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
export declare function withSignalStore<T extends object>(obj: T): SignalStore;
|
|
153
|
+
/**
|
|
154
|
+
* A util that will create a signal store on the object
|
|
155
|
+
* if it does not already exist.
|
|
156
|
+
*
|
|
157
|
+
* Useful for pre-warming the shape of an object to ensure
|
|
158
|
+
* a key-transition to add it is not required later.
|
|
159
|
+
*
|
|
160
|
+
* @internal
|
|
161
|
+
*/
|
|
162
|
+
export declare function initializeSignalStore<T extends object>(obj: T): asserts obj is T & {
|
|
163
|
+
[Signals]: SignalStore;
|
|
164
|
+
};
|
|
165
|
+
export declare function createInternalSignal(signals: SignalStore, obj: object, key: string | symbol, initialValue: unknown): WarpDriveSignal;
|
|
166
|
+
export declare function getOrCreateInternalSignal(signals: SignalStore, obj: object, key: string | symbol, initialValue: unknown): WarpDriveSignal;
|
|
167
|
+
export declare function peekInternalSignal(signals: SignalStore | undefined, key: string | symbol): WarpDriveSignal | undefined;
|
|
168
|
+
export declare function consumeInternalSignal(signal: WarpDriveSignal): void;
|
|
169
|
+
export declare function notifyInternalSignal(signal: WarpDriveSignal | undefined): void;
|