import { ConsolaInstance } from 'consola';
import { z } from 'zod';
import useSWR from 'swr';

/**
 *
 * Request model (no read-only fields).
 */
interface TokenRefreshRequest$1 {
    refresh: string;
}
/**
 *
 * Response model (includes read-only fields).
 */
interface TokenRefresh$1 {
    access: string;
    refresh: string;
}

/**
 * API endpoints for Auth.
 */
declare class Auth {
    private client;
    constructor(client: any);
    /**
     * Refresh JWT token.
     */
    accountsTokenRefreshCreate(data: TokenRefreshRequest$1): Promise<TokenRefresh$1>;
}

/**
 * OAuth provider to disconnect
 * * `github` - GitHub
 */
declare enum OAuthDisconnectRequestRequestProvider {
    GITHUB = "github"
}
/**
 * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
 * * `email` - Email
 * * `phone` - Phone
 */
declare enum OTPRequestRequestChannel {
    EMAIL = "email",
    PHONE = "phone"
}
/**
 * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
 * * `email` - Email
 * * `phone` - Phone
 */
declare enum OTPVerifyRequestChannel {
    EMAIL = "email",
    PHONE = "phone"
}

/**
 * Request to disconnect OAuth provider.
 *
 * Request model (no read-only fields).
 */
interface OAuthDisconnectRequestRequest$1 {
    /** OAuth provider to disconnect
  
    * `github` - GitHub */
    provider: OAuthDisconnectRequestRequestProvider;
}
/**
 * Request to start OAuth flow.
 *
 * Request model (no read-only fields).
 */
interface OAuthAuthorizeRequestRequest$1 {
    /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
    redirect_uri?: string;
    /** Optional source URL for registration tracking */
    source_url?: string;
}
/**
 * Response with OAuth authorization URL.
 *
 * Response model (includes read-only fields).
 */
interface OAuthAuthorizeResponse$1 {
    /** Full URL to redirect user to OAuth provider */
    authorization_url: string;
    /** State token for CSRF protection. Store this and verify on callback. */
    state: string;
}
/**
 * Request to complete OAuth flow (callback handler).
 *
 * Request model (no read-only fields).
 */
interface OAuthCallbackRequestRequest$1 {
    /** Authorization code from OAuth provider callback */
    code: string;
    /** State token for CSRF verification (from authorize response) */
    state: string;
    /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
    redirect_uri?: string;
}
/**
 * Response with JWT tokens after OAuth authentication. When 2FA is required: -
 * requires_2fa: True - session_id: UUID of 2FA verification session -
 * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
 * session_id: null - access/refresh/user: populated
 *
 * Response model (includes read-only fields).
 */
interface OAuthTokenResponse$1 {
    /** True if 2FA verification is required */
    requires_2fa?: boolean;
    /** 2FA session ID (only when requires_2fa=True) */
    session_id?: string | null;
    /** JWT access token (null when requires_2fa=True) */
    access?: string | null;
    /** JWT refresh token (null when requires_2fa=True) */
    refresh?: string | null;
    /** Authenticated user info (null when requires_2fa=True) */
    user?: Record<string, any> | null;
    /** True if a new user was created during this OAuth flow */
    is_new_user: boolean;
    /** True if a new OAuth connection was created */
    is_new_connection: boolean;
    /** True if user should be prompted to enable 2FA */
    should_prompt_2fa?: boolean;
}
/**
 * Response with available OAuth providers.
 *
 * Response model (includes read-only fields).
 */
interface OAuthProvidersResponse {
    /** List of available OAuth providers */
    providers: Array<Record<string, any>>;
}

/**
 * API endpoints for Oauth.
 */
