@adobe/data 0.5.22 → 0.5.23
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/entity/entity.d.ts +8 -0
- package/dist/ecs/entity/entity.js +3 -0
- package/dist/ecs/entity/entity.js.map +1 -0
- package/dist/ecs/entity/u32.d.ts +8 -0
- package/dist/{lit/elements/service-context.js → ecs/entity/u32.js} +3 -3
- package/dist/ecs/entity/u32.js.map +1 -0
- package/dist/ecs/store/create-store-schema-test.d.ts +1 -0
- package/dist/ecs/store/create-store-schema-test.js +33 -0
- package/dist/ecs/store/create-store-schema-test.js.map +1 -0
- package/dist/ecs/store/create-store.d.ts +2 -6
- package/dist/ecs/store/create-store.js.map +1 -1
- package/dist/ecs/store/index.d.ts +0 -1
- package/dist/ecs/store/index.js +0 -1
- package/dist/ecs/store/index.js.map +1 -1
- package/dist/ecs/store/store-schema/create-store-schema-test.js +2 -2
- package/dist/ecs/store/store-schema/create-store-schema-test.js.map +1 -1
- package/dist/ecs/store/store-schema/create-store-schema.d.ts +1 -11
- package/dist/ecs/store/store-schema/create-store-schema.js +44 -30
- package/dist/ecs/store/store-schema/create-store-schema.js.map +1 -1
- package/dist/ecs/store/store-schema/index.d.ts +1 -2
- package/dist/ecs/store/store-schema/index.js +20 -23
- package/dist/ecs/store/store-schema/index.js.map +1 -1
- package/dist/ecs/store/store-schema/store-schema.d.ts +1 -12
- package/dist/ecs/store/store-schema/store-schema.js +55 -21
- package/dist/ecs/store/store-schema/store-schema.js.map +1 -1
- package/dist/ecs/store/store.d.ts +25 -4
- package/dist/ecs/store/store.js +17 -1
- package/dist/ecs/store/store.js.map +1 -1
- package/dist/graphics/frame.d.ts +1 -22
- package/dist/graphics/frame.js +14 -11
- package/dist/graphics/frame.js.map +1 -1
- package/dist/graphics/get-web-gpu-device-and-context.d.ts +1 -2
- package/dist/graphics/get-web-gpu-device-and-context.js +23 -20
- package/dist/graphics/get-web-gpu-device-and-context.js.map +1 -1
- package/dist/graphics/graphics-context.d.ts +1 -5
- package/dist/graphics/graphics-context.js +5 -0
- package/dist/graphics/graphics-context.js.map +1 -1
- package/dist/math/aabb-face/face.d.ts +51 -0
- package/dist/math/aabb-face/face.js +110 -0
- package/dist/math/aabb-face/face.js.map +1 -0
- package/dist/math/aabb-face/face.test.d.ts +1 -0
- package/dist/math/aabb-face/face.test.js +94 -0
- package/dist/math/aabb-face/face.test.js.map +1 -0
- package/dist/math/box/box.d.ts +50 -0
- package/dist/math/box/box.js +23 -0
- package/dist/math/box/box.js.map +1 -0
- package/dist/math/face/face.d.ts +51 -0
- package/dist/math/face/face.js +110 -0
- package/dist/math/face/face.js.map +1 -0
- package/dist/math/face/face.test.d.ts +1 -0
- package/dist/math/face/face.test.js +94 -0
- package/dist/math/face/face.test.js.map +1 -0
- package/dist/math/picking/face.d.ts +1 -0
- package/dist/math/picking/face.js +2 -0
- package/dist/math/picking/face.js.map +1 -0
- package/dist/math/picking/get-closest-entity-to-line.js +1 -1
- package/dist/math/picking/get-closest-entity-to-line.js.map +1 -1
- package/dist/math/picking/get-closest-entity-to-point.js +1 -1
- package/dist/math/picking/get-closest-entity-to-point.js.map +1 -1
- package/dist/math/picking/getClosestEntityToLine.d.ts +4 -0
- package/dist/math/picking/getClosestEntityToLine.js +29 -0
- package/dist/math/picking/getClosestEntityToLine.js.map +1 -0
- package/dist/math/picking/getClosestEntityToPoint.d.ts +4 -0
- package/dist/math/picking/getClosestEntityToPoint.js +27 -0
- package/dist/math/picking/getClosestEntityToPoint.js.map +1 -0
- package/dist/math/picking/getIntersectingEntities.d.ts +12 -0
- package/dist/math/picking/getIntersectingEntities.js +15 -0
- package/dist/math/picking/getIntersectingEntities.js.map +1 -0
- package/dist/math/picking/pick-from-tables.js +1 -1
- package/dist/math/picking/pick-from-tables.js.map +1 -1
- package/dist/math/picking/pick-result.d.ts +4 -2
- package/dist/math/transform/debug-inverse.d.ts +1 -0
- package/dist/math/transform/debug-inverse.js +28 -0
- package/dist/math/transform/debug-inverse.js.map +1 -0
- package/dist/math/transform/debug-quat.d.ts +1 -0
- package/dist/math/transform/debug-quat.js +23 -0
- package/dist/math/transform/debug-quat.js.map +1 -0
- package/dist/math/transform/debug-test.d.ts +1 -0
- package/dist/math/transform/debug-test.js +34 -0
- package/dist/math/transform/debug-test.js.map +1 -0
- package/dist/math/transform/transform.d.ts +58 -0
- package/dist/math/transform/transform.js +101 -0
- package/dist/math/transform/transform.js.map +1 -0
- package/dist/math/transform/transform.test.d.ts +1 -0
- package/dist/math/transform/transform.test.js +309 -0
- package/dist/math/transform/transform.test.js.map +1 -0
- package/dist/samples/todo/services/state-service/create-todo-database.d.ts +32 -9
- package/dist/samples/todo/services/state-service/create-todo-store.d.ts +32 -9
- package/dist/schema/schema.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/lit/elements/service-application.d.ts +0 -9
- package/dist/lit/elements/service-application.js +0 -55
- package/dist/lit/elements/service-application.js.map +0 -1
- package/dist/lit/elements/service-context.d.ts +0 -1
- package/dist/lit/elements/service-context.js.map +0 -1
- package/dist/lit/elements/service-element.d.ts +0 -6
- package/dist/lit/elements/service-element.js +0 -43
- package/dist/lit/elements/service-element.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/ecs/entity/entity.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC"}
|
|
@@ -19,6 +19,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
import {
|
|
23
|
-
export const
|
|
24
|
-
//# sourceMappingURL=
|
|
22
|
+
import { U32Schema } from "../../schema/index.js";
|
|
23
|
+
export const schema = U32Schema;
|
|
24
|
+
//# sourceMappingURL=u32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u32.js","sourceRoot":"","sources":["../../../src/ecs/entity/u32.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,SAAS,EAAc,MAAM,uBAAuB,CAAC;AAC9D,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { Store } from "./store.js";
|
|
23
|
+
const storeSchema = Store.Schema.create({
|
|
24
|
+
velocity: { type: "number" },
|
|
25
|
+
particle: { type: "boolean" },
|
|
26
|
+
}, {
|
|
27
|
+
mousePosition: { type: "number", default: 0 },
|
|
28
|
+
fooPosition: { type: "number", default: 0 },
|
|
29
|
+
}, {
|
|
30
|
+
Particle: ["particle"],
|
|
31
|
+
DynamicParticle: ["particle", "velocity"],
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=create-store-schema-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-store-schema-test.js","sourceRoot":"","sources":["../../../src/ecs/store/create-store-schema-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAKX,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CACnC;IACI,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;CAChC,EACD;IACI,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;IAC7C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;CAC9C,EACD;IACI,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;CAC5C,CACJ,CAAA"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { ComponentSchemas } from "../component-schemas.js";
|
|
2
2
|
import { StringKeyof } from "../../types/types.js";
|
|
3
3
|
import { Store } from "./store.js";
|
|
4
|
-
import {
|
|
4
|
+
import { FromSchemas } from "../../schema/schema.js";
|
|
5
5
|
import { ResourceSchemas } from "../resource-schemas.js";
|
|
6
6
|
import { ArchetypeComponents } from "./archetype-components.js";
|
|
7
|
-
export declare function createStore<NC extends ComponentSchemas, NR extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<NC>> = {}>(newComponentSchemas: NC, resourceSchemas?: NR, archetypeComponentNames?: A): Store<
|
|
8
|
-
[K in StringKeyof<NC>]: FromSchema<NC[K]>;
|
|
9
|
-
}, {
|
|
10
|
-
-readonly [K in StringKeyof<NR>]: FromSchema<NR[K]>;
|
|
11
|
-
}, A>;
|
|
7
|
+
export declare function createStore<NC extends ComponentSchemas, NR extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<NC>> = {}>(newComponentSchemas: NC, resourceSchemas?: NR, archetypeComponentNames?: A): Store<FromSchemas<NC>, FromSchemas<NR>, A>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store.js","sourceRoot":"","sources":["../../../src/ecs/store/create-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAOX,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAMnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,UAAU,WAAW,CAKvB,mBAAuB,EACvB,kBAAsB,EAAQ,EAC9B,0BAA6B,EAAO;
|
|
1
|
+
{"version":3,"file":"create-store.js","sourceRoot":"","sources":["../../../src/ecs/store/create-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAOX,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAMnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,UAAU,WAAW,CAKvB,mBAAuB,EACvB,kBAAsB,EAAQ,EAC9B,0BAA6B,EAAO;IAKpC,MAAM,SAAS,GAAG,EAAO,CAAC;IAE1B,MAAM,2BAA2B,GAA0C,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACtG,iGAAiG;IACjG,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;QAC9C,MAAM,UAAU,GAAG,IAA0B,CAAC;QAC9C,2BAA2B,CAAC,UAAU,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC,2BAA2B,CAAuB,CAAC;IAE3E,0FAA0F;IAC1F,wEAAwE;IACxE,MAAM,wCAAwC,GAAG,GAAG,EAAE;QAClD,KAAK,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;YACnE,MAAM,UAAU,GAAG,IAAsB,CAAC;YAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;YAC3D,IAAI,SAAS,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;gBAC3B,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,EAAS,CAAC,CAAC;YACtE,CAAC;YACD,MAAM,GAAG,GAAG,CAAC,CAAC;YACd,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE;gBACnC,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAE,CAAC,GAAG,CAAC,GAAG,CAAC;gBAClD,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE;oBACX,SAAS,CAAC,OAAO,CAAC,UAAU,CAAE,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBACnD,CAAC;gBACD,UAAU,EAAE,IAAI;gBAChB,YAAY,EAAE,IAAI;aACrB,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAA;IACD,wCAAwC,EAAE,CAAC;IAE3C,MAAM,MAAM,GAAG,CAGX,OAAiD,EACjD,OAAoF,EACnE,EAAE;QACnB,OAAO,cAAc,CAAa,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CACjC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE;QACnE,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,GAAG,cAAqB,CAAC,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,EAAE,SAAS,CAAU,CAAC;IACtC,CAAC,CAAC,CACE,CAAC;IAET,MAAM,KAAK,GAAgB;QACvB,GAAG,IAAI;QACP,SAAS;QACT,MAAM;QACN,UAAU;QACV,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE;QAC3B,QAAQ,EAAE,CAAC,IAAa,EAAE,EAAE;YACxB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpB,wCAAwC,EAAE,CAAC;QAC/C,CAAC;KACJ,CAAC;IAEF,OAAO,KAAY,CAAC;AACxB,CAAC"}
|
package/dist/ecs/store/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecs/store/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecs/store/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
|
@@ -19,8 +19,8 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
import {
|
|
23
|
-
const storeSchema =
|
|
22
|
+
import { Store } from "../store.js";
|
|
23
|
+
const storeSchema = Store.Schema.create({
|
|
24
24
|
velocity: { type: "number" },
|
|
25
25
|
particle: { type: "boolean" },
|
|
26
26
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store-schema-test.js","sourceRoot":"","sources":["../../../../src/ecs/store/store-schema/create-store-schema-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;
|
|
1
|
+
{"version":3,"file":"create-store-schema-test.js","sourceRoot":"","sources":["../../../../src/ecs/store/store-schema/create-store-schema-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAKX,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CACnC;IACI,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;CAChC,EACD;IACI,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;IAC7C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;CAC9C,EACD;IACI,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;CAC5C,CACJ,CAAA"}
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ComponentSchemas } from "../../component-schemas.js";
|
|
3
|
-
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
4
|
-
import { ArchetypeComponents } from "../archetype-components.js";
|
|
5
|
-
import { StoreSchema } from "./store-schema.js";
|
|
6
|
-
export declare function createStoreSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>>(components: CS, resources: RS, archetypes: A): {
|
|
7
|
-
readonly components: CS;
|
|
8
|
-
readonly resources: RS;
|
|
9
|
-
readonly archetypes: A;
|
|
10
|
-
};
|
|
11
|
-
export declare function createStoreFromSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>>(schema: StoreSchema<CS, RS, A>): import("../store.js").Store<{ [K in Extract<keyof CS, string>]: import("../../../schema/schema.js").FromSchema<CS[K], 5>; }, { -readonly [K_1 in Extract<keyof RS, string>]: import("../../../schema/schema.js").FromSchema<RS[K_1], 5>; }, A>;
|
|
1
|
+
export {};
|
|
@@ -1,31 +1,45 @@
|
|
|
1
|
-
/*MIT License
|
|
2
|
-
|
|
3
|
-
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
// /*MIT License
|
|
2
|
+
export {};
|
|
3
|
+
// © Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
// copies or substantial portions of the Software.
|
|
12
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
// SOFTWARE.*/
|
|
19
|
+
// import { StringKeyof } from "../../../types/types.js";
|
|
20
|
+
// import { ComponentSchemas } from "../../component-schemas.js";
|
|
21
|
+
// import { ResourceSchemas } from "../../resource-schemas.js";
|
|
22
|
+
// import { ArchetypeComponents } from "../archetype-components.js";
|
|
23
|
+
// import { createStore } from "../create-store.js";
|
|
24
|
+
// import { StoreSchema } from "./store-schema.js";
|
|
25
|
+
// export function createStoreSchema<
|
|
26
|
+
// const CS extends ComponentSchemas,
|
|
27
|
+
// const RS extends ResourceSchemas,
|
|
28
|
+
// const A extends ArchetypeComponents<StringKeyof<CS>>,
|
|
29
|
+
// >(
|
|
30
|
+
// components: CS,
|
|
31
|
+
// resources: RS,
|
|
32
|
+
// archetypes: A,
|
|
33
|
+
// ) {
|
|
34
|
+
// return { components, resources, archetypes } as const satisfies StoreSchema<CS, RS, A>;
|
|
35
|
+
// };
|
|
36
|
+
// export function createStoreFromSchema<
|
|
37
|
+
// const CS extends ComponentSchemas,
|
|
38
|
+
// const RS extends ResourceSchemas,
|
|
39
|
+
// const A extends ArchetypeComponents<StringKeyof<CS>>,
|
|
40
|
+
// >(
|
|
41
|
+
// schema: StoreSchema<CS, RS, A>,
|
|
42
|
+
// ) {
|
|
43
|
+
// return createStore(schema.components, schema.resources, schema.archetypes);
|
|
44
|
+
// };
|
|
31
45
|
//# sourceMappingURL=create-store-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store-schema.js","sourceRoot":"","sources":["../../../../src/ecs/store/store-schema/create-store-schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-store-schema.js","sourceRoot":"","sources":["../../../../src/ecs/store/store-schema/create-store-schema.ts"],"names":[],"mappings":"AAAA,gBAAgB;;AAEhB,+CAA+C;AAE/C,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAE3D,iFAAiF;AACjF,kDAAkD;AAElD,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,cAAc;AAEd,yDAAyD;AACzD,iEAAiE;AACjE,+DAA+D;AAC/D,oEAAoE;AACpE,oDAAoD;AACpD,mDAAmD;AAEnD,qCAAqC;AACrC,yCAAyC;AACzC,wCAAwC;AACxC,4DAA4D;AAC5D,KAAK;AACL,sBAAsB;AACtB,qBAAqB;AACrB,qBAAqB;AACrB,MAAM;AACN,8FAA8F;AAC9F,KAAK;AAEL,yCAAyC;AACzC,yCAAyC;AACzC,wCAAwC;AACxC,4DAA4D;AAC5D,KAAK;AACL,sCAAsC;AACtC,MAAM;AACN,kFAAkF;AAClF,KAAK"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./store-schema.js";
|
|
1
|
+
export {};
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
/*MIT License
|
|
2
|
-
|
|
3
|
-
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
SOFTWARE.*/
|
|
22
|
-
export * from "./create-store-schema.js";
|
|
23
|
-
export * from "./store-schema.js";
|
|
1
|
+
// /*MIT License
|
|
2
|
+
export {};
|
|
3
|
+
// © Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
// copies or substantial portions of the Software.
|
|
12
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
// SOFTWARE.*/
|
|
19
|
+
// export * from "./create-store-schema.js";
|
|
20
|
+
// export * from "./store-schema.js";
|
|
24
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecs/store/store-schema/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecs/store/store-schema/index.ts"],"names":[],"mappings":"AAAA,gBAAgB;;AAEhB,+CAA+C;AAE/C,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAE3D,iFAAiF;AACjF,kDAAkD;AAElD,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,cAAc;AAEd,4CAA4C;AAC5C,qCAAqC"}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ComponentSchemas } from "../../component-schemas.js";
|
|
3
|
-
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
4
|
-
import { Store } from "../store.js";
|
|
5
|
-
import { ArchetypeComponents } from "../archetype-components.js";
|
|
6
|
-
import { StringKeyof } from "../../../types/types.js";
|
|
7
|
-
export type StoreSchema<CS extends ComponentSchemas, RS extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<CS>>> = {
|
|
8
|
-
readonly components: CS;
|
|
9
|
-
readonly resources: RS;
|
|
10
|
-
readonly archetypes: A;
|
|
11
|
-
};
|
|
12
|
-
export type StoreFromSchema<T> = T extends StoreSchema<infer CS, infer RS, infer A> ? Store<FromSchemas<CS>, FromSchemas<RS>, A> : never;
|
|
1
|
+
export {};
|
|
@@ -1,23 +1,57 @@
|
|
|
1
|
-
/*MIT License
|
|
2
|
-
|
|
3
|
-
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.*/
|
|
1
|
+
// /*MIT License
|
|
22
2
|
export {};
|
|
3
|
+
// © Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
// copies or substantial portions of the Software.
|
|
12
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
// SOFTWARE.*/
|
|
19
|
+
// import { FromSchemas } from "../../../schema/schema.js";
|
|
20
|
+
// import { ComponentSchemas } from "../../component-schemas.js";
|
|
21
|
+
// import { ResourceSchemas } from "../../resource-schemas.js";
|
|
22
|
+
// import { Store } from "../store.js";
|
|
23
|
+
// import { ArchetypeComponents } from "../archetype-components.js";
|
|
24
|
+
// import { StringKeyof } from "../../../types/types.js";
|
|
25
|
+
// import { Assert } from "../../../types/assert.js";
|
|
26
|
+
// import { Equal } from "../../../types/equal.js";
|
|
27
|
+
// import { Archetype } from "../../archetype/archetype.js";
|
|
28
|
+
// import { CoreComponents } from "../../core-components.js";
|
|
29
|
+
// export type StoreSchema<
|
|
30
|
+
// CS extends ComponentSchemas,
|
|
31
|
+
// RS extends ResourceSchemas,
|
|
32
|
+
// A extends ArchetypeComponents<StringKeyof<CS>>,
|
|
33
|
+
// > = {
|
|
34
|
+
// readonly components: CS;
|
|
35
|
+
// readonly resources: RS;
|
|
36
|
+
// readonly archetypes: A;
|
|
37
|
+
// };
|
|
38
|
+
// export type StoreFromSchema<T> = T extends StoreSchema<infer CS, infer RS, infer A> ? Store<FromSchemas<CS>, FromSchemas<RS>, A> : never;
|
|
39
|
+
// type CheckStoreFromSchema = StoreFromSchema<StoreSchema<{
|
|
40
|
+
// velocity: { type: "number" },
|
|
41
|
+
// particle: { type: "boolean" },
|
|
42
|
+
// }, {
|
|
43
|
+
// mousePosition: { type: "number", default: 0 },
|
|
44
|
+
// fooPosition: { type: "number", default: 0 },
|
|
45
|
+
// }, {
|
|
46
|
+
// Particle: ["particle"],
|
|
47
|
+
// DynamicParticle: ["particle", "velocity"],
|
|
48
|
+
// }>>;
|
|
49
|
+
// declare const testStore: CheckStoreFromSchema;
|
|
50
|
+
// type CheckDynamicParticle = Assert<Equal<typeof testStore.archetypes.DynamicParticle, Archetype<CoreComponents & {
|
|
51
|
+
// particle: boolean;
|
|
52
|
+
// velocity: number;
|
|
53
|
+
// }>>>;
|
|
54
|
+
// type CheckParticle = Assert<Equal<typeof testStore.archetypes.Particle, Archetype<CoreComponents & {
|
|
55
|
+
// particle: boolean;
|
|
56
|
+
// }>>>;
|
|
23
57
|
//# sourceMappingURL=store-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-schema.js","sourceRoot":"","sources":["../../../../src/ecs/store/store-schema/store-schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"store-schema.js","sourceRoot":"","sources":["../../../../src/ecs/store/store-schema/store-schema.ts"],"names":[],"mappings":"AAAA,gBAAgB;;AAEhB,+CAA+C;AAE/C,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAE3D,iFAAiF;AACjF,kDAAkD;AAElD,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,cAAc;AAEd,2DAA2D;AAC3D,iEAAiE;AACjE,+DAA+D;AAC/D,uCAAuC;AACvC,oEAAoE;AACpE,yDAAyD;AACzD,qDAAqD;AACrD,mDAAmD;AACnD,4DAA4D;AAC5D,6DAA6D;AAE7D,2BAA2B;AAC3B,mCAAmC;AACnC,kCAAkC;AAClC,sDAAsD;AACtD,QAAQ;AACR,+BAA+B;AAC/B,8BAA8B;AAC9B,8BAA8B;AAC9B,KAAK;AAEL,4IAA4I;AAE5I,4DAA4D;AAC5D,oCAAoC;AACpC,qCAAqC;AACrC,OAAO;AACP,qDAAqD;AACrD,mDAAmD;AACnD,OAAO;AACP,8BAA8B;AAC9B,iDAAiD;AACjD,OAAO;AACP,iDAAiD;AACjD,qHAAqH;AACrH,yBAAyB;AACzB,wBAAwB;AACxB,QAAQ;AACR,uGAAuG;AACvG,yBAAyB;AACzB,QAAQ"}
|
|
@@ -2,12 +2,15 @@ import { CoreComponents } from "../core-components.js";
|
|
|
2
2
|
import { ResourceComponents } from "./resource-components.js";
|
|
3
3
|
import { Core, ReadonlyCore } from "./core/core.js";
|
|
4
4
|
import { Entity } from "../entity.js";
|
|
5
|
-
import { StringKeyof } from "../../types/types.js";
|
|
5
|
+
import { Simplify, StringKeyof } from "../../types/types.js";
|
|
6
6
|
import { Components } from "./components.js";
|
|
7
7
|
import { ArchetypeComponents } from "./archetype-components.js";
|
|
8
8
|
import { Archetype, ReadonlyArchetype } from "../archetype/archetype.js";
|
|
9
9
|
import { EntitySelectOptions } from "./entity-select-options.js";
|
|
10
10
|
import { Undoable } from "../database/undoable.js";
|
|
11
|
+
import { FromSchemas } from "../../schema/schema.js";
|
|
12
|
+
import { ComponentSchemas } from "../component-schemas.js";
|
|
13
|
+
import { ResourceSchemas } from "../resource-schemas.js";
|
|
11
14
|
interface BaseStore<C extends object = never> {
|
|
12
15
|
select<Include extends StringKeyof<C>>(include: readonly Include[] | ReadonlySet<string>, options?: EntitySelectOptions<C, Pick<C & CoreComponents, Include>>): readonly Entity[];
|
|
13
16
|
toData(): unknown;
|
|
@@ -42,7 +45,25 @@ export interface Store<C extends Components = never, R extends ResourceComponent
|
|
|
42
45
|
};
|
|
43
46
|
fromData(data: unknown): void;
|
|
44
47
|
}
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
export declare namespace Store {
|
|
49
|
+
type Components<S extends Store<any, any, any>> = S extends Store<infer C, infer R, infer A> ? C & R & A : never;
|
|
50
|
+
type Resources<S extends Store<any, any, any>> = S extends Store<any, infer R, any> ? R : never;
|
|
51
|
+
type Archetypes<S extends Store<any, any, any>> = S extends Store<any, any, infer A> ? A : never;
|
|
52
|
+
type EntityValues<S extends Store<any, any, any>, K extends S extends Store<any, any, infer A> ? StringKeyof<A> : never> = Simplify<Parameters<S["archetypes"][K]["insert"]>[0] & CoreComponents>;
|
|
53
|
+
type InsertValues<S extends Store<any, any, any>, K extends S extends Store<any, any, infer A> ? StringKeyof<A> : never> = Parameters<S["archetypes"][K]["insert"]>[0];
|
|
54
|
+
type Schema<CS extends ComponentSchemas, RS extends ResourceSchemas, A extends ArchetypeComponents<StringKeyof<CS>>> = {
|
|
55
|
+
readonly components: CS;
|
|
56
|
+
readonly resources: RS;
|
|
57
|
+
readonly archetypes: A;
|
|
58
|
+
};
|
|
59
|
+
type FromSchema<T> = T extends Store.Schema<infer CS, infer RS, infer A> ? Store<FromSchemas<CS>, FromSchemas<RS>, A> : never;
|
|
60
|
+
namespace Schema {
|
|
61
|
+
function create<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>>(components: CS, resources: RS, archetypes: A): {
|
|
62
|
+
readonly components: CS;
|
|
63
|
+
readonly resources: RS;
|
|
64
|
+
readonly archetypes: A;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function createFromSchema<const CS extends ComponentSchemas, const RS extends ResourceSchemas, const A extends ArchetypeComponents<StringKeyof<CS>>>(schema: Store.Schema<CS, RS, A>): Store<FromSchemas<CS>, FromSchemas<RS>, A>;
|
|
68
|
+
}
|
|
48
69
|
export {};
|
package/dist/ecs/store/store.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { createStore } from "./create-store.js";
|
|
2
|
+
export var Store;
|
|
3
|
+
(function (Store) {
|
|
4
|
+
let Schema;
|
|
5
|
+
(function (Schema) {
|
|
6
|
+
function create(components, resources, archetypes) {
|
|
7
|
+
return { components, resources, archetypes };
|
|
8
|
+
}
|
|
9
|
+
Schema.create = create;
|
|
10
|
+
;
|
|
11
|
+
})(Schema = Store.Schema || (Store.Schema = {}));
|
|
12
|
+
function createFromSchema(schema) {
|
|
13
|
+
return createStore(schema.components, schema.resources, schema.archetypes);
|
|
14
|
+
}
|
|
15
|
+
Store.createFromSchema = createFromSchema;
|
|
16
|
+
;
|
|
17
|
+
})(Store || (Store = {}));
|
|
2
18
|
//# sourceMappingURL=store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/ecs/store/store.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/ecs/store/store.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAyChD,MAAM,KAAW,KAAK,CA2CrB;AA3CD,WAAiB,KAAK;IAmBlB,IAAiB,MAAM,CAatB;IAbD,WAAiB,MAAM;QACnB,SAAgB,MAAM,CAKlB,UAAc,EACd,SAAa,EACb,UAAa;YAEb,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAA6C,CAAC;QAC5F,CAAC;QAVe,aAAM,SAUrB,CAAA;QAAA,CAAC;IAEN,CAAC,EAbgB,MAAM,GAAN,YAAM,KAAN,YAAM,QAatB;IAED,SAAgB,gBAAgB,CAK5B,MAA+B;QAE/B,OAAO,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC/E,CAAC;IARe,sBAAgB,mBAQ/B,CAAA;IAAA,CAAC;AACN,CAAC,EA3CgB,KAAK,KAAL,KAAK,QA2CrB"}
|
package/dist/graphics/frame.d.ts
CHANGED
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const FrameSchema: {
|
|
3
|
-
readonly type: "object";
|
|
4
|
-
readonly properties: {
|
|
5
|
-
readonly count: {
|
|
6
|
-
readonly type: "number";
|
|
7
|
-
readonly default: 0;
|
|
8
|
-
};
|
|
9
|
-
readonly deltaTime: {
|
|
10
|
-
readonly type: "number";
|
|
11
|
-
readonly default: 0;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
readonly required: readonly ["count", "deltaTime"];
|
|
15
|
-
readonly additionalProperties: false;
|
|
16
|
-
readonly default: {
|
|
17
|
-
readonly count: number;
|
|
18
|
-
readonly deltaTime: number;
|
|
19
|
-
};
|
|
20
|
-
readonly transient: true;
|
|
21
|
-
};
|
|
22
|
-
export type Frame = FromSchema<typeof FrameSchema>;
|
|
1
|
+
export {};
|
package/dist/graphics/frame.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
// import { FromSchema, Schema } from "../schema/schema.js";
|
|
2
|
+
export {};
|
|
3
|
+
// export const FrameSchema = {
|
|
4
|
+
// type: "object",
|
|
5
|
+
// properties: {
|
|
6
|
+
// count: { type: "number", default: 0 },
|
|
7
|
+
// deltaTime: { type: "number", default: 0 },
|
|
8
|
+
// },
|
|
9
|
+
// required: ["count", "deltaTime"],
|
|
10
|
+
// additionalProperties: false,
|
|
11
|
+
// default: { count: 0 as number, deltaTime: 1 / 60 as number },
|
|
12
|
+
// transient: true,
|
|
13
|
+
// } as const satisfies Schema;
|
|
14
|
+
// export type Frame = FromSchema<typeof FrameSchema>;
|
|
12
15
|
//# sourceMappingURL=frame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/graphics/frame.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/graphics/frame.ts"],"names":[],"mappings":"AAAA,4DAA4D;;AAE5D,+BAA+B;AAC/B,sBAAsB;AACtB,oBAAoB;AACpB,iDAAiD;AACjD,qDAAqD;AACrD,SAAS;AACT,wCAAwC;AACxC,mCAAmC;AACnC,oEAAoE;AACpE,uBAAuB;AACvB,+BAA+B;AAE/B,sDAAsD"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const getWebGPUGraphicsContext: (canvas: HTMLCanvasElement) => Promise<GraphicsContext>;
|
|
1
|
+
export {};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
// import { GraphicsContext } from "./graphics-context.js";
|
|
2
|
+
export {};
|
|
3
|
+
// export const getWebGPUGraphicsContext = async (canvas: HTMLCanvasElement)
|
|
4
|
+
// : Promise<GraphicsContext> => {
|
|
5
|
+
// if (!canvas) {
|
|
6
|
+
// throw new Error('Canvas not found');
|
|
7
|
+
// }
|
|
8
|
+
// const adapter = await navigator.gpu?.requestAdapter();
|
|
9
|
+
// if (!adapter) {
|
|
10
|
+
// throw new Error('No GPU adapter found');
|
|
11
|
+
// }
|
|
12
|
+
// const device = await adapter.requestDevice();
|
|
13
|
+
// const context = canvas.getContext('webgpu');
|
|
14
|
+
// if (!context) {
|
|
15
|
+
// throw new Error('No WebGPU context');
|
|
16
|
+
// }
|
|
17
|
+
// context.configure({
|
|
18
|
+
// device,
|
|
19
|
+
// format: navigator.gpu.getPreferredCanvasFormat(),
|
|
20
|
+
// alphaMode: 'premultiplied',
|
|
21
|
+
// });
|
|
22
|
+
// return { context, device, canvas }
|
|
23
|
+
// }
|
|
21
24
|
//# sourceMappingURL=get-web-gpu-device-and-context.js.map
|