import * as react_jsx_runtime from 'react/jsx-runtime';
import { QueryClient } from '@tanstack/react-query';
import { RenderHookOptions, RenderOptions, render, renderHook } from '@testing-library/react';
export * from '@testing-library/react';
import { ReactNode, ReactElement } from 'react';
import * as vitest from 'vitest';
import * as msw_node from 'msw/node';
import * as msw from 'msw';

declare const workOsOrgIdBrand: unique symbol;
/** A WorkOS organization id (`org_...`) -- the auth identity for API/SSE/query keys. */
type WorkOsOrgId = string & {
    readonly [workOsOrgIdBrand]: true;
};

/**
 * Service context value exposed by ElevasisServiceProvider.
 * Provides a ready-to-use apiRequest function and organization state.
 *
 * For standalone usage (testing, embedding), use ElevasisServiceProvider directly.
 * For standard SDK usage, ElevasisUIProvider composes this automatically when apiUrl is provided.
 */
interface ElevasisServiceContextValue {
    apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
    /**
     * @deprecated Alias of `workOSOrganizationId` retained for existing query-key consumers.
     * Resolves to the WorkOS `org_xxx` id (NOT the Supabase UUID). Prefer `workOSOrganizationId`.
     */
    organizationId: WorkOsOrgId | null;
    /** WorkOS `org_xxx` id for the current organization. */
    workOSOrganizationId: WorkOsOrgId | null;
    isReady: boolean;
}

type ApiRequest = ElevasisServiceContextValue['apiRequest'];
declare function createTestQueryClient(): QueryClient;
interface TestProvidersProps {
    children: ReactNode;
    queryClient?: QueryClient;
    getAccessToken?: () => Promise<string | undefined>;
    organizationId?: string | null;
    isOrganizationReady?: boolean;
    apiRequest?: ApiRequest;
    isServiceReady?: boolean;
}
declare function TestProviders({ children, queryClient, getAccessToken, organizationId, isOrganizationReady, apiRequest, isServiceReady }: TestProvidersProps): react_jsx_runtime.JSX.Element;
interface CustomRenderOptions extends Omit<RenderOptions, 'wrapper'> {
    queryClient?: QueryClient;
    getAccessToken?: () => Promise<string | undefined>;
    organizationId?: string | null;
    isOrganizationReady?: boolean;
    apiRequest?: ApiRequest;
    isServiceReady?: boolean;
}
declare function renderWithProviders(ui: ReactElement, options?: CustomRenderOptions): ReturnType<typeof render>;
interface CustomRenderHookOptions<TProps> extends Omit<RenderHookOptions<TProps>, 'wrapper'> {
    queryClient?: QueryClient;
    getAccessToken?: () => Promise<string | undefined>;
    organizationId?: string | null;
    isOrganizationReady?: boolean;
    apiRequest?: ApiRequest;
    isServiceReady?: boolean;
}
declare function renderHookWithProviders<TResult, TProps>(hook: (props: TProps) => TResult, options?: CustomRenderHookOptions<TProps>): ReturnType<typeof renderHook<TResult, TProps>>;
declare function createTestWrapper(options?: Omit<TestProvidersProps, 'children'>): ({ children }: {
    children: ReactNode;
}) => react_jsx_runtime.JSX.Element;

declare const mockWorkOSUser: {
    id: string;
    email: string;
    firstName: string;
    lastName: string;
    emailVerified: boolean;
    profilePictureUrl: null;
    createdAt: string;
    updatedAt: string;
};
declare const mockUseAuth: {
    user: typeof mockWorkOSUser | null;
    isLoading: boolean;
    signIn: vitest.Mock<(...args: any[]) => any>;
    signOut: vitest.Mock<(...args: any[]) => any>;
    getAccessToken: vitest.Mock<(...args: any[]) => any>;
    organizationId: string;
    canRecover: vitest.Mock<() => boolean>;
};
declare function createMockUseAuth(overrides?: Partial<typeof mockUseAuth>): {
    user: typeof mockWorkOSUser | null;
    isLoading: boolean;
    signIn: vitest.Mock<(...args: any[]) => any>;
    signOut: vitest.Mock<(...args: any[]) => any>;
    getAccessToken: vitest.Mock<(...args: any[]) => any>;
    organizationId: string;
    canRecover: vitest.Mock<() => boolean>;
};
declare const mockAuthenticatedUser: () => {
    user: typeof mockWorkOSUser | null;
    isLoading: boolean;
    signIn: vitest.Mock<(...args: any[]) => any>;
    signOut: vitest.Mock<(...args: any[]) => any>;
    getAccessToken: vitest.Mock<(...args: any[]) => any>;
    organizationId: string;
    canRecover: vitest.Mock<() => boolean>;
};
declare const mockUnauthenticatedUser: () => {
    user: typeof mockWorkOSUser | null;
    isLoading: boolean;
    signIn: vitest.Mock<(...args: any[]) => any>;
    signOut: vitest.Mock<(...args: any[]) => any>;
    getAccessToken: vitest.Mock<(...args: any[]) => any>;
    organizationId: string;
    canRecover: vitest.Mock<() => boolean>;
};
declare const mockAuthLoading: () => {
    user: typeof mockWorkOSUser | null;
    isLoading: boolean;
    signIn: vitest.Mock<(...args: any[]) => any>;
    signOut: vitest.Mock<(...args: any[]) => any>;
    getAccessToken: vitest.Mock<(...args: any[]) => any>;
    organizationId: string;
    canRecover: vitest.Mock<() => boolean>;
};

