import type { AuthMe, AuthPerms, TokenPair } from '../../../typings/admin/base/auth';
import type { RequestOptions } from '../../../typings/admin/comm/request';
export type { AuthMe, AuthPerms, TokenPair } from '../../../typings/admin/base/auth';
export type { MenuTreeNode } from '../../../typings/admin/base/permission';
export type { ApiResult, RequestOptions } from '../../../typings/admin/comm/request';
/** 拼接配置中的 baseUrl（dev 为 /dev） */
export declare function apiUrl(path: string): string;
export declare function getAccessToken(): string;
export declare function setTokens(accessToken: string, refreshToken: string): void;
export declare function clearTokens(): void;
export declare function getRefreshToken(): string;
/** 把 Zod / 长 JSON 错误收成可读短句 */
export declare function formatApiMessage(message: string): string;
/** 通用请求：业务码 1000 成功；鉴权失败尝试 refresh；AI call 流式返回 SSE */
export declare function request<T>(path: string, init?: RequestOptions): Promise<T>;
export type AiClientStreamChunk = {
    type: 'delta' | 'done' | 'error';
    text?: string;
    data?: Record<string, unknown>;
    usage?: Record<string, unknown>;
    error?: {
        code: string;
        message: string;
    };
};
export type AiClientStreamResult = {
    kind: 'stream';
    mode: 'stream';
    stream: AsyncGenerator<AiClientStreamChunk>;
};
export declare function isAiStreamResult(v: unknown): v is AiClientStreamResult;
export declare const api: {
    login(body: {
        username: string;
        password: string;
        captchaId: string;
        verifyCode: string;
    }): Promise<TokenPair>;
    captcha(params?: {
        width?: number;
        height?: number;
        color?: string;
    }): Promise<{
        captchaId: string;
        data: string;
    }>;
    me(init?: RequestOptions): Promise<AuthMe>;
    perms(init?: RequestOptions): Promise<AuthPerms>;
    logout(): Promise<any>;
};
