@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.
@@ -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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