@adobe/data 0.5.21 → 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.
Files changed (102) hide show
  1. package/dist/ecs/entity/entity.d.ts +8 -0
  2. package/dist/ecs/entity/entity.js +3 -0
  3. package/dist/ecs/entity/entity.js.map +1 -0
  4. package/dist/ecs/entity/u32.d.ts +8 -0
  5. package/dist/{lit/elements/service-context.js → ecs/entity/u32.js} +3 -3
  6. package/dist/ecs/entity/u32.js.map +1 -0
  7. package/dist/ecs/store/create-store-schema-test.d.ts +1 -0
  8. package/dist/ecs/store/create-store-schema-test.js +33 -0
  9. package/dist/ecs/store/create-store-schema-test.js.map +1 -0
  10. package/dist/ecs/store/create-store.d.ts +2 -6
  11. package/dist/ecs/store/create-store.js.map +1 -1
  12. package/dist/ecs/store/index.d.ts +0 -1
  13. package/dist/ecs/store/index.js +0 -1
  14. package/dist/ecs/store/index.js.map +1 -1
  15. package/dist/ecs/store/store-schema/create-store-schema-test.js +2 -2
  16. package/dist/ecs/store/store-schema/create-store-schema-test.js.map +1 -1
  17. package/dist/ecs/store/store-schema/create-store-schema.d.ts +1 -11
  18. package/dist/ecs/store/store-schema/create-store-schema.js +44 -30
  19. package/dist/ecs/store/store-schema/create-store-schema.js.map +1 -1
  20. package/dist/ecs/store/store-schema/index.d.ts +1 -2
  21. package/dist/ecs/store/store-schema/index.js +20 -23
  22. package/dist/ecs/store/store-schema/index.js.map +1 -1
  23. package/dist/ecs/store/store-schema/store-schema.d.ts +1 -12
  24. package/dist/ecs/store/store-schema/store-schema.js +55 -21
  25. package/dist/ecs/store/store-schema/store-schema.js.map +1 -1
  26. package/dist/ecs/store/store.d.ts +25 -4
  27. package/dist/ecs/store/store.js +17 -1
  28. package/dist/ecs/store/store.js.map +1 -1
  29. package/dist/graphics/frame.d.ts +1 -22
  30. package/dist/graphics/frame.js +14 -11
  31. package/dist/graphics/frame.js.map +1 -1
  32. package/dist/graphics/get-web-gpu-device-and-context.d.ts +1 -2
  33. package/dist/graphics/get-web-gpu-device-and-context.js +23 -20
  34. package/dist/graphics/get-web-gpu-device-and-context.js.map +1 -1
  35. package/dist/graphics/graphics-context.d.ts +1 -5
  36. package/dist/graphics/graphics-context.js +5 -0
  37. package/dist/graphics/graphics-context.js.map +1 -1
  38. package/dist/lit/hooks/use-ref.d.ts +2 -2
  39. package/dist/lit/hooks/use-ref.js +2 -2
  40. package/dist/lit/hooks/use-ref.js.map +1 -1
  41. package/dist/math/aabb-face/face.d.ts +51 -0
  42. package/dist/math/aabb-face/face.js +110 -0
  43. package/dist/math/aabb-face/face.js.map +1 -0
  44. package/dist/math/aabb-face/face.test.d.ts +1 -0
  45. package/dist/math/aabb-face/face.test.js +94 -0
  46. package/dist/math/aabb-face/face.test.js.map +1 -0
  47. package/dist/math/box/box.d.ts +50 -0
  48. package/dist/math/box/box.js +23 -0
  49. package/dist/math/box/box.js.map +1 -0
  50. package/dist/math/face/face.d.ts +51 -0
  51. package/dist/math/face/face.js +110 -0
  52. package/dist/math/face/face.js.map +1 -0
  53. package/dist/math/face/face.test.d.ts +1 -0
  54. package/dist/math/face/face.test.js +94 -0
  55. package/dist/math/face/face.test.js.map +1 -0
  56. package/dist/math/picking/face.d.ts +1 -0
  57. package/dist/math/picking/face.js +2 -0
  58. package/dist/math/picking/face.js.map +1 -0
  59. package/dist/math/picking/get-closest-entity-to-line.js +1 -1
  60. package/dist/math/picking/get-closest-entity-to-line.js.map +1 -1
  61. package/dist/math/picking/get-closest-entity-to-point.js +1 -1
  62. package/dist/math/picking/get-closest-entity-to-point.js.map +1 -1
  63. package/dist/math/picking/getClosestEntityToLine.d.ts +4 -0
  64. package/dist/math/picking/getClosestEntityToLine.js +29 -0
  65. package/dist/math/picking/getClosestEntityToLine.js.map +1 -0
  66. package/dist/math/picking/getClosestEntityToPoint.d.ts +4 -0
  67. package/dist/math/picking/getClosestEntityToPoint.js +27 -0
  68. package/dist/math/picking/getClosestEntityToPoint.js.map +1 -0
  69. package/dist/math/picking/getIntersectingEntities.d.ts +12 -0
  70. package/dist/math/picking/getIntersectingEntities.js +15 -0
  71. package/dist/math/picking/getIntersectingEntities.js.map +1 -0
  72. package/dist/math/picking/pick-from-tables.js +1 -1
  73. package/dist/math/picking/pick-from-tables.js.map +1 -1
  74. package/dist/math/picking/pick-result.d.ts +4 -2
  75. package/dist/math/transform/debug-inverse.d.ts +1 -0
  76. package/dist/math/transform/debug-inverse.js +28 -0
  77. package/dist/math/transform/debug-inverse.js.map +1 -0
  78. package/dist/math/transform/debug-quat.d.ts +1 -0
  79. package/dist/math/transform/debug-quat.js +23 -0
  80. package/dist/math/transform/debug-quat.js.map +1 -0
  81. package/dist/math/transform/debug-test.d.ts +1 -0
  82. package/dist/math/transform/debug-test.js +34 -0
  83. package/dist/math/transform/debug-test.js.map +1 -0
  84. package/dist/math/transform/transform.d.ts +58 -0
  85. package/dist/math/transform/transform.js +101 -0
  86. package/dist/math/transform/transform.js.map +1 -0
  87. package/dist/math/transform/transform.test.d.ts +1 -0
  88. package/dist/math/transform/transform.test.js +309 -0
  89. package/dist/math/transform/transform.test.js.map +1 -0
  90. package/dist/samples/todo/services/state-service/create-todo-database.d.ts +32 -9
  91. package/dist/samples/todo/services/state-service/create-todo-store.d.ts +32 -9
  92. package/dist/schema/schema.d.ts +1 -1
  93. package/dist/tsconfig.tsbuildinfo +1 -1
  94. package/package.json +1 -1
  95. package/dist/lit/elements/service-application.d.ts +0 -9
  96. package/dist/lit/elements/service-application.js +0 -55
  97. package/dist/lit/elements/service-application.js.map +0 -1
  98. package/dist/lit/elements/service-context.d.ts +0 -1
  99. package/dist/lit/elements/service-context.js.map +0 -1
  100. package/dist/lit/elements/service-element.d.ts +0 -6
  101. package/dist/lit/elements/service-element.js +0 -43
  102. package/dist/lit/elements/service-element.js.map +0 -1
