import { type Getter } from '@dereekb/util'; /** * A getter that returns the function under test. Allows the function reference to be swapped * between tests without re-declaring test cases. */ export type UseTestFunctionFixtureFunctionGetter O, O = any> = Getter; /** * Configuration for {@link useTestFunctionFixture} providing a getter for the function under test. */ export interface UseTestFunctionFixture O, O = any> { fn: Getter; } /** * Function that declares test cases using the provided forwarded function reference. */ export type TestFunctionFixtureBuildTests = (fn: I) => void; /** * Sets up a test fixture that forwards calls to a lazily-resolved function reference. * * The forwarded function delegates to the getter at call time, so the underlying implementation * can change between tests while test declarations remain stable. * * @param config - provides the getter for the function under test * @param buildTests - declares test cases using the forwarded function */ export declare function useTestFunctionFixture O, O = any>(config: UseTestFunctionFixture, buildTests: TestFunctionFixtureBuildTests): void; /** * A record of named functions, used as the shape for multi-function test fixtures. */ export type UseTestFunctionMapObject = Record any>; /** * Configuration for {@link useTestFunctionMapFixture} providing getters for multiple named functions. */ export type UseTestFunctionMapFixture = { fns: UseTestFunctionMapFixtureGetterFunctions; }; /** * Maps each key in `T` to its corresponding function getter type, filtering out non-getter entries. */ export type UseTestFunctionMapFixtureGetterFunctions = { [K in keyof T]: T[K] extends UseTestFunctionFixtureFunctionGetter ? T[K] : never; }; /** * Maps each key in `T` to the unwrapped function type returned by its getter. * This is the shape of the object passed to test-building functions. */ export type UseTestFunctionMapFixtureFunctions = { [K in keyof T]: T[K] extends UseTestFunctionFixtureFunctionGetter ? I : never; }; /** * Function that declares test cases using the provided map of forwarded function references. */ export type TestFunctionFixtureMapBuildTests = (fixture: UseTestFunctionMapFixtureFunctions) => void; /** * Sets up a test fixture for multiple named functions, forwarding each to its lazily-resolved getter. * * Similar to {@link useTestFunctionFixture} but operates on a map of functions, allowing tests * to be declared against multiple related function implementations at once. * * @param config - provides getters for each named function under test * @param buildTests - declares test cases using the map of forwarded functions */ export declare function useTestFunctionMapFixture(config: UseTestFunctionMapFixture, buildTests: TestFunctionFixtureMapBuildTests): void;