import * as swr from 'swr';
import { SWRConfiguration } from 'swr';
import * as swr__internal from 'swr/_internal';
import { z } from 'zod';

interface ApiKeyTestResult {
    valid: boolean;
    userId: string | null;
}
interface UseApiKeyReturn {
    /**
     * The key to display. Masked by default (from retrieve). Becomes the FULL
     * value after `reveal()` or `regenerate()` resolves, so the user can copy it.
     */
    apiKey: string | null;
    /** True once `reveal()`/`regenerate()` has surfaced the full (unmasked) key. */
    isRevealed: boolean;
    reissuedAt: string | null;
    createdAt: string | null;
    isLoading: boolean;
    isRevealing: boolean;
    isRegenerating: boolean;
    isTesting: boolean;
    /**
     * Fetch the current full key WITHOUT rotating it (the durable value every one
     * of the user's agents uses). Use this to let the user copy their key for
     * agent onboarding — `regenerate()` would invalidate the agents already using it.
     */
    reveal: () => Promise<void>;
    regenerate: () => Promise<void>;
    testKey: (key: string) => Promise<ApiKeyTestResult>;
    refresh: () => void;
}
declare function useApiKey(): UseApiKeyReturn;

/**
 * Marketing-consent UI policy derived from the request's geo context.
 */
type ConsentPolicy$1 = {
    /**
     * Country code seen by the edge (CF-IPCountry), '' if unknown
     */
    country: string;
    /**
     * Default state for the marketing-consent checkbox
     *
     * * `checked` - checked
     * * `unchecked` - unchecked
     */
    marketing_consent_default: MarketingConsentDefaultEnum;
};
/**
 * * `checked` - checked
 * * `unchecked` - unchecked
 */
declare enum MarketingConsentDefaultEnum {
    CHECKED = "checked",
    UNCHECKED = "unchecked"
}
type CfgAccountsOtpConsentPolicyRetrieveData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/cfg/accounts/otp/consent-policy/';
};
type CfgAccountsOtpConsentPolicyRetrieveResponses = {
    200: ConsentPolicy$1;
};

type Result = CfgAccountsOtpConsentPolicyRetrieveResponses[keyof CfgAccountsOtpConsentPolicyRetrieveResponses];
/**
 * Optional `enabled` flag — when `false`, the SWR key becomes `null` and
 * no request is made. Use for gated endpoints (auth-required, feature
 * flags, "fetch only when X is selected"). The flag is stripped before
 * being forwarded to `useSWR` so the underlying SWR config stays pristine.
 */
type HookConfig = SWRConfiguration<Result> & {
    enabled?: boolean;
};
declare function useCfgAccountsOtpConsentPolicyRetrieve(args?: Omit<CfgAccountsOtpConsentPolicyRetrieveData, "url" | "body">, config?: HookConfig): swr.SWRResponse<ConsentPolicy$1, any, SWRConfiguration<ConsentPolicy$1, any, ((arg: readonly [any, ...unknown[]]) => swr__internal.FetcherResponse<ConsentPolicy$1>) | ((arg: readonly [any, ...unknown[]]) => swr__internal.FetcherResponse<ConsentPolicy$1>)>>;

declare const ConsentPolicySchema: z.ZodObject<{
    country: z.ZodString;
    marketing_consent_default: z.ZodEnum<{
        checked: "checked";
        unchecked: "unchecked";
    }>;
}, z.core.$strip>;
type ConsentPolicy = z.infer<typeof ConsentPolicySchema>;

export { type ConsentPolicy, type UseApiKeyReturn, useApiKey, useCfgAccountsOtpConsentPolicyRetrieve };