declare class Oauth {
    private client;
    constructor(client: any);
    /**
     * List OAuth connections
     *
     * Get all OAuth connections for the current user.
     */
    accountsOauthConnectionsList(): Promise<any>;
    /**
     * Disconnect OAuth provider
     *
     * Remove OAuth connection for the specified provider.
     */
    accountsOauthDisconnectCreate(data: OAuthDisconnectRequestRequest$1): Promise<any>;
    /**
     * Start GitHub OAuth
     *
     * Generate GitHub OAuth authorization URL. Redirect user to this URL to
     * start authentication.
     */
    accountsOauthGithubAuthorizeCreate(data: OAuthAuthorizeRequestRequest$1): Promise<OAuthAuthorizeResponse$1>;
    /**
     * Complete GitHub OAuth
     *
     * Exchange authorization code for JWT tokens. Call this after GitHub
     * redirects back with code.
     */
    accountsOauthGithubCallbackCreate(data: OAuthCallbackRequestRequest$1): Promise<OAuthTokenResponse$1>;
    /**
     * List OAuth providers
     *
     * Get list of available OAuth providers for authentication.
     */
    accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse>;
}

/**
 * Serializer for user details.
 *
 * Response model (includes read-only fields).
 */
interface User$2 {
    id: number;
    email: string;
    first_name?: string;
    last_name?: string;
    /** Get user's full name. */
    full_name: string;
    /** Get user's initials for avatar fallback. */
    initials: string;
    /** Get formatted username for display. */
    display_username: string;
    company?: string;
    phone?: string;
    position?: string;
    avatar?: string | null;
    /** Designates whether the user can log into this admin site. */
    is_staff: boolean;
    /** Designates that this user has all permissions without explicitly assigning them. */
    is_superuser: boolean;
    date_joined: string;
    last_login?: string | null;
    unanswered_messages_count: number;
    centrifugo: CentrifugoToken$1 | null;
}
/**
 *
 * Request model (no read-only fields).
 */
interface CfgAccountsProfileAvatarCreateRequest$1 {
    /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
    avatar: File | Blob;
}
/**
 * Serializer for updating user profile.
 *
 * Request model (no read-only fields).
 */
interface UserProfileUpdateRequest$1 {
    first_name?: string;
    last_name?: string;
    company?: string;
    phone?: string;
    position?: string;
}
/**
 * Serializer for updating user profile.
 *
 * Request model (no read-only fields).
 */
interface PatchedUserProfileUpdateRequest$1 {
    first_name?: string;
    last_name?: string;
    company?: string;
    phone?: string;
    position?: string;
}
/**
 * Nested serializer for Centrifugo WebSocket connection token.
 *
 * Response model (includes read-only fields).
 */
interface CentrifugoToken$1 {
    /** JWT token for Centrifugo WebSocket connection */
    token: string;
    /** Centrifugo WebSocket URL */
    centrifugo_url: string;
    /** Token expiration time (ISO 8601) */
    expires_at: string;
    /** List of allowed channels for this user */
    channels: Array<string>;
}

/**
 * API endpoints for User Profile.
 */
declare class UserProfile {
    private client;
    constructor(client: any);
    /**
     * Get current user profile
     *
     * Retrieve the current authenticated user's profile information.
     */
    accountsProfileRetrieve(): Promise<User$2>;
    /**
     * Upload user avatar
     *
     * Upload avatar image for the current authenticated user. Accepts
     * multipart/form-data with 'avatar' field.
     */
    accountsProfileAvatarCreate(data: CfgAccountsProfileAvatarCreateRequest$1): Promise<User$2>;
    /**
     * Partial update user profile
     *
     * Partially update the current authenticated user's profile information.
     * Supports avatar upload.
     */
    accountsProfilePartialUpdate(data: UserProfileUpdateRequest$1): Promise<User$2>;
    /**
     * Partial update user profile
     *
     * Partially update the current authenticated user's profile information.
     * Supports avatar upload.
     */
    accountsProfilePartialPartialUpdate(data?: PatchedUserProfileUpdateRequest$1): Promise<User$2>;
    /**
     * Update user profile
     *
     * Update the current authenticated user's profile information.
     */
    accountsProfileUpdateUpdate(data: UserProfileUpdateRequest$1): Promise<User$2>;
    /**
     * Update user profile
     *
     * Update the current authenticated user's profile information.
     */
    accountsProfileUpdatePartialUpdate(data?: PatchedUserProfileUpdateRequest$1): Promise<User$2>;
}

