import type { TSchema } from "typebox"; import type { TCoreEntityForkRecord } from "../schemata/fork.js"; import type { TInvariantValidationResult } from "../types/validation.js"; /** * A keyed collection of fork records for a single entity type. * Each record maps a forked entity back to its origin via `entityId → forkId`. * Records are schema-validated on mutation; invalid state throws {@link InvariantViolationError}. */ export declare class ForkNamespace { private records; private schema; constructor(schema?: TSchema); private restoreFromRecords; private withValidation; /** Registers a fork record. Throws if the `entityId` already exists. */ create(record: T): T; /** Returns the fork record for the given entity ID, or `undefined`. */ get(entityId: string): T | undefined; /** Returns all fork records in this namespace. */ getAll(): T[]; /** Returns all records that share the given origin `forkId`. */ getByForkId(forkId: string): T[]; /** Removes and returns the fork record for the given entity ID. Throws if not found. */ remove(entityId: string): T; /** Returns a serializable snapshot of all records. */ snapshot(): T[]; /** Restores a namespace from a previously captured snapshot. */ static fromSnapshot(records: T[], schema?: TSchema): ForkNamespace; /** Validates every record against the namespace's schema. */ validate(): TInvariantValidationResult; } //# sourceMappingURL=fork-namespace.d.ts.map