mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
21 lines
690 B
TypeScript
21 lines
690 B
TypeScript
import { ReadonlySignal } from "./signals/primitives.js";
|
|
import "../index.js";
|
|
//#region src/core/machine.d.ts
|
|
/**
|
|
* Base snapshot for all machine-like primitives (Actors and Reactors).
|
|
* Carries only the finite state value. Actors extend this with `context`.
|
|
*/
|
|
interface MachineSnapshot<State extends string> {
|
|
value: State;
|
|
}
|
|
/**
|
|
* Shared interface for all machine-like primitives.
|
|
* Both Actors (message-driven) and Reactors (signal-driven) implement this.
|
|
*/
|
|
interface Machine<Snapshot extends MachineSnapshot<string>> {
|
|
readonly snapshot: ReadonlySignal<Snapshot>;
|
|
destroy(): void;
|
|
}
|
|
//#endregion
|
|
export { Machine, MachineSnapshot };
|
|
//# sourceMappingURL=machine.d.ts.map
|