/**
 * Serializer for OTP request.
 *
 * Request model (no read-only fields).
 */
interface OTPRequestRequest$1 {
    /** Email address or phone number for OTP delivery */
    identifier: string;
    /** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
  
    * `email` - Email
    * `phone` - Phone */
    channel?: OTPRequestRequestChannel;
    /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
    source_url?: string;
}
/**
 * OTP request response.
 *
 * Response model (includes read-only fields).
 */
interface OTPRequestResponse$1 {
    /** Success message */
    message: string;
}
/**
 * Serializer for OTP verification.
 *
 * Request model (no read-only fields).
 */
interface OTPVerifyRequest$1 {
    /** Email address or phone number used for OTP request */
    identifier: string;
    otp: string;
    /** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
  
    * `email` - Email
    * `phone` - Phone */
    channel?: OTPVerifyRequestChannel;
    /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
    source_url?: string;
}
/**
 * OTP verification response. When 2FA is required: - requires_2fa: True -
 * session_id: UUID of 2FA verification session - refresh/access/user: null
 * When 2FA is not required: - requires_2fa: False - session_id: null -
 * refresh/access/user: populated
 *
 * Response model (includes read-only fields).
 */
interface OTPVerifyResponse$1 {
    /** Whether 2FA verification is required */
    requires_2fa?: boolean;
    /** 2FA session ID (if requires_2fa is True) */
    session_id?: string | null;
    /** JWT refresh token (if requires_2fa is False) */
    refresh?: string | null;
    /** JWT access token (if requires_2fa is False) */
    access?: string | null;
    user?: User$1 | null;
    /** Whether user should be prompted to enable 2FA */
    should_prompt_2fa?: boolean;
}
/**
 * Serializer for user details.
 *
 * Response model (includes read-only fields).
 */
interface User$1 {
    id: number;
    email: string;
    first_name?: string;
    last_name?: string;
    /** Get user's full name. */
    full_name: string;
    /** Get user's initials for avatar fallback. */
    initials: string;
    /** Get formatted username for display. */
    display_username: string;
    company?: string;
    phone?: string;
    position?: string;
    avatar?: string | null;
    /** Designates whether the user can log into this admin site. */
    is_staff: boolean;
    /** Designates that this user has all permissions without explicitly assigning them. */
    is_superuser: boolean;
    date_joined: string;
    last_login?: string | null;
    unanswered_messages_count: number;
    centrifugo: CentrifugoToken | null;
}
/**
 * Nested serializer for Centrifugo WebSocket connection token.
 *
 * Response model (includes read-only fields).
 */
interface CentrifugoToken {
    /** JWT token for Centrifugo WebSocket connection */
    token: string;
    /** Centrifugo WebSocket URL */
    centrifugo_url: string;
    /** Token expiration time (ISO 8601) */
    expires_at: string;
    /** List of allowed channels for this user */
    channels: Array<string>;
}

/**
 * API endpoints for Accounts.
 */
declare class Accounts {
    private client;
    constructor(client: any);
    /**
     * Request OTP code to email or phone.
     */
    otpRequestCreate(data: OTPRequestRequest$1): Promise<OTPRequestResponse$1>;
    /**
     * Verify OTP code and return JWT tokens or 2FA session. If user has 2FA
     * enabled: - Returns requires_2fa=True with session_id - Client must
     * complete 2FA verification at /cfg/totp/verify/ If user has no 2FA: -
     * Returns JWT tokens and user data directly
     */
    otpVerifyCreate(data: OTPVerifyRequest$1): Promise<OTPVerifyResponse$1>;
}

/**
 * API Logger with Consola
 * Beautiful console logging for API requests and responses
 *
 * Installation:
 *   npm install consola
 */

/**
 * Logger configuration
 */
