@adobe/data 0.9.57 → 0.9.58
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/dist/ecs/database/database.d.ts +9 -1
- package/dist/ecs/database/database.js.map +1 -1
- package/dist/ecs/store/transaction-functions.d.ts +21 -0
- package/dist/ecs/store/transaction-functions.type-test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/references/data-lit/package.json +1 -1
- package/references/data-lit-tictactoe/package.json +1 -1
- package/references/data-react/package.json +1 -1
- package/references/data-react-hello/package.json +1 -1
- package/references/data-react-pixie/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { ReadonlyStore, Store } from "../store/index.js";
|
|
|
4
4
|
import { Entity } from "../entity/entity.js";
|
|
5
5
|
import { EntityReadValues } from "../store/core/index.js";
|
|
6
6
|
import { Observe } from "../../observe/index.js";
|
|
7
|
-
import { TransactionResult } from "./transactional-store/index.js";
|
|
7
|
+
import { TransactionContext, TransactionResult } from "./transactional-store/index.js";
|
|
8
8
|
import { TransactionEnvelope } from "./reconciling/reconciling-database.js";
|
|
9
9
|
import { StringKeyof, RemoveIndex } from "../../types/types.js";
|
|
10
10
|
import { Components } from "../store/components.js";
|
|
@@ -182,6 +182,14 @@ export declare namespace Database {
|
|
|
182
182
|
const combine: typeof combinePlugins;
|
|
183
183
|
type ToDatabase<P extends Database.Plugin> = Database.FromPlugin<P>;
|
|
184
184
|
type ToStore<P extends Database.Plugin> = Store<FromSchemas<RemoveIndex<P['components']>>, FromSchemas<RemoveIndex<P['resources']>>, RemoveIndex<P['archetypes']>>;
|
|
185
|
+
/**
|
|
186
|
+
* The plugin's store as seen *inside a transaction body* — i.e. `ToStore<P>`
|
|
187
|
+
* plus the `userId` field added by the transaction dispatcher. Use this
|
|
188
|
+
* when typing helper functions that forward a transaction's store into
|
|
189
|
+
* another plugin's transaction declaration; `ToStore<P>` is the bare
|
|
190
|
+
* store type and does not include `userId`.
|
|
191
|
+
*/
|
|
192
|
+
type ToTransactionContext<P extends Database.Plugin> = TransactionContext<FromSchemas<RemoveIndex<P['components']>>, FromSchemas<RemoveIndex<P['resources']>>, RemoveIndex<P['archetypes']>>;
|
|
185
193
|
type ToSystemDatabase<P extends Database.Plugin> = Database.FromPlugin<P> & {
|
|
186
194
|
readonly store: Database.Plugin.ToStore<P>;
|
|
187
195
|
services: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../src/ecs/database/database.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAgBvD,OAAO,EAAE,cAAc,EAA4B,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAc1F,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA0JtD,MAAM,KAAW,QAAQ,
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../src/ecs/database/database.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAgBvD,OAAO,EAAE,cAAc,EAA4B,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAc1F,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA0JtD,MAAM,KAAW,QAAQ,CAqExB;AArED,WAAiB,QAAQ;IAkBV,eAAM,GAAG,cAAc,CAAC;IAExB,WAAE,GAAG,CAAC,KAAc,EAAqB,EAAE;QACtD,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,cAAc,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,IAAI,OAAO,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAC;IAC1L,CAAC,CAAA;IAEY,0BAAiB,GAAG,kBAAkB,CAAC;IAsBpD,IAAiB,MAAM,CAqBtB;IArBD,WAAiB,MAAM;QACR,aAAM,GAAG,YAAY,CAAC;QACtB,cAAO,GAAG,cAAc,CAAC;IAmBxC,CAAC,EArBgB,MAAM,GAAN,eAAM,KAAN,eAAM,QAqBtB;AAEH,CAAC,EArEgB,QAAQ,KAAR,QAAQ,QAqExB"}
|
|
@@ -30,3 +30,24 @@ export type TransactionFunction = (args?: any) => void | Entity;
|
|
|
30
30
|
export type TransactionFunctions = {
|
|
31
31
|
readonly [AF: string]: TransactionFunction;
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Extracts the `AsyncArgsProvider`-arg overload from a `ToTransactionFunctions`
|
|
35
|
+
* entry as a single-signature function. TypeScript's structural assignment and
|
|
36
|
+
* `Parameters` / `ReturnType` see only the *last* overload of an overloaded
|
|
37
|
+
* function type, which hides the async-provider overload when a transaction is
|
|
38
|
+
* passed by value (e.g. as a prop). This helper recovers the async-provider
|
|
39
|
+
* signature without forcing consumers to copy/paste the Input shape.
|
|
40
|
+
*/
|
|
41
|
+
export type ToAsyncTransactionFn<T> = T extends {
|
|
42
|
+
(arg: AsyncArgsProvider<infer Input>): Promise<infer R>;
|
|
43
|
+
(arg: any): any;
|
|
44
|
+
} ? (arg: AsyncArgsProvider<Input>) => Promise<R> : never;
|
|
45
|
+
/**
|
|
46
|
+
* Extracts the plain-arg (synchronous) overload from a `ToTransactionFunctions`
|
|
47
|
+
* entry as a single-signature function. Pairs with `ToAsyncTransactionFn`
|
|
48
|
+
* for consumers that need to type each call path independently.
|
|
49
|
+
*/
|
|
50
|
+
export type ToSyncTransactionFn<T> = T extends {
|
|
51
|
+
(arg: AsyncArgsProvider<any>): any;
|
|
52
|
+
(arg: infer Input): infer R;
|
|
53
|
+
} ? (arg: Input) => R : never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-functions.type-test.js","sourceRoot":"","sources":["../../../src/ecs/store/transaction-functions.type-test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,EAAE;AACF,mDAAmD;AACnD,EAAE;AACF,kEAAkE;AAClE,EAAE;AACF,uFAAuF;AACvF,iEAAiE;AACjE,mEAAmE;AACnE,EAAE;AACF,wEAAwE;AACxE,uEAAuE;AACvE,yEAAyE;AACzE,qCAAqC;
|
|
1
|
+
{"version":3,"file":"transaction-functions.type-test.js","sourceRoot":"","sources":["../../../src/ecs/store/transaction-functions.type-test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,EAAE;AACF,mDAAmD;AACnD,EAAE;AACF,kEAAkE;AAClE,EAAE;AACF,uFAAuF;AACvF,iEAAiE;AACjE,mEAAmE;AACnE,EAAE;AACF,wEAAwE;AACxE,uEAAuE;AACvE,yEAAyE;AACzE,qCAAqC;AA2DrC,MAAM,SAAS,GAAS,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAEjD,MAAM,qBAAqB,GACvB,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAEpD,MAAM,uBAAuB,GACzB,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IACpB,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC;AAEP,MAAM,UAAU,GAAW,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;AAE3D,MAAM,WAAW,GACb,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,U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