import { type Mock } from "vitest"; import { type RenderHookOptions, type RenderHookResult } from "@testing-library/react"; import { type SublayContextValues } from "../context/sublay-context"; export declare function jsonResponse(body: unknown, status?: number): Response; export interface FetchCallRecord { url: string; method: string; } export interface FetchMockHandle { fetchMock: Mock; calls: () => FetchCallRecord[]; } /** * Stubs the global `fetch`/`Request` for RTK-Query-backed hook tests. Call * from `beforeEach`; pair with `unstubFetchMock` in `afterEach`. The returned * `fetchMock` is a plain `vi.fn()` — configure per-test behavior on it with * `mockImplementation`/`mockResolvedValueOnce`, building responses with * `jsonResponse`. */ export declare function stubFetchMock(implementation?: (...args: unknown[]) => Promise): FetchMockHandle; /** Restores the real global `fetch`/`Request`. Call from `afterEach`. */ export declare function unstubFetchMock(): void; export declare function makeRtkQueryStore(): import("@reduxjs/toolkit").EnhancedStore<{ sublay: { auth: import("../store/slices/authSlice").AuthState; appNotifications: import("../store/slices/appNotificationsSlice").AppNotificationsState; collections: import("../store/slices/collectionsSlice").CollectionsState; user: import("../store/slices/userSlice").UserState; entityLists: import("../store/slices/entityListsSlice").EntityListsState; spaceLists: import("../store/slices/spaceListsSlice").SpaceListsState; accounts: import("../store/slices/accountsSlice").AccountsState; chat: import("..").ChatState; tables: import("../store/slices/tablesSlice").TablesState; }; sublayApi: import("@reduxjs/toolkit/query").CombinedState<{}, "AppNotification" | "Collection" | "CollectionEntities" | "User" | "Entity" | "Space" | "TableRow" | "NotificationPreferences", "sublayApi">; }, import("@reduxjs/toolkit").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{ dispatch: import("@reduxjs/toolkit").ThunkDispatch<{ sublay: { auth: import("../store/slices/authSlice").AuthState; appNotifications: import("../store/slices/appNotificationsSlice").AppNotificationsState; collections: import("../store/slices/collectionsSlice").CollectionsState; user: import("../store/slices/userSlice").UserState; entityLists: import("../store/slices/entityListsSlice").EntityListsState; spaceLists: import("../store/slices/spaceListsSlice").SpaceListsState; accounts: import("../store/slices/accountsSlice").AccountsState; chat: import("..").ChatState; tables: import("../store/slices/tablesSlice").TablesState; }; sublayApi: import("@reduxjs/toolkit/query").CombinedState<{}, "AppNotification" | "Collection" | "CollectionEntities" | "User" | "Entity" | "Space" | "TableRow" | "NotificationPreferences", "sublayApi">; }, undefined, import("@reduxjs/toolkit").UnknownAction>; }>, import("@reduxjs/toolkit").StoreEnhancer]>>; export type RtkQueryStore = ReturnType; export interface RenderHookWithStoreOptions extends Omit, "wrapper"> { projectId?: string; project?: SublayContextValues["project"]; /** Reuse an existing store (e.g. to dispatch/read state across renders or hooks). */ store?: RtkQueryStore; } export interface RenderHookWithStoreResult extends RenderHookResult { store: RtkQueryStore; } /** * Renders an RTK-Query-backed core hook wrapped in `SublayContext` plus a * real store (`sublayReducers` + `baseApi`). One store is created per call * and held stable across re-renders — recreating it on every render would * wipe RTK Query's cache. Pair with `stubFetchMock` to control the network. */ export declare function renderHookWithStore(callback: (props: Props) => Result, options?: RenderHookWithStoreOptions): RenderHookWithStoreResult;