interface LoggerConfig {
    /** Enable logging */
    enabled: boolean;
    /** Log requests */
    logRequests: boolean;
    /** Log responses */
    logResponses: boolean;
    /** Log errors */
    logErrors: boolean;
    /** Log request/response bodies */
    logBodies: boolean;
    /** Log headers (excluding sensitive ones) */
    logHeaders: boolean;
    /** Custom consola instance */
    consola?: ConsolaInstance;
}

/**
 * Retry Configuration and Utilities
 *
 * Provides automatic retry logic for failed HTTP requests using p-retry.
 * Retries only on network errors and server errors (5xx), not client errors (4xx).
 */
/**
 * Information about a failed retry attempt.
 */
interface FailedAttemptInfo {
    /** The error that caused the failure */
    error: Error;
    /** The attempt number (1-indexed) */
    attemptNumber: number;
    /** Number of retries left */
    retriesLeft: number;
}
/**
 * Retry configuration options.
 *
 * Uses exponential backoff with jitter by default to avoid thundering herd.
 */
interface RetryConfig {
    /**
     * Maximum number of retry attempts.
     * @default 3
     */
    retries?: number;
    /**
     * Exponential backoff factor.
     * @default 2
     */
    factor?: number;
    /**
     * Minimum wait time between retries (ms).
     * @default 1000
     */
    minTimeout?: number;
    /**
     * Maximum wait time between retries (ms).
     * @default 60000
     */
    maxTimeout?: number;
    /**
     * Add randomness to wait times (jitter).
     * Helps avoid thundering herd problem.
     * @default true
     */
    randomize?: boolean;
    /**
     * Callback called on each failed attempt.
     */
    onFailedAttempt?: (info: FailedAttemptInfo) => void;
}

/**
 * Storage adapters for cross-platform token storage.
 *
 * Supports:
 * - LocalStorage (browser)
 * - Cookies (SSR/browser)
 * - Memory (Node.js/Electron/testing)
 */

/**
 * Storage adapter interface for cross-platform token storage.
 */
interface StorageAdapter {
    getItem(key: string): string | null;
    setItem(key: string, value: string): void;
    removeItem(key: string): void;
}

/**
 * Zod schema for CfgAccountsProfileAvatarCreateRequest
 *
 * This schema provides runtime validation and type inference.
 *  */

declare const CfgAccountsProfileAvatarCreateRequestSchema: z.ZodObject<{
    avatar: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>]>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type CfgAccountsProfileAvatarCreateRequest = z.infer<typeof CfgAccountsProfileAvatarCreateRequestSchema>;

/**
 * Zod schema for OAuthAuthorizeRequestRequest
 *
 * This schema provides runtime validation and type inference.
 *  * Request to start OAuth flow.
 *  */

/**
 * Request to start OAuth flow.
 */
