@bloopjs/bloop 0.0.9 → 0.0.10
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/jsr.json +1 -1
- package/package.json +2 -2
- package/src/context.ts +2 -2
- package/src/data/schema.ts +1 -1
- package/src/mod.ts +4 -4
- package/src/system.ts +2 -2
- package/test/inputs.test.ts +3 -0
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloopjs/bloop",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@types/bun": "latest"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@bloopjs/engine": "0.0.
|
|
26
|
+
"@bloopjs/engine": "0.0.10"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"typescript": "^5"
|
package/src/context.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { InputSnapshot } from "@bloopjs/engine";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BloopSchema } from "./data/schema";
|
|
3
3
|
|
|
4
4
|
export type Context<
|
|
5
|
-
GS extends
|
|
5
|
+
GS extends BloopSchema = BloopSchema,
|
|
6
6
|
// Q extends Query<GS["CS"]> = Query<GS["CS"]>,
|
|
7
7
|
// QS extends readonly Query<GS["CS"]>[] = readonly Query<GS["CS"]>[],
|
|
8
8
|
> = {
|
package/src/data/schema.ts
CHANGED
package/src/mod.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BloopSchema } from "./data/schema";
|
|
2
2
|
import type { Bag } from "./data/bag";
|
|
3
3
|
import type { System } from "./system";
|
|
4
4
|
import { EngineInputs, type PlatformEvent } from "@bloopjs/engine";
|
|
@@ -25,15 +25,15 @@ export type BloopOpts<B extends Bag> = {
|
|
|
25
25
|
// schema: GS;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
type MakeGS<B extends Bag> =
|
|
28
|
+
type MakeGS<B extends Bag> = BloopSchema<B>;
|
|
29
29
|
|
|
30
|
-
export class Bloop<GS extends
|
|
30
|
+
export class Bloop<GS extends BloopSchema> {
|
|
31
31
|
#systems: System<GS>[] = [];
|
|
32
32
|
#bag: GS["B"];
|
|
33
33
|
#context: Context<GS>;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* Bloop.create() is the way to create a new
|
|
36
|
+
* Bloop.create() is the way to create a new bloop instance.
|
|
37
37
|
*/
|
|
38
38
|
static create<
|
|
39
39
|
// S extends Schema,
|
package/src/system.ts
CHANGED
|
@@ -5,9 +5,9 @@ import type {
|
|
|
5
5
|
MouseWheelEvent,
|
|
6
6
|
} from "@bloopjs/engine";
|
|
7
7
|
import type { Context } from "./context";
|
|
8
|
-
import type {
|
|
8
|
+
import type { BloopSchema } from "./data/schema";
|
|
9
9
|
|
|
10
|
-
export type System<GS extends
|
|
10
|
+
export type System<GS extends BloopSchema = BloopSchema> = {
|
|
11
11
|
label?: string;
|
|
12
12
|
|
|
13
13
|
update?: (context: Context<GS>) => void;
|