@@ -0,0 +1,8 @@
1
+ import { FromSchema } from "../../schema/schema.js";
2
+ export declare const EntitySchema: {
3
+ readonly type: "integer";
4
+ readonly minimum: 0;
5
+ readonly maximum: 4294967295;
6
+ readonly default: number;
7
+ };
8
+ export type Entity = FromSchema<typeof EntitySchema>;
@@ -0,0 +1,3 @@
1
+ import { U32Schema } from "../../schema/u32.js";
2
+ export const EntitySchema = U32Schema;
3
+ //# sourceMappingURL=entity.js.map
@@ -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"}
@@ -0,0 +1,8 @@
1
+ import { FromSchema } from "../../schema/index.js";
2
+ export declare const schema: {
3
+ readonly type: "integer";
4
+ readonly minimum: 0;
5
+ readonly maximum: 4294967295;
6
+ readonly default: number;
7
+ };
8
+ export type Type = FromSchema<typeof schema>;
@@ -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 { createContext } from "@lit/context";
23
- export const serviceContext = createContext(Symbol("service"));
24
- //# sourceMappingURL=service-context.js.map
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 { FromSchema } from "../../schema/schema.js";
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,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AC,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"}
@@ -1,4 +1,3 @@
1
1
  export * from "./store.js";
