sia-reactor 0.0.21 → 0.0.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/README.md +115 -89
- package/dist/{TimeTravelOverlay-DxqJL0Zk.d.ts → TimeTravelOverlay-Dglcwpg-.d.ts} +9 -8
- package/dist/{TimeTravelOverlay-CJv-S_Km.d.cts → TimeTravelOverlay-OjklzuCD.d.cts} +9 -8
- package/dist/adapters/react.cjs +74 -91
- package/dist/adapters/react.d.cts +23 -22
- package/dist/adapters/react.d.ts +23 -22
- package/dist/adapters/react.js +3 -3
- package/dist/adapters/vanilla.cjs +74 -91
- package/dist/adapters/vanilla.d.cts +4 -4
- package/dist/adapters/vanilla.d.ts +4 -4
- package/dist/adapters/vanilla.js +3 -3
- package/dist/{chunk-TFLYCXK4.js → chunk-5JNWC7Z4.js} +14 -13
- package/dist/{chunk-DP74DVRT.js → chunk-MKL3JUPO.js} +55 -15
- package/dist/{chunk-2WBPGSRL.js → chunk-MSTHQVNK.js} +61 -78
- package/dist/{index-Oie9hhE8.d.cts → index-m0aAWxhX.d.cts} +330 -218
- package/dist/{index-Oie9hhE8.d.ts → index-m0aAWxhX.d.ts} +330 -218
- package/dist/index.cjs +69 -89
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -4
- package/dist/{plugins.cjs → modules.cjs} +464 -195
- package/dist/modules.d.cts +52 -0
- package/dist/modules.d.ts +52 -0
- package/dist/modules.js +619 -0
- package/dist/super.d.ts +642 -298
- package/dist/super.global.js +481 -210
- package/dist/timeTravel-DExvNb04.d.ts +352 -0
- package/dist/timeTravel-DctvcHVt.d.cts +352 -0
- package/dist/utils.cjs +59 -14
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +7 -1
- package/package.json +6 -6
- package/dist/plugins.d.cts +0 -112
- package/dist/plugins.d.ts +0 -112
- package/dist/plugins.js +0 -370
- package/dist/timeTravel-B1vedDQc.d.ts +0 -76
- package/dist/timeTravel-WpgWmKu-.d.cts +0 -76
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { a as REvent, P as Paths, B as BaseReactorPlugin, b as Reactor } from './index-Oie9hhE8.cjs';
|
|
2
|
-
|
|
3
|
-
/** The DNA of a specific moment in time, Records the 'Desire' (Intent) or the 'Fact' (State). */
|
|
4
|
-
interface HistoryEntry {
|
|
5
|
-
/** The surgical address in the Reactor */
|
|
6
|
-
path: string;
|
|
7
|
-
/** The data payload at that moment */
|
|
8
|
-
value: any;
|
|
9
|
-
/** The "Undo" antidote (Previous value), if applicable */
|
|
10
|
-
oldValue: any;
|
|
11
|
-
/** Was it a 'set' or a 'delete' surgery? */
|
|
12
|
-
type: REvent<any, any>["staticType"];
|
|
13
|
-
/** Did the Power Line disapprove?; why? */
|
|
14
|
-
rejected: string;
|
|
15
|
-
/** For chronological re-enactment */
|
|
16
|
-
timedelta: number;
|
|
17
|
-
/** Did the key for the value exist on its parent object? */
|
|
18
|
-
hadKey: boolean;
|
|
19
|
-
}
|
|
20
|
-
interface TimeTravelConfig<T extends object = any> {
|
|
21
|
-
/** Specific paths only, no "*"; instead don't pass anything */
|
|
22
|
-
paths?: Paths<T>[];
|
|
23
|
-
/** Maximum number of history entries to keep (Memory Cap), you lose replaying Sessions or the Genesis */
|
|
24
|
-
maxHistoryLength: number;
|
|
25
|
-
/** Max delay between events during playback (ms) */
|
|
26
|
-
maxPlaybackDelay: number;
|
|
27
|
-
}
|
|
28
|
-
interface TimeTravelState {
|
|
29
|
-
/** The "Genesis" snapshot (Raw Data) */
|
|
30
|
-
initialState: any;
|
|
31
|
-
/** The "Timeline" of mutations (Chronological Log) */
|
|
32
|
-
history: HistoryEntry[];
|
|
33
|
-
/** The manual playhead (Index in the Timeline) */
|
|
34
|
-
currentFrame: number;
|
|
35
|
-
/** Whether playback is currently paused (Automatic Replay) */
|
|
36
|
-
paused: boolean;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The Flight Recorder (Black Box).
|
|
40
|
-
* - Implements S.I.A. logic to allow playback, teleportation, redos and undos.
|
|
41
|
-
*/
|
|
42
|
-
declare class TimeTravelPlugin<T extends object = any> extends BaseReactorPlugin<T, TimeTravelConfig<T>, TimeTravelState> {
|
|
43
|
-
static readonly plugName = "timeTravel";
|
|
44
|
-
protected lastTimestamp: number;
|
|
45
|
-
protected playbackTimeoutId: number;
|
|
46
|
-
constructor(config?: Partial<TimeTravelConfig<T>>, rtr?: Reactor<T>);
|
|
47
|
-
wire(): void;
|
|
48
|
-
protected handlePathsState({ value: paths, oldValue: prevs }: REvent<TimeTravelConfig<T>, "paths">): void;
|
|
49
|
-
/** Chronicling the lifecycle of the system, Captures the essence of every mutation wave that bubbles up. */
|
|
50
|
-
protected record(e: REvent<T, any>): void;
|
|
51
|
-
/** Clears timeline history and resets playhead/genesis to the current reactor state. */
|
|
52
|
-
clear(): void;
|
|
53
|
-
/** Instant state reconstruction (Teleport). Glides through deltas natively. */
|
|
54
|
-
jumpTo(index?: number, keepShield?: boolean): void;
|
|
55
|
-
/** Step through time, Moves the playhead and teleports the state. */
|
|
56
|
-
step(stride?: number, forward?: boolean): void;
|
|
57
|
-
/** Step back in time, Moves the playhead backward and teleports the state. */
|
|
58
|
-
undo: () => void;
|
|
59
|
-
/** Step forward in time, Restores previously undone actions. */
|
|
60
|
-
redo: () => void;
|
|
61
|
-
/** Core automove engine. Replays or rewinds the "Story" by respecting time gaps. */
|
|
62
|
-
automove(forward?: boolean): Promise<void>;
|
|
63
|
-
/** Start chronological re-enactment of the session. */
|
|
64
|
-
play: () => Promise<void>;
|
|
65
|
-
/** Start reverse chronological re-enactment of the session. */
|
|
66
|
-
rewind: () => Promise<void>;
|
|
67
|
-
/** Pauses the live VCR playback. */
|
|
68
|
-
pause: () => void;
|
|
69
|
-
/** Exports the current session as a JSON string. */
|
|
70
|
-
export(replacer?: ((this: any, key: string, value: any) => any) | (number | string)[] | null, space?: string | number): string;
|
|
71
|
-
/** Imports a session from a JSON string, allowing you to replay or analyze past states. */
|
|
72
|
-
import(json: string): void;
|
|
73
|
-
}
|
|
74
|
-
declare const TIME_TRAVEL_PLUGIN_BUILD: Partial<TimeTravelConfig>;
|
|
75
|
-
|
|
76
|
-
export { type HistoryEntry as H, TimeTravelPlugin as T, TIME_TRAVEL_PLUGIN_BUILD as a, type TimeTravelConfig as b, type TimeTravelState as c };
|