import { NapCatConfig, OneBotActionResponse, SendGroupMessagePayload, SendPrivateMessagePayload, OneBotGroupInfo, OneBotFriendInfo, NapCatWebApiResponse, NapCatWebhookEvent } from '../core/index.js';
import { NextRequest, NextResponse } from 'next/server';

declare class NapCatClient {
    private readonly baseUrl;
    private readonly accessToken?;
    private readonly timeoutMs;
    constructor(config: NapCatConfig);
    callApi<TData = unknown>(action: string, params?: Record<string, unknown>): Promise<OneBotActionResponse<TData>>;
    sendGroupMessage(payload: SendGroupMessagePayload): Promise<OneBotActionResponse<{
        message_id: number;
    }>>;
    sendPrivateMessage(payload: SendPrivateMessagePayload): Promise<OneBotActionResponse<{
        message_id: number;
    }>>;
    getGroupList(): Promise<OneBotActionResponse<OneBotGroupInfo[]>>;
    getFriendList(): Promise<OneBotActionResponse<OneBotFriendInfo[]>>;
}

interface HttpLikeRequest {
    method: string;
    path: string;
    body?: unknown;
}
interface HttpLikeResponse {
    status: number;
    headers?: Record<string, string>;
    body: NapCatWebApiResponse<unknown>;
}
interface NapCatWebApiOptions {
    onWebhookEvent?: (event: NapCatWebhookEvent) => Promise<void> | void;
}
declare function createNapCatWebApi(client: NapCatClient, options?: NapCatWebApiOptions): (request: HttpLikeRequest) => Promise<HttpLikeResponse>;

interface NextNapCatRouteConfig {
    client: NapCatClient;
    basePath?: string;
    onWebhookEvent?: (event: Record<string, unknown>) => Promise<void> | void;
}
declare function createNextNapCatRouteHandler(config: NextNapCatRouteConfig): (request: NextRequest) => Promise<NextResponse<NapCatWebApiResponse<unknown>>>;

export { type HttpLikeRequest, type HttpLikeResponse, NapCatClient, type NapCatWebApiOptions, type NextNapCatRouteConfig, createNapCatWebApi, createNextNapCatRouteHandler };
