/** * renderHook — test composable hooks (lifecycle, reactive state, etc.) in isolation * without rendering a full component template. */ import { type InferProps, type PropInputDefs } from '../props'; export interface HookFixture { /** Teardown the hook (runs cleanups). Idempotent. */ dispose(): void; /** `true` after `dispose()` has been called. */ readonly disposed: boolean; /** Flush pending reactive updates */ flush(): Promise; /** The value returned by the setup function */ result: T; /** Delegates to `dispose()`. Enables `using` declarations. */ [Symbol.dispose](): void; } /** * Run a setup function in a component-like context and return the result. * `onMounted`/`onCleanup`/`bind`/... work exactly as they would inside a real * `setup()`, since they resolve the same implicit current-component context. * * @example No props * ```ts * const { result, flush } = await renderHook(() => { * const count = signal(0); * onMounted(() => { count.value = 1; }); * return count; * }); * expect(result.value).toBe(1); * ``` * * @example With props * ```ts * const { result } = await renderHook( * { label: prop.string('hello') }, * (props) => props.label, * ); * expect(result.value).toBe('hello'); * ``` */ export declare function renderHook(setup: (_props: Record) => T): Promise>; export declare function renderHook(propDefs: D, setup: (props: InferProps) => T): Promise>; //# sourceMappingURL=render-hook.d.ts.map