import type { NixKitIntegration } from "./index.js"; export interface I18nIntegration { /** Extracts the locale from a request (e.g. from URL, cookie, Accept-Language). */ getLocale(request: Request): string | Promise; /** Returns hreflang alternates for a given URL and locale. */ getAlternates(url: URL, locale: string): Array<{ hreflang: string; href: string; }>; /** Translates a key for a given locale. */ translate(key: string, locale: string, params?: Record): string; } export interface AuthIntegration { /** Extracts the user/session from a request and populates locals. */ getSession(request: Request): Promise<{ user?: unknown; session?: unknown; } | null>; /** Seeds SSR data with auth state for client hydration. */ seedSSR(locals: Record): Record; } export interface QueryIntegration { /** Dehydrates query cache for SSR serialization. */ dehydrate(): Record; /** Rehydrates query cache on the client from SSR data. */ rehydrate(data: Record): void; /** Invalidates queries by tags/keys after an action. */ invalidate(tags: readonly string[], keys?: readonly string[]): void | Promise; } export interface TestingIntegration { /** Creates a test request fixture. */ createRequest(method: string, path: string, options?: RequestInit): Request; /** Creates a render fixture for a given route. */ createRenderFixture(routePath: string, params?: Record): unknown; /** Resets test state between tests. */ reset(): void; } /** * Registers an integration. Optional packages call this on import. * The Kit never imports optional packages — they register themselves. */ export declare function registerIntegration(type: "i18n", integration: I18nIntegration): void; export declare function registerIntegration(type: "auth", integration: AuthIntegration): void; export declare function registerIntegration(type: "query", integration: QueryIntegration): void; export declare function registerIntegration(type: "testing", integration: TestingIntegration): void; export declare function registerIntegration(type: "custom", integration: NixKitIntegration): void; /** Gets the registered i18n integration, if any. */ export declare function getI18nIntegration(): I18nIntegration | undefined; /** Gets the registered auth integration, if any. */ export declare function getAuthIntegration(): AuthIntegration | undefined; /** Gets the registered query integration, if any. */ export declare function getQueryIntegration(): QueryIntegration | undefined; /** Gets the registered testing integration, if any. */ export declare function getTestingIntegration(): TestingIntegration | undefined; /** Gets all registered custom integrations. */ export declare function getCustomIntegrations(): readonly NixKitIntegration[]; /** Clears all registered integrations. Used in tests. */ export declare function clearIntegrations(): void;