2
2
  export * from "./create-store.js";
3
3
  export * from "./archetype-components.js";
4
- export * from "./store-schema/index.js";
@@ -22,5 +22,4 @@ SOFTWARE.*/
22
22
  export * from "./store.js";
23
23
  export * from "./create-store.js";
24
24
  export * from "./archetype-components.js";
25
- export * from "./store-schema/index.js";
26
25
  //# sourceMappingURL=index.js.map
@@ -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;AAC1C,cAAc,yBAAyB,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 { createStoreSchema } from "./create-store-schema.js";
23
- const storeSchema = createStoreSchema({
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;AAMX,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,GAAG,iBAAiB,CACjC;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
+ {"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
- import { StringKeyof } from "../../../types/types.js";
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
- 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 { createStore } from "../create-store.js";
23
- export function createStoreSchema(components, resources, archetypes) {
24
- return { components, resources, archetypes };
25
- }
26
- ;
27
- export function createStoreFromSchema(schema) {
28
- return createStore(schema.components, schema.resources, schema.archetypes);
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;;;;;;;;;;;;;;;;;;;;WAoBW;AAMX,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,UAAU,iBAAiB,CAK7B,UAAc,EACd,SAAa,EACb,UAAa;IAEb,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAA4C,CAAC;AAC3F,CAAC;AAAA,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAKjC,MAA8B;IAE9B,OAAO,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;AAC/E,CAAC;AAAA,CAAC"}
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 * from "./create-store-schema.js";
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
- 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
- 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;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC"}
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
- import { FromSchemas } from "../../../schema/schema.js";
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;;;;;;;;;;;;;;;;;;;;WAoBW"}
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 type StoreComponents<S extends Store<any, any, any>> = S extends Store<infer C, infer R, infer A> ? C & R & A : never;
46
- export type StoreResources<S extends Store<any, any, any>> = S extends Store<any, infer R, any> ? R : never;
47
- export type StoreArchetypes<S extends Store<any, any, any>> = S extends Store<any, any, infer A> ? A : never;
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 {};
@@ -1,2 +1,18 @@
1
- export {};
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"}
@@ -1,22 +1 @@
1
- import { FromSchema } from "../schema/schema.js";
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 {};
@@ -1,12 +1,15 @@
1
- export const FrameSchema = {
2
- type: "object",
3
- properties: {
4
- count: { type: "number", default: 0 },
5
- deltaTime: { type: "number", default: 0 },
6
- },
7
- required: ["count", "deltaTime"],
8
- additionalProperties: false,
9
- default: { count: 0, deltaTime: 1 / 60 },
10
- transient: true,
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":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;QACrC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;KAC5C;IACD,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;IAChC,oBAAoB,EAAE,KAAK;IAC3B,OAAO,EAAE,EAAE,KAAK,EAAE,CAAW,EAAE,SAAS,EAAE,CAAC,GAAG,EAAY,EAAE;IAC5D,SAAS,EAAE,IAAI;CACQ,CAAC"}
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
- import { GraphicsContext } from "./graphics-context.js";
2
- export declare const getWebGPUGraphicsContext: (canvas: HTMLCanvasElement) => Promise<GraphicsContext>;
1
+ export {};
@@ -1,21 +1,24 @@
1
- export const getWebGPUGraphicsContext = async (canvas) => {
2
- if (!canvas) {
3
- throw new Error('Canvas not found');
4
- }
5
- const adapter = await navigator.gpu?.requestAdapter();
6
- if (!adapter) {
7
- throw new Error('No GPU adapter found');
8
- }
9
- const device = await adapter.requestDevice();
10
- const context = canvas.getContext('webgpu');
11
- if (!context) {
12
- throw new Error('No WebGPU context');
13
- }
14
- context.configure({
15
- device,
16
- format: navigator.gpu.getPreferredCanvasFormat(),
17
- alphaMode: 'premultiplied',
18
- });
19
- return { context, device, canvas };
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