declare const OAuthAuthorizeRequestRequestSchema: z.ZodObject<{
    redirect_uri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
    source_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type OAuthAuthorizeRequestRequest = z.infer<typeof OAuthAuthorizeRequestRequestSchema>;

/**
 * Zod schema for OAuthAuthorizeResponse
 *
 * This schema provides runtime validation and type inference.
 *  * Response with OAuth authorization URL.
 *  */

/**
 * Response with OAuth authorization URL.
 */
declare const OAuthAuthorizeResponseSchema: z.ZodObject<{
    authorization_url: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
    state: z.ZodString;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type OAuthAuthorizeResponse = z.infer<typeof OAuthAuthorizeResponseSchema>;

/**
 * Zod schema for OAuthCallbackRequestRequest
 *
 * This schema provides runtime validation and type inference.
 *  * Request to complete OAuth flow (callback handler).
 *  */

/**
 * Request to complete OAuth flow (callback handler).
 */
declare const OAuthCallbackRequestRequestSchema: z.ZodObject<{
    code: z.ZodString;
    state: z.ZodString;
    redirect_uri: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type OAuthCallbackRequestRequest = z.infer<typeof OAuthCallbackRequestRequestSchema>;

/**
 * Zod schema for OAuthDisconnectRequestRequest
 *
 * This schema provides runtime validation and type inference.
 *  * Request to disconnect OAuth provider.
 *  */

/**
 * Request to disconnect OAuth provider.
 */
declare const OAuthDisconnectRequestRequestSchema: z.ZodObject<{
    provider: z.ZodEnum<typeof OAuthDisconnectRequestRequestProvider>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type OAuthDisconnectRequestRequest = z.infer<typeof OAuthDisconnectRequestRequestSchema>;

/**
 * Zod schema for OAuthTokenResponse
 *
 * This schema provides runtime validation and type inference.
 *  * Response with JWT tokens after OAuth authentication.

When 2FA is required:
- requires_2fa: True
- session_id: UUID of 2FA verification session
- access/refresh/user: null

When 2FA is not required:
- requires_2fa: False
- session_id: null
- access/refresh/user: populated
 *  */

/**
 * Response with JWT tokens after OAuth authentication.

When 2FA is required:
- requires_2fa: True
- session_id: UUID of 2FA verification session
- access/refresh/user: null

When 2FA is not required:
- requires_2fa: False
- session_id: null
- access/refresh/user: populated
 */
declare const OAuthTokenResponseSchema: z.ZodObject<{
    requires_2fa: z.ZodOptional<z.ZodBoolean>;
    session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    access: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    refresh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    user: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
    is_new_user: z.ZodBoolean;
    is_new_connection: z.ZodBoolean;
    should_prompt_2fa: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type OAuthTokenResponse = z.infer<typeof OAuthTokenResponseSchema>;

/**
 * Zod schema for OTPRequestRequest
 *
 * This schema provides runtime validation and type inference.
 *  * Serializer for OTP request.
 *  */

/**
 * Serializer for OTP request.
 */
declare const OTPRequestRequestSchema: z.ZodObject<{
    identifier: z.ZodString;
    channel: z.ZodOptional<z.ZodEnum<typeof OTPRequestRequestChannel>>;
    source_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type OTPRequestRequest = z.infer<typeof OTPRequestRequestSchema>;

/**
 * Zod schema for OTPRequestResponse
 *
 * This schema provides runtime validation and type inference.
 *  * OTP request response.
 *  */

/**
 * OTP request response.
 */
declare const OTPRequestResponseSchema: z.ZodObject<{
    message: z.ZodString;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>;

/**
 * Zod schema for OTPVerifyRequest
 *
 * This schema provides runtime validation and type inference.
 *  * Serializer for OTP verification.
 *  */

/**
 * Serializer for OTP verification.
 */
declare const OTPVerifyRequestSchema: z.ZodObject<{
    identifier: z.ZodString;
    otp: z.ZodString;
    channel: z.ZodOptional<z.ZodEnum<typeof OTPVerifyRequestChannel>>;
    source_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type OTPVerifyRequest = z.infer<typeof OTPVerifyRequestSchema>;

/**
 * Zod schema for OTPVerifyResponse
 *
 * This schema provides runtime validation and type inference.
 *  * OTP verification response.

When 2FA is required:
- requires_2fa: True
- session_id: UUID of 2FA verification session
- refresh/access/user: null

When 2FA is not required:
- requires_2fa: False
- session_id: null
- refresh/access/user: populated
 *  */

/**
 * OTP verification response.

When 2FA is required:
- requires_2fa: True
- session_id: UUID of 2FA verification session
- refresh/access/user: null

When 2FA is not required:
- requires_2fa: False
- session_id: null
- refresh/access/user: populated
 */
declare const OTPVerifyResponseSchema: z.ZodObject<{
    requires_2fa: z.ZodOptional<z.ZodBoolean>;
    session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    refresh: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    access: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    user: z.ZodOptional<z.ZodNullable<z.ZodObject<{
        id: z.ZodInt;
        email: z.ZodEmail;
        first_name: z.ZodOptional<z.ZodString>;
        last_name: z.ZodOptional<z.ZodString>;
        full_name: z.ZodString;
        initials: z.ZodString;
        display_username: z.ZodString;
        company: z.ZodOptional<z.ZodString>;
        phone: z.ZodOptional<z.ZodString>;
        position: z.ZodOptional<z.ZodString>;
        avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
        is_staff: z.ZodBoolean;
        is_superuser: z.ZodBoolean;
        date_joined: z.ZodISODateTime;
        last_login: z.ZodNullable<z.ZodISODateTime>;
        unanswered_messages_count: z.ZodInt;
        centrifugo: z.ZodNullable<z.ZodObject<{
            token: z.ZodString;
            centrifugo_url: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
            expires_at: z.ZodISODateTime;
            channels: z.ZodArray<z.ZodString>;
        }, z.core.$strip>>;
    }, z.core.$strip>>>;
    should_prompt_2fa: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type OTPVerifyResponse = z.infer<typeof OTPVerifyResponseSchema>;

/**
 * Zod schema for PatchedUserProfileUpdateRequest
 *
 * This schema provides runtime validation and type inference.
 *  * Serializer for updating user profile.
 *  */

/**
 * Serializer for updating user profile.
 */
declare const PatchedUserProfileUpdateRequestSchema: z.ZodObject<{
    first_name: z.ZodOptional<z.ZodString>;
    last_name: z.ZodOptional<z.ZodString>;
    company: z.ZodOptional<z.ZodString>;
    phone: z.ZodOptional<z.ZodString>;
    position: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type PatchedUserProfileUpdateRequest = z.infer<typeof PatchedUserProfileUpdateRequestSchema>;

/**
 * Zod schema for TokenRefresh
 *
 * This schema provides runtime validation and type inference.
 *  */

declare const TokenRefreshSchema: z.ZodObject<{
    access: z.ZodString;
    refresh: z.ZodString;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type TokenRefresh = z.infer<typeof TokenRefreshSchema>;

/**
 * Zod schema for TokenRefreshRequest
 *
 * This schema provides runtime validation and type inference.
 *  */

declare const TokenRefreshRequestSchema: z.ZodObject<{
    refresh: z.ZodString;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type TokenRefreshRequest = z.infer<typeof TokenRefreshRequestSchema>;

/**
 * Zod schema for User
 *
 * This schema provides runtime validation and type inference.
 *  * Serializer for user details.
 *  */

/**
 * Serializer for user details.
 */
declare const UserSchema: z.ZodObject<{
    id: z.ZodInt;
    email: z.ZodEmail;
    first_name: z.ZodOptional<z.ZodString>;
    last_name: z.ZodOptional<z.ZodString>;
    full_name: z.ZodString;
    initials: z.ZodString;
    display_username: z.ZodString;
    company: z.ZodOptional<z.ZodString>;
    phone: z.ZodOptional<z.ZodString>;
    position: z.ZodOptional<z.ZodString>;
    avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
    is_staff: z.ZodBoolean;
    is_superuser: z.ZodBoolean;
    date_joined: z.ZodISODateTime;
    last_login: z.ZodNullable<z.ZodISODateTime>;
    unanswered_messages_count: z.ZodInt;
    centrifugo: z.ZodNullable<z.ZodObject<{
        token: z.ZodString;
        centrifugo_url: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
        expires_at: z.ZodISODateTime;
        channels: z.ZodArray<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type User = z.infer<typeof UserSchema>;

/**
 * Zod schema for UserProfileUpdateRequest
 *
 * This schema provides runtime validation and type inference.
 *  * Serializer for updating user profile.
 *  */

/**
 * Serializer for updating user profile.
 */
declare const UserProfileUpdateRequestSchema: z.ZodObject<{
    first_name: z.ZodOptional<z.ZodString>;
    last_name: z.ZodOptional<z.ZodString>;
    company: z.ZodOptional<z.ZodString>;
    phone: z.ZodOptional<z.ZodString>;
    position: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
/**
 * Infer TypeScript type from Zod schema
 */
type UserProfileUpdateRequest = z.infer<typeof UserProfileUpdateRequestSchema>;

/**
 * Django CFG API - API Client with JWT Management
 *
 * Usage:
 * ```typescript
 * import { API } from './api';
 *
 * const api = new API('https://api.example.com');
 *
 * // Set JWT token
 * api.setToken('your-jwt-token', 'refresh-token');
 *
 * // Use API
 * const posts = await api.posts.list();
 * const user = await api.users.retrieve(1);
 *
 * // Check authentication
 * if (api.isAuthenticated()) {
 *   // ...
 * }
 *
 * // Custom storage with logging (for Electron/Node.js)
 * import { MemoryStorageAdapter, APILogger } from './storage';
 * const logger = new APILogger({ enabled: true, logLevel: 'debug' });
 * const api = new API('https://api.example.com', {
 *   storage: new MemoryStorageAdapter(logger),
 *   loggerConfig: { enabled: true, logLevel: 'debug' }
 * });
 *
 * // Get OpenAPI schema
 * const schema = api.getSchema();
 * ```
 */

interface APIOptions {
    /** Custom storage adapter (defaults to LocalStorageAdapter) */
    storage?: StorageAdapter;
    /** Retry configuration for failed requests */
    retryConfig?: RetryConfig;
    /** Logger configuration */
    loggerConfig?: Partial<LoggerConfig>;
}
declare class API {
    private baseUrl;
    private _client;
    private _token;
    private _refreshToken;
    private storage;
    private options?;
    auth: Auth;
    oauth: Oauth;
    user_profile: UserProfile;
    accounts: Accounts;
    constructor(baseUrl: string, options?: APIOptions);
    private _loadTokensFromStorage;
    private _reinitClients;
    private _injectAuthHeader;
    /**
     * Get current JWT token
     */
    getToken(): string | null;
    /**
     * Get current refresh token
     */
    getRefreshToken(): string | null;
    /**
     * Set JWT token and refresh token
     * @param token - JWT access token
     * @param refreshToken - JWT refresh token (optional)
     */
    setToken(token: string, refreshToken?: string): void;
    /**
     * Clear all tokens
     */
    clearTokens(): void;
    /**
     * Check if user is authenticated
     */
    isAuthenticated(): boolean;
    /**
     * Update base URL and reinitialize clients
     * @param url - New base URL
     */
    setBaseUrl(url: string): void;
    /**
     * Get current base URL
     */
    getBaseUrl(): string;
    /**
     * Get OpenAPI schema path
     * @returns Path to the OpenAPI schema JSON file
     *
     * Note: The OpenAPI schema is available in the schema.json file.
     * You can load it dynamically using:
     * ```typescript
     * const schema = await fetch('./schema.json').then(r => r.json());
     * // or using fs in Node.js:
     * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
     * ```
     */
    getSchemaPath(): string;
}

/**
 * API operation
 *
 * @method POST
 * @path /cfg/accounts/token/refresh/
 */
declare function useCreateAccountsTokenRefreshCreate(): (data: TokenRefreshRequest, client?: API) => Promise<TokenRefresh>;

/**
 * SWR Hooks for Oauth
 *
 * React hooks powered by SWR for data fetching with automatic caching,
 * revalidation, and optimistic updates.
 *
 * Usage:
 * ```typescript
 * // Query hooks (GET)
 * const { data, error, isLoading } = useUsers({ page: 1 })
 *
 * // Mutation hooks (POST/PUT/PATCH/DELETE)
 * const createUser = useCreateUser()
 * await createUser({ name: 'John', email: 'john@example.com' })
 * ```
 */

/**
 * List OAuth connections
 *
 * @method GET
 * @path /cfg/accounts/oauth/connections/
 */
declare function useAccountsOauthConnectionsList(client?: API): ReturnType<typeof useSWR<any>>;
/**
 * Disconnect OAuth provider
 *
 * @method POST
 * @path /cfg/accounts/oauth/disconnect/
 */
declare function useCreateAccountsOauthDisconnectCreate(): (data: OAuthDisconnectRequestRequest, client?: API) => Promise<any>;
/**
 * Start GitHub OAuth
 *
 * @method POST
 * @path /cfg/accounts/oauth/github/authorize/
 */
declare function useCreateAccountsOauthGithubAuthorizeCreate(): (data: OAuthAuthorizeRequestRequest, client?: API) => Promise<OAuthAuthorizeResponse>;
/**
 * Complete GitHub OAuth
 *
 * @method POST
 * @path /cfg/accounts/oauth/github/callback/
 */
declare function useCreateAccountsOauthGithubCallbackCreate(): (data: OAuthCallbackRequestRequest, client?: API) => Promise<OAuthTokenResponse>;
/**
 * List OAuth providers
 *
 * @method GET
 * @path /cfg/accounts/oauth/providers/
 */
declare function useAccountsOauthProvidersRetrieve(client?: API): ReturnType<typeof useSWR<OAuthProvidersResponse>>;

/**
 * SWR Hooks for User Profile
 *
 * React hooks powered by SWR for data fetching with automatic caching,
 * revalidation, and optimistic updates.
 *
 * Usage:
 * ```typescript
 * // Query hooks (GET)
 * const { data, error, isLoading } = useUsers({ page: 1 })
 *
 * // Mutation hooks (POST/PUT/PATCH/DELETE)
 * const createUser = useCreateUser()
 * await createUser({ name: 'John', email: 'john@example.com' })
 * ```
 */

/**
 * Get current user profile
 *
 * @method GET
 * @path /cfg/accounts/profile/
 */
declare function useAccountsProfileRetrieve(client?: API): ReturnType<typeof useSWR<User>>;
/**
 * Upload user avatar
 *
 * @method POST
 * @path /cfg/accounts/profile/avatar/
 */
declare function useCreateAccountsProfileAvatarCreate(): (data: CfgAccountsProfileAvatarCreateRequest, client?: API) => Promise<User>;
/**
 * Partial update user profile
 *
 * @method PUT
 * @path /cfg/accounts/profile/partial/
 */
declare function usePartialUpdateAccountsProfilePartialUpdate(): (data: UserProfileUpdateRequest, client?: API) => Promise<User>;
/**
 * Partial update user profile
 *
 * @method PATCH
 * @path /cfg/accounts/profile/partial/
 */
declare function usePartialUpdateAccountsProfilePartialPartialUpdate(): (data?: PatchedUserProfileUpdateRequest, client?: API) => Promise<User>;
/**
 * Update user profile
 *
 * @method PUT
 * @path /cfg/accounts/profile/update/
 */
declare function useUpdateAccountsProfileUpdateUpdate(): (data: UserProfileUpdateRequest, client?: API) => Promise<User>;
/**
 * Update user profile
 *
 * @method PATCH
 * @path /cfg/accounts/profile/update/
 */
declare function usePartialUpdateAccountsProfileUpdatePartialUpdate(): (data?: PatchedUserProfileUpdateRequest, client?: API) => Promise<User>;

/**
 * API operation
 *
 * @method POST
 * @path /cfg/accounts/otp/request/
 */
declare function useCreateAccountsOtpRequestCreate(): (data: OTPRequestRequest, client?: API) => Promise<OTPRequestResponse>;
/**
 * API operation
 *
 * @method POST
 * @path /cfg/accounts/otp/verify/
 */
declare function useCreateAccountsOtpVerifyCreate(): (data: OTPVerifyRequest, client?: API) => Promise<OTPVerifyResponse>;

export { useAccountsOauthConnectionsList, useAccountsOauthProvidersRetrieve, useAccountsProfileRetrieve, useCreateAccountsOauthDisconnectCreate, useCreateAccountsOauthGithubAuthorizeCreate, useCreateAccountsOauthGithubCallbackCreate, useCreateAccountsOtpRequestCreate, useCreateAccountsOtpVerifyCreate, useCreateAccountsProfileAvatarCreate, useCreateAccountsTokenRefreshCreate, usePartialUpdateAccountsProfilePartialPartialUpdate, usePartialUpdateAccountsProfilePartialUpdate, usePartialUpdateAccountsProfileUpdatePartialUpdate, useUpdateAccountsProfileUpdateUpdate };
