export interface WorldStateDefinition = Record> { meta: { id: string; description: string; }; setup: (ctx: TContext) => Promise | void; teardown?: (ctx: TContext) => Promise | void; } /** * Synchronous accessor (backwards compatible). * * Note: This will only work for CommonJS world-states. If your world-state is ESM, use * {@link ensureWorldState} / {@link teardownWorldState} which support async loading. */ export declare function getWorldStateById(id: string): WorldStateDefinition; /** * Run teardown for a world-state using a fresh context object. * Use when you did not keep the {@link ensureWorldState} return value (e.g. simplified-view codegen). * World-states whose teardown depends on the exact same ctx instance setup mutated are not supported here. */ export declare function teardownWorldState(id: string, ctx?: Record): Promise; /** @internal Reset registry between tests (Node test runner). */ export declare function __resetWorldStateRegistryForTests(): void; export declare function defineWorldState = Record>(def: WorldStateDefinition): WorldStateDefinition; export declare function ensureWorldState = Record>(id: string, ctx?: TContext): Promise<{ id: string; ctx: TContext; teardown: () => Promise; }>; //# sourceMappingURL=worldstate.d.ts.map