import type { CanonicalState, Transaction, CapabilityInvocation } from "../types/index.js"; /** State store interface */ export interface IStateStore { initialize(): Promise; save(state: CanonicalState): Promise; load(): Promise; beginTransaction(intent: CapabilityInvocation, txId?: string): Transaction; commit(tx: Transaction, state: CanonicalState): Promise; rollback(tx: Transaction): Promise; computeHash(state: CanonicalState): string; } /** State store — persists and loads canonical state. * * Writes (save, commit, snapshot) require the module-private write token. * Direct instantiation by application code is read-only; any write attempt * throws IllegalMutationError. This mirrors the EventStore authorization * model and ensures canonical state mutations flow through ExecutionGate. */ export declare class StateStore implements IStateStore { private filePath; private authorized; constructor(filePath?: string, authToken?: symbol); /** Create an authorized StateStore instance for the infrastructure layer. */ static createAuthorized(filePath?: string): StateStore; protected ensureAuthorized(): void; initialize(): Promise; save(state: CanonicalState): Promise; load(): Promise; beginTransaction(intent: CapabilityInvocation, txId?: string): Transaction; commit(tx: Transaction, state: CanonicalState): Promise; rollback(tx: Transaction): Promise; computeHash(state: CanonicalState): string; snapshot(state: CanonicalState, name: string): Promise; loadSnapshot(name: string): Promise; } /** In-memory state store (for testing / fast access) */ export declare class InMemoryStateStore implements IStateStore { private state; initialize(): Promise; save(state: CanonicalState): Promise; load(): Promise; beginTransaction(intent: CapabilityInvocation, txId?: string): Transaction; commit(_tx: Transaction, state: CanonicalState): Promise; rollback(tx: Transaction): Promise; computeHash(state: CanonicalState): string; }