@bloopjs/engine 0.0.0
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/engine.d.ts +46 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +1185 -0
- package/dist/engine.js.map +14 -0
- package/dist/events.d.ts +75 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/inputs.d.ts +459 -0
- package/dist/inputs.d.ts.map +1 -0
- package/dist/mod.d.ts +37 -0
- package/dist/mod.d.ts.map +1 -0
- package/dist/mod.js +1115 -0
- package/dist/mod.js.map +12 -0
- package/dist/runtime.d.ts +31 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/timing.d.ts +11 -0
- package/dist/timing.d.ts.map +1 -0
- package/dist/wasmEngine.d.ts +13 -0
- package/dist/wasmEngine.d.ts.map +1 -0
- package/js/codegen/enums.ts +223 -0
- package/js/contexts/inputContext.ts +745 -0
- package/js/contexts/timeContext.ts +31 -0
- package/js/engine.ts +34 -0
- package/js/inputs.ts +47 -0
- package/js/wasmEngine.ts +47 -0
- package/package.json +37 -0
- package/wasm/bloop.wasm +0 -0
package/dist/engine.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Runtime } from "./runtime";
|
|
2
|
+
import type { WasmEngine } from "./wasmEngine";
|
|
3
|
+
export type * from "./events";
|
|
4
|
+
export type * from "./inputs";
|
|
5
|
+
export * as EngineEvents from "./events";
|
|
6
|
+
export * as EngineInputs from "./inputs";
|
|
7
|
+
export * as EngineTiming from "./timing";
|
|
8
|
+
export declare const DEFAULT_WASM_URL: URL;
|
|
9
|
+
export type EnginePointer = number;
|
|
10
|
+
export type EngineBuffer = number;
|
|
11
|
+
export type EngineLen = number;
|
|
12
|
+
export type MountOpts = {
|
|
13
|
+
wasmUrl?: URL;
|
|
14
|
+
/**
|
|
15
|
+
* A callback function for each system
|
|
16
|
+
*
|
|
17
|
+
* @param ptr - A pointer to the engine context
|
|
18
|
+
*
|
|
19
|
+
* ptr[0] - pointer to time context
|
|
20
|
+
* ptr[1] - pointer to input snapshot
|
|
21
|
+
* ptr[2] - pointer to events buffer
|
|
22
|
+
*/
|
|
23
|
+
systemsCallback: (system_handle: number, ptr: EnginePointer) => void;
|
|
24
|
+
snapshot?: () => Uint8Array;
|
|
25
|
+
restore?: (snapshot: Uint8Array) => void;
|
|
26
|
+
/** Options for tape recording, not yet implemented */
|
|
27
|
+
tape?: {
|
|
28
|
+
/** Whether to start recording on frame 0 */
|
|
29
|
+
enabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* How often to take snapshots.
|
|
32
|
+
* More snapshots = faster rewind, less snapshots = less memory usage
|
|
33
|
+
*/
|
|
34
|
+
snapshotInterval?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The size of the event buffer in bytes
|
|
37
|
+
*/
|
|
38
|
+
eventBufferSize?: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type MountResult = {
|
|
42
|
+
runtime: Runtime;
|
|
43
|
+
wasm: WasmEngine;
|
|
44
|
+
};
|
|
45
|
+
export declare function mount(opts: MountOpts): Promise<MountResult>;
|
|
46
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../js/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,UAAU,CAAC;AAE9B,OAAO,KAAK,YAAY,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,YAAY,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,YAAY,MAAM,UAAU,CAAC;AAEzC,eAAO,MAAM,gBAAgB,KAAiD,CAAC;AAE/E,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AACnC,MAA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