declare const server: msw_node.SetupServerApi;

declare const handlers: msw.HttpHandler[];

type OrgOsUiRouteContractMode = 'development' | 'production';
interface OrgOsRouteContractSystem {
    id: string;
    lifecycle?: string | null;
    path?: string | null;
    systems?: Record<string, OrgOsRouteContractSystem> | null;
    subsystems?: Record<string, OrgOsRouteContractSystem> | null;
    ui?: {
        path?: string | null;
    } | null;
    enabled?: boolean;
    devOnly?: boolean;
}
type OrgOsRouteContractSystemsDomain = Record<string, OrgOsRouteContractSystem> | {
    systems: readonly OrgOsRouteContractSystem[];
};
interface OrgOsRouteContractOrganizationModel {
    systems: OrgOsRouteContractSystemsDomain;
}
interface OrgOsUiRouteContractTarget {
    name: string;
    routeTreePath: string;
    systemIds: readonly string[];
    orgModelSource: string;
    shellSource: string;
}
interface OrgOsUiRouteContractOptions {
    target: OrgOsUiRouteContractTarget;
    organizationModel: OrgOsRouteContractOrganizationModel;
    routeTreeSource?: string;
    routePaths?: Iterable<string>;
    mode?: OrgOsUiRouteContractMode;
}
type OrgOsUiRouteContractIssueKind = 'missing-system' | 'missing-route';
interface OrgOsUiRouteContractIssue {
    target: OrgOsUiRouteContractTarget;
    kind: OrgOsUiRouteContractIssueKind;
    systemId: string;
    path?: string;
    ownerSystemId?: string;
}
interface OrgOsUiRouteContractResult {
    issues: OrgOsUiRouteContractIssue[];
    checkedPathCount: number;
}
declare function normalizeOrgOsRoutePath(path: string): string;
declare function extractOrgOsRouteTreeFullPaths(routeTreeSource: string): Set<string>;
declare function ownsOrgOsSystem(ownerSystemId: string, systemId: string): boolean;
declare function collectOrgOsUiRouteContractIssues(options: OrgOsUiRouteContractOptions): OrgOsUiRouteContractResult;
declare function formatOrgOsUiRouteContractIssue(issue: OrgOsUiRouteContractIssue): string;
declare function formatOrgOsUiRouteContractFailure(issues: readonly OrgOsUiRouteContractIssue[]): string;
declare function assertOrgOsUiRouteContract(options: OrgOsUiRouteContractOptions): OrgOsUiRouteContractResult;

export { TestProviders, assertOrgOsUiRouteContract, collectOrgOsUiRouteContractIssues, createMockUseAuth, createTestQueryClient, createTestWrapper, extractOrgOsRouteTreeFullPaths, formatOrgOsUiRouteContractFailure, formatOrgOsUiRouteContractIssue, handlers, mockAuthLoading, mockAuthenticatedUser, mockUnauthenticatedUser, mockUseAuth, mockWorkOSUser, normalizeOrgOsRoutePath, ownsOrgOsSystem, renderWithProviders as render, renderHookWithProviders, renderWithProviders, server };
export type { CustomRenderHookOptions, CustomRenderOptions, OrgOsRouteContractOrganizationModel, OrgOsRouteContractSystem, OrgOsUiRouteContractIssue, OrgOsUiRouteContractIssueKind, OrgOsUiRouteContractMode, OrgOsUiRouteContractOptions, OrgOsUiRouteContractResult, OrgOsUiRouteContractTarget, TestProvidersProps };
