import { QueryClient, type QueryClientConfig } from "@tanstack/react-query"; import { type RenderOptions, type RenderResult } from "@testing-library/react"; import { type ReactElement, type ReactNode } from "react"; import type { JestAxe } from "jest-axe"; export interface TestRequestInput { path: string; method?: string; body?: unknown; headers?: Record; } export interface TestRequestCall extends TestRequestInput { index: number; } export type TestRequest = (input: TestRequestInput) => Promise; export interface TestRequestMock { request: TestRequest; calls: TestRequestCall[]; resolve(value: unknown): TestRequestMock; reject(error: unknown): TestRequestMock; reset(): void; } export interface RenderWithQueryClientOptions extends Omit { client?: QueryClient; queryClientConfig?: QueryClientConfig; } export declare class UnauthorizedTestError extends Error { readonly status = 401; constructor(message?: string); } export declare function createTestQueryClient(config?: QueryClientConfig): QueryClient; export declare function createQueryClientWrapper(queryClient?: QueryClient): ({ children }: { children: ReactNode; }) => ReactElement; export declare function renderWithQueryClient(ui: ReactElement, options?: RenderWithQueryClientOptions): RenderResult & { queryClient: QueryClient; }; export declare function createTestRequestMock(): TestRequestMock; export declare function createUnauthorizedError(message?: string): UnauthorizedTestError; /** * The kit's a11y baseline (`A-C5`). Every consuming repository — the four * business plugins and this package's own registry render tests — runs the * same `axe-core` ruleset through this one entry point, rather than each * pinning its own `jest-axe`/`axe-core` version and rule config. * * `jest-axe` is imported lazily, on first call, rather than at module load. * `renderWithQueryClient` and friends already give every consumer of this * harness an unavoidable `@testing-library/react` + `@tanstack/react-query` * requirement; a static top-level `import "jest-axe"` here would add a third * one for every caller of *any* helper in this file, including the many that * never touch accessibility. A lazy import keeps that cost scoped to callers * of this function. * * Accepts `RenderResult["container"]` directly so a call site reads as one * line after `render(...)`, matching `renderWithQueryClient`'s ergonomics. * Reports the offending rule id, its impact and the affected node's HTML on * failure — detail a bare boolean assertion would throw away. */ export declare function expectNoA11yViolations(container: Element, options?: Parameters[1]): Promise; //# sourceMappingURL=index.d.ts.map