import EventEmitter from 'events';
import * as chalk from 'chalk';
export { basePath, commentPath, configPath, consolePath, dataPath, dbPath, defaultConfigPath, defaultViewPath, htmlPath, isPackaged, isPkg, karinDir, karinMain, karinPathBase, karinPathComment, karinPathConfig, karinPathConsole, karinPathData, karinPathDb, karinPathDefaultConfig, karinPathDefaultView, karinPathHtml, karinPathKv, karinPathLogs, karinPathMain, karinPathPlugins, karinPathPm2Config, karinPathRedisSqlite3, karinPathResource, karinPathRoot, karinPathSandboxData, karinPathSandboxTemp, karinPathTaskDb, karinPathTemp, kvPath, logsPath, pluginDir, pm2Path, redisSqlite3Path, resourcePath, sandboxDataPath, sandboxTempPath, tempPath } from './root.js';
import { a as LoggerLevel, b as LogMethodNames, L as Logger } from './types-hAhbXJDZ.js';
export { D as DEFAULT_LOGGER_CONFIG, F as FileLogConfig, c as LogMethodsOnly, d as LoggerConfig } from './types-hAhbXJDZ.js';
import { Database } from 'sqlite3';
import { Job } from 'node-schedule';
import fs$1, { WriteStream } from 'node:fs';
import { Readable } from 'node:stream';
import { AxiosRequestConfig, AxiosResponse } from 'axios';
import * as _yaml from 'yaml';
import { Document, parse, stringify, parseDocument, YAMLSeq, YAMLMap } from 'yaml';
import { FSWatcher } from 'chokidar';
import { ExecException as ExecException$1, exec as exec$2 } from 'node:child_process';
import { Request as Request$1, Router, Response, RequestHandler, Express } from 'express';
import { exec as exec$1, ExecException } from 'child_process';
export { ExecException } from 'child_process';
import { RedisClientOptions, RedisClientType } from 'redis';
import * as http from 'http';
import { EventEmitter as EventEmitter$1 } from 'node:events';
import { IncomingHttpHeaders, IncomingMessage } from 'node:http';
import { WebSocket } from 'ws';
import 'log4js';

declare const debug: {
    chalk: chalk.ChalkInstance;
    setColor: (fnc: (text: string) => string) => void;
    enable: (bool: boolean) => void;
} & ((...args: any[]) => void);

/**
 * 事件来源
 * - group: 群聊
 * - friend: 好友聊天
 * - guild: 频道
 * - direct: 频道私信
 * - groupTemp: 临时群会话
 */
type Scene = 'group' | 'friend' | 'guild' | 'direct' | 'groupTemp';
/**
 * 事件来源类型基类
 */
interface BaseContact {
    /** 事件来源 */
    scene: Scene;
    /** 事件来源id */
    peer: string;
    /** 事件来源子id 仅在频道、频道私信和临时会话中存在 */
    subPeer?: string;
    /** 来源场景的昵称 */
    name: string;
    /** 来源场景的子昵称 */
    subName?: string;
}
/**
 * 群聊来源信息类型
 */
interface GroupContact extends BaseContact {
    scene: 'group';
    /** 群ID */
    peer: string;
    /** 群名 */
    name: string;
}
/**
 * 好友来源信息类型
 */
interface FriendContact extends BaseContact {
    scene: 'friend';
    /** 好友ID */
    peer: string;
    /** 好友昵称 */
    name: string;
}
/**
 * 频道私信来源信息类型
 */
interface DirectContact extends BaseContact {
    scene: 'direct';
    /** 频道ID 虚拟ID 用于请求Api使用 */
    peer: string;
    /** 频道名称 */
    name: string;
    /** 子频道ID 虚拟ID */
    subPeer: string;
    /** 子频道名称 */
    subName?: string;
}
/**
 * 频道来源信息类型
 */
interface GuildContact extends BaseContact {
    scene: 'guild';
    /** 频道ID */
    peer: string;
    /** 频道名称 */
    name: string;
    /** 子频道ID */
    subPeer: string;
    /** 子频道名称 */
    subName: string;
}
/**
 * 群临时会话来源信息类型
 */
interface GroupTempContact extends BaseContact {
    scene: 'groupTemp';
    /** 群ID */
    peer: string;
    /** 发起临时会话用户ID */
    subPeer: string;
    /** 群名 */
    name: string;
}
/**
 * 事件来源信息
 * - `group`: 群聊
 * - `friend`: 好友
 * - `guild`: 频道
 * - `direct`: 频道私信
 * - `groupTemp`: 临时群会话
 */
type Contact<T extends Scene = Scene> = T extends 'group' ? GroupContact : T extends 'friend' ? FriendContact : T extends 'guild' ? GuildContact : T extends 'direct' ? DirectContact : T extends 'groupTemp' ? GroupTempContact : never;

/**
 * 事件发送者性别
 * - `male` 男
 * - `female` 女
 * - `unknown` 未知
 */
type Sex$1 = 'male' | 'female' | 'unknown';
/**
 * 事件发送者身份 仅在群聊、频道中存在
 * - `owner` 群主、频道主
 * - `admin` 管理员、超管
 * - `member` 群成员、频道成员
 * - `unknown` 未知身份
 */
type Role = 'owner' | 'admin' | 'member' | 'unknown';
/**
 * 事件发送者信息父类
 */
interface SenderBase {
    /** 发送者ID */
    userId: string;
    /** 发送者昵称 与`name`一致 */
    nick: string;
    /** 发送者昵称 与`nick`一致 */
    name: string;
    /** 发送者性别 */
    sex?: Sex$1;
    /** 发送者年龄 */
    age?: number;
    /** 发送者uid QQ场景专属 */
    uid?: string;
    /** 发送者uin QQ场景专属 */
    uin?: number;
}
/**
 * - 好友事件发送者信息
 * - tips: 如果名称不存在则是空字符串
 */
type FriendSender = SenderBase;
/**
 * - 群聊事件发送者信息
 * - tips: 如果名称不存在则是空字符串
 */
interface GroupSender extends SenderBase {
    /** 群成员身份 */
    role: Role;
    /** 群名片/备注 */
    card?: string;
    /** 地区 */
    area?: string;
    /** 成员等级 */
    level?: number;
    /** 专属头衔 */
    title?: string;
}
/**
 * - 群聊临时会话事件发送者信息
 * - tips: 如果名称不存在则是空字符串
 */
type GroupTempSender = SenderBase;
/**
 * - 频道事件发送者信息
 * - tips: 如果名称不存在则是空字符串
 */
interface GuildSender extends SenderBase {
    /** 频道成员身份 */
    role: Role;
}
/**
 * - 频道私信事件发送者信息
 * - tips: 如果名称不存在则是空字符串
 */
type DirectSender = SenderBase;
/**
 * 事件发送者信息
 * - `friend`: 好友
 * - `group`: 群聊
 * - `guild`: 频道
 * - `direct`: 频道私信
 * - `groupTemp`: 临时群会话
 * - `notice`: 通知
 * - `request`: 请求
 */
type Sender<T extends Scene = Scene> = T extends 'friend' ? FriendSender : T extends 'group' ? GroupSender : T extends 'guild' ? GuildSender : T extends 'direct' ? DirectSender : T extends 'groupTemp' ? GroupTempSender : never;
/** 构建群聊场景的`sender`函数重载类型 */
interface SenderGroup$1 {
    /**
     * 构建群聊场景的`sender`
     * @param userId 用户ID
     * @param role 群成员身份
     * @param name 用户名
     * @param sex 性别
     * @param age 年龄
     * @param card 群名片/备注
     * @param area 地区
     * @param level 成员等级
     * @param title 专属头衔
     * @param uid QQ场景专属
     * @param uin QQ场景专属
     */
    (userId: Sender<'group'>['userId'], role?: Sender<'group'>['role'], name?: Sender<'group'>['name'], sex?: Sender<'friend'>['sex'], age?: Sender<'friend'>['age'], card?: Sender<'group'>['card'], area?: Sender<'group'>['area'], level?: Sender<'group'>['level'], title?: Sender<'group'>['title'], uid?: Sender<'friend'>['uid'], uin?: Sender<'friend'>['uin']): Sender<'group'>;
    (options: Sender<'group'>): Sender<'group'>;
}

/**
 * 适配器所属平台
 * - `qq`: QQ
 * - `wechat`: 微信
 * - `wecom`: 企业微信
 * - `telegram`: Telegram
 * - `discord`: Discord
 * - `koko`: 开黑吧
 * - `dingtalk`: 钉钉
 * - `feishu`: 飞书
 * - `slack`: Slack
 * - `whatsapp`: WhatsApp
 * - `other`: 其他
 */
type AdapterPlatform = 'qq' | 'wechat' | 'telegram' | 'discord' | 'koko' | 'dingtalk' | 'feishu' | 'slack' | 'wecom' | 'whatsapp' | 'other' | (string & {});
/**
 * 适配器所使用的标准接口协议
 * - `onebot11`: OneBot v11 标准
 * - `onebot12`: OneBot v12 标准
 * - `oicq`: OICQ 标准
 * - `icqq`: OICQ fork 标准
 * - `milky`: Milky 标准
 * - `satori`: Satori 标准
 * - `other`: 其他标准
 */
type AdapterStandard = 'onebot11' | 'onebot12' | 'oicq' | 'icqq' | 'milky' | 'satori' | 'other' | (string & {});
/**
 * 适配器协议实现名称
 * - `console`: 控制台
 * - `qqbot`: https://bot.q.qq.com/wiki
 * - `icqq`: https://github.com/icqqjs/icqq
 * - `gocq-http`: https://docs.go-cqhttp.org/
 * - `napcat`: https://napneko.github.io/zh-CN/
 * - `oicq`: https://github.com/takayama-lily/oicq
 * - `llonebot`: https://llonebot.github.io/zh-CN/
 * - `conwechat`: https://justundertaker.github.io/ComWeChatBotClient/
 * - `lagrange`: https://lagrangedev.github.io/Lagrange.Doc/Lagrange.OneBot/
 * - `yogurt`: https://acidify.ntqqrev.org/
 */
type AdapterProtocol = 'qqbot' | 'icqq' | 'gocq-http' | 'napcat' | 'oicq' | 'llonebot' | 'conwechat' | 'lagrange' | 'console' | 'yogurt' | 'other' | (string & {});
/**
 * 适配器通信方式
 * - `http`: HTTP 通信
 * - `webSocketServer`: WebSocket 服务端
 * - `webSocketClient`: WebSocket 客户端
 * - `grpc`: gRPC 通信
 * - `sse`: Server-Sent Events 通信
 * - `other`: 其他通信方式
 */
type AdapterCommunication = 'http' | 'webSocketServer' | 'webSocketClient' | 'grpc' | 'sse' | 'other' | (string & {});
/**
 * 适配器基本信息
 */
interface AdapterInfo {
    /** 适配器索引 默认为-1 在注册适配器时会自动更改为对应的索引 */
    index: number;
    /** 适配器名称 如lagrange-onebot */
    name: string;
    /** 适配器版本 */
    version: string;
    /** 适配器平台 */
    platform: AdapterPlatform;
    /** 适配器使用的协议标准 如onebot11 */
    standard: AdapterStandard;
    /** 适配器协议实现 如gocq、napcat */
    protocol: AdapterProtocol;
    /** 适配器通信方式 */
    communication: AdapterCommunication;
    /**
     * 适配器通信地址
     * @example `http://127.0.0.1:7000`
     * @example `ws://127.0.0.1:7000/ws`
     * @example `grpc://127.0.0.1:7001`
     * @example `internal://127.0.0.1`
     */
    address: string;
    /** 连接时间 */
    connectTime: number;
    /** 鉴权秘钥 */
    secret: string | null;
}

/**
 * 适配器账号信息
 */
interface AccountInfo {
    /** Bot的uin */
    uin: string;
    /** Bot的uid */
    uid: string;
    /** Bot的selfId 一般使用此参数即可 */
    selfId: string;
    /** 账号名 不存在则是空字符串 */
    name: string;
    /** Bot的头像链接 */
    avatar: string;
    /**
     * - Bot的子账号键值对
     * - 结构约定: key=场景 value=id
     * - 此部分由适配器自行实现
     * @example
     * ```json
     * {
     *   "group": "123456",
     *   "guild": "123456",
     *   "friend": "123456",
     *   "direct": "123456"
     * }
     * ```
     */
    subId: Record<string, string>;
}

/** 按钮结构 */
interface KarinButton {
    /** 按钮显示文本 */
    text: string;
    /** 按钮类型 不建议使用 此为预留字段 */
    type?: number;
    /**
     * - 是否为回调按钮
     * @default false
     */
    callback?: boolean;
    /** 跳转按钮 */
    link?: string;
    /** 操作相关的数据 */
    data?: string;
    /** 按钮点击后显示的文字，不传为text */
    show?: string;
    /**
     * 按钮样式
     * - 0-灰色线框
     * - 1-蓝色线框
     * - 2-特殊样式按钮
     * - 3-红色文字
     * - 4-白色填充
     */
    style?: number;
    /** 点击按钮后直接自动发送 data */
    enter?: boolean;
    /** 指令是否带引用回复本消息 */
    reply?: boolean;
    /** 是否仅群管理员可操作 */
    admin?: boolean;
    /** 有权限点击的用户UID列表 群聊、私聊 */
    list?: string[];
    /** 有权限点击的用户UID列表 频道 */
    role?: string[];
    /** 客户端不支持本 action 的时候，弹出的 toast 文案 */
    tips?: string;
}
/** QQ官方按钮消息结构 */
interface QQBotButton {
    /** 按钮ID：在一个keyboard消息内设置唯一 */
    id: string;
    /** 按钮上的文字 */
    render_data: {
        /** 按钮上的文字 */
        label: string;
        /** 点击后按钮的上文字 */
        visited_label: string;
        /**
         * 按钮样式
         * - 0-灰色线框
         * - 1-蓝色线框
         * - 2-特殊样式按钮
         * - 3-红色文字
         * - 4-白色填充
         */
        style: number;
    };
    /** 操作相关的数据 */
    action: {
        /** 设置 0 跳转按钮：http 或 小程序 客户端识别 scheme，设置 1 回调按钮：回调后台接口, data 传给后台，设置 2 指令按钮：自动在输入框插入 @bot data */
        type: 0 | 1 | 2;
        /** 权限设置 */
        permission: {
            /** 0 指定用户可操作，1 仅管理者可操作，2 所有人可操作，3 指定身份组可操作（仅频道可用） */
            type: number;
            /** 有权限的用户 id 的列表 */
            specify_user_ids?: string[];
            /** 有权限的身份组 id 的列表（仅频道可用） */
            specify_role_ids?: string[];
        };
        /** 操作相关的数据 */
        data: string;
        /** 指令按钮可用，指令是否带引用回复本消息，默认 false */
        reply?: boolean;
        /** 指令按钮可用，点击按钮后直接自动发送 data，默认 false */
        enter?: boolean;
        /** 本字段仅在指令按钮下有效，设置后后会忽略 action.enter 配置。
        设置为 1 时 ，点击按钮自动唤起启手Q选图器，其他值暂无效果。
        （仅支持手机端版本 8983+ 的单聊场景，桌面端不支持） */
        anchor?: number;
        /** 【已弃用】可操作点击的次数，默认不限 */
        click_limit?: number;
        /** 【已弃用】指令按钮可用，弹出子频道选择器，默认 false */
        at_bot_show_channel_list?: boolean;
        /** 客户端不支持本action的时候，弹出的toast文案 */
        unsupport_tips: string;
    };
}
/** QQ按钮消息结构 */
interface QQButtonTextType {
    link?: string;
    text: string;
    show: string;
    style: number;
    tips: string;
    admin?: boolean;
    list?: string[];
    role?: string[];
    enter?: boolean;
    reply?: boolean;
    callback?: boolean;
}

/**
 * @description 消息段类型
 * - `text`: 文本
 * - `image`: 图片
 * - `at`: @
 * - `face`: 表情
 * - `reply`: 引用回复
 * - `video`: 视频
 * - `record`: 语音
 * - `music`: 音乐
 * - `json`: JSON
 * - `xml`: XML
 * - `markdown`: Markdown
 * - `markdownTpl`: Markdown模板
 * - `pasmsg`: 被动消息
 * - `keyboard`: 多维按钮
 * - `button`: 单行按钮
 * - `longMsg`: 长消息
 * - `raw`: 原始消息
 * - `basketball`: 篮球
 * - `dice`: 骰子
 * - `rps`: 猜拳
 * - `bubbleFace`: 气泡表情
 * - `weather`: 天气
 * - `location`: 位置
 * - `share`: 分享
 * - `gift`: 礼物
 * - `marketFace`: 商城表情
 * - `contact`: 联系人
 */
type messageType = 'text' | 'image' | 'at' | 'face' | 'reply' | 'video' | 'record' | 'music' | 'json' | 'xml' | 'markdown' | 'markdownTpl' | 'pasmsg' | 'keyboard' | 'button' | 'longMsg' | 'raw' | 'basketball' | 'dice' | 'rps' | 'bubbleFace' | 'weather' | 'location' | 'share' | 'gift' | 'marketFace' | 'contact' | 'node' | 'file';
interface Element$1 {
    /** 消息段类型 */
    type: messageType;
}
/** 文本元素 */
interface TextElement extends Element$1 {
    type: 'text';
    /** 文本内容 */
    text: string;
}
/** At元素 */
interface AtElement extends Element$1 {
    type: 'at';
    /** 目标id atall=all at在线成员=online */
    targetId: string;
    /** At的名称 */
    name?: string;
}
/** 表情元素 */
interface FaceElement extends Element$1 {
    type: 'face';
    /** 表情ID */
    id: number;
    /** 是否大表情，默认不是 */
    isBig?: boolean;
}
/** 回复元素 */
interface ReplyElement extends Element$1 {
    type: 'reply';
    /** 回复的消息ID */
    messageId: string;
}
/** 图片元素 */
interface ImageElement extends Element$1 {
    type: 'image';
    /** 图片url、路径或者base64 */
    file: string;
    /** fid */
    fid?: string;
    /** 图片名称 */
    name?: string;
    /** 图片外显名称 */
    summary?: string;
    /** 图片MD5 */
    md5?: string;
    /** 图片宽度 */
    width?: number;
    /** 图片高度 */
    height?: number;
    /** 图片子类型 */
    subType?: string;
    /** 图片大小 */
    size?: number;
    /**
     * show: 展示图片
     * flash: 闪照
     * original: 原图
     */
    fileType?: 'show' | 'flash' | 'original';
}
/** 视频元素 */
interface VideoElement extends Element$1 {
    type: 'video';
    /** 视频url、路径或者base64 */
    file: string;
    /** fid */
    fid?: string;
    /** 视频名称 */
    name?: string;
    /** 视频MD5 */
    md5?: string;
    /** 视频宽度 */
    width?: number;
    /** 视频高度 */
    height?: number;
}
/** 文件元素 */
interface FileElement extends Element$1 {
    type: 'file';
    /** url、路径或者base64 */
    file: string;
    /** fid */
    fid?: string;
    /** 文件名称 */
    name?: string;
    /** 文件大小 */
    size?: number;
    /** 文件hash */
    hash?: string;
}
/** 语音元素 */
interface RecordElement extends Element$1 {
    type: 'record';
    /** 语音文件url、路径或者base64 */
    file: string;
    /** fid */
    fid?: string;
    /** 是否为魔法语音 */
    magic: boolean;
    /** 语音md5 */
    md5?: string;
    /** 语音名称 */
    name?: string;
}
/**
 * 支持的音乐平台
 * - `custom`: 自定义音乐
 * - `qq`: QQ音乐
 * - `163`: 网易云音乐
 * - `migu`: 咪咕音乐
 * - `kugou`: 酷狗音乐
 * - `kuwo`: 酷我音乐
 */
type MusicPlatform = 'custom' | 'qq' | '163' | 'migu' | 'kugou' | 'kuwo';
/** 常规音乐 */
interface ReadyMusicElement extends Element$1 {
    type: 'music';
    /** 音乐平台 */
    platform: 'qq' | '163' | 'migu' | 'kugou' | 'kuwo';
    /** 歌曲ID */
    id: string;
}
/** 自定义音乐元素 */
interface CustomMusicElement extends Element$1 {
    type: 'music';
    /** 音乐平台 */
    platform: 'custom';
    /** 跳转链接 */
    url: string;
    /** 音乐音频链接 */
    audio: string;
    /** 标题 */
    title: string;
    /** 歌手 */
    author: string;
    /** 封面 */
    pic: string;
}
/** 音乐元素 */
type MusicElement = CustomMusicElement | ReadyMusicElement;
/** JSON元素 */
interface JsonElement extends Element$1 {
    type: 'json';
    /** JSON内容 未反序 */
    data: string;
}
/** XML元素 */
interface XmlElement extends Element$1 {
    type: 'xml';
    /** XML内容 未反序 */
    data: string;
}
/** Markdown元素 */
interface MarkdownElement extends Element$1 {
    type: 'markdown';
    /** Markdown内容 */
    markdown: string;
    config?: {
        /** 未知的参数 */
        unknown?: number;
        time: number;
        token: string;
    };
}
/** Markdown模板元素 */
interface MarkdownTplElement extends Element$1 {
    type: 'markdownTpl';
    /** 模板ID */
    templateId: string;
    /** 模板参数 */
    params: Array<{
        /** 模板参数键名称 */
        key: string;
        /** 模板参数值 */
        values: Array<string>;
    }>;
}
/** 被动事件元素 */
interface PasmsgElement extends Element$1 {
    type: 'pasmsg';
    /** 事件id来源 */
    source: 'msg' | 'event';
    /** 被动事件ID */
    id: string;
}
/** 多行按钮 */
interface KeyboardElement extends Element$1 {
    type: 'keyboard';
    /** 按钮行数组 */
    rows: KarinButton[][];
}
/** 单行按钮 */
interface ButtonElement extends Element$1 {
    type: 'button';
    /** 按钮数组 */
    data: KarinButton[];
}
/** 长消息元素 */
interface LongMsgElement extends Element$1 {
    type: 'longMsg';
    /** 消息ID */
    id: string;
}
/** 原始元素 */
interface RawElement extends Element$1 {
    type: 'raw';
    /** 原始数据 */
    data: any;
}
/** 篮球元素 */
interface BasketballElement extends Element$1 {
    type: 'basketball';
    /** 篮球ID */
    id: number;
}
/** 骰子元素 */
interface DiceElement extends Element$1 {
    type: 'dice';
    /** 骰子ID */
    id: number;
}
/** 猜拳元素 */
interface RpsElement extends Element$1 {
    type: 'rps';
    /** 猜拳ID */
    id: number;
}
/** 弹射表情元素 */
interface BubbleFaceElement extends Element$1 {
    type: 'bubbleFace';
    /** 表情ID */
    id: number;
    /** 表情数量 */
    count: number;
}
/** 天气元素 */
interface WeatherElement extends Element$1 {
    type: 'weather';
    /** 城市名称 */
    city: string;
    /** 城市代码 */
    code: string;
}
/** 位置元素 */
interface LocationElement extends Element$1 {
    type: 'location';
    /** 纬度 */
    lat: number;
    /** 经度 */
    lon: number;
    /** 标题 */
    title: string;
    /** 地址 */
    address: string;
}
/** 分享元素 */
interface ShareElement extends Element$1 {
    type: 'share';
    /** 分享链接 */
    url: string;
    /** 分享标题 */
    title: string;
    /** 分享内容 */
    content: string;
    /** 分享图片 */
    image: string;
}
/** 礼物元素 */
interface GiftElement extends Element$1 {
    type: 'gift';
    /** QQ 号 */
    qq: number;
    /** 礼物ID */
    id: number;
}
/** 商城表情元素 */
interface MarketFaceElement extends Element$1 {
    type: 'marketFace';
    /** 表情ID */
    id: string;
}
/** 分享名片元素 */
interface ContactElement extends Element$1 {
    type: 'contact';
    /** 分享类型 */
    scene: 'group' | 'friend';
    /** 被推荐人的QQ号或者被推荐群的群号 */
    peer: string;
}
/**
 * 全部消息段元素
 */
type Elements = TextElement | AtElement | FaceElement | ReplyElement | ImageElement | VideoElement | RecordElement | MusicElement | JsonElement | XmlElement | MarkdownElement | MarkdownTplElement | PasmsgElement | KeyboardElement | ButtonElement | LongMsgElement | RawElement | BasketballElement | DiceElement | RpsElement | BubbleFaceElement | WeatherElement | LocationElement | ShareElement | GiftElement | MarketFaceElement | ContactElement | FileElement;
/**
 * 发送消息段类型
 */
type SendMessage = string | Elements | Array<string | Elements>;
/**
 * 全部消息段元素
 */
type ElementTypes = Elements;

interface Element {
    type: 'node';
    /** 节点类型 */
    subType: 'messageID' | 'fake';
}
/** 合并转发接口外显参数 */
interface ForwardOptions {
    /** 小卡片中间的外显 */
    news: Array<{
        text: string;
    }>;
    /** qwqa说这个叫不懂 消息列表的外显 */
    prompt: string;
    /** 小卡片底下文本: 查看1条转发消息 */
    summary: string;
    /** 小卡片标题 */
    source: string;
}
/** 常规合并转发节点 */
interface DirectNodeElement extends Element {
    subType: 'messageID';
    /** 消息ID */
    messageId: string;
    /** @deprecated 即将废弃 请使用 `messageId` */
    message_id: string;
}
/** 自定义节点 */
interface CustomNodeElement extends Element {
    subType: 'fake';
    /** 目标ID */
    userId: string;
    /** 目标名称 */
    nickname: string;
    /** 转发的元素节点 */
    message: Array<SendElement>;
    /** 外显设置 */
    options?: ForwardOptions;
}
/** 合并转发节点消息段 */
type NodeElement = DirectNodeElement | CustomNodeElement;
/** 合并转发节点消息段 */
type SendElement = NodeElement | Elements;

/** 发送消息后的通用返回值 */
interface SendMsgResults {
    /** 消息ID */
    messageId: string;
    /** 消息发送时间戳 */
    time: number;
    /** 原始结果 一般是Object、Array */
    rawData: any;
    /** @deprecated 已废弃 请使用 `messageId` */
    message_id: string;
    /** @deprecated 已废弃 请使用 `time` */
    messageTime: number;
}
/** 基本消息Api返回值结构 */
interface MessageResponse {
    /** 消息发送时间 */
    time: number;
    /** 消息ID */
    messageId: string;
    /** 消息序列号 */
    messageSeq: number;
    /** 消息来源目标信息 */
    contact: Contact;
    /** 消息发送者 请注意role仅在群聊场景下有效 */
    sender: GroupSender;
    /** 消息元素 */
    elements: Array<Elements>;
}
/** 发送转发消息后返回值接口 */
interface SendForwardMessageResponse {
    /** 消息ID */
    messageId: string;
    /** resID 可通过长消息接口进行发送 */
    forwardId: string;
}
/** 获取精华消息返回值结构 */
interface GetGroupHighlightsResponse {
    /** 群ID */
    groupId: string;
    /** 消息发送者ID */
    senderId: string;
    /** 发送者昵称 */
    senderName: string;
    /** 操作者ID */
    operatorId: string;
    /** 操作者昵称 */
    operatorName: string;
    /** 操作时间 */
    operationTime: number;
    /** 消息发送时间 */
    messageTime: number;
    /** 消息ID */
    messageId: string;
    /** 消息序列号 */
    messageSeq: number;
    /** 被设置的精华消息元素文本 */
    jsonElements: string;
}
/**
 * 用户信息结构
 * @description 此接口仅可保证返回user_id、nick这两个字段
 */
interface UserInfo {
    /** 用户ID */
    userId: string;
    /** 名称 */
    nick: string;
    /** 用户UID */
    uid?: string;
    /** 用户UIN */
    uin?: string;
    /** qid */
    qid?: string;
    /** 备注 */
    remark?: string;
    /** 用户等级 */
    level?: number;
    /** 生日 */
    birthday?: string;
    /** 登录天数 */
    loginDay?: number;
    /** 点赞数 */
    likeCount?: number;
    /** 学校是否已核实 */
    isSchoolVerified?: boolean;
    /** 年龄 */
    age?: number;
    /** 性别 */
    sex?: Sex$1;
    /** 好莱坞/腾讯视频会员 */
    hollywoodVip?: boolean;
    /** QQ会员 */
    qqVip?: boolean;
    /** QQ超级会员 */
    qqSvip?: boolean;
    /** 大会员 */
    bigVip?: boolean;
    /** 是否已经赞过 */
    isLike?: boolean;
    [key: string]: any;
}
/**
 * 群信息结构
 * @description 此接口仅可保证返回group_id这个字段
 */
interface GroupInfo {
    /** 群ID */
    groupId: string;
    /** 群名称 */
    groupName?: string;
    /** 群主ID */
    owner?: string;
    /** 群备注 */
    groupRemark?: string;
    /** 群管理员ID列表 */
    admins: {
        userId: string;
        name: string;
        role: Role;
    }[];
    /** 最大成员数 */
    maxMemberCount?: number;
    /** 当前成员数 */
    memberCount?: number;
    /** 群描述 */
    groupDesc?: string;
    /** 群头像 */
    avatar?: string;
}
/**
 * 群成员信息
 * @description 此接口仅可保证返回user_id这个字段
 */
interface GroupMemberInfo {
    /** 用户ID */
    userId: string;
    /** 用户角色 */
    role: Role;
    /** 用户昵称 */
    nick?: string;
    /** 年龄 */
    age?: number;
    /** 群内头衔 */
    uniqueTitle?: string;
    /** 群名片 */
    card?: string;
    /** 加群时间 */
    joinTime?: number;
    /** 最后活跃时间 */
    lastActiveTime?: number;
    /** 用户等级 */
    level?: number;
    /** 禁言时间 */
    shutUpTime?: number;
    /** 距离 */
    distance?: number;
    /** 荣誉列表 */
    honors?: Array<number>;
    /** 是否好友 */
    unfriendly?: boolean;
    /** 性别 */
    sex?: Sex$1;
    /** 构建成发送者 方便使用 */
    get sender(): GroupSender;
}
/**
 * 群荣誉信息
 * @description 此接口仅可在QQ协议端中使用
 */
interface QQGroupHonorInfo {
    /** 荣誉成员ID */
    userId: string;
    /** 荣誉成员昵称 */
    nick: string;
    /** 荣誉名称 */
    honorName: string;
    /** 荣誉图标url */
    avatar: string;
    /** 荣誉id */
    id: number;
    /** 荣誉描述 */
    description: string;
}
/**
 * 群文件信息
 * @description 此接口仅可在QQ协议端中使用
 */
interface QQGroupFileInfo {
    /** 文件ID */
    fid: string;
    /** 文件名 */
    name: string;
    /** 文件大小 */
    size: number;
    /** 上传时间 */
    uploadTime: number;
    /** 过期时间 */
    expireTime: number;
    /** 修改时间 */
    modifyTime: number;
    /** 下载次数 */
    downloadCount: number;
    /** 上传者ID */
    uploadId: string;
    /** 上传者昵称 */
    uploadName: string;
    /** SHA1 */
    sha1: string;
    /** SHA3 */
    sha3: string;
    /** MD5 */
    md5: string;
}
/**
 * 群文件夹信息
 * @description 此接口仅可在QQ协议端中使用
 */
interface QQGroupFolderInfo {
    /** 文件夹ID */
    id: string;
    /** 文件夹名 */
    name: string;
    /** 文件数量 */
    fileCount: number;
    /** 创建时间 */
    createTime: number;
    /** 创建者ID */
    creatorId: string;
    /** 创建者昵称 */
    creatorName: string;
}
/** 获取at全体成员剩余次数返回值结构 */
interface GetAtAllCountResponse {
    /** 是否允许at全体成员 */
    accessAtAll: boolean;
    /** 全群剩余次数 */
    groupRemainCount: number;
    /** 个人剩余次数 */
    userRremainCount: number;
}
/** 获取群被禁言用户列表返回值结构 */
interface GetGroupMuteListResponse {
    /** 用户ID */
    userId: string;
    /** 禁言时间 */
    muteTime: number;
}
/** 获取群文件夹下文件列表返回值结构 */
interface GetGroupFileListResponse {
    /** 文件列表 */
    files: QQGroupFileInfo[];
    /** 文件夹列表 */
    folders: QQGroupFolderInfo[];
}
/** 获取群文件系统信息返回值结构 */
interface GetGroupFileSystemInfoResponse {
    /** 文件数量 */
    fileCount: number;
    /** 文件上限 */
    limitCount: number;
    /** 已使用空间 */
    usedSpace: number;
    /** 空间上限 */
    totalSpace: number;
}
/** 创建群文件夹返回值结构 */
interface CreateGroupFolderResponse {
    /** 文件夹ID */
    id: string;
    /** 已使用空间 */
    usedSpace: string;
}
/** 基础选项，不包含 url 和 base64 */
interface DownloadFileOptionsBase {
    /** 下载文件的根目录，需确保 Kritor 有该目录访问权限，可选 */
    rootPath?: string;
    /** 保存的文件名称，默认为文件 MD5，可选 */
    fileName?: string;
    /** 下载文件的线程数，默认为 3，可选 */
    threadCnt?: number;
    /** 下载文件的请求头，可选 */
    headers?: string;
}
/** 包含 url 的选项，base64 必须为 never */
interface DownloadFileOptionsWithUrl extends DownloadFileOptionsBase {
    /** 下载文件的 URL，二选一 */
    url: string;
    /** 下载文件的 base64，不允许 */
    base64?: never;
}
/** 包含 base64 的选项，url 必须为 never */
interface DownloadFileOptionsWithBase64 extends DownloadFileOptionsBase {
    /** 下载文件的 base64，二选一 */
    base64: string;
    /** 下载文件的 URL，不允许 */
    url?: never;
}
/** 让协议端下载文件到协议端本地请求参数结构 */
type DownloadFileOptions = DownloadFileOptionsWithUrl | DownloadFileOptionsWithBase64;
/** 让协议端下载文件到协议端本地返回值结构 */
interface DownloadFileResponse {
    /** 下载后文件的绝对路径 */
    filePath: string;
}
/** 获取 rkey 返回值结构 */
interface GetRkeyResponse {
    /** 可使用的场景 */
    type: 'private' | 'group';
    /** rkey */
    rkey: string;
    /** 创建时间 */
    created_at: number;
    /** 过期时间 */
    ttl: number;
}
/** 获取群 Ai 语音可用声色列表返回值结构 */
interface GetAiCharactersResponse {
    /** 声色ID */
    character_id: string;
    /** 声色名称 */
    character_name: string;
    /** 声色预览URL */
    preview_url: string;
}

/** 适配器类型 */
interface AdapterType<T = any> {
    /** 原生方法 */
    super: T;
    /** 原生方法 */
    raw: T;
    /**
     * onebot专属方法
     * @param action 请求的方法
     * @param params 请求的参数
     * @param time 超时时间 默认为120s
     */
    sendApi?: (...args: any[]) => Promise<any>;
    /** 适配器信息 */
    adapter: AdapterInfo;
    /** 账号信息 */
    account: AccountInfo;
    /** 获取Bot的id */
    get selfId(): string;
    /** 获取Bot的name */
    get selfName(): string;
    /**
     * 获取Bot的subId
     * @param key 子ID的key
     */
    selfSubId(key: string): string;
    /**
     * 打印当前Bot的专属日志
     * @param level 日志等级
     * @param args 日志内容
     */
    logger(level: LoggerLevel, ...args: any[]): void;
    /**
     * 发送消息
     * @param contact 目标信息
     * @param elements 消息元素
     * @param retryCount 重试次数 默认为0
     */
    sendMsg(contact: Contact, elements: Array<SendElement>, retryCount?: number): Promise<SendMsgResults>;
    /**
     * 发送长消息
     * @param contact 目标信息
     * @param resId 资源ID
     */
    sendLongMsg(contact: Contact, resId: string): Promise<SendMsgResults>;
    /**
     * 发送合并转发消息
     * @param contact 目标信息
     * @param elements 消息元素
     * @param options 首层小卡片外显参数
     */
    sendForwardMsg(contact: Contact, elements: Array<NodeElement>, options?: ForwardOptions): Promise<{
        messageId: string;
    }>;
    /**
     * 撤回消息
     * @param contact 目标信息
     * @param messageId 消息ID
     */
    recallMsg(contact: Contact, messageId: string): Promise<void>;
    /**
     * 获取头像url
     * @param userId 用户ID
     * @param size 头像大小，默认需要为`0`，请开发者注意
     * @returns 头像的url地址
     */
    getAvatarUrl(userId: string, size?: 0 | 40 | 100 | 140): Promise<string>;
    /**
     * 获取群头像url
     * @param groupId 群号
     * @param size 头像大小，默认`0`
     * @param history 历史头像记录，默认`0`，若要获取历史群头像则填写1,2,3...
     * @returns 头像的url地址
     */
    getGroupAvatarUrl(groupId: string, size?: 0 | 40 | 100 | 140, history?: number): Promise<string>;
    /**
     * 获取消息
     * @param contact 目标信息
     * @param messageId 消息ID
     * @returns MessageResponse对象
     */
    getMsg(messageId: string): Promise<MessageResponse>;
    /**
     * 获取消息
     * @param contact 目标信息
     * @param messageId 消息ID
     * @returns MessageResponse对象
     */
    getMsg(contact: Contact, messageId: string): Promise<MessageResponse>;
    /**
     * 获取msgId获取历史消息
     * @param contact 目标信息
     * @param startMsgSeq 起始消息序列号
     * @param count 获取消息数量 默认为1
     * @returns 包含历史消息的数组
     */
    getHistoryMsg(contact: Contact, startMsgSeq: number, count: number): Promise<Array<MessageResponse>>;
    /**
     * 获取msgId获取历史消息
     * @param contact 目标信息
     * @param startMsgId 起始消息ID
     * @param count 获取消息数量 默认为1
     * @returns 包含历史消息的数组
     */
    getHistoryMsg(contact: Contact, startMsgId: string, count: number): Promise<Array<MessageResponse>>;
    /**
     * 获取合并转发消息
     * @param resId 资源ID
     * @returns 包含MessageResponse对象的数组
     */
    getForwardMsg(resId: string): Promise<Array<MessageResponse>>;
    /**
     * 获取精华消息
     * @param groupId 群ID
     * @param page 页码
     * @param pageSize 每页数量
     * @returns EssenceMessageBody对象
     */
    getGroupHighlights(groupId: string, page: number, pageSize: number): Promise<Array<GetGroupHighlightsResponse>>;
    /**
     * 构造一个资源ID 即上传合并转发消息后不进行发送
     * @param contact 目标信息
     * @param elements 转发消息元素
     * @description 此接口并不是所有协议端都支持的，因此在使用时请注意
     */
    createResId(contact: Contact, elements: Array<NodeElement>): Promise<string>;
    /**
     * 设置、取消群精华消息
     * @param groupId 群ID
     * @param messageId 群消息ID
     * @param create true为添加精华消息，false为删除精华消息 默认为true
     */
    setGroupHighlights(groupId: string, messageId: string, create: boolean): Promise<void>;
    /**
     * 发送好友赞
     * @param targetId 目标ID
     * @param count 赞的次数，默认为10
     */
    sendLike(targetId: string, count: number): Promise<void>;
    /**
     * 群踢人
     * @param groupId 群ID
     * @param targetId 被踢出目标的ID 任选其一
     * @param rejectAddRequest 是否拒绝再次申请，默认为false
     * @param kickReason 踢出原因，可选
     */
    groupKickMember(groupId: string, targetId: string, rejectAddRequest?: boolean, kickReason?: string): Promise<void>;
    /**
     * 禁言群成员
     * @param groupId 群ID
     * @param targetId 被禁言目标的ID 任选其一
     * @param duration 禁言时长 单位:秒
     */
    setGroupMute(groupId: string, targetId: string, duration: number): Promise<void>;
    /**
     * 群全员禁言
     * @param groupId 群ID
     * @param isBan 是否开启全员禁言
     */
    setGroupAllMute(groupId: string, isBan: boolean): Promise<void>;
    /**
     * 设置群管理员
     * @param groupId 群ID
     * @param targetId 目标用户的ID
     * @param isAdmin 是否设置为管理员
     */
    setGroupAdmin(groupId: string, targetId: string, isAdmin: boolean): Promise<void>;
    /**
     * 设置群名片
     * @param groupId 群ID
     * @param targetId 目标用户的ID
     * @param card 新的群名片
     */
    setGroupMemberCard(groupId: string, targetId: string, card: string): Promise<void>;
    /**
     * 设置群名
     * @param groupId 群ID
     * @param groupName 新的群名
     */
    setGroupName(groupId: string, groupName: string): Promise<void>;
    /**
     * 退出群组
     * @param groupId 群ID
     * @param isDismiss 如果Bot是群主，是否解散群
     */
    setGroupQuit(groupId: string, isDismiss: boolean): Promise<void>;
    /**
     * 设置群专属头衔 仅群主可用
     * @param groupId 群ID
     * @param targetId 目标用户的ID
     * @param title 新的专属头衔
     */
    setGroupMemberTitle(groupId: string, targetId: string, title: string): Promise<void>;
    /**
     * 获取陌生人信息
     * @param targetId 用户ID 任选其一
     * @returns 陌生人信息数组
     */
    getStrangerInfo(targetId: string): Promise<UserInfo>;
    /**
     * 获取好友列表
     * @param refresh 是否刷新好友列表
     * @returns 好友列表数组
     */
    getFriendList(refresh?: boolean): Promise<Array<UserInfo>>;
    /**
     * 获取群信息
     * @param groupId 群ID
     * @param noCache 是否刷新缓存
     * @returns 群信息
     */
    getGroupInfo(groupId: string, noCache?: boolean): Promise<GroupInfo>;
    /**
     * 获取群列表
     * @param refresh 是否刷新好友列表
     * @returns 群列表数组
     */
    getGroupList(refresh?: boolean): Promise<Array<GroupInfo>>;
    /**
     * 获取群成员信息
     * 此接口在非QQ平台上很难获取到标准信息，因此返回的数据可能会有所不同
     * @param groupId 群ID
     * @param targetId 目标用户的ID
     * @param refresh 是否刷新缓存
     * @returns 群成员信息
     */
    getGroupMemberInfo(groupId: string, targetId: string, refresh?: boolean): Promise<GroupMemberInfo>;
    /**
     * 获取群成员列表
     * @param groupId 群ID
     * @param refresh 是否刷新缓存
     * @returns 群成员列表数组
     */
    getGroupMemberList(groupId: string, refresh?: boolean): Promise<Array<GroupMemberInfo>>;
    /**
     * 获取群荣誉信息
     * @param groupId 群ID
     * @returns 群荣誉信息数组
     */
    getGroupHonor(groupId: string): Promise<Array<QQGroupHonorInfo>>;
    /**
     * 设置好友请求结果
     * @param requestId 请求事件ID
     * @param isApprove 是否同意
     * @param remark 好友备注 同意时有效
     * @returns 设置结果
     */
    setFriendApplyResult(requestId: string, isApprove: boolean, remark?: string): Promise<void>;
    /**
     * 设置申请加入群请求结果
     * @param requestId 请求事件ID
     * @param isApprove 是否同意
     * @param denyReason 拒绝理由 拒绝时有效
     */
    setGroupApplyResult(requestId: string, isApprove: boolean, denyReason?: string): Promise<void>;
    /**
     * 设置邀请加入群请求结果
     * @param requestId 请求事件ID
     * @param isApprove 是否同意
     */
    setInvitedJoinGroupResult(requestId: string, isApprove: boolean): Promise<void>;
    /**
     * 设置消息表情回应
     * @param contact 目标信息
     * @param messageId 消息ID
     * @param faceId 表情ID
     */
    setMsgReaction(contact: Contact, messageId: string, faceId: number | string, isSet: boolean): Promise<void>;
    /**
     * 上传群文件、私聊文件
     * @param contact 目标信息
     * @param file 本地文件绝对路径
     * @param name 文件名称 必须提供
     * @param folder 父目录ID 不提供则上传到根目录 仅在群聊时有效
     */
    uploadFile(contact: Contact, file: string, name: string, folder?: string): Promise<void>;
    /**
     * 让协议端下载文件到协议端本地
     * @param options 下载文件的选项
     * @returns 下载文件的绝对路径和文件MD5
     */
    downloadFile(options?: DownloadFileOptions): Promise<DownloadFileResponse>;
    /**
     * 获取文件url
     * @param contact 目标信息
     * @param fileId 文件id
     * @returns 文件url
     */
    getFileUrl(contact: Contact, fileId: string): Promise<string>;
    /**
     * 创建群文件夹
     * @param groupId 群号
     * @param name 文件夹名
     * @returns 返回文件夹id和已使用空间
     */
    createGroupFolder(groupId: string, name: string): Promise<CreateGroupFolderResponse>;
    /**
     * 重命名群文件的文件夹
     * @param groupId 群号
     * @param folderId 文件夹id
     * @param name 文件夹名
     * @returns 无返回值
     */
    renameGroupFolder(groupId: string, folderId: string, name: string): Promise<boolean>;
    /**
     * 删除群文件的文件夹
     * @param groupId 群号
     * @param folderId 文件夹id
     * @returns 无返回值
     */
    delGroupFolder(groupId: string, folderId: string): Promise<boolean>;
    /**
     * 上传群文件
     * @description 此接口仅可以在Bot和协议端在同一台设备上时使用
     * @param groupId 群号
     * @param file 文件绝对路径
     * @param name 文件名
     * @returns 无返回值
     */
    uploadGroupFile(groupId: string, file: string, name?: string): Promise<boolean>;
    /**
     * 删除群文件
     * @param groupId 群号
     * @param fileId 文件id
     * @param busId 文件类型ID
     * @returns 无返回值
     */
    delGroupFile(groupId: string, fileId: string, busId: number): Promise<boolean>;
    /**
     * 获取群文件系统信息
     * @param groupId 群号
     * @returns 返回文件数量、文件数量上限、已使用空间和空间上限
     */
    getGroupFileSystemInfo(groupId: string): Promise<GetGroupFileSystemInfoResponse>;
    /**
     * 获取群文件夹下的文件列表
     * @param groupId 群号
     * @param folderId 文件夹id，空则为根目录
     * @returns 返回文件和文件夹的列表
     */
    getGroupFileList(groupId: string, folderId?: string): Promise<GetGroupFileListResponse>;
    /**
     * 设置群备注
     * @param groupId 群号
     * @param remark 新的备注
     */
    setGroupRemark(groupId: string, remark: string): Promise<boolean>;
    /**
     * 获取陌生群信息
     * @param groupId 群号
     */
    getNotJoinedGroupInfo?(groupId: string): Promise<GroupInfo>;
    /**
     * 获取艾特全体成员剩余次数
     * @param groupId 群号
     * @returns 返回是否允许at全体成员和全群剩余次数、个人剩余次数
     */
    getAtAllCount(groupId: string): Promise<GetAtAllCountResponse>;
    /**
     * 获取群被禁言用户列表
     * @param groupId
     * @returns 返回禁言用户列表
     */
    getGroupMuteList(groupId: string): Promise<Array<GetGroupMuteListResponse>>;
    /**
     * 戳一戳用户 支持群聊和私聊
     * @param contact 目标信息
     * @param targetId 被戳用户 ID
     * @param count 戳一戳次数 默认为1
     */
    pokeUser(contact: Contact, targetId: string, count?: number): Promise<boolean>;
    /**
     * 获取 Cookies
     * @param domain The domain to get cookies from
     */
    getCookies(domain: string): Promise<{
        cookie: string;
    }>;
    /**
     * 获取 QQ 相关接口凭证
     * @param domain The domain to get credentials from
     */
    getCredentials(domain: string): Promise<{
        cookies: string;
        csrf_token: number;
    }>;
    /**
     * 获取 CSRF Token
     */
    getCSRFToken(): Promise<{
        token: number;
    }>;
    /**
     * 设置头像
     * @param file base64:// file:// http(s)://
     * @returns 是否设置成功
     */
    setAvatar(file: string): Promise<void>;
    /**
     * 获取群 Ai 语音可用声色列表
     * @returns 声色列表
     */
    getAiCharacters(): Promise<Array<GetAiCharactersResponse>>;
    /**
     * 发送群 Ai 语音声色
     * @param group_id 群号
     * @param character_id 声色ID
     * @param text 转换的文本
     * @returns 是否设置成功
     */
    sendAiCharacter(group_id: string, character: string, text: string): Promise<{
        messageId: string;
    }>;
    /**
     * 获取 rkey
     * @returns rkey
     */
    getRkey(): Promise<Array<GetRkeyResponse>>;
}
/** 适配器类型 */
type Adapter = AdapterType;

/** 快速回复源函数 适配器实现 */
type SrcReply = (
/** 发送的消息 */
elements: Elements[]) => Promise<SendMsgResults> | SendMsgResults;
/** 快速回复函数 */
type Reply = (
/** 发送的消息 */
elements: SendMessage, 
/** 发送消息选项 */
options?: {
    /** 是否@发送者 */
    at?: boolean;
    /** 是否引用回复发送者 */
    reply?: boolean;
    /** 撤回消息时间 默认为0不撤回 */
    recallMsg?: number;
    /** 重试次数 默认为0 */
    retryCount?: number;
}) => Promise<SendMsgResults> | SendMsgResults;

/** 通知事件: 收到点赞 */
interface ReceiveLikeType {
    /** 点赞者id */
    operatorId: string;
    /** 点赞者数量 */
    count: number;
}
/** 通知事件: 新增好友 */
interface FriendIncreaseType {
    /** 新好友id */
    targetId: string;
}
/** 通知事件: 好友减少 */
interface FriendDecreaseType {
    /** 减少的好友id */
    targetId: string;
}
/** 通知事件: 私聊戳一戳 */
interface PrivatePokeType {
    /** 操作者id */
    operatorId: string;
    /** 被戳者id */
    targetId: string;
    /** 操作名称，如“戳了戳” */
    action: string;
    /** 后缀，未设置则未空字符串 */
    suffix: string;
    /** 操作图标url */
    actionImage: string;
}
/** 通知事件: 私聊撤回消息 */
interface PrivateRecallType {
    /** 操作者id */
    operatorId: string;
    /** 撤回的消息id */
    messageId: string;
    /** 操作提示，如“撤回了一条消息”  一般此项为空字符串 */
    tips: string;
}
/**
 * 通知事件: 私聊文件上传
 * 文件信息最少需要提供一个url
 */
interface PrivateFileUploadedType {
    /** 操作者id */
    operatorId: string;
    /** 文件ID 此项没有则为空字符串 */
    fid: string;
    /** 文件子ID 此项没有则为0 */
    subId: number;
    /** 文件名 此项没有则为空字符串 */
    name: string;
    /** 文件大小 此项没有则为0 */
    size: number;
    /** 过期时间 此项没有则为0 */
    expireTime: number;
    /** 文件URL */
    url: () => Promise<string>;
}
/** 通知事件: 群聊戳一戳 */
interface GroupPokeType {
    /** 操作者id */
    operatorId: string;
    /** 操作名称，如“戳了戳” */
    action: string;
    /** 后缀，未设置则未空字符串 */
    suffix: string;
    /** 操作图标url */
    actionImage: string;
    /** 被戳目标id */
    targetId: string;
}
/**
 * 通知事件: 群聊撤回
 * 撤回自己消息时，operator和target为自己
 * 撤回别人消息时，operator为操作者，target为被撤回者
 */
interface GroupRecallType {
    /** 操作者id */
    operatorId: string;
    /** 目标id 撤回自己消息为自己 否则是被撤回者 */
    targetId: string;
    /** 撤回的消息id */
    messageId: string;
    /** 操作提示，如“撤回了一条消息”  一般此项为空字符串 */
    tip: string;
}
/**
 * 通知事件: 群文件上传
 * 文件信息最少需要提供一个url
 */
interface GroupFileUploadedType {
    /** 文件ID */
    fid: string;
    /** 文件子ID */
    subId: number;
    /** 文件名 */
    name: string;
    /** 文件大小 */
    size: number;
    /** 过期时间 */
    expireTime?: number;
    /** 文件URL */
    url: () => Promise<string>;
}
/** 通知事件: 群名片变动 */
interface GroupCardChangedType {
    /** 操作者id */
    operatorId: string;
    /** 目标id */
    targetId: string;
    /** 新名片 */
    newCard: string;
}
/** 通知事件: 群成员头衔变动 */
interface GroupMemberUniqueTitleChangedType {
    /** 目标id */
    targetId: string;
    /** 新头衔 */
    title: string;
}
/** 通知事件: 群精华消息变动 */
interface GroupHlightsChangedType {
    /** 操作者id */
    operatorId: string;
    /** 发送者id */
    senderId: string;
    /** 被操作的消息id */
    messageId: string;
    /** 设置、取消精华 */
    isSet: boolean;
}
/** 通知事件: 群成员增加 */
interface GroupMemberIncreaseType {
    /** 操作者id */
    operatorId: string;
    /** 加入者id */
    targetId: string;
    /** 加入方式 APPROVE:管理员批准 INVITE:管理员邀请 */
    type: 'invite' | 'approve';
}
/** 通知事件: 群成员减少 */
interface GroupMemberDecreaseType {
    /** 操作者id */
    operatorId: string;
    /** 目标id */
    targetId: string;
    /** 减少方式 leave:主动退群 kick:成员被踢 kickBot:机器人自身被踢 */
    type: 'leave' | 'kick' | 'kickBot';
}
/** 通知事件: 群管理员变动 */
interface GroupAdminChangedType {
    /** 目标id */
    targetId: string;
    /** 设置、取消管理员 */
    isAdmin: boolean;
}
/** 通知事件: 群打卡 */
interface GroupSignInType {
    /** 目标id */
    targetId: string;
    /** 操作名称，如“打卡了” */
    action: string;
    /** 打卡图标url */
    rankImage: string;
}
/** 通知事件: 群成员被禁言 */
interface GroupMemberBanType {
    /** 操作者id */
    operatorId: string;
    /** 目标id */
    targetId: string;
    /** 禁言时长，单位秒 */
    duration: number;
    /** 是否为禁言 */
    isBan: boolean;
}
/** 通知事件: 群全员禁言 */
interface GroupWholeBanType {
    /** 操作者id */
    operatorId: string;
    /** 是否开启全体禁言 */
    isBan: boolean;
}
/** 通知事件: 群表情动态 */
interface GroupMessageReactionType {
    /** 消息ID */
    messageId: string;
    /** 表情ID 参考: https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#EmojiType */
    faceId: number;
    /** 数量 */
    count: number;
    /** 添加、取消回应 */
    isSet: boolean;
}
/** 通知事件: 群聊运气王 */
interface GroupLuckKingType {
    /** 红包发送者id */
    userId: string;
    /** 运气王id */
    targetId: string;
}
/** 通知事件: 群聊荣誉变更事件 */
interface GroupHonorChangedType {
    /** 荣誉类型，分别表示龙王、群聊之火、快乐源泉 */
    honorType: 'talkative' | 'performer' | 'emotion';
}
/** 通知事件: Bot下线 */
interface BotOfflineType {
    /** 下线标签（原因） */
    tag: string;
    /** 下线消息 */
    message: string;
}
/** 请求事件: 好友申请 */
interface PrivateApplyType {
    /** 申请者id */
    applierId: string;
    /** 验证信息 */
    message: string;
    /** 请求 flag，在调用处理请求的 API 时需要传入 */
    flag: string;
}
/** 请求事件: 新成员申请加入群聊申请 */
interface GroupApply {
    /** 申请者id */
    applierId: string;
    /** 邀请者id */
    inviterId: string;
    /** 申请理由 */
    reason: string;
    /** 请求 flag，在调用处理请求的 API 时需要传入 */
    flag: string;
    /** 群id */
    groupId: string;
}
/** 请求事件: 邀请Bot加入群聊 */
interface GroupInvite {
    /** 邀请者id */
    inviterId: string;
    /** 请求 flag，在调用处理请求的 API 时需要传入 */
    flag: string;
}

/**
 * 事件父类型
 * - `message`: 消息事件
 * - `notice`: 通知事件
 * - `request`: 请求事件
 */
type EventParent = 'message' | 'notice' | 'request';
/**
 * `消息`事件子类型
 * - `group`: 群消息
 * - `friend`: 好友消息
 * - `guild`: 频道消息
 * - `direct`: 频道私信
 * - `groupTemp`: 群临时会话
 */
type MessageEventSub = 'group' | 'friend' | 'guild' | 'direct' | 'groupTemp';
/**
 * `通知`事件子类型
 * - `receiveLike`: 收到点赞
 * - `friendPoke`: 好友戳一戳
 * - `friendRecall`: 好友撤回消息
 * - `privateFileUploaded`: 好友发送文件
 * - `friendIncrease`: 好友增加
 * - `friendDecrease`: 好友减少
 * - `botOffline`: Bot下线
 *
 * - `groupPoke`: 群聊戳一戳
 * - `groupCardChanged`: 群聊名片变动
 * - `groupMemberTitleUpdate`: 群聊成员头衔变动
 * - `groupHighlightsChange`: 群聊精华消息变动
 * - `groupRecall`: 群聊撤回消息
 * - `groupMemberAdd`: 群聊成员增加
 * - `groupMemberRemove`: 群聊成员减少
 * - `groupAdminChanged`: 群聊管理员变动
 * - `groupMemberBan`: 群聊成员禁言
 * - `groupSignIn`: 群聊签到
 * - `groupWholeBan`: 群聊全员禁言
 * - `groupFileUploaded`: 群聊发送文件
 * - `groupMessageReaction`: 群聊消息表情动态回应
 * - `groupLuckyKing`: 群聊运气王事件
 * - `groupHonorChange`: 群聊荣誉变更事件
 */
type NoticeEventSub = 
/** 收到点赞 */
'receiveLike'
/** 好友戳一戳 */
 | 'friendPoke'
/** 好友撤回消息 */
 | 'friendRecall'
/** 好友发送文件 */
 | 'privateFileUploaded'
/** 好友增加 */
 | 'friendIncrease'
/** 好友减少 */
 | 'friendDecrease'
/** 群聊戳一戳 */
 | 'groupPoke'
/** 群聊名片变动 */
 | 'groupCardChanged'
/** 群聊成员头衔变动 */
 | 'groupMemberTitleUpdate'
/** 群聊精华消息变动 */
 | 'groupHighlightsChange'
/** 群聊撤回消息 */
 | 'groupRecall'
/** 群聊成员增加 */
 | 'groupMemberAdd'
/** 群聊成员减少 */
 | 'groupMemberRemove'
/** 群聊管理员变动 */
 | 'groupAdminChanged'
/** 群聊成员禁言 */
 | 'groupMemberBan'
/** 群聊签到 */
 | 'groupSignIn'
/** 群聊全员禁言 */
 | 'groupWholeBan'
/** 群聊发送文件 */
 | 'groupFileUploaded'
/** 群聊消息表情动态回应 */
 | 'groupMessageReaction'
/** 群聊运气王事件 */
 | 'groupLuckyKing'
/** 群聊荣誉变更事件 */
 | 'groupHonorChange'
/** Bot下线 */
 | 'botOffline';
/**
 * `请求`事件子类型
 * - `friendApply`: 收到添加Bot为好友请求
 * - `groupApply`: 收到用户申请加入群聊请求
 * - `groupInvite`: 收到邀请Bot加入群聊请求
 */
type RequestEventSub = 'friendApply' | 'groupApply' | 'groupInvite';
/**
 * 事件父类型与子类型的映射
 */
interface EventToSubEvent {
    message: MessageEventSub;
    notice: NoticeEventSub;
    request: RequestEventSub;
}
/**
 * 事件基类定义
 * @description 所有的事件都拥有这些基本属性
 */
interface BaseEventType<T extends EventParent> {
    /** 机器人ID */
    selfId: string;
    /** 用户ID */
    userId: string;
    /** 事件类型 */
    event: T;
    /** 事件子类型 */
    subEvent: EventToSubEvent[T];
    /** 事件ID */
    eventId: string;
    /** 原始事件 */
    rawEvent: any;
    /** 事件触发时间戳 */
    time: number;
    /** 事件联系人信息 */
    contact: Contact;
    /** 事件发送者信息 */
    sender: Sender;
    /** 快速回复源函数 适配器实现 */
    srcReply: SrcReply;
    /** bot自身实例 所有标准Api都通过这里调用 */
    bot: AdapterType;
}
/** 事件基类参数 */
type BaseEventOptions<T extends EventParent> = Omit<BaseEventType<T>, 'userId' | 'selfId'>;
/** 创建消息事件类所需参数类型 */
type MessageOptions = Omit<BaseEventOptions<'message'>, 'event'> & {
    /** 消息ID */
    messageId: string;
    /** 消息序列号 */
    messageSeq: number;
    /** 消息体元素 */
    elements: Elements[];
};
/** 创建好友消息事件所需参数类型 */
type FriendMessageOptions = Omit<MessageOptions, 'subEvent' | 'contact' | 'sender'> & {
    /** 事件来源好友信息 */
    contact: Contact<'friend'>;
    /** 好友发送者信息 */
    sender: Sender<'friend'>;
};
/** 创建群消息事件所需参数类型 */
type GroupMessageOptions = Omit<MessageOptions, 'subEvent' | 'contact' | 'sender'> & {
    /** 事件来源群信息 */
    contact: Contact<'group'>;
    /** 群发送者信息 */
    sender: Sender<'group'>;
};
/** 创建频道消息事件所需参数类型 */
type GuildMessageOptions = Omit<MessageOptions, 'subEvent' | 'contact' | 'sender'> & {
    /** 事件来源频道信息 */
    contact: Contact<'guild'>;
    /** 频道发送者信息 */
    sender: Sender<'guild'>;
};
/** 创建频道私信消息事件所需参数类型 */
type DirectMessageOptions = Omit<MessageOptions, 'subEvent' | 'contact' | 'sender'> & {
    /** 事件来源频道私信信息 */
    contact: Contact<'direct'>;
    /** 频道私信发送者信息 */
    sender: Sender<'direct'>;
    /** 来源频道ID */
    srcGuildId: string;
};
/** 创建群临时会话消息事件所需参数类型 */
type GroupTempMessageOptions = Omit<MessageOptions, 'subEvent' | 'contact' | 'sender'> & {
    /** 事件来源群临时会话信息 */
    contact: Contact<'groupTemp'>;
    /** 群临时会话发送者信息 */
    sender: Sender<'groupTemp'>;
};
/** 通知事件: 创建通知事件类所需参数类型 */
type NoticeOptions = Omit<BaseEventOptions<'notice'>, 'event' | 'sender'> & {
    sender: Sender;
};
/** 创建收到点赞通知事件 */
type ReceiveLikeOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'friend'>;
    /** 事件创建者信息 */
    sender: Sender<'friend'>;
    /** 请求内容 */
    content: ReceiveLikeType;
};
/** 创建好友增加通知事件 */
type FriendIncreaseOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'friend'>;
    /** 事件创建者信息 */
    sender: Sender<'friend'>;
    /** 请求内容 */
    content: FriendIncreaseType;
};
/** 创建好友减少通知事件 */
type FriendDecreaseOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'friend'>;
    /** 事件创建者信息 */
    sender: Sender<'friend'>;
    /** 请求内容 */
    content: FriendDecreaseType;
};
/** 创建私聊戳一戳通知事件 */
type PrivatePokeOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'friend'>;
    /** 事件创建者信息 */
    sender: Sender<'friend'>;
    /** 请求内容 */
    content: PrivatePokeType;
};
/** 创建私聊撤回消息通知事件 */
type PrivateRecallOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'friend'>;
    /** 事件创建者信息 */
    sender: Sender<'friend'>;
    /** 请求内容 */
    content: PrivateRecallType;
};
/** 创建私聊文件上传通知事件 */
type PrivateFileUploadedOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'friend'>;
    /** 事件创建者信息 */
    sender: Sender<'friend'>;
    /** 请求内容 */
    content: PrivateFileUploadedType;
};
/** 创建群聊戳一戳通知事件 */
type GroupPokeOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupPokeType;
};
/** 创建群聊撤回通知事件 */
type GroupRecallOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupRecallType;
};
/** 创建群聊文件上传通知事件 */
type GroupFileUploadedOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupFileUploadedType;
};
/** 创建群名片变动通知事件 */
type GroupCardChangedOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupCardChangedType;
};
/** 创建群成员头衔变动通知事件 */
type GroupMemberUniqueTitleChangedOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupMemberUniqueTitleChangedType;
};
/** 创建群精华消息变动通知事件 */
type GroupHlightsChangedOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupHlightsChangedType;
};
/** 创建群成员增加通知事件 */
type GroupMemberIncreaseOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupMemberIncreaseType;
};
/** 创建群成员减少通知事件 */
type GroupMemberDecreaseOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupMemberDecreaseType;
};
/** 创建群管理员变动通知事件 */
type GroupAdminChangedOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupAdminChangedType;
};
/** 创建群打卡通知事件 */
type GroupSignInOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupSignInType;
};
/** 创建群成员被禁言通知事件 */
type GroupMemberBanOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupMemberBanType;
};
/** 创建群全员禁言通知事件 */
type GroupWholeBanOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupWholeBanType;
};
/** 创建群表情动态通知事件 */
type GroupMessageReactionOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupMessageReactionType;
};
/** 创建群聊运气王通知事件 */
type GroupLuckKingOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupLuckKingType;
};
/** 创建群聊荣誉变更通知事件 */
type GroupHonorChangedOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupHonorChangedType;
};
/** 创建Bot下线通知事件 */
type BotOfflineOptions = Omit<NoticeOptions, 'subEvent'> & {
    /** 事件来源信息 */
    contact: Contact<'friend'>;
    /** 事件创建者信息 */
    sender: Sender<'friend'>;
    /** 请求内容 */
    content: BotOfflineType;
};
/** 创建请求事件类所需参数类型 */
type RequestOptions = Omit<BaseEventOptions<'request'>, 'event'> & {
    /** 请求内容 */
    content: any;
};
/** 创建好友申请请求事件 */
type PrivateApplyRequestOptions = RequestOptions & {
    /** 事件来源信息 */
    contact: Contact<'friend'>;
    /** 事件创建者信息 */
    sender: Sender<'friend'>;
    /** 请求内容 */
    content: PrivateApplyType;
};
type FriendRequestOptions = PrivateApplyRequestOptions;
/** 创建新成员加入群聊申请请求事件 */
type GroupApplyRequestOptions = RequestOptions & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupApply;
};
/** 创建邀请机器人加入群聊请求事件 */
type GroupInviteRequestOptions = RequestOptions & {
    /** 事件来源信息 */
    contact: Contact<'group'>;
    /** 事件创建者信息 */
    sender: Sender<'group'>;
    /** 请求内容 */
    content: GroupInvite;
};

/** 事件实现基类 */
declare abstract class BaseEvent<T extends EventParent> {
    #private;
    /** 快速回复 */
    reply: Reply;
    /** 存储器 由开发者自行调用 */
    store: Map<any, any>;
    /** 日志函数字符串 */
    logFnc: string;
    /** 日志用户字符串 */
    logText: string;
    /** 是否为主人 */
    isMaster: boolean;
    /** 是否为Bot管理员 */
    isAdmin: boolean;
    constructor({ event, subEvent, eventId, rawEvent, time, contact, sender, srcReply, bot, }: BaseEventOptions<T>);
    /**
     * @description 机器人ID
     * @deprecated 即将废弃，请使用 `selfId`
     */
    get self_id(): string;
    /**
     * @description 用户ID
     * @deprecated 即将废弃，请使用 `userId`
     */
    get user_id(): string;
    /** 机器人自身ID */
    get selfId(): string;
    /** 用户ID */
    get userId(): string;
    /** 事件父类型 */
    get event(): T;
    /** 事件子类型 */
    get subEvent(): EventToSubEvent[T];
    /** 事件ID */
    get eventId(): string;
    /** 原始事件 */
    get rawEvent(): unknown;
    /** 事件触发时间戳 */
    get time(): number;
    /** 事件来源信息 */
    get contact(): Contact;
    /** 事件发送者信息 */
    get sender(): Sender;
    /** 快速回复源函数 */
    get srcReply(): SrcReply;
    /** 机器人实例 */
    get bot(): AdapterType<any>;
    /**
     * 是否为私聊场景
     * - 在好友场景下为 `true`
     * - 在频道私信场景下为 `true`
     */
    get isPrivate(): boolean;
    /** 是否为好友场景 */
    get isFriend(): boolean;
    /** 是否为群聊场景 */
    get isGroup(): boolean;
    /** 是否为频道场景 */
    get isGuild(): boolean;
    /** 是否为群临时会话场景 */
    get isGroupTemp(): boolean;
    /** 是否为频道私信场景 */
    get isDirect(): boolean;
    /**
     * 传入目标权限，返回当前事件触发者是否拥有该权限
     * @param role - 目标权限
     * @param isUpper - 是否向上检查 例如`group:admin`向上检查到`master` 默认`true`
     * @returns 是否拥有该权限
     */
    hasPermission(role: Permission, isUpper?: boolean): boolean;
}

/**
 * @description 消息事件基类
 * @class FriendMessage
 */
declare abstract class MessageBase$1 extends BaseEvent<'message'> {
    #private;
    /** 消息段 */
    elements: Elements[];
    /** 消息文本 */
    msg: string;
    /** 别名 */
    alias: string;
    /** 消息日志 */
    rawMessage: string;
    constructor({ subEvent, eventId, rawEvent, time, contact, sender, srcReply, bot, messageId, messageSeq, elements, }: MessageOptions);
    /**
     * @deprecated 即将废弃 请使用 `rawMessage`
     */
    get raw_message(): string;
    /**
     * @description 消息ID
     * @deprecated 即将废弃 请使用 `messageId`
     */
    get message_id(): string;
    /**
     * @description 消息序列号
     * @deprecated 即将废弃 请使用 `messageSeq`
     */
    get message_seq(): number;
    get event(): "message";
    get subEvent(): MessageEventSub;
    get messageId(): string;
    get messageSeq(): number;
    get at(): string[];
    get atBot(): boolean;
    get atAll(): boolean;
    get image(): string[];
    get record(): string;
    get replyId(): string;
    /**
     * @description 引用回复的消息id
     * @deprecated 即将废弃 请使用 `replyId`
     */
    get reply_id(): string;
}
/**
 * @description 好友消息事件类
 * @class FriendMessage
 */
declare class FriendMessage extends MessageBase$1 {
    #private;
    constructor(options: FriendMessageOptions);
    get contact(): FriendContact;
    get sender(): SenderBase;
    get subEvent(): "friend";
    get isPrivate(): true;
    get isFriend(): true;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群消息事件类
 * @class GroupMessage
 */
declare class GroupMessage extends MessageBase$1 {
    #private;
    constructor(options: GroupMessageOptions);
    /**
     * @description 群ID
     * @deprecated 即将废弃 请使用 `groupId`
     */
    get group_id(): string;
    /**
     * @description 群ID
     */
    get groupId(): string;
    get contact(): GroupContact;
    get sender(): GroupSender;
    get subEvent(): "group";
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 频道私信消息事件类
 * @class DirectMessage
 */
declare class DirectMessage extends MessageBase$1 {
    #private;
    constructor(options: DirectMessageOptions);
    /** 来源频道id */
    get srcGuildId(): string;
    get guildId(): string;
    get channelId(): string;
    get contact(): DirectContact;
    get sender(): SenderBase;
    get subEvent(): "direct";
    get isPrivate(): true;
    get isFriend(): false;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): true;
    get isGroupTemp(): false;
}
/**
 * @description 频道消息事件类
 * @class GuildMessage
 */
declare class GuildMessage extends MessageBase$1 {
    #private;
    constructor(options: GuildMessageOptions);
    /**
     * @description 频道ID
     * @deprecated 即将废弃 请使用 `guildId`
     */
    get guild_id(): string;
    /**
     * @description 子频道ID
     * @deprecated 即将废弃 请使用 `channelId`
     */
    get channel_id(): string;
    /**
     * @description 频道ID
     */
    get guildId(): string;
    /**
     * @description 子频道ID
     */
    get channelId(): string;
    get contact(): GuildContact;
    get sender(): GuildSender;
    get subEvent(): "guild";
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): false;
    get isGuild(): true;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群临时会话消息事件类
 * @class GroupTempMessage
 */
declare class GroupTempMessage extends MessageBase$1 {
    #private;
    constructor(options: GroupTempMessageOptions);
    /**
     * @description 群ID
     * @deprecated 即将废弃 请使用 `groupId`
     */
    get group_id(): string;
    /**
     * @description 群ID
     */
    get groupId(): string;
    get contact(): GroupTempContact;
    get sender(): SenderBase;
    get subEvent(): "groupTemp";
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): true;
}

/**
 * @description 通知事件基类
 * @class NoticeBase
 */
declare abstract class NoticeBase extends BaseEvent<'notice'> {
    #private;
    /** 通知内容str */
    tips: string;
    /** 事件内容 */
    content: unknown;
    constructor({ subEvent, eventId, rawEvent, time, contact, sender, srcReply, bot, }: NoticeOptions);
    get event(): "notice";
    get subEvent(): NoticeEventSub;
}
/**
 * @description 收到点赞事件
 * @class ReceiveLikeNotice
 */
declare class ReceiveLikeNotice extends NoticeBase {
    #private;
    content: ReceiveLikeOptions['content'];
    constructor(options: ReceiveLikeOptions);
    get subEvent(): "receiveLike";
    get contact(): FriendContact;
    get sender(): Sender & SenderBase;
    get isPrivate(): true;
    get isFriend(): true;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 好友增加事件
 * @class FriendIncreaseNotice
 */
declare class FriendIncreaseNotice extends NoticeBase {
    #private;
    content: FriendIncreaseOptions['content'];
    constructor(options: FriendIncreaseOptions);
    get subEvent(): "friendIncrease";
    get contact(): FriendContact;
    get sender(): Sender & SenderBase;
    get isPrivate(): true;
    get isFriend(): true;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 好友减少事件
 * @class FriendDecreaseNotice
 */
declare class FriendDecreaseNotice extends NoticeBase {
    #private;
    content: FriendDecreaseOptions['content'];
    constructor(options: FriendDecreaseOptions);
    get subEvent(): "friendDecrease";
    get contact(): FriendContact;
    get sender(): Sender & SenderBase;
    get isPrivate(): true;
    get isFriend(): true;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 收到私聊戳一戳事件
 * @class PrivatePokeNotice
 */
declare class PrivatePokeNotice extends NoticeBase {
    #private;
    content: PrivatePokeOptions['content'];
    constructor(options: PrivatePokeOptions);
    get subEvent(): "friendPoke";
    get contact(): FriendContact;
    get sender(): Sender & SenderBase;
    get isPrivate(): true;
    get isFriend(): true;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 收到私聊撤回事件
 * @class PrivateRecallNotice
 */
declare class PrivateRecallNotice extends NoticeBase {
    #private;
    content: PrivateRecallOptions['content'];
    constructor(options: PrivateRecallOptions);
    get subEvent(): "friendRecall";
    get contact(): FriendContact;
    get sender(): Sender & SenderBase;
    get isPrivate(): true;
    get isFriend(): true;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 收到私聊文件上传事件
 * @class PrivateFileUploadedNotice
 */
declare class PrivateFileUploadedNotice extends NoticeBase {
    #private;
    content: PrivateFileUploadedOptions['content'];
    constructor(options: PrivateFileUploadedOptions);
    get subEvent(): "privateFileUploaded";
    get contact(): FriendContact;
    get sender(): Sender & SenderBase;
    get isPrivate(): true;
    get isFriend(): true;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
declare class GroupNotice extends NoticeBase {
    /**
     * @deprecated 已经弃用 请使用`groupId`
     */
    get group_id(): string;
    get groupId(): string;
}
/**
 * @description 收到群聊戳一戳事件
 * @class GroupPokeNotice
 */
declare class GroupPokeNotice extends GroupNotice {
    #private;
    content: GroupPokeOptions['content'];
    constructor(options: GroupPokeOptions);
    get subEvent(): "groupPoke";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 收到群聊撤回事件
 * @class GroupRecallNotice
 */
declare class GroupRecallNotice extends GroupNotice {
    #private;
    content: GroupRecallOptions['content'];
    constructor(options: GroupRecallOptions);
    get subEvent(): "groupRecall";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 收到群聊文件上传事件
 * @class GroupFileUploadedNotice
 */
declare class GroupFileUploadedNotice extends GroupNotice {
    #private;
    content: GroupFileUploadedOptions['content'];
    constructor(options: GroupFileUploadedOptions);
    get subEvent(): "groupFileUploaded";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群名片变动事件
 * @class GroupCardChangedNotice
 */
declare class GroupCardChangedNotice extends GroupNotice {
    #private;
    content: GroupCardChangedOptions['content'];
    constructor(options: GroupCardChangedOptions);
    get subEvent(): "groupCardChanged";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群成员头衔变动事件
 * @class GroupMemberTitleUpdatedNotice
 */
declare class GroupMemberTitleUpdatedNotice extends GroupNotice {
    #private;
    content: GroupMemberUniqueTitleChangedOptions['content'];
    constructor(options: GroupMemberUniqueTitleChangedOptions);
    get subEvent(): "groupMemberTitleUpdate";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群精华消息变动事件
 * @class GroupHlightsChangedNotice
 */
declare class GroupHlightsChangedNotice extends GroupNotice {
    #private;
    content: GroupHlightsChangedOptions['content'];
    constructor(options: GroupHlightsChangedOptions);
    get subEvent(): "groupHighlightsChange";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群成员增加事件
 * @class GroupMemberIncreaseNotice
 */
declare class GroupMemberIncreaseNotice extends GroupNotice {
    #private;
    content: GroupMemberIncreaseOptions['content'];
    constructor(options: GroupMemberIncreaseOptions);
    get subEvent(): "groupMemberAdd";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群成员减少事件
 * @class GroupMemberDecreaseNotice
 */
declare class GroupMemberDecreaseNotice extends GroupNotice {
    #private;
    content: GroupMemberDecreaseOptions['content'];
    constructor(options: GroupMemberDecreaseOptions);
    get subEvent(): "groupMemberRemove";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群管理员变动事件
 * @class GroupAdminChangedNotice
 */
declare class GroupAdminChangedNotice extends GroupNotice {
    #private;
    content: GroupAdminChangedOptions['content'];
    constructor(options: GroupAdminChangedOptions);
    get subEvent(): "groupAdminChanged";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群打卡事件
 * @class GroupSignInNotice
 */
declare class GroupSignInNotice extends GroupNotice {
    #private;
    content: GroupSignInOptions['content'];
    constructor(options: GroupSignInOptions);
    get subEvent(): "groupSignIn";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群成员被禁言事件
 * @class GroupMemberBanNotice
 */
declare class GroupMemberBanNotice extends GroupNotice {
    #private;
    content: GroupMemberBanOptions['content'];
    constructor(options: GroupMemberBanOptions);
    get subEvent(): "groupMemberBan";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群全员禁言事件
 * @class GroupWholeBanNotice
 */
declare class GroupWholeBanNotice extends GroupNotice {
    #private;
    content: GroupWholeBanOptions['content'];
    constructor(options: GroupWholeBanOptions);
    get subEvent(): "groupWholeBan";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群表情动态事件
 * @class GroupMessageReactionNotice
 */
declare class GroupMessageReactionNotice extends GroupNotice {
    #private;
    content: GroupMessageReactionOptions['content'];
    constructor(options: GroupMessageReactionOptions);
    get subEvent(): "groupMessageReaction";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群聊运气王事件
 * @class GroupLuckKingNotice
 */
declare class GroupLuckKingNotice extends GroupNotice {
    #private;
    content: GroupLuckKingOptions['content'];
    constructor(options: GroupLuckKingOptions);
    get subEvent(): "groupLuckyKing";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 群聊荣誉变更事件
 * @class GroupHonorChangedNotice
 */
declare class GroupHonorChangedNotice extends GroupNotice {
    #private;
    content: GroupHonorChangedOptions['content'];
    constructor(options: GroupHonorChangedOptions);
    get subEvent(): "groupHonorChange";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description Bot下线事件
 * @class BotOfflineNotice
 */
declare class BotOfflineNotice extends NoticeBase {
    #private;
    content: BotOfflineOptions['content'];
    constructor(options: BotOfflineOptions);
    get subEvent(): "botOffline";
    get contact(): FriendContact;
    get sender(): Sender & SenderBase;
    get isPrivate(): true;
    get isFriend(): true;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}

/**
 * @description 请求事件基类
 * @class RequestBase
 */
declare abstract class RequestBase extends BaseEvent<'request'> {
    #private;
    /** 通知内容str */
    tips: string;
    /** 事件内容 */
    content: unknown;
    constructor({ subEvent, eventId, rawEvent, time, contact, sender, srcReply, bot, }: RequestOptions);
    get event(): "request";
    get subEvent(): RequestEventSub;
}
/**
 * @description 创建好友申请请求事件
 * @class ReceiveLikeNotice
 */
declare class PrivateApplyRequest extends RequestBase {
    #private;
    content: PrivateApplyRequestOptions['content'];
    constructor(options: PrivateApplyRequestOptions);
    get subEvent(): "friendApply";
    get contact(): FriendContact;
    get sender(): Sender & SenderBase;
    get isPrivate(): true;
    get isFriend(): true;
    get isGroup(): false;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 创建入群请求事件
 * @class ReceiveLikeNotice
 */
declare class GroupApplyRequest extends RequestBase {
    #private;
    content: GroupApplyRequestOptions['content'];
    constructor(options: GroupApplyRequestOptions);
    /**
     * @deprecated 已经弃用 请使用`groupId`
     */
    get group_id(): string;
    get groupId(): string;
    get subEvent(): "groupApply";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}
/**
 * @description 创建邀请Bot入群请求事件
 * @class GroupInviteRequest
 */
declare class GroupInviteRequest extends RequestBase {
    #private;
    content: GroupInviteRequestOptions['content'];
    constructor(options: GroupInviteRequestOptions);
    /**
     * @deprecated 已经弃用 请使用`groupId`
     */
    get group_id(): string;
    get groupId(): string;
    get subEvent(): "groupInvite";
    get contact(): GroupContact;
    get sender(): Sender & GroupSender;
    get isPrivate(): false;
    get isFriend(): false;
    get isGroup(): true;
    get isGuild(): false;
    get isDirect(): false;
    get isGroupTemp(): false;
}

/** 消息事件对应的对象类型 */
interface MessageEventMap {
    message: Message;
    'message.group': GroupMessage;
    'message.friend': FriendMessage;
    'message.guild': GuildMessage;
    'message.direct': DirectMessage;
    'message.groupTemp': GroupTempMessage;
}
/** 私聊通知事件对应的对象类型 */
interface FriendNoticeEventMap {
    'notice.receiveLike': ReceiveLikeNotice;
    'notice.friendDecrease': FriendDecreaseNotice;
    'notice.friendIncrease': FriendIncreaseNotice;
    'notice.privatePoke': PrivatePokeNotice;
    'notice.privateRecall': PrivateRecallNotice;
    'notice.privateFileUploaded': PrivateFileUploadedNotice;
    'notice.botOffline': BotOfflineNotice;
}
/** 群聊通知事件对应的对象类型 */
interface GroupNoticeEventMap {
    'notice.groupPoke': GroupPokeNotice;
    'notice.groupRecall': GroupRecallNotice;
    'notice.groupFileUploaded': GroupFileUploadedNotice;
    'notice.groupCardChanged': GroupCardChangedNotice;
    'notice.groupMemberTitleUpdate': GroupMemberTitleUpdatedNotice;
    'notice.groupHighlightsChange': GroupHlightsChangedNotice;
    'notice.groupMemberAdd': GroupMemberIncreaseNotice;
    'notice.groupMemberRemove': GroupMemberDecreaseNotice;
    'notice.groupAdminChanged': GroupAdminChangedNotice;
    'notice.groupSignIn': GroupSignInNotice;
    'notice.groupMemberBan': GroupMemberBanNotice;
    'notice.groupWholeBan': GroupWholeBanNotice;
    'notice.groupMessageReaction': GroupMessageReactionNotice;
    'notice.groupLuckyKing': GroupLuckKingNotice;
    'notice.groupHonorChange': GroupHonorChangedNotice;
}
/** 通知事件对应的对象类型 */
interface NoticeEventMap extends FriendNoticeEventMap, GroupNoticeEventMap {
    notice: Notice;
}
/** 好友请求事件对应的对象类型 */
interface FriendRequestEventMap {
    'request.friendApply': PrivateApplyRequest;
}
/** 群聊请求事件对应的对象类型 */
interface GroupRequestEventMap {
    'request.groupApply': GroupApplyRequest;
    'request.groupInvite': GroupInviteRequest;
}
/** 请求事件对应的对象类型 */
interface RequestEventMap extends FriendRequestEventMap, GroupRequestEventMap {
    request: Request;
}
/**
 * @description 通知事件类型
 */
type Notice = ReceiveLikeNotice | FriendDecreaseNotice | FriendIncreaseNotice | PrivatePokeNotice | PrivateRecallNotice | PrivateFileUploadedNotice | GroupPokeNotice | GroupRecallNotice | GroupFileUploadedNotice | GroupCardChangedNotice | GroupMemberTitleUpdatedNotice | GroupHlightsChangedNotice | GroupMemberIncreaseNotice | GroupMemberDecreaseNotice | GroupAdminChangedNotice | GroupSignInNotice | GroupMemberBanNotice | GroupWholeBanNotice | GroupMessageReactionNotice | GroupLuckKingNotice | GroupHonorChangedNotice | BotOfflineNotice;
/**
 * @description 消息事件类型
 */
type Message = FriendMessage | GroupMessage | DirectMessage | GuildMessage | GroupTempMessage;
/**
 * @description 请求事件类型
 */
type Request = PrivateApplyRequest | GroupApplyRequest | GroupInviteRequest;
/**
 * @description 所有事件类型
 */
type Event = Message | Notice | Request;

/**
 * 权限类型
 * - `all`: 所有人
 * - `master`: 所有者
 * - `admin`: 管理员
 * - `group.owner`: 群主
 * - `group.admin`: 群管理
 * - `guild.owner`: 频道主
 * - `guild.admin`: 频道管理
 */
type Permission = 'all' | 'master' | 'admin' | 'group.owner' | 'group.admin' | 'guild.owner' | 'guild.admin';

/**
 * 执行 shell 命令返回类型
 */
interface ExecType {
    status: boolean;
    error: ExecException | null;
    stderr: string;
    stdout: string;
}
/**
 * 执行 shell 命令返回类型泛型
 */
type ExecReturn<K extends boolean> = K extends true ? boolean : ExecType;
/**
 * 执行 shell 命令参数
 */
type ExecOptions$1<T extends boolean> = Parameters<typeof exec$1>[1] & {
    /** 是否打印日志 默认不打印 */
    log?: boolean;
    /** 是否只返回布尔值 表示命令是否成功执行 优先级比抛错误高 */
    booleanResult?: T;
    /** 是否去除日志中的换行符 默认不去除 */
    trim?: boolean;
};

type Args = {
    e?: Event;
} & Record<string, any>;
type FileToUrlResult<T> = T extends 'image' ? {
    url: string;
    width: number;
    height: number;
} : {
    url: string;
};
/**
 * 文件转换为url类型
 */
type FileToUrlHandler = {
    <T extends 'image' | 'video' | 'record' | 'file'>(
    /** 文件类型 */
    type: T, 
    /** 文件数据 */
    file: string | Buffer | Uint8Array, 
    /** 文件名名称: `image.jpg` */
    filename: string, 
    /** 自定义参数 如果传e记得符合规范 */
    args?: Args): Promise<FileToUrlResult<T>>;
};

/**
 * 动态导入模块成功结果
 */
interface ImportSuccessResult<T = any> {
    status: true;
    data: T;
}
/**
 * 动态导入模块失败结果
 */
interface ImportErrorResult {
    status: false;
    data: unknown;
}
/**
 * 动态导入模块结果
 */
type ImportModuleResult<T = any> = ImportSuccessResult<T> | ImportErrorResult;

/**
 * 适配器基类 一个示例
 * @class AdapterBase
 */
declare abstract class AdapterBase<T = any> implements AdapterType<T> {
    #private;
    account: AdapterType['account'];
    adapter: AdapterType['adapter'];
    super: T;
    raw: T;
    constructor();
    get selfId(): string;
    get selfName(): string;
    selfSubId(key: string): string;
    /**
     * 打印当前Bot的专属日志
     * @param level 日志等级
     * @param args 日志内容
     */
    logger(level: LogMethodNames, ...args: any[]): void;
    /**
     * 发送消息
     * @param _contact 目标信息
     * @param _elements 消息元素
     * @param _retryCount 重试次数 默认为0
     */
    sendMsg(_contact: Contact, _elements: Array<Elements>, _retryCount?: number): Promise<SendMsgResults>;
    /**
     * 发送长消息
     * @param _contact 目标信息
     * @param _resId 资源ID
     */
    sendLongMsg(_contact: Contact, _resId: string): Promise<SendMsgResults>;
    /**
     * 发送合并转发消息
     * @param _contact 目标信息
     * @param _elements 消息元素
     * @param _options 首层小卡片外显参数
     */
    sendForwardMsg(_contact: Contact, _elements: Array<NodeElement>, _options?: ForwardOptions): Promise<{
        messageId: string;
        forwardId: string;
    }>;
    /**
     * 撤回消息
     * @param _contact 目标信息
     * @param _messageId 消息ID
     */
    recallMsg(_contact: Contact, _messageId: string): Promise<void>;
    /**
     * 获取头像url
     * @param _userId 用户ID
     * @param _size 头像大小，默认需要为`0`，请开发者注意
     * @returns 头像的url地址
     */
    getAvatarUrl(_userId: string, _size?: 0 | 40 | 100 | 140): Promise<string>;
    /**
     * 获取群头像url
     * @param _groupId 群号
     * @param _size 头像大小，默认`0`
     * @param _history 历史头像记录，默认`0`，若要获取历史群头像则填写1,2,3...
     * @returns 头像的url地址
     */
    getGroupAvatarUrl(_groupId: string, _size?: 0 | 40 | 100 | 140, _history?: number): Promise<string>;
    /**
     * 获取消息
     * @param _contact 目标信息
     * @param _messageId 消息ID
     * @returns MessageResponse对象
     */
    getMsg(_contact: Contact | string, _messageId?: string): Promise<MessageResponse>;
    /**
     * 获取msgId获取历史消息
     * @param _contact 目标信息
     * @param _startMsgId 起始消息ID
     * @param _count 获取消息数量 默认为1
     * @returns 包含历史消息的数组
     */
    getHistoryMsg(_contact: Contact, _startMsgId: string, _count: number): Promise<Array<MessageResponse>>;
    /**
     * 获取msgSeq获取历史消息
     * @param _contact 目标信息
     * @param _startMsgSeq 起始消息序列号
     * @param _count 获取消息数量 默认为1
     * @returns 包含历史消息的数组
     */
    getHistoryMsg(_contact: Contact, _startMsgSeq: number, _count: number): Promise<Array<MessageResponse>>;
    /**
     * 获取合并转发消息
     * @param _resId 资源ID
     * @returns 包含MessageResponse对象的数组
     */
    getForwardMsg(_resId: string): Promise<Array<MessageResponse>>;
    /**
     * 获取精华消息
     * @param _groupId 群ID
     * @param _page 页码
     * @param _pageSize 每页数量
     * @returns EssenceMessageBody对象
     */
    getGroupHighlights(_groupId: string, _page: number, _pageSize: number): Promise<Array<GetGroupHighlightsResponse>>;
    /**
     * 构造一个资源ID 即上传合并转发消息后不进行发送
     * @param _contact 目标信息
     * @param _elements 转发消息元素
     * @description 此接口并不是所有协议端都支持的，因此在使用时请注意
     */
    createResId(_contact: Contact, _elements: Array<NodeElement>): Promise<string>;
    /**
     * 设置、取消群精华消息
     * @param _groupId 群ID
     * @param _messageId 群消息ID
     * @param _create true为添加精华消息，false为删除精华消息 默认为true
     */
    setGroupHighlights(_groupId: string, _messageId: string, _create: boolean): Promise<void>;
    /**
     * 发送好友赞
     * @param _targetId 目标ID
     * @param _count 赞的次数
     */
    sendLike(_targetId: string, _count: number): Promise<void>;
    /**
     * 群踢人
     * @param _groupId 群ID
     * @param _targetId 被踢出目标的ID 任选其一
     * @param _rejectAddRequest 是否拒绝再次申请，默认为false
     * @param _kickReason 踢出原因，可选
     */
    groupKickMember(_groupId: string, _targetId: string, _rejectAddRequest?: boolean, _kickReason?: string): Promise<void>;
    /**
     * 禁言群成员
     * @param _groupId 群ID
     * @param _targetId 被禁言目标的ID 任选其一
     * @param _duration 禁言时长 单位:秒
     */
    setGroupMute(_groupId: string, _targetId: string, _duration: number): Promise<void>;
    /**
     * 群全员禁言
     * @param _groupId 群ID
     * @param _isBan 是否开启全员禁言
     */
    setGroupAllMute(_groupId: string, _isBan: boolean): Promise<void>;
    /**
     * 设置群管理员
     * @param _groupId 群ID
     * @param _targetId 目标用户的ID
     * @param _isAdmin 是否设置为管理员
     */
    setGroupAdmin(_groupId: string, _targetId: string, _isAdmin: boolean): Promise<void>;
    /**
     * 设置群名片
     * @param _groupId 群ID
     * @param _targetId 目标用户的ID
     * @param _card 新的群名片
     */
    setGroupMemberCard(_groupId: string, _targetId: string, _card: string): Promise<void>;
    /**
     * 设置群名
     * @param _groupId 群ID
     * @param _groupName 新的群名
     */
    setGroupName(_groupId: string, _groupName: string): Promise<void>;
    /**
     * 退出群组
     * @param _groupId 群ID
     * @param _isDismiss 如果Bot是群主，是否解散群
     */
    setGroupQuit(_groupId: string, _isDismiss: boolean): Promise<void>;
    /**
     * 设置群专属头衔 仅群主可用
     * @param _groupId 群ID
     * @param _targetId 目标用户的ID
     * @param _title 新的专属头衔
     */
    setGroupMemberTitle(_groupId: string, _targetId: string, _title: string): Promise<void>;
    /**
     * 获取陌生人信息 此接口数据无法保证完全正确并且无法保证数据的完整性
     * @param _targetId 用户ID 任选其一
     * @returns 陌生人信息数组
     */
    getStrangerInfo(_targetId: string): Promise<UserInfo>;
    /**
     * 获取好友列表
     * @param _refresh 是否刷新好友列表
     * @returns 好友列表数组
     */
    getFriendList(_refresh?: boolean): Promise<Array<UserInfo>>;
    /**
     * 获取群信息
     * @param _groupId 群ID
     * @param _noCache 是否刷新缓存
     * @returns 群信息
     */
    getGroupInfo(_groupId: string, _noCache?: boolean): Promise<GroupInfo>;
    /**
     * 获取群列表
     * @param _refresh 是否刷新好友列表
     * @returns 群列表数组
     */
    getGroupList(_refresh?: boolean): Promise<Array<GroupInfo>>;
    /**
     * 获取群成员信息
     * 此接口在非QQ平台上很难获取到标准信息，因此返回的数据可能会有所不同
     * @param _groupId 群ID
     * @param _targetId 目标用户的ID
     * @param _refresh 是否刷新缓存
     * @returns 群成员信息
     */
    getGroupMemberInfo(_groupId: string, _targetId: string, _refresh?: boolean): Promise<GroupMemberInfo>;
    /**
     * 获取群成员列表
     * @param _groupId 群ID
     * @param _refresh 是否刷新缓存
     * @returns 群成员列表数组
     */
    getGroupMemberList(_groupId: string, _refresh?: boolean): Promise<Array<GroupMemberInfo>>;
    /**
     * 获取群荣誉信息
     * @param _groupId 群ID
     * @param refresh 是否刷新缓存
     * @returns 群荣誉信息数组
     */
    getGroupHonor(_groupId: string): Promise<Array<QQGroupHonorInfo>>;
    /**
     * 设置好友请求结果
     * @param _requestId 请求事件ID
     * @param _isApprove 是否同意
     * @param _remark 好友备注 同意时有效
     */
    setFriendApplyResult(_requestId: string, _isApprove: boolean, _remark?: string): Promise<void>;
    /**
     * 设置申请加入群请求结果
     * @param _requestId 请求事件ID
     * @param _isApprove 是否同意
     * @param _denyReason 拒绝理由 拒绝时有效
     */
    setGroupApplyResult(_requestId: string, _isApprove: boolean, _denyReason?: string): Promise<void>;
    /**
     * 设置邀请加入群请求结果
     * @param _requestId 请求事件ID
     * @param _isApprove 是否同意
     */
    setInvitedJoinGroupResult(_requestId: string, _isApprove: boolean): Promise<void>;
    /**
     * 设置消息表情回应
     * @param _contact 目标信息
     * @param _messageId 消息ID
     * @param _faceId 表情ID
     */
    setMsgReaction(_contact: Contact, _messageId: string, _faceId: number | string, _isSet: boolean): Promise<void>;
    /**
     * 上传群文件、私聊文件
     * @param _contact 目标信息
     * @param _file 本地文件绝对路径
     * @param _name 文件名称 必须提供
     * @param _folder 父目录ID 不提供则上传到根目录 仅在群聊时有效
     */
    uploadFile(_contact: Contact, _file: string, _name: string, _folder?: string): Promise<void>;
    /**
     * 让协议端下载文件到协议端本地
     * @param _options 下载文件的选项
     * @returns 下载文件的绝对路径和文件MD5
     */
    downloadFile(_options?: DownloadFileOptions): Promise<DownloadFileResponse>;
    /**
     * 创建群文件夹
     * @param _groupId 群号
     * @param _name 文件夹名
     * @returns 返回文件夹id和已使用空间
     */
    createGroupFolder(_groupId: string, _name: string): Promise<CreateGroupFolderResponse>;
    /**
     * 重命名群文件的文件夹
     * @param _groupId 群号
     * @param _folderId 文件夹id
     * @param _name 文件夹名
     * @returns 无返回值
     */
    renameGroupFolder(_groupId: string, _folderId: string, _name: string): Promise<boolean>;
    /**
     * 删除群文件的文件夹
     * @param _groupId 群号
     * @param _folderId 文件夹id
     * @returns 无返回值
     */
    delGroupFolder(_groupId: string, _folderId: string): Promise<boolean>;
    /**
     * 上传群文件
     * @description 此接口仅可以在Bot和协议端在同一台设备上时使用
     * @param _groupId 群号
     * @param _file 文件绝对路径
     * @param _name 文件名
     * @returns 无返回值
     */
    uploadGroupFile(_groupId: string, _file: string, _name?: string): Promise<boolean>;
    /**
     * 获取文件url
     * @param _contact 目标信息
     * @param _fileId 文件id
     * @returns 文件url
     */
    getFileUrl(_contact: Contact, _fileId: string): Promise<string>;
    /**
     * 删除群文件
     * @param _groupId 群号
     * @param _fileId 文件id
     * @param _busId 文件类型ID
     * @returns 无返回值
     */
    delGroupFile(_groupId: string, _fileId: string, _busId: number): Promise<boolean>;
    /**
     * 获取群文件系统信息
     * @param _groupId 群号
     * @returns 返回文件数量、文件数量上限、已使用空间和空间上限
     */
    getGroupFileSystemInfo(_groupId: string): Promise<GetGroupFileSystemInfoResponse>;
    /**
     * 获取群文件夹下文件列表
     * @param _groupId 群号
     * @param _folderId 文件夹id，空则为根目录
     * @returns 返回文件和文件夹的列表
     */
    getGroupFileList(_groupId: string, _folderId?: string): Promise<GetGroupFileListResponse>;
    /**
     * 设置群备注
     * @param _groupId 群号
     * @param _remark 新的备注
     */
    setGroupRemark(_groupId: string, _remark: string): Promise<boolean>;
    /**
     * 获取陌生群信息
     * @param _groupId 群号
     */
    getNotJoinedGroupInfo(_groupId: string): Promise<GroupInfo>;
    /**
     * 获取艾特全体成员剩余次数
     * @param _groupId 群号
     * @returns 返回是否允许at全体成员和全群剩余次数、个人剩余次数
     */
    getAtAllCount(_groupId: string): Promise<GetAtAllCountResponse>;
    /**
     * 获取群被禁言用户列表
     * @param _groupId
     * @returns 返回禁言用户列表
     */
    getGroupMuteList(_groupId: string): Promise<Array<GetGroupMuteListResponse>>;
    /**
     * 戳一戳用户 支持群聊和私聊
     * @param _contact 目标信息
     * @param _targetId 被戳用户 ID
     * @param _count 戳一戳次数 默认为1
     */
    pokeUser(_contact: Contact, _targetId: string, _count?: number): Promise<boolean>;
    /**
     * 获取 Cookies
     * @param _domain The domain to get cookies from
     */
    getCookies(_domain: string): Promise<{
        cookie: string;
    }>;
    /**
     * 获取 QQ 相关接口凭证
     * @param _domain The domain to get credentials from
     */
    getCredentials(_domain: string): Promise<{
        cookies: string;
        csrf_token: number;
    }>;
    /**
     * 获取 CSRF Token
     */
    getCSRFToken(): Promise<{
        token: number;
    }>;
    /**
     * 设置头像
     * @param file base64:// file:// http(s)://
     */
    setAvatar(_file: string): Promise<void>;
    /**
     * 获取 rkey
     * @returns rkey
     */
    getRkey(): Promise<Array<GetRkeyResponse>>;
    /**
     * 获取群 Ai 语音可用声色列表
     * @returns 声色列表
     */
    getAiCharacters(): Promise<Array<GetAiCharactersResponse>>;
    /**
     * 设置群 Ai 语音声色
     * @param _groupId 群号
     * @param _characterId 声色ID
     * @param _text 文本
     * @returns 是否设置成功
     */
    sendAiCharacter(_groupId: string, _characterId: string, _text: string): Promise<{
        messageId: string;
    }>;
}

type GetBot = {
    /**
     * 获取指定Bot类
     * @param index 适配器索引
     */
    (index: number): AdapterType | null;
    /**
     * 获取指定Bot类
     * @param protocol 适配器协议实现
     * @param isProtocol 此项是为了区分传入的是BotID还是协议实现
     */
    (protocol: AdapterProtocol, isProtocol: boolean): AdapterType | null;
    /**
     * 获取指定Bot类
     * @param botID 机器人ID
     */
    (botID: string): AdapterType | null;
};
type UnregisterBot = {
    /**
     * @description 通过索引ID卸载Bot
     * @param index 适配器索引
     */
    (type: 'index', index: number): boolean;
    /**
     * @description 通过BotID卸载Bot
     * @param selfId 机器人ID
     */
    (type: 'selfId', selfId: string): boolean;
    /**
     * @description 通过BotID和地址卸载Bot
     * @param type 卸载类型
     * @param selfId 机器人ID
     * @param address 机器人地址
     */
    (type: 'address', selfId: string, address: string): boolean;
};
/**
 * 获取Bot
 * @param id 适配器索引 | 适配器协议实现 | 机器人ID
 * @param isProtocol 此项是为了区分传入的是BotID还是协议实现
 * @returns 适配器
 */
declare const getBot: GetBot;
/**
 * 获取所有Bot类 不包含索引
 * @returns Bot类列表
 */
declare const getAllBot: () => AdapterType<any>[];
/**
 * 获取所有Bot类 包含索引
 * @returns 注册的Bot列表
 */
declare const getAllBotList: () => {
    index: number;
    bot: AdapterType;
}[];
/**
 * 获取所有BotID
 * @returns BotID列表
 */
declare const getAllBotID: () => string[];
/**
 * 获取注册的Bot数量
 * @returns Bot数量
 */
declare const getBotCount: () => number;
/**
 * 卸载Bot
 * @param type 卸载方式
 * @param idOrIndex 适配器索引 | 机器人ID
 * @param address 机器人地址
 */
declare const unregisterBot: UnregisterBot;
/**
 * 注册Bot
 * @param bot 适配器实例
 * @returns 适配器索引
 */
declare const registerBot: (_: AdapterCommunication, bot: AdapterBase) => number;
interface SendMsgOptions$1 {
    /** 发送成功后撤回消息时间 */
    recallMsg?: number;
    /** @deprecated 已废弃 请使用 `retryCount` */
    retry_count?: number;
    /** 重试次数 */
    retryCount?: number;
}
/**
 * 发送主动消息
 * @param selfId Bot的id
 * @param contact 目标信息
 * @param elements 消息内容
 * @param options 消息选项
 */
declare const sendMsg$1: (selfId: string, contact: Contact, elements: SendMessage, options?: SendMsgOptions$1) => Promise<SendMsgResults>;

interface HandlerType<T = any> {
    /**
     * 调用事件处理器
     * @param key - 事件键
     * @param args 自定义参数 如果传递e需要传递标准事件对象
     */
    (key: string, args: {
        [key: string]: any;
        e?: Event;
    }): Promise<T>;
    /**
     * 调用事件处理器
     * @param key - 事件键
     * @param args 自定义参数 如果传递e需要传递标准事件对象
     */
    call<K = any>(key: string, args: {
        [key: string]: any;
        e?: Event;
    }): Promise<K>;
    /**
     * 检查是否存在指定键的事件处理器
     * @param key 事件键
     */
    has(key: string): boolean;
}
/**
 * 事件处理器
 */
declare const handler$1: HandlerType;

/**
 * 任务类型枚举
 * - install: 安装插件
 * - uninstall: 卸载插件
 * - update: 更新插件
 * - disable: 禁用插件
 * - enable: 启用插件
 */
type TaskType = 'install' | 'uninstall' | 'update' | 'disable' | 'enable';
/**
 * 任务状态枚举
 * - pending: 待执行
 * - running: 执行中
 * - success: 成功
 * - failed: 失败
 * - canceled: 已取消
 * - timeout: 超时
 */
type TaskStatus = 'pending' | 'running' | 'success' | 'failed' | 'canceled' | 'timeout';
/**
 * 任务执行器类型
 * @param task - 任务实体
 * @param log - 日志记录函数
 * @returns Promise<boolean> - 执行成功返回true，失败返回false
 */
type TaskExecutor = (task: TaskEntity, log: (message: string) => void) => Promise<boolean>;
/**
 * 任务实体接口
 */
interface TaskEntity {
    /** 任务唯一标识 */
    id: string;
    /** 任务类型 */
    type: TaskType;
    /** 任务名称 */
    name: string;
    /** 目标(插件名/包名/路径) */
    target: string;
    /**
     * 任务状态
     * - pending: 待执行
     * - running: 执行中
     * - success: 成功
     * - failed: 失败
     * - canceled: 已取消
     * - timeout: 超时
     */
    status: TaskStatus;
    /** 完整执行日志 */
    logs: string;
    /** 操作者IP */
    operatorIp: string;
    /** 创建时间戳 */
    createTime: number;
    /** 更新时间戳 */
    updateTime: number;
    /** 结束时间戳(可选) */
    endTime?: number;
}
/**
 * 创建任务参数接口
 */
interface CreateTaskParams {
    /** 任务类型 */
    type: TaskType;
    /** 任务名称 */
    name: string;
    /** 目标(插件名/包名/路径) */
    target: string;
    /** 操作者IP 无需指定，自动获取 */
    operatorIp: string;
    /** 创建时间戳 无需指定，自动获取 */
    createTime?: number;
}
/**
 * 任务回调函数接口
 */
interface TaskCallbacks {
    /** 状态变更回调 */
    onStatusChange?: (status: TaskStatus) => void;
}
/**
 * 添加任务返回结果接口
 */
interface AddTaskResult {
    /** 操作是否成功 */
    success: boolean;
    /** 任务ID(成功时返回) */
    taskId?: string;
    /** 错误信息(失败时返回) */
    message?: string;
    /** 取消订阅函数 */
    unsubscribe?: () => void;
}
/**
 * 任务查询过滤器接口
 */
interface TaskFilter {
    /** 任务类型过滤 */
    type?: TaskType;
    /** 任务状态过滤 */
    status?: TaskStatus | TaskStatus[];
    /** 任务名称过滤 */
    name?: string;
    /** 操作者IP过滤 */
    operatorIp?: string;
    /** 限制获取数量，返回最新的N条记录 */
    limit?: number;
}
/**
 * 前端请求插件安装参数接口
 */
type CreateTask = Omit<CreateTaskParams, 'createTime' | 'operatorIp'>;
/**
 * 创建任务成功 返回任务ID
 */
type CreateTaskResult = {
    /** 操作成功 */
    success: true;
    /** 任务ID */
    taskId: string;
    /** 提示信息 */
    message: string;
} | {
    /** 操作失败 */
    success: false;
    /** 错误信息 */
    message: string;
};

type TaskDB = {
    db: Database;
};
/**
 * 创建新任务
 * @param taskDB - 数据库连接对象
 * @param taskParams - 任务参数
 * @returns - 返回任务ID
 */
declare const taskAdd: (taskDB: TaskDB, taskParams: CreateTaskParams) => Promise<string>;
/**
 * 更新任务状态
 * @param taskDB - 数据库连接对象
 * @param taskId - 任务ID
 * @param status - 新状态
 * @returns - 操作是否成功
 */
declare const taskUpdateStatus: (taskDB: TaskDB, taskId: string, status: TaskStatus) => Promise<boolean>;
/**
 * 更新任务日志
 * @param taskDB - 数据库连接对象
 * @param taskId - 任务ID
 * @param logs - 完整日志内容
 * @returns - 操作是否成功
 */
declare const taskUpdateLogs: (taskDB: TaskDB, taskId: string, logs: string) => Promise<boolean>;
/**
 * 获取单个任务详情
 * @param taskDB - 数据库连接对象
 * @param taskId - 任务ID
 * @returns - 任务详情或null
 */
declare const taskGet: (taskDB: TaskDB, taskId: string) => Promise<TaskEntity | null>;
/**
 * 获取任务列表
 * @param taskDB - 数据库连接对象
 * @param filter - 任务过滤条件
 * @returns - 任务列表
 */
declare const taskList: (taskDB: TaskDB, filter?: TaskFilter) => Promise<TaskEntity[]>;
/**
 * 检查是否存在相同类型和目标的任务
 * @param taskDB - 数据库连接对象
 * @param type - 任务类型
 * @param target - 目标
 * @param statuses - 状态列表
 * @returns - 是否存在
 */
declare const taskExists: (taskDB: TaskDB, type: TaskType, target: string, statuses: TaskStatus[]) => Promise<boolean>;
/**
 * 设置全局任务数据库实例
 * @param db - 任务数据库实例
 */
declare const setTaskDatabase: (db: TaskDB) => void;
/**
 * 获取全局任务数据库实例
 * @returns TaskDB | null - 任务数据库实例或null
 */
declare const getTaskDatabase: () => TaskDB | null;
/**
 * 更新任务状态
 * @param taskId - 任务ID
 * @param status - 新状态
 * @returns - 操作是否成功
 */
declare const updateTaskStatus: (taskId: string, status: TaskStatus) => Promise<boolean>;
/**
 * 更新任务日志
 * @param taskId - 任务ID
 * @param logs - 完整日志内容
 * @returns - 操作是否成功
 */
declare const updateTaskLogs: (taskId: string, logs: string) => Promise<boolean>;
/**
 * 扩展后的创建任务数据库函数
 */
declare const createTaskDatabase: (dbPath: string) => Promise<{
    /**
     * 添加任务
     * @param params - 任务参数
     * @param executor - 任务执行回调函数
     * @returns 任务ID
     */
    add: (params: CreateTaskParams, executor?: TaskExecutor) => Promise<string>;
    /**
     * 获取任务详情
     * @param taskId - 任务ID
     * @returns 任务详情
     */
    get: (taskId: string) => Promise<TaskEntity | null>;
    /**
     * 获取任务列表
     * @param filter - 过滤条件
     * @returns 任务列表
     */
    list: (filter?: TaskFilter) => Promise<TaskEntity[]>;
    /**
     * 获取所有任务列表
     * @returns 所有任务列表
     */
    all: () => Promise<TaskEntity[]>;
    /**
     * 获取任务日志
     * @param taskId - 任务ID
     * @returns 任务日志内容
     */
    logs: (taskId: string) => Promise<string | null>;
    /**
     * 取消任务
     * @param taskId - 任务ID
     * @returns 是否成功
     */
    cancel: (taskId: string) => Promise<boolean>;
    /**
     * 删除任务
     * @param taskId - 任务ID
     * @returns 是否成功
     */
    delete: (taskId: string) => Promise<boolean>;
    /**
     * 检查是否存在相同类型和目标的任务
     * @param type - 任务类型
     * @param target - 目标
     * @param statuses - 状态列表
     * @returns 是否存在
     */
    exists: (type: TaskType, target: string, statuses: TaskStatus[]) => Promise<boolean>;
    /**
     * 更新任务状态
     * @param taskId - 任务ID
     * @param status - 新状态
     * @returns 是否成功
     */
    update: {
        status: (taskId: string, status: TaskStatus) => Promise<boolean>;
        /**
         * 更新任务日志
         * @param taskId - 任务ID
         * @param logs - 完整日志内容
         * @returns 是否成功
         */
        logs: (taskId: string, logs: string) => Promise<boolean>;
    };
    /**
     * 运行任务
     * @param taskId - 任务ID
     * @param onLog - 日志回调函数
     * @param onStatusChange - 状态变更回调函数
     * @returns 是否成功
     */
    run: (taskId: string, onLog?: (log: string) => void, onStatusChange?: (status: TaskStatus) => void) => Promise<boolean>;
}>;

/**
 * 设置任务回调函数
 * @param taskId - 任务ID
 * @param executor - 任务执行函数
 */
declare const setTaskCallback: (taskId: string, executor: TaskExecutor) => void;
/**
 * 获取任务回调函数
 * @param taskId - 任务ID
 * @returns 对应任务的执行函数，如果未找到返回undefined
 */
declare const getTaskCallback: (taskId: string) => TaskExecutor | undefined;
/**
 * 删除任务回调函数
 * @param taskId - 任务ID
 * @returns 是否成功删除
 */
declare const removeTaskCallback: (taskId: string) => boolean;
/**
 * 执行任务
 * @param task - 任务实体
 * @param emitLog - 日志回调
 * @param emitStatus - 状态回调
 * @returns 执行是否成功的Promise
 */
declare const executeTask: (task: TaskEntity, emitLog: (log: string) => void, emitStatus: (status: TaskStatus) => void) => Promise<boolean>;

/**
 * 任务系统对象
 */
declare let taskSystem: Awaited<ReturnType<typeof createTaskDatabase>>;
/**
 * 初始化任务系统
 * @param dbPath - 数据库路径
 * @returns 任务系统实例
 */
declare const initTaskSystem: (dbPath: string) => Promise<{
    add: (params: CreateTaskParams, executor?: TaskExecutor) => Promise<string>;
    get: (taskId: string) => Promise<TaskEntity | null>;
    list: (filter?: TaskFilter) => Promise<TaskEntity[]>;
    all: () => Promise<TaskEntity[]>;
    logs: (taskId: string) => Promise<string | null>;
    cancel: (taskId: string) => Promise<boolean>;
    delete: (taskId: string) => Promise<boolean>;
    exists: (type: TaskType, target: string, statuses: TaskStatus[]) => Promise<boolean>;
    update: {
        status: (taskId: string, status: TaskStatus) => Promise<boolean>;
        logs: (taskId: string, logs: string) => Promise<boolean>;
    };
    run: (taskId: string, onLog?: (log: string) => void, onStatusChange?: (status: TaskStatus) => void) => Promise<boolean>;
}>;

type Option = {
    label: string;
    value: string | number;
    disabled?: boolean;
};
/** 组件类型 */
type FieldType = 'text' | 'number' | 'switch' | 'select' | 'object' | 'divider' | 'array' | 'objectArray' | 'colorPicker' | 'radio' | 'checkbox' | 'section' | 'title';
/** 值类型 */
type ValueType = 'string' | 'number' | 'boolean' | 'object';
interface BaseField {
    /** 组件类型 */
    type: FieldType;
    /** 字段 */
    key: string;
    /** 显示文本 */
    label?: string;
    /** 是否必填 */
    required?: boolean;
    /** 描述 */
    description?: string;
}
/** 文本组件 */
interface TextField extends BaseField {
    type: 'text';
    /** 默认值 */
    defaultValue?: string;
}
/** 数字输入框 */
interface NumberField extends BaseField {
    type: 'number';
    /** 默认值 */
    defaultValue?: number;
}
/** 开关 */
interface SwitchField extends BaseField {
    type: 'switch';
    /** 默认值 */
    defaultValue?: boolean;
}
/** 下拉框选择器 */
interface SelectField extends BaseField {
    type: 'select';
    /** 是否多选 */
    multiple?: boolean;
    /** 选项 */
    options?: Option[];
    /** 默认值 */
    defaultValue?: string | number;
}
/** 分隔符 */
interface DividerField extends BaseField {
    type: 'divider';
}
/** 单选框 */
interface RadioField extends BaseField {
    type: 'radio';
    /** 选项 */
    options: Option[];
    /** 默认值 */
    defaultValue?: string | number;
}
/** 多选框 */
interface CheckboxField extends BaseField {
    type: 'checkbox';
    /** 选项 */
    options: Option[];
    /** 默认值 */
    defaultValue?: string[] | number[];
}
/** 数组 */
interface ArrayField extends BaseField {
    type: 'array';
    /** 值类型 */
    elementType: 'text' | 'number';
    /** 默认值 */
    defaultValue?: string | number;
}
/** 对象 */
interface ObjectField extends BaseField {
    type: 'object';
    /** 子组件配置 */
    fields: FormField[];
}
/** 对象数组 */
interface ObjectArrayField extends BaseField {
    type: 'objectArray';
    /** 子组件配置 */
    fields: FormField[];
}
/** 分组 */
interface SectionField extends BaseField {
    type: 'section';
    /** 子组件 */
    children: FormField[];
}
/** 标题 */
interface TitleField extends BaseField {
    type: 'title';
    /** 显示文本 */
    text: string;
}
/** 组件 */
type FormField = TextField | NumberField | SwitchField | SelectField | RadioField | CheckboxField | ArrayField | ObjectField | ObjectArrayField | SectionField | TitleField | DividerField;
/**
 * 输入框返回类型
 */
type InputResult = Record<string, string | undefined>;
/**
 * 开关返回类型
 */
type SwitchResult = Record<string, boolean>;
/**
 * 单选框返回类型
 */
type RadioResult = Record<string, string | undefined>;
/**
 * 多选框返回类型
 */
type CheckboxResult = Record<string, Record<string, boolean>>;
/**
 * 手风琴kv类型
 */
type AccordionKV = string | boolean | Record<string, boolean>;
/**
 * 手风琴返回类型
 */
type AccordionResult = Record<string, AccordionKV[]>;
/**
 * 手风琴pro返回类型
 */
type AccordionProResult = AccordionResult;
/**
 * save 方法返回的类型
 */
type SaveResult = InputResult | SwitchResult | RadioResult | CheckboxResult | AccordionResult | AccordionProResult;

/**
 * 组件类型
 * - input: 输入框
 * - switch: 开关
 * - divider: 分隔线
 * - accordion: 手风琴
 * - accordion-item: 手风琴项
 * - accordion-pro: 手风琴Pro
 * - checkbox: 复选框
 * - checkbox-group: 复选框组
 * - radio: 单选框
 * - radio-group: 单选框组
 * - select: 下拉选择框
 * - select-item: 下拉选项
 */
type ComponentType = 'input' | 'switch' | 'divider' | 'accordion' | 'accordion-item' | 'accordion-pro' | 'checkbox' | 'checkbox-group' | 'radio' | 'radio-group' | 'input-group' | 'cron' | 'select' | 'select-item';
/** 组件通用属性 */
interface ComponentProps {
    /** 唯一标识符 */
    key: string;
    /** 组件类型 */
    componentType: ComponentType;
    /** 描述 */
    description?: string;
    /** 每个渲染的组件都包裹了一个div，这里可以自定义这个div的className */
    className?: string;
    /** 组件本身的className */
    componentClassName?: string;
}

/**
 * 验证规则接口
 */
interface ValidationRule {
    /** 正则表达式 */
    regex?: string | RegExp;
    /** 最小长度 */
    minLength?: number;
    /** 最大长度 */
    maxLength?: number;
    /** 最小值 */
    min?: number;
    /** 最大值 */
    max?: number;
    /** 自定义错误消息 */
    error?: string;
}
/**
 * 输入框类型
 */
interface InputProps extends ComponentProps {
    componentType: 'input';
    /**
     * 输入框的样式
     * - flat: 扁平化
     * - bordered: 带边框
     * - underlined: 带下划线
     * - faded: 渐入
     */
    variant?: 'flat' | 'bordered' | 'underlined' | 'faded';
    /**
     * 颜色
     * - default: 默认
     * - primary: 主色
     * - secondary: 次色
     * - success: 成功
     * - warning: 警告
     * - danger: 危险
     */
    color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
    /**
     * 大小
     * - sm: 小
     * - md: 中
     * - lg: 大
     */
    size?: 'sm' | 'md' | 'lg';
    /**
     * 圆角
     * - none: 无
     * - sm: 小
     * - md: 中
     * - lg: 大
     * - full: 全
     */
    radius?: 'none' | 'sm' | 'md' | 'lg' | 'full';
    /** 标签 */
    label?: string;
    /** 值 */
    value?: string;
    /** 默认值 */
    defaultValue?: string;
    /** 提示信息 */
    placeholder?: string;
    /** 错误信息 */
    errorMessage?: string;
    /** 验证行为 */
    validationBehavior?: 'native' | 'aria';
    /** 最小长度 */
    minLength?: number;
    /** 最大长度 */
    maxLength?: number;
    /** 模式 */
    pattern?: string;
    /** 类型 */
    type?: 'text' | 'email' | 'url' | 'password' | 'tel' | 'search' | 'file' | 'number';
    /** 开始内容 */
    startContent?: string;
    /** 结束内容 */
    endContent?: string;
    /** 标签位置 */
    labelPlacement?: 'inside' | 'outside' | 'outside-left' | 'outside-top';
    /** 是否全宽 */
    fullWidth?: boolean;
    /** 是否可清除 */
    isClearable?: boolean;
    /** 是否必填 */
    isRequired?: boolean;
    /** 是否只读 */
    isReadOnly?: boolean;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否无效 */
    isInvalid?: boolean;
    /** 禁用动画 */
    disableAnimation?: boolean;
    /** 自定义字段 验证规则 */
    rules?: ValidationRule[];
    /** 自定义字段 输入框宽度 */
    width?: string;
    /** 自定义字段 输入框高度 */
    height?: string;
    /** 自动补全 */
    autoComplete?: string;
}
/**
 * 输入框组类型
 */
interface InputGroupProps extends ComponentProps {
    componentType: 'input-group';
    /** 标签 */
    label?: string;
    /** 输入框模板 */
    template: InputProps;
    /** 数据 */
    data: string[];
    /** 输入框一行最多显示多少个 默认3个 */
    itemsPerRow?: number;
    /** 输入框最大显示多少行 超出后滚动 默认3行 */
    maxRows?: number;
    /** 输入框最大输入框数量 默认100 0不限制 */
    maxInputs?: number;
    /** 删除输入框提示 默认: 删除成功 */
    deleteSuccessTips?: string;
}

/**
 * 分隔线
 */
interface DividerProps extends ComponentProps {
    componentType: 'divider';
    /** 是否透明 */
    transparent?: boolean;
    /** 方向 */
    orientation?: 'horizontal' | 'vertical';
    /** 描述文本位置 0-100的数字 */
    descPosition?: number;
}

/**
 * 开关类型
 */
interface SwitchProps extends ComponentProps {
    componentType: 'switch';
    /** 开始文本 */
    startText?: string;
    /** 结束文本 */
    endText?: string;
    /** 大小 */
    size?: 'sm' | 'md' | 'lg';
    /** 颜色 */
    color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
    /** 开关图标 */
    thumbIcon?: string;
    /** 切换开始时显示的图标 */
    startContent?: string;
    /** 切换结束时显示的图标 */
    endContent?: string;
    /** 输入是否可以被用户选择但不能被更改 */
    isSelected?: boolean;
    /** 默认选中 */
    defaultSelected?: boolean;
    /** 是否只读 */
    isReadOnly?: boolean;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否禁用动画 */
    disableAnimation?: boolean;
    /** 标签 */
    label?: string;
}

/**
 * Cron表达式编辑器组件属性
 */
interface CronProps extends ComponentProps {
    componentType: 'cron';
    /** defaultValue */
    defaultValue?: string;
}

/**
 * 单选框组
 */
interface RadioGroupProps extends ComponentProps {
    componentType: 'radio-group';
    /** 标签 */
    label?: string;
    /** 复选框的大小 */
    size?: 'sm' | 'md' | 'lg';
    /** 复选框的颜色 */
    color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
    /** 方向 */
    orientation?: 'horizontal' | 'vertical';
    /** 提交 HTML 表单时使用的 checkbox 元素的名称 */
    name?: string;
    /** 值 */
    value?: string;
    /** 默认值 */
    defaultValue?: string;
    /** 错误信息 */
    errorMessage?: string;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否必填 */
    isRequired?: boolean;
    /** 是否只读 */
    isReadOnly?: boolean;
    /** 是否无效 */
    isInvalid?: boolean;
    /** 禁用动画 */
    disableAnimation?: boolean;
    /** 单选框列表 */
    radio: Radio[];
}
/**
 * 单选框
 */
interface Radio extends ComponentProps {
    componentType: 'radio';
    /** 值 */
    value: string;
    /** 标签 */
    label?: string;
    /** 大小 */
    size?: 'sm' | 'md' | 'lg';
    /** 颜色 */
    color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
    /** 描述 */
    description?: string;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否必填 */
    isRequired?: boolean;
    /** 是否只读 */
    isReadOnly?: boolean;
    /** 是否无效 */
    isInvalid?: boolean;
    /** 禁用动画 */
    disableAnimation?: boolean;
}

/**
 * 复选框组
 */
interface CheckboxGroupProps extends ComponentProps {
    componentType: 'checkbox-group';
    /** 方向 垂直或水平 默认水平 */
    orientation?: 'vertical' | 'horizontal';
    /** 颜色 */
    color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
    /** 大小 */
    size?: 'sm' | 'md' | 'lg';
    /** 半径 */
    radius?: 'none' | 'sm' | 'md' | 'lg' | 'full';
    /** 名称 */
    name?: string;
    /** 标签 */
    label?: string;
    /** 值 */
    value?: string[];
    /** 是否划线 */
    lineThrough?: boolean;
    /** 默认值 */
    defaultValue?: string[];
    /** 是否无效 */
    isInvalid?: boolean;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否必填 */
    isRequired?: boolean;
    /** 是否只读 */
    isReadOnly?: boolean;
    /** 禁用动画 */
    disableAnimation?: boolean;
    /** 选项列表 */
    checkbox: CheckboxProps[];
}
/**
 * 复选框
 */
interface CheckboxProps extends ComponentProps {
    componentType: 'checkbox';
    /** 值 */
    value?: string;
    /** 标签 */
    label?: string;
    /** 提交 HTML 表单时使用的 checkbox 元素的名称 */
    name?: string;
    /** 复选框的大小 */
    size?: 'sm' | 'md' | 'lg';
    /** 复选框的颜色 */
    color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
    /**
     * 复选框的半径
     * - none: 无
     * - sm: 小
     * - md: 中
     * - lg: 大
     * - full: 全
     */
    radius?: 'none' | 'sm' | 'md' | 'lg' | 'full';
    /** 是否划线 */
    lineThrough?: boolean;
    /** 是否选中 */
    isSelected?: boolean;
    /** 默认选中 */
    defaultSelected?: boolean;
    /** 是否必填 */
    isRequired?: boolean;
    /** 是否只读 */
    isReadOnly?: boolean;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 不确定性只是呈现性的。无论用户是否进行交互，不确定的视觉呈现都会保持不变 */
    isIndeterminate?: boolean;
    /** 是否无效 */
    isInvalid?: boolean;
    /** 禁用动画 */
    disableAnimation?: boolean;
}

/**
 * 下拉选择框
 */
interface SelectProps extends ComponentProps {
    componentType: 'select';
    /** 标签 */
    label?: string;
    /** 占位符 */
    placeholder?: string;
    /** 描述 */
    description?: string;
    /** 大小 */
    size?: 'sm' | 'md' | 'lg';
    /** 颜色 */
    color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
    /** 变体 */
    variant?: 'flat' | 'bordered' | 'faded' | 'underlined';
    /** 半径 */
    radius?: 'none' | 'sm' | 'md' | 'lg' | 'full';
    /** 标签位置 */
    labelPlacement?: 'inside' | 'outside' | 'outside-left';
    /** 默认值 */
    defaultValue?: string;
    /** 值 */
    value?: string;
    /** 错误信息 */
    errorMessage?: string;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否必填 */
    isRequired?: boolean;
    /** 是否只读 */
    isReadOnly?: boolean;
    /** 是否无效 */
    isInvalid?: boolean;
    /** 禁用动画 */
    disableAnimation?: boolean;
    /** 是否可清除 */
    isClearable?: boolean;
    /** 是否加载中 */
    isLoading?: boolean;
    /** 是否打开 */
    isOpen?: boolean;
    /** 选择模式 */
    selectionMode?: 'single' | 'multiple';
    /** 禁用的键 */
    disabledKeys?: string[];
    /** 开始内容 */
    startContent?: any;
    /** 结束内容 */
    endContent?: any;
    /** 选择器图标 */
    selectorIcon?: any;
    /** 禁用选择器图标旋转 */
    disableSelectorIconRotation?: boolean;
    /** 显示滚动指示器 */
    showScrollIndicators?: boolean;
    /** 滚动阴影属性 */
    scrollShadowProps?: {
        isEnabled?: boolean;
        hideScrollBar?: boolean;
        offset?: number;
        orientation?: 'horizontal' | 'vertical';
        size?: number;
    };
    /** 是否虚拟化，默认true */
    isVirtualized?: boolean;
    /** 最大列表框高度 */
    maxListboxHeight?: number;
    /** 项目高度 */
    itemHeight?: number;
    /** 自定义渲染值函数 */
    renderValue?: (items: SelectItem[]) => any;
    /** 下拉选项列表 */
    items: SelectItem[];
}
/**
 * 下拉选项
 */
interface SelectItem extends ComponentProps {
    componentType: 'select-item';
    /** 值 */
    value: string;
    /** 标签 */
    label?: string;
    /** 描述 */
    description?: string;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 开始内容 */
    startContent?: {
        type: 'image' | 'text';
        value: string;
    };
    /** 结束内容 */
    endContent?: {
        type: 'image' | 'text';
        value: string;
    };
    /** 文本值 */
    textValue?: string;
}

type Children = InputProps | SwitchProps | DividerProps | CheckboxProps | CheckboxGroupProps | RadioGroupProps | InputGroupProps | SelectProps;
/** 组件配置类型 */
type ComponentConfig = InputProps | SwitchProps | RadioGroupProps | CheckboxGroupProps | AccordionProps | AccordionProProps | AccordionItemProps | DividerProps | InputGroupProps | CronProps | SelectProps;

/**
 * 手风琴(折叠面板) 类型
 */
interface Accordion extends ComponentProps {
    /** 标签 */
    label?: string;
    /** 子组件 */
    children?: AccordionItemProps[];
    /** 标题 */
    title?: string;
    /**
     * 样式
     * - light: 浅色
     * - shadow: 阴影
     * - bordered: 边框
     * - splitted: 分割
     */
    variant?: 'light' | 'shadow' | 'bordered' | 'splitted';
    /**
     * 选择模式
     * - none: 无
     * - single: 单选
     * - multiple: 多选
     */
    selectionMode?: 'none' | 'single' | 'multiple';
    /**
     * 选择行为
     * - toggle: 切换
     * - replace: 替换
     */
    selectionBehavior?: 'toggle' | 'replace';
    /** 是否所有 Accordion 项目都应缩小 */
    isCompact?: boolean;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否在每个手风琴项目的底部显示分隔线 */
    showDivider?: boolean;
    /** 是否隐藏指示器 */
    hideIndicator?: boolean;
    /** 是否禁用动画 */
    disableAnimation?: boolean;
    /** 是否禁用指示器动画 */
    disableIndicatorAnimation?: boolean;
    /** 是否不允许空选择 */
    disallowEmptySelection?: boolean;
    /** 是否保持内容挂载 */
    keepContentMounted?: boolean;
    /** 是否全宽 */
    fullWidth?: boolean;
    /** 禁用的键 */
    disabledKeys?: string[];
    /** 选中项 */
    selectedKeys?: string[];
    /** 默认选中项 */
    defaultSelectedKeys?: string[];
}
/**
 * 手风琴子组件类型 `也就是每一项手风琴`
 */
interface AccordionItemProps extends ComponentProps {
    componentType: 'accordion-item';
    /** 子组件 */
    children: Children[];
    /** 标题 */
    title?: string;
    /** 副标题 */
    subtitle?: string;
    /** 折叠项展开指示器，通常为箭头图标 */
    indicator?: boolean;
    /** 折叠项开始内容，通常是图标或头像 */
    /** 折叠项结束内容，通常是图标或头像 */
    /** 用于修改 framer 运动动画的 props。使用 variants API 创建您自己的动画 */
    /** 是否紧凑模式 */
    isCompact?: boolean;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 关闭时是否保持挂载 AccordionItem 内容 */
    keepContentMounted?: boolean;
    /** 是否隐藏 AccordionItem 指示器 */
    hideIndicator?: boolean;
    /** 是否禁用 AccordionItem 动画 */
    disableAnimation?: boolean;
    /** 是否禁用 AccordionItem 指示器动画 */
    disableIndicatorAnimation?: boolean;
}
/** 手风琴 */
interface AccordionProps extends Accordion {
    componentType: 'accordion';
}
/**
 * 手风琴Pro
 */
interface AccordionProProps extends Omit<Accordion, 'children'> {
    componentType: 'accordion-pro';
    /** 渲染数据 */
    data: Record<string, any>[];
    /** 子组件 pro只有一个 因为是模板 */
    children: Omit<AccordionItemProps, 'componentType'>;
}

/**
 * `pm2.json` 类型
 */
interface PM2 {
    /** 日志最多显示多少行 */
    lines: number;
    /** pm2配置 */
    apps: Array<{
        /** 应用名称 */
        name: string;
        /** 入口文件 */
        script: string;
        /** 自动重启 */
        autorestart: boolean;
        /** 最大重启次数 */
        max_restarts: number;
        /** 最大内存重启 */
        max_memory_restart: string;
        /** 重启延迟 */
        restart_delay: number;
        /** 合并日志 */
        merge_logs: boolean;
        /** 错误日志路径 */
        error_file: string;
        /** 输出日志路径 */
        out_file: string;
    }>;
}

/**
 * `redis.json` 类型
 */
type Redis = RedisClientOptions;

/**
 * `config.json` 类型
 */
interface Config {
    /** 主人列表 */
    master: string[];
    /** 管理员列表 */
    admin: string[];
    /** 用户管理 */
    user: {
        /** 用户白名单 */
        enable_list: string[];
        /** 用户黑名单 */
        disable_list: string[];
    };
    /** 好友管理 */
    friend: {
        /** 是否启用好友消息事件 */
        enable: boolean;
        /** 好友白名单 */
        enable_list: string[];
        /** 好友黑名单 */
        disable_list: string[];
        /** 好友日志白名单 */
        log_enable_list: string[];
        /** 好友日志黑名单 */
        log_disable_list: string[];
    };
    /** 群管理 */
    group: {
        /** 是否启用群消息事件 */
        enable: boolean;
        /** 群白名单 */
        enable_list: string[];
        /** 群黑名单 */
        disable_list: string[];
        /** 群日志白名单 */
        log_enable_list: string[];
        /** 群日志黑名单 */
        log_disable_list: string[];
    };
    /** 频道私信管理 */
    directs: {
        /** 是否启用私信消息事件 */
        enable: boolean;
        /** 私信白名单 */
        enable_list: string[];
        /** 私信黑名单 */
        disable_list: string[];
        /** 私信日志白名单 */
        log_enable_list: string[];
        /** 私信日志黑名单 */
        log_disable_list: string[];
    };
    /** 频道管理 */
    guilds: {
        /** 是否启用频道消息事件 */
        enable: boolean;
        /** 频道白名单 */
        enable_list: string[];
        /** 频道黑名单 */
        disable_list: string[];
        /** 频道日志白名单 */
        log_enable_list: string[];
        /** 频道日志黑名单 */
        log_disable_list: string[];
    };
    /** 子频道消息管理 */
    channels: {
        /** 是否启用子频道消息事件 */
        enable: boolean;
        /** 子频道白名单 */
        enable_list: string[];
        /** 子频道黑名单 */
        disable_list: string[];
        /** 子频道日志白名单 */
        log_enable_list: string[];
        /** 子频道日志黑名单 */
        log_disable_list: string[];
    };
}

/**
 * adapter.json 类型
 */
interface Adapters {
    /** `console`适配器配置 */
    console: {
        /** 是否为只允许本地访问 */
        isLocal: boolean;
        /** 如果`isLocal`为`false`，则需要设置`token` */
        token: string;
        /** 打印的资源地址 */
        host: string;
    };
    /** onebot适配器配置 */
    onebot: {
        /** ws服务器的鉴权令牌 也就是反向ws的token */
        ws_server: {
            /** 是否启用 */
            enable: boolean;
            /** onebot发送请求超时时间 */
            timeout: number;
        };
        /** 正向ws的配置 */
        ws_client: {
            /** 是否启用 */
            enable: boolean;
            /** 正向ws的地址 */
            url: string;
            /** 正向ws的鉴权令牌 */
            token: string;
        }[];
        /** http服务器的配置 */
        http_server: {
            /** 是否启用 */
            enable: boolean;
            /** 正向http的QQ号 */
            self_id: string;
            /** http服务的地址 */
            url: string;
            /** @deprecated http服务的鉴权令牌  */
            token: string;
            /** 用于发送Api请求的鉴权Token 如果协议端没有设置无需填写 */
            api_token: string;
            /** 用于验证请求合法的Token 如果协议端没有设置无需填写 */
            post_token: string;
        }[];
    };
}

/**
 * render.json 类型
 */
interface Renders$1 {
    /** ws服务器配置`反向ws` */
    ws_server: {
        /** 是否启用 */
        enable: boolean;
    };
    /** ws客户端配置`正向ws` */
    ws_client: {
        /** 是否启用 */
        enable: boolean;
        /** 地址 */
        url: string;
        /** 令牌 */
        token: string;
        /** 是否为snapka */
        isSnapka: boolean;
        /** 重连时间 单位毫秒 默认5000 */
        reconnectTime?: number;
        /** 心跳时间 单位毫秒 默认30000 */
        heartbeatTime?: number;
    }[];
    /** http服务器配置`反向http` */
    http_server: {
        /** 是否启用 */
        enable: boolean;
        /** 地址 */
        url: string;
        /** 令牌 */
        token: string;
        /** 是否为snapka */
        isSnapka: boolean;
    }[];
}

/**
 * `package.json` 类型
 */
interface Package {
    /** 包名 */
    name: string;
    /** 版本 */
    version: string;
    /** 是否私有 */
    private: boolean;
    /** 描述 */
    description: string;
    /** 主页 */
    homepage: string;
    /** bug地址 */
    bugs: {
        /** bug地址 */
        url: string;
    };
    /** 仓库 */
    repository: {
        /** 仓库类型 */
        type: string;
        /** 仓库地址 */
        url: string;
    };
    /** 开源协议 */
    license: string;
    /** 作者 */
    author: string;
    /** 语法环境 */
    type: 'module';
    /** 导出 */
    exports: Record<string, {
        /** 导入 */
        import: string;
        /** require */
        require: string;
        /** 类型 */
        types: string;
    }>;
    /** 入口文件 */
    main: string;
    /** 类型文件 */
    types: string;
    /** bin */
    bin: Record<string, string>;
    /** npm文件 */
    files: string[];
    /** 工作区 */
    workspaces: string[];
    /** 脚本 */
    scripts: Record<string, string>;
    /** 依赖 */
    dependencies: Record<string, string>;
    /** 开发依赖 */
    devDependencies: Record<string, string>;
    /** peer依赖 */
    peerDependencies: Record<string, string>;
    /** @deprecated 请使用 engines.karin 代替 */
    engines: Record<string, string>;
    /** 发布配置 */
    publishConfig: {
        /** 访问 */
        access: string;
        /** 注册 */
        registry: string;
    };
}

/**
 * `groups.json`中的配置类型
 */
interface GroupsObjectValue {
    /** 配置键: `Bot:selfId:groupId` */
    key: string;
    /** 是否继承全局配置 默认`true` */
    inherit: boolean;
    /** 群聊、频道中所有消息冷却时间，单位秒，0则无限制 */
    cd: number;
    /** 群聊、频道中 每个人的消息冷却时间，单位秒，0则无限制。注意，开启后所有消息都会进CD，无论是否触发插件。 */
    userCD: number;
    /** 机器人响应模式，0-所有 1-仅@机器人 2-仅回应管理员 3-仅回应别名 4-别名或@机器人 5-管理员无限制，成员别名或@机器人 6-仅回应主人 */
    mode: 0 | 1 | 2 | 3 | 4 | 5 | 6;
    /** 机器人别名 设置后别名+指令触发机器人 */
    alias: string[];
    /** 白名单插件、功能，只有在白名单中的插件、功能才会响应 `karin-plugin-test:app.js` `karin-plugin-test:测试转发` */
    enable: string[];
    /** 黑名单插件、功能，黑名单中的插件、功能不会响应 `karin-plugin-test:app.js` `karin-plugin-test:测试转发` */
    disable: string[];
    /** 群、频道成员单独黑名单 */
    member_enable: string[];
    /** 群、频道成员单独白名单 */
    member_disable: string[];
}
/**
 * `groups.json` 文件类型
 */
type Groups = GroupsObjectValue[];

/**
 * `privates.json`文件中数组元素的类型
 */
interface PrivatesObjectValue {
    /** 配置键 `Bot:selfId:userId` */
    key: string;
    /** 是否继承全局配置 默认`true` */
    inherit: boolean;
    /** 好友消息冷却时间，单位秒，0则无限制 */
    cd: number;
    /** 机器人响应模式，0-所有 2-仅回应管理员 3-仅回应别名 5-管理员无限制，非管理员别名 6-仅回应主人 */
    mode: 0 | 2 | 3 | 5 | 6;
    /** 机器人别名 设置后别名+指令触发机器人 */
    alias: string[];
    /** 白名单插件、功能，只有在白名单中的插件、功能才会响应 `karin-plugin-test:app.js` `karin-plugin-test:测试转发` */
    enable: string[];
    /** 黑名单插件、功能，黑名单中的插件、功能不会响应 `karin-plugin-test:app.js` `karin-plugin-test:测试转发` */
    disable: string[];
}
/**
 * `privates.json` 类型
 */
type Privates = PrivatesObjectValue[];

interface Env {
    /** 是否启用HTTP */
    HTTP_ENABLE: string;
    /** HTTP监听端口 */
    HTTP_PORT: string;
    /** HTTP监听地址 */
    HTTP_HOST: string;
    /** HTTP鉴权秘钥 仅用于karin自身Api */
    HTTP_AUTH_KEY: string;
    /** ws_server鉴权秘钥 */
    WS_SERVER_AUTH_KEY: string;
    /** 是否启用Redis 关闭后将使用内部虚拟Redis */
    REDIS_ENABLE: string;
    /** 重启是否调用pm2 如果不调用则会直接关机 此配置适合有进程守护的程序 */
    PM2_RESTART: string;
    /** 日志等级 */
    LOG_LEVEL: string;
    /** 日志保留天数 */
    LOG_DAYS_TO_KEEP: string;
    /** 日志文件最大大小 如果此项大于0则启用日志分割 */
    LOG_MAX_LOG_SIZE: string;
    /** logger.fnc颜色 */
    LOG_FNC_COLOR: string;
    /** 运行器 "node" | "pm2" | "tsx" */
    RUNTIME: 'node' | 'pm2' | 'tsx';
    /** ffmpeg路径 */
    FFMPEG_PATH: string;
    /** ffprobe路径 */
    FFPROBE_PATH: string;
    /** ffplay路径 */
    FFPLAY_PATH: string;
    /** tsx监察者模式 */
    TSX_WATCH: string;
}

/**
 * 文件列表
 * - `config`: 基本配置
 * - `adapter`: 适配器配置
 * - `pm2`: pm2配置
 * - `redis`: redis配置
 * - `render`: 渲染配置
 * - `package`: 框架配置
 * - `groups`: 群组配置
 * - `privates`: 私信配置
 */
type FileList = 'config' | 'adapter' | 'pm2' | 'redis' | 'render' | 'groups' | 'privates';
/** 文件列表类型映射 */
interface FileListMap {
    config: Config;
    adapter: Adapters;
    pm2: PM2;
    redis: Redis;
    render: Renders$1;
    groups: Groups;
    privates: Privates;
    env: Env;
}

/**
 * 登录号信息
 */
interface SandBoxAccountInfo {
    /** 登录号ID */
    userId: string;
    /** 昵称 */
    nick: string;
    /** 性别 */
    sex: Sex$1;
    /** 头像 */
    avatar: string;
    /** 签名 */
    sign: string;
    /** 在线状态 */
    status: 'online' | 'offline' | 'hidden';
}

/**
 * 存档消息记录
 */
interface SandboxMsgRecord {
    /** 消息类型 */
    type: 'friend' | 'group';
    /** 目标id */
    targetId: string;
    /** 消息段 */
    elements: Elements[];
    /** 消息索引 */
    seq: number;
    /** 消息id */
    messageId: string;
    /** 消息时间 */
    time: number;
    /** 消息状态 正常/撤回 */
    status: 'normal' | 'recall';
}
/**
 * 好友数据
 */
interface FriendData {
    /** 好友ID */
    userId: string;
    /** 好友昵称 */
    nick: string;
    /** 好友性别 */
    sex: Sex$1;
    /** 好友头像 */
    avatar: string;
}
/**
 * 群数据
 */
interface GroupData {
    /** 群ID */
    groupId: string;
    /** 群昵称 */
    name: string;
    /** 群头像 */
    avatar: string;
}
/**
 * 群成员数据
 */
interface GroupMemberData {
    /** 群ID */
    groupId: string;
    /** 群成员ID */
    userId: string;
    /** 群成员身份 */
    role: Role;
    /** 群成员加入时间 */
    joinTime: number;
    /** 群成员最后发言时间 */
    lastSpeakTime: number;
    /** 群成员禁言时间 */
    muteTime: number;
    /** 群成员群名片 */
    card: string;
    /** 群成员群头衔 */
    title: string;
}
/**
 * 数据库写入流状态
 */
interface DbStreamStatus {
    /** 写入数量 */
    count: number;
    /** 写入流 */
    stream: WriteStream | undefined;
}
/**
 * 数据库写入流集合
 */
interface DbStreams {
    /** 好友列表 */
    frinendList: DbStreamStatus;
    /** 好友消息记录 */
    friendHistory: DbStreamStatus;
    /** 好友通知 */
    friendNotice: DbStreamStatus;
    /** 好友请求 */
    friendRequest: DbStreamStatus;
    /** 群列表 */
    groupList: DbStreamStatus;
    /** 群成员列表 */
    groupMemberList: DbStreamStatus;
    /** 群消息记录 */
    groupHistory: DbStreamStatus;
    /** 群通知 */
    groupNotice: DbStreamStatus;
    /** 群请求 */
    groupRequest: DbStreamStatus;
}

/** 发送好友消息 */
type SandboxSendSendFriendMsg = Omit<FriendMessageOptions, 'bot' | 'srcReply'> & {
    selfId: string;
};
/** 发送群消息 */
type SandboxSendSendGroupMsg = Omit<GroupMessageOptions, 'bot' | 'srcReply'> & {
    selfId: string;
};
/** 发送消息 */
type SandboxSendSendMsg = SandboxSendSendFriendMsg | SandboxSendSendGroupMsg;
/** 沙盒API */
interface SandboxSendApi {
    /** 发送消息 */
    sendMsg: SandboxSendSendMsg;
    /** 撤回消息 */
    recallMsg: {
        /** 消息id */
        messageId: string;
    };
    /** 初始化完成 */
    init: SandBoxAccountInfo;
}

/**
 * TODO: 后续改为自动化
 */
/**
 * 插件基础类型
 */
interface KarinPluginBase {
    /** 插件包名 */
    name: string;
    /**
     * 插件类型
     * - npm: npm 插件
     * - git: git 插件
     * - app: 单应用插件
     */
    type: 'npm' | 'git' | 'app';
    /** 插件描述 限制 50 长度 */
    description: string;
    /** 插件提交到仓库时间 */
    time: string;
    /** 插件主页 */
    home: string;
    /** 插件许可证 */
    license: {
        /** 许可证名称 */
        name: string;
        /** 许可证地址 */
        url: string;
    };
    /** 插件作者 */
    author: {
        /** 名字 */
        name: string;
        /** 主页 */
        home: string;
        /** 头像 仅支持url 如果是github、gitee无需填写 */
        avatar?: string;
    }[];
    /** 插件仓库 */
    repo: {
        /** 仓库类型 */
        type: 'github' | 'gitee' | 'gitcode' | 'gitlab' | 'npm';
        /** 仓库地址 */
        url: string;
        /** 默认分支 npm类型为空字符串 */
        branch: string;
    }[];
}
/**
 * npm 插件类型
 */
interface KarinNpmPlugin extends KarinPluginBase {
    type: 'npm';
    /** 允许pnpm在安装期间执行脚本的包名列表 */
    allowBuild?: string[];
}
/**
 * git 插件类型
 */
interface KarinGitPlugin extends KarinPluginBase {
    type: 'git';
}
/**
 * 单应用插件类型
 */
interface KarinAppPlugin extends KarinPluginBase {
    type: 'app';
    /** app文件直链 */
    files: {
        /** app插件名称 */
        name: string;
        /** 文件直链 */
        url: string;
        /** 描述 */
        description?: string;
    }[];
}
/**
 * 插件市场类型每个插件的类型
 */
type KarinPluginType = KarinNpmPlugin | KarinGitPlugin | KarinAppPlugin;

/**
 * 插件作者
 */
interface Author {
    /** 名字 */
    name?: string;
    /** 主页 */
    home?: string;
    /**
     * 头像
     * @description https://github.com/[owner].png
     */
    avatar?: string;
}
/**
 * 插件图标
 */
interface Icon {
    /**
     * 图标名称
     * @see https://fonts.google.com/icons
     */
    name?: string;
    /** 图标大小 */
    size?: number;
    /** 图标颜色 */
    color?: string;
}
/** 本地插件列表 请自行添加[] */
interface LocalApiResponse {
    /** 插件id */
    id: string;
    /** 是否存在配置文件 无需配置 */
    hasConfig?: boolean;
    /** 插件类型 无需配置 */
    type?: 'git' | 'npm' | 'app';
    /** 插件名称 前端优先展示 */
    name?: string;
    /** 插件版本 可不填 会自动读取package.json中的version */
    version?: string;
    /** 插件描述 可不填 会自动读取package.json中的version */
    description?: string;
    /** 插件作者 */
    author?: Author[];
    /** 插件图标 前端优先展示 */
    icon?: Icon;
}
/** 获取配置请求参数 */
interface GetConfigRequest {
    /** 插件名称 */
    name: string;
    /** 插件类型 */
    type: 'git' | 'npm' | 'app';
}
/** 获取配置响应 */
interface GetConfigResponse {
    /** 组件配置参数 */
    options: ComponentConfig[];
    /** 插件信息 */
    info: LocalApiResponse;
}
/**
 * 保存配置返回值
 */
interface SaveConfigResponse {
    /** 是否成功 */
    success: boolean;
    /** 消息 */
    message: string;
}
/** webui配置 */
interface DefineConfig<T = any> {
    /** 插件信息 */
    info: {
        /** 插件id 也就是插件的包名 */
        id: string;
        /** 插件名称 前端优先展示 */
        name?: string;
        /** 插件作者 */
        author?: Author | Author[];
        /** 插件图标 前端优先展示 */
        icon?: Icon;
        /** 插件版本 可不填 会自动读取package.json中的version */
        version?: string;
        /** 插件描述 可不填 会自动读取package.json中的version */
        description?: string;
    };
    /** 默认组件配置参数 */
    components?: () => ComponentConfig[] | Promise<ComponentConfig[]>;
    /**
     * 保存配置
     * @param config 配置
     * @returns 保存结果
     */
    save?: (config: T) => SaveConfigResponse | Promise<SaveConfigResponse>;
    /**
     * 自定义组件配置
     * @description 未完成
     */
    customComponent?: () => unknown;
}

/**
 * 基类
 */
interface Base {
    /** 插件包名 */
    name: string;
    /**
     * 插件类型
     * - npm: npm 插件
     * - git: git 插件
     * - app: 单应用插件
     */
    type: 'npm' | 'git' | 'app';
    /** 插件描述 限制 50 长度 */
    description: string;
    /** 仓库主页 */
    home: string;
    /** 插件提交到仓库时间 */
    time: string;
    /** 插件许可证 */
    license: {
        /** 许可证名称 */
        name: string;
        /** 许可证地址 */
        url: string;
    };
    /** 插件作者 */
    author: {
        /** 名字 */
        name: string;
        /** 主页 */
        home: string;
        /** 头像 */
        avatar: string;
    }[];
    /** 插件仓库 */
    repo: {
        /** 仓库类型 */
        type: 'github' | 'gitee' | 'gitcode' | 'gitlab' | 'npm';
        /** 仓库地址 */
        url: string;
        /** 分支名称 */
        branch: string;
    }[];
}
/**
 * karin api返回类型
 */
interface PluginLists extends Base {
    version: string;
    /** 是否已经安装 */
    installed: boolean;
    /** 最新版本 */
    latestVersion?: string;
    /** 下载量 */
    downloads: number;
    /** 插件大小 */
    size: number;
    /** 最近一次更新时间 */
    updated: string;
}
interface PluginUpdateInfo extends PluginLists {
    /** 是否可更新 */
    hasUpdate: boolean;
    /** 当前版本 */
    currentVersion?: string;
    /** 最新版本 */
    latestVersion?: string;
    /** 当前hash */
    currentHash?: string;
    /** 更新日志 */
    updateLog?: string;
    /** 更新数量 */
    updateCount?: number;
}
/**
 * 插件管理 获取插件列表Api响应
 */
interface PluginAdminListResponse {
    /** 插件ID `package.json中的名称` */
    id: string;
    /** 插件名称 `文件夹根目录名称` */
    name: string;
    /** 插件类型 */
    type: KarinPluginAppsType;
    /** 插件版本 App类型为空 */
    version: string;
    /**
     * 插件最新版本
     * - npm: 最新版本号
     * - git: 最新提交哈希
     * - app: 最新版本号
     */
    latestVersion: string;
    webConfig: {
        /** 是否存在`web.config`文件 */
        exists: boolean;
        /** wen.config 文件绝对路径 */
        path: string;
        /** 是否存在自定义组件配置函数 */
        customComponent: boolean;
        /** 是否存在默认组件配置函数 一般用于插件的配置文件管理 */
        defaultComponent: boolean;
        /** 插件图标 */
        icon: Icon;
    };
}
/**
 * 前端已安装插件简约列表 用于在插件管理索引页面显示
 */
interface FrontendInstalledPluginListResponse {
    /** 插件ID `package.json中的名称` */
    id: string;
    /** 插件名称 */
    name: string;
    /** 插件类型 */
    type: KarinPluginAppsType;
    /** 插件是否存在插件市场中 */
    isMarketPlugin: boolean;
    /** 插件描述 */
    description: string;
    /** 插件作者信息 */
    author: {
        /** 名字 */
        name: string;
        /** 主页 */
        home: string;
        /** 头像 */
        avatar: string;
    };
    /** 插件图标 */
    icon: Icon;
    /** 插件仓库主页 */
    repoUrl: string;
    /** 插件是否可配置 */
    hasConfig: boolean;
    /** 插件是否存在自定义组件 */
    hasCustomComponent: boolean;
}
/**
 * 插件市场响应 作者信息
 * @description 因为前端只方便展示一个作者 这里进行解耦
 */
interface PluginMarketAuthor {
    /** 名字 */
    name: string;
    /** 主页 */
    home: string;
    /** 头像 */
    avatar: string;
}
/**
 * 插件市场响应 本地插件基本参数
 */
interface PluginMarketLocalBase {
    /**
     * 是否已安装到本地
     */
    installed: boolean;
    /**
     * 插件名称
     */
    name: string;
    /**
     * 在本地的插件类型
     * @description 此项一般用于追踪插件配置 比如`npm`插件，在开发环境是`git`类型
     */
    type: KarinPluginAppsType;
    /**
     * 插件当前版本
     * @description 如果是`app`类型 则返回空字符串
     */
    version?: string;
    /**
     * 插件描述
     */
    description?: string;
    /**
     * 插件主页
     */
    home?: string;
}
/**
 * 插件市场请求参数
 */
interface PluginMarketRequest {
    /**
     * 是否强制刷新
     * @default false
     */
    refresh?: boolean;
}
/**
 * 插件市场 type=market响应参数
 */
interface PluginMarketOptions {
    /**
     * - `market`: 插件市场
     * - `local`: 本地
     */
    type: 'market';
    /**
     * 插件市场参数
     * @description api返回什么这里就是什么
     */
    market: KarinPluginType;
    /**
     * 本地配置
     */
    local: PluginMarketLocalBase;
    /**
     * 插件作者
     */
    author: PluginMarketAuthor;
}
/**
 * 插件市场 type=local响应参数
 */
interface PluginMarketLocalOptions {
    /**
     * - `market`: 插件市场
     * - `local`: 本地
     */
    type: 'local';
    /**
     * 本地配置
     */
    local: PluginMarketLocalBase;
    /**
     * 插件作者
     */
    author: PluginMarketAuthor;
}
/**
 * 插件市场响应参数
 */
type PluginMarketResponse = PluginMarketOptions | PluginMarketLocalOptions;

/** JWT验证基础接口 */
interface JwtVerifyBase {
    /** 状态码 */
    status: number;
    /** 返回数据 */
    data: string;
}
/** 鉴权成功 */
interface JwtVerifySuccess extends JwtVerifyBase {
    status: 200;
    /** 用户id */
    data: string;
}
/** 鉴权失败 */
interface JwtVerifyUnauthorized extends JwtVerifyBase {
    status: 401;
    /** 错误信息 */
    data: string;
}
/** 令牌过期 */
interface JwtVerifyExpired extends JwtVerifyBase {
    status: 419;
    /** 错误信息 */
    data: string;
}
/** 服务器错误 */
interface JwtVerifyError extends JwtVerifyBase {
    status: 500;
    /** 错误信息 */
    data: string;
}
/** JWT验证返回类型 */
type JwtVerifyResult = JwtVerifySuccess | JwtVerifyUnauthorized | JwtVerifyExpired | JwtVerifyError;

/**
 * 网络状态
 */
interface NetworkStatus {
    /** 上传速度 */
    upload: number;
    /** 下载速度 */
    download: number;
    /** 总上传量 */
    totalSent: number;
    /** 总下载量 */
    totalReceived: number;
}

/** 终端类型 */
type TerminalShell = 'powershell.exe' | 'cmd.exe' | 'bash';
/**
 * 创建pty
 */
interface CreatePty {
    /** 终端名称 */
    name: string;
    /** 初始列数 */
    cols: number;
    /** 初始行数 */
    rows: number;
    /** 终端类型 */
    shell: TerminalShell;
}
/**
 * 终端实例
 */
interface TerminalInstance<T = any> {
    /** 终端名称 */
    name: string;
    /** 终端 */
    pty: T;
    /** 最后访问时间 */
    lastAccess: number;
    /** 连接的 websocket */
    sockets: Set<WebSocket>;
    /** 是否正在关闭 */
    isClosing: boolean;
    /** 终端内容缓存 */
    buffer: string;
}

/**
 * dependencies value类型
 */
interface PnpmDependency {
    /** 依赖来源 */
    from: string;
    /** 依赖版本 */
    version: string;
    /** 依赖路径 */
    path: string;
    /** 依赖下载地址 在link下不存在 例如 https://registry.npmjs.org/@types/node/-/node-18.19.84.tgz */
    resolved?: string;
}
/**
 * `pnpm list --depth=0 --json`命令返回类型
 */
interface PnpmDependencies {
    /** 项目名称 */
    name: string;
    /** 项目版本 */
    version: string;
    /** 项目路径 */
    path: string;
    /** 是否为私有项目 */
    private: boolean;
    /** 项目依赖 */
    dependencies: Record<string, PnpmDependency>;
    /** 项目开发依赖 */
    devDependencies: Record<string, PnpmDependency>;
    /** 未保存的依赖 */
    unsavedDependencies: Record<string, PnpmDependency>;
}
/**
 * dependenciesApi响应类型
 */
interface Dependency {
    /** 依赖名称 */
    name: string;
    /** 是否为karin插件 */
    isKarinPlugin: boolean;
    /** 当前版本 */
    current: string;
    /** 最新的15个版本 */
    latest: string[];
    /** package.json中的值 如果不存在会返回空字符串 */
    packageValue: string;
    /**
     * 依赖类型
     * - dependencies: 生产依赖
     * - devDependencies: 开发依赖
     * - unsavedDependencies: 未保存依赖
     * - peerDependencies: 对等依赖
     * - optionalDependencies: 可选依赖
    */
    type: 'dependencies' | 'devDependencies' | 'unsavedDependencies' | 'peerDependencies' | 'optionalDependencies';
    /**
    * 依赖来源
    * - 此处最大的作用就是用于区分别名安装的依赖
    * - 例如`lodash@npm:@karinjs/lodash` 这里的值就会是`@karinjs/lodash`
    */
    from: string;
}

/**
 * 构建好友场景的`sender`
 * @param userId 用户ID
 * @param name 用户名
 * @param sex 性别
 * @param age 年龄
 * @param uid QQ场景专属
 * @param uin QQ场景专属
 */
declare const senderFriend: (userId: Sender<"friend">["userId"], name?: Sender<"friend">["name"], sex?: Sender<"friend">["sex"], age?: Sender<"friend">["age"], uid?: Sender<"friend">["uid"], uin?: Sender<"friend">["uin"]) => Sender<"friend">;
/**
 * 构建群聊场景的`sender`
 */
declare const senderGroup: SenderGroup$1;
/**
 * 构建频道场景的`sender`
 * @param userId 用户ID
 * @param role 群成员身份
 * @param name 用户名
 * @param sex 性别
 * @param age 年龄
 */
declare const senderGuild: (userId: Sender<"guild">["userId"], role: Sender<"guild">["role"], name: Sender<"guild">["name"] | undefined, sex: Sender<"guild">["sex"], age: Sender<"guild">["age"]) => Sender<"guild">;
/**
 * 构建频道私信场景的`sender`
 */
declare const senderDirect: (userId: Sender<"friend">["userId"], name?: Sender<"friend">["name"], sex?: Sender<"friend">["sex"], age?: Sender<"friend">["age"], uid?: Sender<"friend">["uid"], uin?: Sender<"friend">["uin"]) => Sender<"friend">;
/**
 * 构建群聊临时会话场景的`sender`
 */
declare const senderGroupTemp: (userId: Sender<"friend">["userId"], name?: Sender<"friend">["name"], sex?: Sender<"friend">["sex"], age?: Sender<"friend">["age"], uid?: Sender<"friend">["uid"], uin?: Sender<"friend">["uin"]) => Sender<"friend">;
/**
 * 事件发送者构建器
 * @description 用于构建不同场景的事件发送者信息
 */
declare const sender: {
    /** 好友场景 */
    friend: (userId: Sender<"friend">["userId"], name?: Sender<"friend">["name"], sex?: Sender<"friend">["sex"], age?: Sender<"friend">["age"], uid?: Sender<"friend">["uid"], uin?: Sender<"friend">["uin"]) => Sender<"friend">;
    /** 群聊场景 */
    group: SenderGroup$1;
    /** 频道场景 */
    guild: (userId: Sender<"guild">["userId"], role: Sender<"guild">["role"], name: Sender<"guild">["name"] | undefined, sex: Sender<"guild">["sex"], age: Sender<"guild">["age"]) => Sender<"guild">;
    /** 频道私信场景 */
    direct: (userId: Sender<"friend">["userId"], name?: Sender<"friend">["name"], sex?: Sender<"friend">["sex"], age?: Sender<"friend">["age"], uid?: Sender<"friend">["uid"], uin?: Sender<"friend">["uin"]) => Sender<"friend">;
    /** 群聊临时会话场景 */
    groupTemp: (userId: Sender<"friend">["userId"], name?: Sender<"friend">["name"], sex?: Sender<"friend">["sex"], age?: Sender<"friend">["age"], uid?: Sender<"friend">["uid"], uin?: Sender<"friend">["uin"]) => Sender<"friend">;
};

/**
 * 构建好友事件来源
 * @param peer 好友ID
 * @param name 好友昵称 默认为空字符串
 */
declare const contactFriend: (peer: FriendContact["peer"], name?: FriendContact["name"]) => FriendContact;
/**
 * 构建群聊事件来源
 * @param peer 群ID
 * @param name 群名
 */
declare const contactGroup: (peer: GroupContact["peer"], name?: GroupContact["name"]) => GroupContact;
/**
 * 构建频道私信事件来源
 * @param peer 频道ID
 * @param subId 子频道ID
 * @param srcGuildId 来源频道ID
 * @param name 频道名称 默认为空字符串
 * @param subName 子频道名称 默认为空字符串
 */
declare const contactDirect: (peer: DirectContact["peer"], subId: DirectContact["subPeer"], name?: DirectContact["name"], subName?: DirectContact["subName"]) => DirectContact;
/**
 * 构建频道事件来源
 * @param peer 频道ID
 * @param subPeer 子频道ID
 * @param name 频道名称 默认为空字符串
 * @param subName 子频道名称 默认为空字符串
 */
declare const contactGuild: (peer: GuildContact["peer"], subPeer: GuildContact["subPeer"], name?: GuildContact["name"], subName?: GuildContact["subName"]) => GuildContact;
/**
 * 构建群聊临时会话事件来源
 * @param peer 群ID
 * @param subPeer 发起临时会话的用户ID
 * @param name 群名
 */
declare const contactGroupTemp: (peer: GroupTempContact["peer"], subPeer: GroupTempContact["subPeer"], name?: GroupTempContact["name"]) => GroupTempContact;
/**
 * 事件来源构建器
 * @description 用于构建不同场景的事件来源信息
 */
declare const contact$1: {
    /** 好友场景 */
    friend: (peer: FriendContact["peer"], name?: FriendContact["name"]) => FriendContact;
    /** 群聊场景 */
    group: (peer: GroupContact["peer"], name?: GroupContact["name"]) => GroupContact;
    /** 频道场景 */
    guild: (peer: GuildContact["peer"], subPeer: GuildContact["subPeer"], name?: GuildContact["name"], subName?: GuildContact["subName"]) => GuildContact;
    /** 频道私信场景 */
    direct: (peer: DirectContact["peer"], subId: DirectContact["subPeer"], name?: DirectContact["name"], subName?: DirectContact["subName"]) => DirectContact;
    /** 群聊临时会话场景 */
    groupTemp: (peer: GroupTempContact["peer"], subPeer: GroupTempContact["subPeer"], name?: GroupTempContact["name"]) => GroupTempContact;
};

/**
 * @description 创建好友消息事件
 * @param options 好友消息事件所需参数
 */
declare const createFriendMessage: (options: FriendMessageOptions) => FriendMessage;
/**
 * @description 创建群消息事件实例
 * @param options 群消息事件所需参数
 */
declare const createGroupMessage: (options: GroupMessageOptions) => GroupMessage;
/**
 * @description 创建频道消息事件实例
 * @param options 频道消息事件所需参数
 */
declare const createGuildMessage: (options: GuildMessageOptions) => GuildMessage;
/**
 * @description 创建频道私信消息事件实例
 * @param options 频道私信消息事件所需参数
 */
declare const createDirectMessage: (options: DirectMessageOptions) => DirectMessage;
/**
 * @description 创建群临时消息事件实例
 * @param options 群临时消息事件所需参数
 */
declare const createGroupTempMessage: (options: GroupTempMessageOptions) => GroupTempMessage;
/**
 * @description 创建点赞通知事件
 * @param options 点赞通知事件所需参数
 */
declare const createReceiveLikeNotice: (options: ReceiveLikeOptions) => ReceiveLikeNotice;
/**
 * @description 创建好友增加通知事件
 * @param options 好友增加通知事件所需参数
 */
declare const createFriendIncreaseNotice: (options: FriendIncreaseOptions) => FriendIncreaseNotice;
/**
 * @description 创建好友减少通知事件
 * @param options 好友减少通知事件所需参数
 */
declare const createFriendDecreaseNotice: (options: FriendDecreaseOptions) => FriendDecreaseNotice;
/**
 * @description 创建私聊戳一戳通知事件
 * @param options 私聊戳一戳通知事件所需参数
 */
declare const createPrivatePokeNotice: (options: PrivatePokeOptions) => PrivatePokeNotice;
/**
 * @description 创建私聊撤回通知事件
 * @param options 私聊撤回通知事件所需参数
 */
declare const createPrivateRecallNotice: (options: PrivateRecallOptions) => PrivateRecallNotice;
/**
 * @description 创建私聊文件上传通知事件
 * @param options 私聊文件上传通知事件所需参数
 */
declare const createPrivateFileUploadedNotice: (options: PrivateFileUploadedOptions) => PrivateFileUploadedNotice;
/**
 * @description 创建群戳一戳通知事件
 * @param options 群戳一戳通知事件所需参数
 */
declare const createGroupPokeNotice: (options: GroupPokeOptions) => GroupPokeNotice;
/**
 * @description 创建群撤回通知事件
 * @param options 群撤回通知事件所需参数
 */
declare const createGroupRecallNotice: (options: GroupRecallOptions) => GroupRecallNotice;
/**
 * @description 创建群文件上传通知事件
 * @param options 群文件上传通知事件所需参数
 */
declare const createGroupFileUploadedNotice: (options: GroupFileUploadedOptions) => GroupFileUploadedNotice;
/**
 * @description 创建群成员名片更新通知事件
 * @param options 群成员名片更新通知事件所需参数
 */
declare const createGroupCardChangedNotice: (options: GroupCardChangedOptions) => GroupCardChangedNotice;
/**
 * @description 创建群成员专属头衔更新通知事件
 * @param options 群成员专属头衔更新通知事件所需参数
 */
declare const createGroupMemberTitleUpdatedNotice: (options: GroupMemberUniqueTitleChangedOptions) => GroupMemberTitleUpdatedNotice;
/**
 * @description 创建群精华消息变更通知事件
 * @param options 群精华消息变更通知事件所需参数
 */
declare const createGroupHlightsChangedNotice: (options: GroupHlightsChangedOptions) => GroupHlightsChangedNotice;
/**
 * @description 创建群成员增加通知事件
 * @param options 群成员增加通知事件所需参数
 */
declare const createGroupMemberAddNotice: (options: GroupMemberIncreaseOptions) => GroupMemberIncreaseNotice;
/**
 * @description 创建群成员减少通知事件
 * @param options 群成员减少通知事件所需参数
 */
declare const createGroupMemberDelNotice: (options: GroupMemberDecreaseOptions) => GroupMemberDecreaseNotice;
/**
 * @description 创建群管理员变更通知事件
 * @param options 群管理员变更通知事件所需参数
 */
declare const createGroupAdminChangedNotice: (options: GroupAdminChangedOptions) => GroupAdminChangedNotice;
/**
 * @description 创建群签到通知事件
 * @param options 群签到通知事件所需参数
 */
declare const createGroupSignInNotice: (options: GroupSignInOptions) => GroupSignInNotice;
/**
 * @description 创建群禁言通知事件
 * @param options 群禁言通知事件所需参数
 */
declare const createGroupMemberBanNotice: (options: GroupMemberBanOptions) => GroupMemberBanNotice;
/**
 * @description 创建群全员禁言通知事件
 * @param options 群全员禁言通知事件所需参数
 */
declare const createGroupWholeBanNotice: (options: GroupWholeBanOptions) => GroupWholeBanNotice;
/**
 * @description 创建群消息表态通知事件
 * @param options 群消息表态通知事件所需参数
 */
declare const createGroupMessageReactionNotice: (options: GroupMessageReactionOptions) => GroupMessageReactionNotice;
/**
 * @description 创建群红包运气王通知事件
 * @param options 群红包运气王通知事件所需参数
 */
declare const createGroupLuckKingNotice: (options: GroupLuckKingOptions) => GroupLuckKingNotice;
/**
 * @description 创建群成员荣誉变更通知事件
 * @param options 群成员荣誉变更通知事件所需参数
 */
declare const createGroupHonorChangedNotice: (options: GroupHonorChangedOptions) => GroupHonorChangedNotice;
/**
 * @description 创建Bot下线通知事件
 * @param options Bot下线通知事件所需参数
 */
declare const createBotOfflineNotice: (options: BotOfflineOptions) => BotOfflineNotice;
/**
 * @description 创建群成员申请入群请求事件
 * @param options 群成员申请入群请求事件所需参数
 */
declare const createGroupApplyRequest: (options: GroupApplyRequestOptions) => GroupApplyRequest;
/**
 * @description 创建邀请Bot加群请求事件
 * @param options 邀请Bot加群请求事件所需参数
 */
declare const createGroupInviteRequest: (options: GroupInviteRequestOptions) => GroupInviteRequest;
/**
 * @description 创建Bot收到添加为好友请求事件
 * @param options Bot收到添加为好友请求事件所需参数
 */
declare const createPrivateApplyRequest: (options: PrivateApplyRequestOptions) => PrivateApplyRequest;

/** 通知、请求事件联合类型 */
type NoticeAndRequest = NoticeEventMap & RequestEventMap;
/** 通知、请求事件接收方法 */
interface Accept<T extends keyof NoticeAndRequest = keyof NoticeAndRequest> extends AdapterOptions {
    /** 插件包基本属性 */
    pkg: PkgInfo;
    /** 插件方法基本属性 */
    file: PluginFile<'accept'>;
    /** 监听事件 */
    event: T;
    /** 优先级 */
    priority: number;
    /** 打印触发插件日志方法 */
    log: Log<true>;
    /** 插件方法 */
    fnc: (
    /** 事件 */
    e: NoticeAndRequest[T], 
    /** 调用后将继续匹配下一个插件 */
    next: () => unknown) => Promise<unknown> | unknown;
}

type ButtonType = ButtonElement | KeyboardElement | Array<ButtonElement | KeyboardElement>;
/** 按钮插件类型 */
interface Button {
    /** 插件包基本属性 */
    pkg: PkgInfo;
    /** 插件方法基本属性 */
    file: PluginFile<'button'>;
    /** 优先级 */
    priority: number;
    /** 插件正则 */
    reg: RegExp;
    /** 优先级 */
    rank: number;
    /** 执行方法 */
    fnc: (
    /** 是否继续匹配下一个按钮 默认否 调用后则继续 */
    next: () => void, 
    /** 自定义参数 如果传e需要符合标准 */
    args?: {
        e?: Event;
        [key: string]: any;
    }) => Promise<ButtonType> | ButtonType;
}

interface PluginRule {
    /** 命令正则 */
    reg: string | RegExp;
    /** 命令执行方法名称 */
    fnc: string;
    /** 监听子事件 */
    event?: keyof Omit<MessageEventMap, 'message'>;
    /** 优先级 默认为10000 */
    priority?: number;
    /** 插件触发权限 例如只有主人才可触发 */
    permission?: Permission;
    /** 打印日志 默认为true */
    log?: boolean;
    /** 生效的适配器 */
    adapter?: AdapterProtocol[];
    /** 禁用的适配器 */
    dsbAdapter?: AdapterProtocol[];
    /**
    * 如果无权触发插件 是否打印日志
    * - `true`: `暂无权限，只有主人才能操作`
    * - `false`: ``
    * - `string`: `自定义提示`
    */
    authFailMsg?: boolean | string;
}
interface PluginOptions<T extends keyof MessageEventMap> {
    /** 插件名称 */
    name: string;
    /** 插件描述 */
    desc?: string;
    /** 插件事件 */
    event?: T;
    /** 优先级 */
    priority?: number;
    /** 指令规则 */
    rule: PluginRule[];
}

/** 消息事件插件类 */
declare class Plugin$1<T extends keyof MessageEventMap = keyof MessageEventMap> {
    /** 插件名称 */
    name: PluginOptions<T>['name'];
    /** 指令规则集 */
    rule: PluginOptions<T>['rule'];
    /** 插件描述 */
    desc: PluginOptions<T>['desc'];
    /** 插件事件 */
    event: T;
    /** 优先级 */
    priority: PluginOptions<T>['priority'];
    /** 消息事件对象 */
    e: T extends keyof MessageEventMap ? MessageEventMap[T] : Message;
    /** 调用后将继续匹配下一个插件 */
    next: () => unknown;
    /** 快速回复 */
    reply: Message['reply'];
    constructor(options: PluginOptions<T> & {
        event?: T;
    });
    /**
     * 快速回复合并转发
     * @param element 合并转发消息元素节点
     */
    replyForward(element: NodeElement[]): Promise<{
        /** @deprecated 已废弃 请请使用 messageId */
        message_id: string;
        messageId: string;
    }>;
}

/** 函数命令插件方法 */
type CmdFnc<T extends keyof MessageEventMap> = (
/** 消息事件 */
e: MessageEventMap[T], 
/** 调用后将继续匹配下一个插件 */
next: () => unknown) => unknown;
/** 函数方法命令插件 */
interface Command<T extends keyof MessageEventMap = keyof MessageEventMap> extends AdapterOptions {
    /** 插件包基本属性 */
    pkg: PkgInfo;
    /** 插件方法基本属性 */
    file: PluginFile<'command'>;
    /** 插件子类型 */
    type: 'fnc';
    /** 插件正则 */
    reg: RegExp;
    /** 监听事件 */
    event: T;
    /** 优先级 */
    priority: number;
    /** 插件触发权限 */
    permission: Permission;
    /**
     * 如果无权触发插件 是否打印日志
     * - `true`: `暂无权限，只有主人才能操作`
     * - `false`: ``
     * - `string`: `自定义提示`
     */
    authFailMsg: boolean | string;
    /** 打印触发插件日志方法 */
    log: Log<true>;
    /** 插件方法 */
    fnc: CmdFnc<T>;
}
/** 类方法命令插件 */
interface CommandClass<T extends keyof MessageEventMap = keyof MessageEventMap> extends AdapterOptions {
    /** 插件包基本属性 */
    pkg: PkgInfo;
    /** 插件方法基本属性 */
    file: PluginFile<'command'>;
    /** 插件子类型 */
    type: 'class';
    /** 插件正则 */
    reg: RegExp;
    /** 监听事件 */
    event: T;
    /** 优先级 */
    priority: number;
    /** 插件触发权限 */
    permission: Permission;
    /**
     * 如果无权触发插件 是否打印日志
     * - `true`: `暂无权限，只有主人才能操作`
     * - `false`: ``
     * - `string`: `自定义提示`
     */
    authFailMsg: boolean | string;
    /** 插件类 */
    Cls: new () => Plugin$1<T>;
    /** 打印触发插件日志方法 */
    log: Log<true>;
}

/** handler类型 */
interface Handler {
    /** 插件包基本属性 */
    pkg: PkgInfo;
    /** 插件方法基本属性 */
    file: PluginFile<'handler'>;
    /** 优先级 */
    priority: number;
    /** 入口key */
    key: string;
    /** handler的处理方法 */
    fnc: (
    /** 自定义参数 由调用方传递 */
    args: {
        [key: string]: any;
    }, 
    /** 调用后将继续执行下一个handler */
    next: (msg?: string) => void) => unknown;
}

interface Count {
    accept: number;
    command: number;
    task: number;
    button: number;
    handler: {
        /** 入口key */
        key: number;
        /** handler处理函数 */
        fnc: number;
    };
}
/** 缓存 */
interface Cache {
    /** 插件索引 */
    index: Record<number, PkgInfo>;
    /** accept */
    accept: Accept<keyof NoticeAndRequest>[];
    /** command */
    command: Array<CommandClass<keyof MessageEventMap> | Command<keyof MessageEventMap>>;
    /** 定时任务 */
    task: Array<Task>;
    /** 按钮 */
    button: Button[];
    /** 插件数量统计 */
    count: Count;
    /** 插件名称:缺失的依赖 */
    missing: Map<string, string>;
    /** apps监听 */
    watcher: Map<string, FSWatcher>;
    /** handler */
    handler: Record<string, Handler[]>;
    /** 静态资源目录 */
    static: string[];
}
/**
 * 已加载插件缓存信息列表
 */
interface LoadedPluginCacheList {
    /** 插件名称 */
    name: string;
    /** 插件文件列表 */
    files: {
        /** 文件名称 */
        fileName: string;
        /** 该文件下所有的command函数名称 */
        command: {
            /** 此函数的插件名称 */
            pluginName: string;
            /** 此函数的导出名称 */
            method: string;
        }[];
    }[];
}

/** 缓存 */
declare const cache: Cache;

type UnionMessage = Message | FriendMessage | GroupMessage | GuildMessage | DirectMessage | GroupTempMessage;
/** 调用后继续执行下一个钩子 如果没钩子则继续正常流程 */
type HookNext = () => void;
/** 通用钩子配置项 */
interface HookOptions {
    /** 优先级，数字越小优先级越高 */
    priority?: number;
}
/** 收到消息事件钩子回调函数 */
type HookCallback<T extends UnionMessage> = (event: T, next: HookNext) => void | Promise<void>;
/** 收到消息事件钩子项 */
interface MessageHookItem<T extends UnionMessage> {
    /** 钩子ID */
    id: number;
    /** 钩子优先级 */
    priority: number;
    /** 钩子回调函数 */
    callback: HookCallback<T>;
}
/**
 * 事件调用插件钩子回调函数
 * @param event 事件
 * @param plugin 插件对象
 * @param next 继续执行下一个钩子的函数
 */
type EventCallCallback<T, P> = (event: T, plugin: P, next: HookNext) => void | Promise<void>;
/** 事件调用插件钩子项 */
interface EventCallHookItem<T, P> {
    /** 钩子ID */
    id: number;
    /** 钩子优先级 */
    priority: number;
    /** 钩子回调函数 */
    callback: EventCallCallback<T, P>;
}
/**
 * 发送基础消息回调类型
 * @param contact 联系人
 * @param elements 消息元素
 * @param retryCount 重试次数
 * @param next 继续执行下一个钩子的函数
 */
type BaseMessageCallback<T> = (contact: Contact, elements: Array<Elements>, retryCount: number, next: HookNext) => T | Promise<T>;
/**
 * 接收普通消息发送回调类型 这个由开发者调用
 */
type NormalMessageCallback = BaseMessageCallback<void>;
/**
 * 消息钩子触发类型 这个由karin内部调用
 */
type HookEmitMessage = BaseMessageCallback<boolean>;
/**
 * 基础转发消息回调类型
 * @param contact 联系人
 * @param elements 消息元素
 * @param options 转发选项
 * @param next 继续执行下一个钩子的函数
 */
type BaseForwardCallback<T> = (contact: Contact, elements: Array<NodeElement>, options: ForwardOptions | undefined, next: HookNext) => T | Promise<T>;
/**
 * 接收转发消息回调类型 这个由开发者调用
 */
type ForwardMessageCallback = BaseForwardCallback<void>;
/**
 * 转发消息钩子触发类型 这个由karin内部调用
 */
type HookEmitForward = BaseForwardCallback<boolean>;
/**
 * 消息发送后回调类型 这个由开发者调用
 * @param contact 联系人
 * @param elements 消息元素
 * @param result 发送消息结果
 * @param next 继续执行下一个钩子的函数
 */
type AfterMessageCallback = (contact: Contact, elements: Array<Elements>, result: any, next: HookNext) => void | Promise<void>;
/**
 * 转发消息发送后回调类型 这个由开发者调用
 * @param contact 联系人
 * @param elements 消息元素
 * @param result 发送转发消息结果
 * @param options 转发选项
 * @param next 继续执行下一个钩子的函数
 */
type AfterForwardMessageCallback = (contact: Contact, elements: Array<NodeElement>, result: any, options: ForwardOptions | undefined, next: HookNext) => void | Promise<void>;
/** 发送消息钩子项 */
interface SendMsgHookItem<T extends NormalMessageCallback | ForwardMessageCallback | AfterMessageCallback | AfterForwardMessageCallback> {
    /** 钩子ID */
    id: number;
    /** 钩子优先级 */
    priority: number;
    /** 钩子回调函数 */
    callback: T;
}
/** 缓存 */
interface HookCache {
    /** 消息事件钩子 */
    message: {
        message: MessageHookItem<Message>[];
        friend: MessageHookItem<FriendMessage>[];
        group: MessageHookItem<GroupMessage>[];
        guild: MessageHookItem<GuildMessage>[];
        direct: MessageHookItem<DirectMessage>[];
        groupTemp: MessageHookItem<GroupTempMessage>[];
    }; /** 发送消息事件钩子 */
    sendMsg: {
        /** 普通消息 */
        message: SendMsgHookItem<NormalMessageCallback>[];
        /** 转发消息 */
        forward: SendMsgHookItem<ForwardMessageCallback>[];
        /** 发送消息后钩子 */
        afterMessage: SendMsgHookItem<AfterMessageCallback>[];
        /** 发送转发消息后钩子 */
        afterForward: SendMsgHookItem<AfterForwardMessageCallback>[];
    };
    /** 未找到匹配插件钩子 */
    empty: {
        /** 消息 */
        message: MessageHookItem<Message>[];
        /** 通知 */
        notice: GeneralHookItem<Notice>[];
        /** 请求 */
        request: GeneralHookItem<Request>[];
    };
    /** 事件调用插件钩子 */
    eventCall: {
        /** 通用消息事件 */
        message: EventCallHookItem<Message, typeof cache.command[number]>[];
        /** 群聊事件 */
        group: EventCallHookItem<GroupMessage, typeof cache.command[number]>[];
        /** 频道事件 */
        guild: EventCallHookItem<GuildMessage, typeof cache.command[number]>[];
        /** 群临时事件 */
        groupTemp: EventCallHookItem<GroupTempMessage, typeof cache.command[number]>[];
        /** 好友事件 */
        friend: EventCallHookItem<FriendMessage, typeof cache.command[number]>[];
        /** 私聊事件 */
        direct: EventCallHookItem<DirectMessage, typeof cache.command[number]>[];
        /** 通知事件 */
        notice: EventCallHookItem<Notice, typeof cache.accept[number]>[];
        /** 请求事件 */
        request: EventCallHookItem<Request, typeof cache.accept[number]>[];
    };
}
/** 通用事件钩子回调函数 */
type GeneralHookCallback<T> = (event: T, next: HookNext) => void | Promise<void>;
/** 通用事件钩子项 */
interface GeneralHookItem<T> {
    /** 钩子ID */
    id: number;
    /** 钩子优先级 */
    priority: number;
    /** 钩子回调函数 */
    callback: GeneralHookCallback<T>;
}

/**
 * 下载文件请求参数
 */
interface DownloadFilesOptions<T extends boolean = false> extends AxiosRequestConfig {
    /** 是否返回布尔值 */
    returnBoolean?: T;
}
/**
 * 下载文件成功返回值
 */
interface DownloadFileSuccessResult {
    success: true;
    data: AxiosResponse<any>;
}
/**
 * 下载文件失败返回值
 */
interface DownloadFileErrorResult {
    success: false;
    data: unknown;
}
/**
 * 下载文件返回值
 */
type DownloadFileResult<T extends boolean = false> = T extends true ? boolean : DownloadFileSuccessResult | DownloadFileErrorResult;

/** .npmrc文件列表接口响应 */
interface NpmrcFileResponse {
    path: string;
    type: string;
    description: string;
}
/** npm registry、proxy、https-proxy配置 */
interface NpmBaseConfigResponse {
    registry: string;
    proxy: string;
    'https-proxy': string;
}
/** npm registry配置 */
interface NpmRegistryResponse {
    _id: string;
    _rev: string;
    name: string;
    'dist-tags': {
        latest: string;
        [key: string]: string;
    };
    versions: Record<string, {
        name: string;
        version: string;
        license: string;
        _id: string;
        maintainers: [
            {
                name: string;
                email: string;
            }
        ];
        dist: {
            shasum: string;
            tarball: string;
            fileCount: number;
            integrity: string;
            signatures: {
                sig: string;
                keyid: string;
            }[];
            unpackedSize: number;
        };
        gitHead: string;
        _npmUser: {
            name: string;
            email: string;
        };
        _npmVersion: string;
        _nodeVersion: string;
        _hasShrinkwrap: false;
        _npmOperationalInternal: {
            tmp: string;
            host: string;
        };
        [key: string]: any;
    }>;
    time: Record<string, string>;
    maintainers: [
        {
            name: string;
            email: string;
        },
        {
            name: string;
            email: string;
        }
    ];
    readme: string;
    readmeFilename: string;
    [key: string]: any;
}

/**
 * 测试网络请求结果详细信息接口
 */
interface TestNetworkRequestDetail {
    /**
     * 请求URL
     */
    url: string;
    /**
     * 请求是否成功
     */
    success: boolean;
    /**
     * 错误信息（如果请求失败）
     */
    error: unknown;
    /**
     * 请求耗时（毫秒）
     */
    duration: number;
}
/**
 * 扩展的Axios请求配置
 * @template D - 请求数据类型
 * @template T - 是否返回详细信息
 * @template R - 是否为竞速模式
 */
interface ExtendedAxiosRequestConfig<D = any, T extends boolean = false, R extends boolean = false> extends AxiosRequestConfig<D> {
    /**
     * 成功状态码列表，默认为 [200]
     */
    successCodes?: number[];
    /**
     * 是否返回详细信息，默认为 false
     */
    detailed?: T;
    /**
     * race模式 必须条件为请求成功 不符合的状态码将会被忽略
     */
    isRace?: R;
}
/**
 * 竞速模式返回结果类型 - 返回单个值或null
 * @template T - 是否返回详细信息
 */
type RaceResult<T extends boolean = false> = T extends true ? TestNetworkRequestDetail | null : string | null;
/**
 * 标准模式返回结果类型 - 返回数组
 * @template T - 是否返回详细信息
 */
type StandardResult<T extends boolean = false> = T extends true ? TestNetworkRequestDetail[] : string[];
/**
 * pingRequest函数的返回类型
 * @template T - 是否返回详细信息
 * @template R - 是否为竞速模式
 */
type PingRequestResult<T extends boolean = false, R extends boolean = false> = R extends true ? RaceResult<T> : StandardResult<T>;
interface GithubConfig {
    proxy: string;
    /**
     * 是否支持克隆
     */
    isClone: boolean;
    /**
     * 是否支持raw
     */
    isRaw: boolean;
    /**
     * 获取raw地址
     * @param url - github地址
     * @returns 返回raw地址
     */
    raw: (url: string) => string;
    /**
     * 克隆地址
     * @param url - github地址
     * @returns 返回克隆地址
     */
    clone: (url: string) => string;
}

/** 依赖管理基类 */
interface DependenciesManageBase {
    /** 操作类型：升级、删除、添加 */
    type: 'upgrade' | 'remove' | 'add';
}
/**
 * 新增依赖请求参数
 * @description 新增依赖请求参数
 */
interface AddDependenciesParams extends DependenciesManageBase {
    type: 'add';
    data: {
        /** 依赖名称 */
        name: string;
        /** 安装到哪里 */
        location: 'dependencies' | 'devDependencies' | 'optionalDependencies';
        /** 依赖版本 */
        version?: string;
        /** 允许pnpm在安装期间执行安装的包名列表 */
        allowBuild?: string[];
    };
}
/** 升级依赖请求参数 */
interface UpgradeDependenciesParams extends DependenciesManageBase {
    type: 'upgrade';
    /** 是否更新所有依赖 */
    isAll: boolean;
    /** 依赖列表 */
    data: Array<{
        /** 依赖名称 */
        name: string;
        /** 依赖版本 */
        version?: string;
    }>;
}
/** 删除依赖请求参数 */
interface RemoveDependenciesParams extends DependenciesManageBase {
    type: 'remove';
    /** 依赖列表 */
    data: string[];
}
/**
 * 依赖管理请求参数接口
 */
type DependenciesManage = UpgradeDependenciesParams | RemoveDependenciesParams | AddDependenciesParams;

/** 插件类型 */
type PluginType = 'npm' | 'git' | 'app';
/** 插件管理任务参数 */
type PluginAdminBase = Omit<CreateTaskParams, 'operatorIp' | 'createTime' | 'target'>;
/**
 * 插件安装任务参数
 */
interface PluginAdminInstallBase extends PluginAdminBase {
    type: 'install';
    /** 插件名称 */
    target: string;
    /** 插件类型 */
    source: 'market' | 'custom';
}
/**
 * 自定义安装插件任务参数基类
 */
interface PluginAdminCustomInstallBase extends PluginAdminInstallBase {
    source: 'custom';
    /** 插件类型 */
    pluginType: PluginType;
}
/**
 * 自定义安装npm包任务参数
 */
interface PluginAdminCustomInstallNpm extends PluginAdminCustomInstallBase {
    pluginType: 'npm';
    /** 版本 */
    version?: string;
    /** 指定registry源 */
    registry?: string;
    /** 允许pnpm在安装期间执行安装的包名列表 */
    allowBuild?: string[];
}
/**
 * 自定义安装git仓库任务参数
 */
interface PluginAdminCustomInstallGit extends PluginAdminCustomInstallBase {
    pluginType: 'git';
    /** 仓库地址 */
    repo: string;
    /** 分支 */
    branch?: string;
    /** 自定义插件名称 不指定则使用git仓库名称 */
    target: string;
}
/**
 * 自定义安装app任务参数
 */
interface PluginAdminCustomInstallApp extends PluginAdminCustomInstallBase {
    pluginType: 'app';
    /** js文件直链 */
    jsUrl: string;
    /** 下载后显示的名称 不指定则使用jsUrl的文件名 无需指定后缀 */
    target: string;
}
/**
 * 插件卸载任务参数
 */
interface PluginAdminUninstall extends PluginAdminBase {
    type: 'uninstall';
    /** 卸载目标 */
    target: {
        /** 插件类型 */
        type: PluginType;
        /** 插件名称 在app类型下是`插件包名称:ts、js文件名称` 包含后缀 */
        name: string;
    }[];
}
/**
 * 插件更新任务参数
 */
interface PluginAdminUpdate extends PluginAdminBase {
    type: 'update';
    /** 是否更新所有插件 */
    isAll?: {
        /** 是否更新全部npm插件 */
        npm: boolean;
        /** 是否更新全部git插件 */
        git: boolean;
        /** git插件是否强制更新 */
        force: boolean;
    };
    /** 更新目标 */
    target: {
        /** 插件类型 */
        type: Omit<PluginType, 'app'>;
        /** 插件名称 */
        name: string;
        /** 更新版本 默认为latest 仅在npm下有效 */
        version?: string;
        /** 是否强制更新 仅在git下有效 */
        force?: boolean;
    }[];
}
/**
 * 插件市场
 */
interface PluginAdminMarketInstallBaase extends PluginAdminInstallBase {
    type: 'install';
    /** 插件类型 */
    source: 'market';
}
/**
 * app类型插件市场安装任务参数
 */
interface PluginAdminMarketInstallApp extends PluginAdminMarketInstallBaase {
    pluginType: 'app';
    /** 需要安装的url列表 */
    urls: string[];
}
/**
 * npm类型插件市场安装任务参数
 */
interface PluginAdminMarketInstallNpm extends PluginAdminMarketInstallBaase {
    pluginType: 'npm';
    /** 允许pnpm在安装期间执行脚本的包名列表 */
    allowBuild?: string[];
}
/**
 * git类型插件市场安装任务参数
 */
interface PluginAdminMarketInstallGit extends PluginAdminMarketInstallBaase {
    pluginType: 'git';
}
/**
 * 插件市场安装任务参数
 */
type PluginAdminMarketInstall = PluginAdminMarketInstallApp | PluginAdminMarketInstallNpm | PluginAdminMarketInstallGit;
/** 自定义安装任务参数 */
type PluginAdminCustomInstall = PluginAdminCustomInstallNpm | PluginAdminCustomInstallGit | PluginAdminCustomInstallApp;
/**
 * 前端插件安装任务参数
 */
type PluginAdminInstall = PluginAdminMarketInstall | PluginAdminCustomInstall;
/**
 * 插件管理路由参数
 */
type PluginAdminParams = PluginAdminInstall | PluginAdminUninstall | PluginAdminUpdate;
/**
 * 插件管理返回值
 */
interface PluginAdminResult {
    /** 是否成功 */
    success: boolean;
    /** 操作日志 */
    message: string;
    /** 任务ID */
    taskId?: string;
}

/**
 * 输入包名 返回包根目录的绝对路径 仅简单查找
 * @param name - 包名
 * @param rootPath - 导入包的路径 此项适用于在插件中读取插件的依赖包
 * @returns - 包根目录的绝对路径
 * @example
 * pkgRoot('axios')
 * pkgRoot('axios', import.meta.url)
 * pkgRoot('axios', import.meta.url)
 */
declare const pkgRoot: (name: string, rootPath?: string) => string;
/**
 * 传入插件名称 返回插件根目录、路径、package.json等信息
 * @param name - 插件名称
 */
declare const getPluginInfo: (name: string) => (PkgInfo & {
    readonly pkg: PkgData | null;
}) | null;
/**
 * 传入一个名称 判断是否为插件
 * @param name - 插件名称
 */
declare const isPlugin: (name: string) => boolean;

/** 插件类型 */
type Apps = 'app' | 'git' | 'npm';
/** karin插件类型 */
type KarinPluginAppsType = Apps;
/** 获取插件的方式 */
type GetPluginType = 'app' | 'git' | 'npm' | 'all';
/**
 * 插件方法类型
 * - `command` 命令
 * - `accept` 接受通知请求
 * - `task` 定时任务
 * - `button` 按钮
 * - `handler` 处理器
 * - `use` 中间件
 */
type PluginFncTypes = 'command' | 'accept' | 'task' | 'button' | 'handler' | 'use';
/** 插件包基本属性 */
interface PkgInfo {
    /**
     * 插件包唯一标识
     */
    id: number;
    /**
     * 插件包类型
     * - `app`: 单app
     * - `git`: git仓库
     * - `npm`: npm包
     */
    type: Apps;
    /**
     * 插件包名称
     * - `app`: `karin-plugin-example`
     * - `git`: `karin-plugin-memes`
     * - `npm`: `@karinjs/adapter-qqbot`
     */
    name: string;
    /**
     * 插件根目录
     * - `app`: `/root/karin/plugins/karin-plugin-example`
     * - `git`: `/root/karin/plugins/karin-plugin-memes`
     * - `npm`: `/root/karin/node_modules/@karinjs/adapter-qqbot`
     */
    dir: string;
    /**
     * apps绝对路径列表
     */
    apps: string[];
    /**
     * 所有可能包含apps的目录列表
     */
    allApps: string[];
    /**
    * 获取`package.json`绝对路径
    */
    get pkgPath(): string;
    /**
     * 读取`package.json`文件
     */
    get pkgData(): PkgData;
}
/** 获取本地插件Api请求参数 */
type GetPluginLocalOptions<T extends boolean, R extends boolean> = {
    /** 是否获取详细信息 */
    info?: T;
    /** 是否强制获取 忽略缓存 */
    force?: boolean;
    /** 在获取全部插件时多返回一个类型 */
    returnType?: R;
};
/** 获取插件Apii返回 */
type GetPluginReturn<T extends boolean> = T extends true ? PkgInfo[] : string[];
/** 获取本地插件Api返回 */
type GetPluginLocalReturn<T extends boolean, R extends boolean> = T extends true ? PkgInfo[] : R extends true ? {
    name: string;
    type: Apps;
}[] : string[];
/** 单个方法基本属性 */
interface PluginFile<T extends PluginFncTypes> {
    /** app绝对路径 */
    absPath: string;
    /** app目录：`/root/karin/plugins/karin-plugin-example` */
    get dirname(): string;
    /** app文件名：`index.ts` `index.js` */
    get basename(): string;
    /**
     * 插件方法类型
     * - `accept`
     * - `command`
     * - `task`
     * - `button`
     * - `handler`
     * - `middleware` */
    type: T;
    /**
     * 插件方法名称
     * @example
     * ```ts
     * import karin from 'node-karin'
     *
     * export const fnc = karin.command('你好', 'hello', { name: 'demo插件' })
     * // 此时`method`为`fnc` 也就是导出的方法名称
     * ```
     */
    method: string;
    /**
     * app名称
     * @example
     * ```ts
     * import karin from 'node-karin'
     *
     * export const fnc = karin.command('你好', 'hello', { name: 'demo插件' })
     * // 此时`name`为`demo插件` 如果没有，则是`this.method`
     * ```
     */
    name: string;
}
/** 适配器参数 */
interface AdapterOptions {
    /** 适配器 */
    adapter: AdapterProtocol[];
    /** 禁用的适配器 */
    dsbAdapter: AdapterProtocol[];
}
/**
 * 日志方法
 * @param T 是否为bot专属日志方法
 */
type Log<T extends boolean> = T extends true ? (id: string, log: string) => void : (log: string) => void;

/** 任务执行策略枚举 */
declare enum TaskExecutionType {
    /** 默认策略，允许并发执行 */
    DEFAULT = "default",
    /** 跳过策略，如果上一次任务未完成，则直接跳过本次执行 */
    SKIP = "skip"
}
/** 定时任务方法 */
interface Task {
    /** 插件包基本属性 */
    pkg: PkgInfo;
    /** 插件方法基本属性 */
    file: PluginFile<'task'>;
    /** 任务名称 */
    name: string;
    /** cron表达式 */
    cron: string;
    /** 执行方法 */
    fnc: Function;
    /** 打印触发插件日志方法 */
    log: Log<false>;
    /** schedule */
    schedule?: Job;
    /**
     * 任务执行策略
     * - `default`: 默认策略，允许并发执行，即不检查上一次任务是否完成
     * - `skip`: 跳过策略，如果上一次任务未完成，则直接跳过本次执行
     */
    type: TaskExecutionType;
    /** 运行状态 */
    running: boolean;
}

/**
 * 全部插件方法联合类型
 */
type AllPluginMethods = Accept | Button | Handler | Task | Command | CommandClass;

/** pkg环境变量类型 */
interface PkgEnv {
    /** 变量名 */
    key: string;
    /** 变量值 */
    value: string;
    /** 变量注释 */
    comment: string;
}
/** 插件的package.json标准类型 */
interface PkgData {
    /** 插件名称 */
    name: string;
    /** 插件版本 */
    version: string;
    /** 插件入口 */
    main: string;
    /** 官方的 engines 字段 */
    engines?: {
        karin?: string;
        ['node-karin']?: string;
        [key: string]: any;
    };
    karin?: {
        /** ts入口 */
        main?: string;
        /** 插件app列表 */
        apps?: string | string[];
        /** web配置文件 */
        web?: string;
        /** ts插件app列表 ts专属 仅在ts开发模式下生效 */
        ['ts-apps']?: string | string[];
        /** ts-web */
        ['ts-web']?: string;
        /** 静态资源目录 */
        static?: string | string[];
        /** 基本文件夹结构 */
        files?: string[];
        /** 环境变量配置 */
        env?: PkgEnv[];
        /**
         * 引擎兼容性 官方的翻译。。。奇奇怪怪的
         * @description 插件的引擎兼容性配置，用于指定插件在哪些karin版本下运行。
         * @description karin版本
         * @example ^0.0.1
         * @example >=0.0.1
         * @example 0.0.1
         * @example 0.0.x
         */
        engines?: string;
        /** 忽略引擎版本检查，强制加载插件（仅适用于karin.engines，不影响package.engines） */
        ignoreEngines?: boolean;
    };
    [key: string]: any;
}

/**
 * 加载插件缓存类型
 */
type LoadPluginResult = Record<string, AllPluginMethods | AllPluginMethods[]>;

/**
 * 命令选项
 */
interface Options$1 {
    /** 插件名称 */
    name?: string;
    /** 是否启用日志 */
    log?: boolean;
    /** 权限 默认`all` */
    perm?: Command['permission'];
    /** 优先级 默认`10000` */
    rank?: Command['priority'];
    /** 生效的适配器 */
    adapter?: Command['adapter'];
    /** 禁用的适配器 */
    dsbAdapter?: Command['dsbAdapter'];
    /**
     * 权限
     * @default 'all'
     */
    permission?: Command['permission'];
    /**
     * 插件优先级 数字越小优先级越高
     * @default 10000
     */
    priority?: Command['priority'];
    /**
     * 禁用的适配器
     * @deprecated 已废弃 请使用`dsbAdapter`
     */
    notAdapter?: Command['dsbAdapter'];
}

interface TaskOptions {
    /** 插件名称 */
    name?: string;
    /** 是否启用日志 */
    log?: boolean;
    /**
     * 任务执行策略
     * - `default`: 默认策略，允许并发执行，即不检查上一次任务是否完成
     * - `skip`: 跳过策略，如果上一次任务未完成，则直接跳过本次执行
     */
    type?: TaskExecutionType | `${TaskExecutionType}`;
}
/**
 * 构建定时任务
 * @param name 任务名称
 * @param cron cron表达式
 * @param fnc 执行函数
 * @param options 选项
 */
declare const task: (name: string, cron: string, fnc: Function, options?: TaskOptions) => Task;

interface AcceptOptions extends Options$1 {
}
/**
 * accept
 * @param event 监听事件
 * @param fnc 实现函数
 */
declare const accept: <T extends keyof NoticeAndRequest>(event: T, fnc: (e: NoticeAndRequest[T], next: () => unknown) => Promise<unknown> | unknown, options?: AcceptOptions) => Accept<T>;

interface ButtonOptions {
    /** 插件名称 */
    name?: string;
    /** 是否启用日志 */
    log?: boolean;
    /**
     * 插件优先级 数字越小优先级越高
     * @default 10000
     */
    priority?: Button['priority'];
    /** 优先级 默认`10000` */
    rank?: Button['priority'];
}
/**
 * 按钮
 * @param reg - 正则表达式
 * @param fnc - 函数
 */
declare const button$1: (reg: RegExp | string, fnc: Button["fnc"], options?: ButtonOptions) => Button;

/**
 * @public
 */
declare interface Point {
    x: number;
    y: number;
}
/**
 * @public
 */
declare interface BoundingBox extends Point {
    /** 元素的宽度（以像素为单位） */
    width: number;
    /** 元素的高度（以像素为单位） */
    height: number;
}
/**
 * @public
 */
declare interface ScreenshotClip extends BoundingBox {
    /**
     * @defaultValue `1`
     */
    scale?: number;
}
/**
 * @public
 */
declare interface ScreenshotOptions {
    /**
     * @defaultValue `false`
     */
    optimizeForSpeed?: boolean;
    /**
     * @defaultValue `'png'`
     */
    type?: 'png' | 'jpeg' | 'webp';
    /**
     * 图像的质量，范围为 0-100。不适用于 `png` 图像。
     */
    quality?: number;
    /**
     * 从表面捕获屏幕截图，而不是从视图捕获。
     *
     * @defaultValue `true`
     */
    fromSurface?: boolean;
    /**
     * 当设置为 `true` 时，将捕获整个页面的屏幕截图。
     *
     * @defaultValue `false`
     */
    fullPage?: boolean;
    /**
     * 隐藏默认的白色背景，允许捕获具有透明背景的屏幕截图。
     *
     * @defaultValue `false`
     */
    omitBackground?: boolean;
    /**
     * 保存图像的文件路径。屏幕截图的类型将从文件扩展名推断得出。
     * 如果路径是相对路径，则会相对于当前工作目录解析。
     * 如果未提供路径，则图像不会保存到磁盘。
     */
    path?: string;
    /**
     * 指定页面/元素需要裁剪的区域。
     */
    clip?: ScreenshotClip;
    /**
     * 图像的编码方式。
     *
     * @deprecated 这是无效选项，强制性返回base64编码的字符串
     */
    encoding?: 'base64' | 'binary';
    /**
     * 捕获视口之外的屏幕截图。
     *
     * @defaultValue `false` 如果没有 `clip` 的情况下为 `false`。否则为 `true`。
     */
    captureBeyondViewport?: boolean;
}
/**
 * @public
 */
declare type PuppeteerLifeCycleEvent = 
/**
* 等待`load`事件。
*/
'load'
/**
* 等待`DOMContentLoaded`事件。
*/
 | 'domcontentloaded'
/**
* 等待至少 `500` 毫秒，直至网络连接不超过 0 个
*/
 | 'networkidle0'
/**
* 等待至少 `500` 毫秒，直至网络连接不超过 2 个
*/
 | 'networkidle2';
/**
 * @public
 */
declare interface WaitForOptions {
    /**
     * 最大等待时间（以毫秒为单位）。传递 0 可禁用超时
     *
     * The default value can be changed by using the
     * {@link Page.setDefaultTimeout} or {@link Page.setDefaultNavigationTimeout}
     * methods.
     *
     * @defaultValue `30000`
     */
    timeout?: number;
    /**
     * 何时认为等待成功。给定一个事件字符串数组，当所有事件都触发后，等待才被视为成功
     *
     * @defaultValue `'load'`
     */
    waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
    /** 允许您取消呼叫的信号对象 */
    signal?: AbortSignal;
}
/**
 * @public
 */
declare interface GoToOptions extends WaitForOptions {
    /**
     * 如果提供，它将优先于由以下项设置的 referer 标头值：
     * {@link Page.setExtraHTTPHeaders | page.setExtraHTTPHeaders()}.
     */
    referer?: string;
    /**
     * 如果提供，它将优先于 referer-policy 标头值
     * set by {@link Page.setExtraHTTPHeaders | page.setExtraHTTPHeaders()}.
     */
    referrerPolicy?: string;
}
interface screenshot extends ScreenshotOptions {
    /** http地址或本地文件路径 */
    file: string;
    /**
   * 选择的元素截图
   * fullPage为false时生效
   * 如果未找到指定元素则使用body
   * @default 'body'
   */
    selector?: string;
    /**
     * 截图类型
     * @default 'jpeg'
    */
    type?: 'png' | 'jpeg' | 'webp';
    /**
     * 截图质量 默认90
     * @default 90
     */
    quality?: number;
    /**
     * - 额外的 HTTP 头信息将随页面发起的每个请求一起发送
     * - 标头值必须是字符串
     * - 所有 HTTP 标头名称均小写。(HTTP 标头不区分大小写，因此这不会影响服务器代码）。
     */
    headers?: Record<string, string>;
    /**
     * 截图整个页面
     * @default false
     */
    fullPage?: boolean;
    /**
     * 控制截图的优化速度
     * @default false
     */
    optimizeForSpeed?: boolean;
    /**
     * 捕获视口之外的屏幕截图
     * @default false
     */
    captureBeyondViewport?: boolean;
    /** 设置视窗大小和设备像素比 */
    setViewport?: {
        /** 视窗宽度 */
        width?: number;
        /** 视窗高度 */
        height?: number;
        /**
         * 设备像素比
         * @default 1
         */
        deviceScaleFactor?: number;
    };
    /** 分页截图 传递数字则视为视窗高度 返回数组 */
    multiPage?: number | boolean;
    /** 页面goto时的参数 */
    pageGotoParams?: GoToOptions;
    /** 等待指定元素加载完成 */
    waitForSelector?: string | string[];
    /** 等待特定函数完成 */
    waitForFunction?: string | string[];
    /** 等待特定请求完成 */
    waitForRequest?: string | string[];
    /** 等待特定响应完成 */
    waitForResponse?: string | string[];
}
/** 截图参数 */
interface Options extends screenshot {
    /** 保存文件目录 推荐使用插件名称 */
    name?: string;
    /** 传递给 art-template 的参数 */
    data?: Record<string, any>;
}
/** 单页或多页截图返回 */
type RenderResult<T extends screenshot> = T['multiPage'] extends true | number ? string[] : string;
/**
 * snapka截图参数
 */
interface Snapka extends screenshot {
    /**
     * 截图类型
     * @default 'png'
     */
    type?: 'png' | 'jpeg' | 'webp';
    /** http地址、本地文件路径、html字符串 */
    file: string;
    /**
     * file类型
     * @default 'auto'
     * @description 如果传递的是URL、HTML绝对路径则无需传递此项
     * - auto: 自动识别、支持URL、HTML绝对路径
     * - htmlString: 传递HTML字符串
     * - vue3: 传递Vue3组件路径
     * - vueString: 传递Vue3组件字符串
     * - react: 传递React组件路径 `(暂未支持)`
     */
    file_type?: 'auto' | 'htmlString' | 'vue3' | 'vueString' | 'react';
    /** 文件名 推荐在传递字符串时使用 */
    file_name?: string;
    /** 重试次数 */
    retry?: number;
    /** 渲染参数 */
    data?: Record<string, any>;
}
/** snapka截图返回 */
type SnapkaResult<T extends Snapka> = T['multiPage'] extends true | number ? string[] : string;

interface Renders {
    /**
     * 快速渲染
     * @param file - 文件路径、http地址
     */
    render(file: string): Promise<string>;
    /**
     * 分片渲染
     * @param options - 渲染参数
     */
    render(file: string, multiPage: number | boolean): Promise<Array<string>>;
    /**
     * 自定义渲染
     * @param options - 渲染参数
     */
    render<T extends Options>(options: T, id?: string): Promise<RenderResult<T>>;
    /**
     * 如果第三个重载没有类型 请使用这个重载
     * @param options - 渲染参数
     */
    render<T extends Options>(type: 'opt', options: T, id?: string): Promise<RenderResult<T>>;
}
/**
 * 渲染
 * @param options - 渲染参数
 * @param multiPageOrId - 多页截图参数
 * @param id - 页面id
 */
declare const render$2: <T extends Options>(options: string | T, multiPageOrId?: string | number | boolean | T, id?: string) => Promise<RenderResult<T>>;

/**
 * 命令选项
 */
interface CommandOptions<T extends keyof MessageEventMap> extends Options$1 {
    /** 监听事件 */
    event?: T;
    notAdapter?: Command['dsbAdapter'];
    /** 是否加上at 仅在群聊中有效 */
    at?: boolean;
    /** 是否加上引用回复 */
    reply?: boolean;
    /** 发送是否撤回消息 单位秒 */
    recallMsg?: number;
    /**
     * 如果无权触发插件 是否打印日志
     * - `true`: `暂无权限，只有主人才能操作`
     * - `false`: ``
     * - `string`: `自定义提示`
     */
    authFailMsg?: boolean | string;
}
/**
 * 字符串命令选项
 */
interface StrCommandOptions<T extends keyof MessageEventMap> extends CommandOptions<T> {
    /** 延迟回复 单位毫秒 */
    delay?: number;
    /** 是否停止执行后续插件 */
    stop?: boolean;
}
/**
 * 命令类型
 */
interface CommandType {
    /**
    * @param reg 正则表达式
    * @param fnc 函数
    * @param options 选项
    */
    <T extends keyof MessageEventMap = keyof MessageEventMap>(reg: string | RegExp, fnc: CmdFnc<T>, options?: CommandOptions<T>): Command<T>;
    /**
     * @param reg 正则表达式
     * @param element 字符串或者KarinElement、KarinElement数组
     * @param options 选项
     */
    <T extends keyof MessageEventMap = keyof MessageEventMap>(reg: string | RegExp, element: string | Elements | Elements[], options?: StrCommandOptions<T>): Command<T>;
}
/**
 * 快速构建命令
 * @param reg 正则表达式
 * @param second 函数或者字符串或者KarinElement、KarinElement数组
 * @param options 选项
 * @returns 返回插件对象
 */
declare const command: CommandType;

/**
 * 上下文
 * @param e - 消息事件
 * @param options - 上下文选项
 * @returns 返回下文消息事件 如果超时则返回null
 */
declare const ctx: <T = Message>(e: Event, options?: {
    /** 指定用户id触发下文 不指定则使用默认e.user_id */
    userId?: string;
    /** 超时时间 默认120秒 */
    time?: number;
    /** 超时后是否回复 */
    reply?: boolean;
    /** 超时回复文本 默认为'操作超时已取消' */
    replyMsg?: string;
    /** 超时后是否抛出错误 默认为 true */
    throwOnTimeout?: boolean;
}) => Promise<T | null>;

interface HandlerOptions {
    /** 插件名称 */
    name?: string;
    /** 是否启用日志 */
    log?: boolean;
    /** 优先级 默认`10000` */
    rank?: Handler['priority'];
    /** 优先级 默认`10000` */
    priority?: Handler['priority'];
}
/**
 * - 构建handler
 * @param key - 事件key
 * @param fnc - 函数实现
 * @param options - 选项
 */
declare const handler: (key: string, fnc: Handler["fnc"], options?: HandlerOptions) => Handler;

interface SendMsgOptions {
    /** 发送成功后撤回消息时间 */
    recallMsg?: number;
    /** @deprecated 已废弃 请使用 `retryCount` */
    retry_count?: number;
    /** 重试次数 */
    retryCount?: number;
}
interface SendMasterOptions extends SendMsgOptions {
    /** 是否必须为Bot对应的主人/管理员 默认false */
    mustMaster?: boolean;
}
interface SendAdminOptions extends SendMsgOptions {
    /** 是否必须为Bot对应的主人/管理员 默认false */
    mustAdmin?: boolean;
}
/**
 * 给主人发消息
 * @param selfId Bot的ID
 * @param targetId 主人ID
 * @param elements 消息内容
 * @param options 消息选项
 */
declare const sendMaster: (selfId: string, targetId: string, elements: SendMessage, options?: SendMasterOptions) => Promise<SendMsgResults>;
/**
 * 给管理员发消息
 * @param selfId Bot的ID
 * @param targetId 管理员ID
 * @param elements 消息内容
 * @param options 消息选项
 */
declare const sendAdmin: (selfId: string, targetId: string, elements: SendMessage, options?: SendAdminOptions) => Promise<SendMsgResults>;

type fnc_AcceptOptions = AcceptOptions;
type fnc_ButtonOptions = ButtonOptions;
type fnc_CommandOptions<T extends keyof MessageEventMap> = CommandOptions<T>;
type fnc_CommandType = CommandType;
type fnc_GetBot = GetBot;
type fnc_HandlerOptions = HandlerOptions;
type fnc_Renders = Renders;
type fnc_StrCommandOptions<T extends keyof MessageEventMap> = StrCommandOptions<T>;
type fnc_TaskOptions = TaskOptions;
type fnc_UnregisterBot = UnregisterBot;
declare const fnc_accept: typeof accept;
declare const fnc_command: typeof command;
declare const fnc_ctx: typeof ctx;
declare const fnc_getAllBot: typeof getAllBot;
declare const fnc_getAllBotID: typeof getAllBotID;
declare const fnc_getAllBotList: typeof getAllBotList;
declare const fnc_getBot: typeof getBot;
declare const fnc_getBotCount: typeof getBotCount;
declare const fnc_handler: typeof handler;
declare const fnc_registerBot: typeof registerBot;
declare const fnc_sendAdmin: typeof sendAdmin;
declare const fnc_sendMaster: typeof sendMaster;
declare const fnc_task: typeof task;
declare const fnc_unregisterBot: typeof unregisterBot;
declare namespace fnc {
  export { type fnc_AcceptOptions as AcceptOptions, type fnc_ButtonOptions as ButtonOptions, type fnc_CommandOptions as CommandOptions, type fnc_CommandType as CommandType, type fnc_GetBot as GetBot, type fnc_HandlerOptions as HandlerOptions, type Options$1 as Options, type fnc_Renders as Renders, type fnc_StrCommandOptions as StrCommandOptions, type fnc_TaskOptions as TaskOptions, type fnc_UnregisterBot as UnregisterBot, fnc_accept as accept, button$1 as button, fnc_command as command, fnc_ctx as ctx, fnc_getAllBot as getAllBot, fnc_getAllBotID as getAllBotID, fnc_getAllBotList as getAllBotList, fnc_getBot as getBot, fnc_getBotCount as getBotCount, fnc_handler as handler, fnc_registerBot as registerBot, render$2 as render, fnc_sendAdmin as sendAdmin, fnc_sendMaster as sendMaster, sendMsg$1 as sendMsg, fnc_task as task, fnc_unregisterBot as unregisterBot };
}

declare const karin: {
    name: "karin";
    contact(scene: "friend", peer: string, name?: string): Contact<"friend">;
    contact(scene: "group", peer: string, name?: string): Contact<"group">;
    contact(scene: "guild", peer: string, subPeer: string, name?: string): Contact<"guild">;
    contact(scene: "direct", peer: string, subPeer: string, name?: string): Contact<"direct">;
    contact(scene: "groupTemp", peer: string, subPeer: string, name?: string): Contact<"groupTemp">;
    contactGroup(peer: Contact["peer"], name?: string): Contact<"group">;
    contactFriend(peer: Contact["peer"], name?: string): Contact<"friend">;
    contactGuild(peer: string, subPeer: string, name?: string, subName?: string): Contact<"guild">;
    contactGroupTemp(peer: string, subPeer: string, name?: string): Contact<"groupTemp">;
    friendSender(userId: number | string, nick: string, sex?: FriendSender["sex"], age?: number, uid?: string, uin?: number): FriendSender;
    groupSender(userId: number | string, role: GroupSender["role"], nick?: string, sex?: GroupSender["sex"], age?: number, card?: string, area?: string, level?: number, title?: string, uid?: string, uin?: number): GroupSender;
    getBotByIndex(index: number): AdapterType<any> | null;
    getBotCount(): number;
    getBotAll<T extends boolean = false>(isIndex?: T): T extends true ? ReturnType<typeof getAllBotList> : ReturnType<typeof getAllBot>;
    [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
    addListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    on<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    once<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    removeListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    off<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    removeAllListeners(event?: string | symbol | undefined): /*elided*/ any;
    setMaxListeners(n: number): /*elided*/ any;
    getMaxListeners(): number;
    listeners<K>(eventName: string | symbol): Function[];
    rawListeners<K>(eventName: string | symbol): Function[];
    emit<K>(eventName: string | symbol, ...args: any[]): boolean;
    listenerCount<K>(eventName: string | symbol, listener?: Function | undefined): number;
    prependListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    prependOnceListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    eventNames(): (string | symbol)[];
} & typeof fnc;
/**
 * @deprecated 已废弃，请使用`karin`
 */
declare const Bot: {
    name: "karin";
    contact(scene: "friend", peer: string, name?: string): Contact<"friend">;
    contact(scene: "group", peer: string, name?: string): Contact<"group">;
    contact(scene: "guild", peer: string, subPeer: string, name?: string): Contact<"guild">;
    contact(scene: "direct", peer: string, subPeer: string, name?: string): Contact<"direct">;
    contact(scene: "groupTemp", peer: string, subPeer: string, name?: string): Contact<"groupTemp">;
    contactGroup(peer: Contact["peer"], name?: string): Contact<"group">;
    contactFriend(peer: Contact["peer"], name?: string): Contact<"friend">;
    contactGuild(peer: string, subPeer: string, name?: string, subName?: string): Contact<"guild">;
    contactGroupTemp(peer: string, subPeer: string, name?: string): Contact<"groupTemp">;
    friendSender(userId: number | string, nick: string, sex?: FriendSender["sex"], age?: number, uid?: string, uin?: number): FriendSender;
    groupSender(userId: number | string, role: GroupSender["role"], nick?: string, sex?: GroupSender["sex"], age?: number, card?: string, area?: string, level?: number, title?: string, uid?: string, uin?: number): GroupSender;
    getBotByIndex(index: number): AdapterType<any> | null;
    getBotCount(): number;
    getBotAll<T extends boolean = false>(isIndex?: T): T extends true ? ReturnType<typeof getAllBotList> : ReturnType<typeof getAllBot>;
    [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
    addListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    on<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    once<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    removeListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    off<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    removeAllListeners(event?: string | symbol | undefined): /*elided*/ any;
    setMaxListeners(n: number): /*elided*/ any;
    getMaxListeners(): number;
    listeners<K>(eventName: string | symbol): Function[];
    rawListeners<K>(eventName: string | symbol): Function[];
    emit<K>(eventName: string | symbol, ...args: any[]): boolean;
    listenerCount<K>(eventName: string | symbol, listener?: Function | undefined): number;
    prependListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    prependOnceListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): /*elided*/ any;
    eventNames(): (string | symbol)[];
} & typeof fnc;

/**
 * 调用按钮处理器
 * @param msg 传e.msg就行
 * @param e 消息事件 可不传
 * @param arg 自定义参数 可不传
 * @returns 返回按钮元素
 */
declare const buttonHandle: (reg: string, args?: {
    e?: Event;
    [key: string]: any;
}) => Promise<(KeyboardElement | ButtonElement)[]>;

/**
 * 将karin标准格式的按钮转换为QQ官方按钮
 * @param button karin按钮
 * @returns QQ按钮数组
 */
declare const karinToQQBot: (button: ButtonElement | KeyboardElement) => Array<{
    buttons: Array<QQBotButton>;
}>;
/**
 * 将QQ官方按钮转换为karin标准格式的按钮
 * @param button QQ按钮 传`content.rows`
 * @returns karin按钮
 */
declare const qqbotToKarin: (button: Array<{
    buttons: Array<QQBotButton>;
}>) => string;

/**
 * 异步检查路径文件是否存在
 * @param file 文件路径
 * @returns 返回布尔值
 */
declare const exists: (file: string) => Promise<boolean>;
/**
 * 异步检查是否为目录
 * @param file 文件路径
 * @returns 返回布尔值
 */
declare const isDir: (file: string) => Promise<boolean>;
/**
 * 异步检查是否为文件
 * @param file 文件路径
 * @returns 返回布尔值
 */
declare const isFile: (file: string) => Promise<boolean>;
/**
 * 递归创建文件夹
 * @param dirname 文件夹路径
 * @returns 返回布尔值 是否创建成功
 */
declare const mkdir: (dirname: string) => Promise<boolean>;
/**
 * 检查目录是否存在 不存在则创建
 * @param file 文件路径
 * @returns 返回布尔值
 */
declare const existToMkdir: (file: string) => Promise<boolean>;

/**
 * 检查目录是否存在
 * @param file 文件路径
 * @returns 返回布尔值
 */
declare const existsSync: (file: string) => boolean;
/**
 * 检查是否为目录
 * @param file 文件路径
 * @returns 返回布尔值
 */
declare const isDirSync: (file: string) => boolean;
/**
 * 检查是否为文件
 * @param file 文件路径
 * @returns 返回布尔值
 */
declare const isFileSync: (file: string) => boolean;
/**
 * 递归创建文件夹
 * @param dirname 文件夹路径
 * @returns 返回布尔值 是否创建成功
 */
declare const mkdirSync: (dirname: string) => boolean;
/**
 * 检查目录是否存在 不存在则创建
 * @param file 文件路径
 * @returns 返回布尔值
 */
declare const existToMkdirSync: (file: string) => boolean;
declare const rmSync: typeof fs$1.rmSync;

/**
 * 将数据转换为不带前缀的base64字符串
 * @param data - 文件路径或Buffer对象、可读流对象、http地址、base64://字符串
 * @param options - 选项 http为true时返回http地址
 * @returns 返回base64字符串
 * @example
 * ```ts
 * await base64('https://example.com/image.png')
 * await base64('C:/Users/admin/1.txt')
 * await base64('base64://aGVsbG8=')
 * await base64(fs.createReadStream('C:/Users/admin/1.txt'))
 * // -> 'aGVsbG8='
 * ```
 */
declare const base64: (data: unknown, options?: {
    http: boolean;
}) => Promise<string>;
/**
 * 将数据转换为Buffer对象
 * @param data - 文件路径或Buffer对象、可读流对象、http地址、base64://字符串
 * @param options - 选项 http为true时返回http地址
 * @returns 返回Buffer对象
 * @example
 * ```ts
 * await buffer('https://example.com/image.png')
 * await buffer('C:/Users/admin/1.txt')
 * await buffer('base64://aGVsbG8=')
 * await buffer(fs.createReadStream('C:/Users/admin/1.txt'))
 * // -> <Buffer ...>
 * ```
 */
declare const buffer: <T extends {
    http: boolean;
}>(data: unknown, options?: T) => Promise<T extends {
    http: true;
} ? string : Buffer>;
/**
 * 将数据流对象转换为Buffer对象
 * @param stream - 要转换的数据流对象
 * @returns 返回Buffer对象
 * @example
 * ```ts
 * await stream(fs.createReadStream('C:/Users/admin/1.txt'))
 * // -> <Buffer ...>
 */
declare const stream: (stream: Readable) => Promise<Buffer<ArrayBufferLike>>;
/**
 * 传入文件路径 转为buffer
 * @param path - 文件路径
 * @returns 返回Buffer对象 如果发生错误则返回null
 */
declare const readFile: (path: string) => Promise<Buffer | null>;
/**
 * 生成随机字符串 包含字母和数字
 * @param length 长度
 * @returns 返回随机字符串
 */
declare const randomStr: (length?: number) => string;

/** 当前运行环境的路径标准协议前缀 */
declare const sep: RegExp;
/**
 * 下载文件
 * @param fileUrl 下载地址
 * @param savePath 保存路径
 * @param options 请求参数 基本是axios参数，额外拓展了returnBoolean
 */
declare const downloadFile: <T extends boolean = false>(fileUrl: string, savePath: string, options?: DownloadFilesOptions<T>) => Promise<DownloadFileResult<T>>;
/**
 * 下载保存文件
 * @param fileUrl 下载地址
 * @param savePath 保存路径
 * @param param axios参数
 */
declare const downFile: (fileUrl: string, savePath: string, param?: AxiosRequestConfig) => Promise<DownloadFileResult<boolean>>;
/**
 * 标准化文件路径 统一使用/分隔符
 * @param file - 路径
 * @param absPath - 返回绝对路径 默认为true
 * @param prefix - 添加file://前缀 默认为false
 * @returns 标准化后的路径
 */
declare const absPath: (file: string, absPath?: boolean, prefix?: boolean) => string;
/**
 * 为每个插件创建基本文件夹结构
 * @param name 插件名称
 * @param files 需要创建的文件夹列表
 */
declare const createPluginDir: (name: string, files?: string[]) => Promise<void>;
/**
 * 获取符合后缀的文件列表(仅包含文件名称)
 * @param filePath 文件路径
 * @param suffixs 需要复制的文件后缀 可带点
 * @returns 符合条件的文件列表
 */
declare const getFiles: (filePath: string, suffixs?: string[]) => string[];
/**
 * 复制文件 同步
 * @param files 需要复制的文件列表
 * @param defaulPath 模板配置文件路径
 * @param userPath 用户配置文件路径
 */
declare const copyFilesSync: (files: string[], defaulPath: string, userPath: string) => void;
/**
 * 复制文件 异步
 * @param files 需要复制的文件列表
 * @param defaulPath 模板配置文件路径
 * @param userPath 用户配置文件路径
 */
declare const copyFiles: (files: string[], defaulPath: string, userPath: string) => Promise<void>;
/**
 * 创建配置文件 同步
 * @description 从模板配置文件复制到目标文件夹
 * @param defaulPath 模板配置文件路径
 * @param userPath 目标文件夹路径
 * @param suffixs 需要复制的文件后缀 可带点
 * @param isThrow 是否抛出异常 默认不抛出
 * @returns 是否复制成功
 * @example
 * ```ts
 * copyConfigSync('defaultPath', 'userPath')
 * copyConfigSync('defaultPath', 'userPath', ['yaml'])
 * copyConfigSync('defaultPath', 'userPath', ['.yaml', 'json'])
 * copyConfigSync('defaultPath', 'userPath', [], true)
 * ```
 */
declare const copyConfigSync: (defaulPath: string, userPath: string, suffixs?: string[], isThrow?: boolean) => boolean;
/**
 * 创建配置文件 异步
 * @description 从模板配置文件复制到用户配置文件
 * @param defaulPath 模板配置文件路径
 * @param userPath 用户配置文件路径
 * @param suffixs 需要复制的文件后缀 可带点
 * @param isThrow 是否抛出异常 默认不抛出
 * @returns 是否复制成功
 * @example
 * ```ts
 * await copyConfig('defaultPath', 'userPath')
 * await copyConfig('defaultPath', 'userPath', ['yaml'])
 * await copyConfig('defaultPath', 'userPath', ['.yaml', 'json'])
 * await copyConfig('defaultPath', 'userPath', [], true)
 * ```
 */
declare const copyConfig: (defaulPath: string, userPath: string, suffixs?: string[], isThrow?: boolean) => Promise<boolean>;
/**
 * 递归获取目录下的所有文件
 * @param dir 目录路径
 * @param options 选项
 * @returns 符合条件的文件路径列表
 * @example
 * ```ts
 * getAllFilesSync('dir')
 * getAllFilesSync('dir', { suffixs: ['yaml', '.json'] })
 * getAllFilesSync('dir', { exclude: ['.yaml', 'json'] })
 * getAllFilesSync('dir', { returnType: 'abs' })
 * ```
 */
declare const getAllFilesSync: (dir: string, options?: {
    /** 仅获取指定后缀的文件 与 exclude 互斥 */
    suffixs?: string[];
    /** 排除指定后缀的文件 与 suffixs 互斥 */
    exclude?: string[];
    /** 返回类型 'rel':相对路径 'abs':绝对路径 */
    returnType?: "rel" | "abs";
}) => string[];
/**
 * 递归获取目录下的所有文件（异步版本）
 * @param dir 目录路径
 * @param options 选项
 * @returns 符合条件的文件路径列表
 * @example
 * ```ts
 * await getFilesRecursive('dir')
 * await getFilesRecursive('dir', { suffixs: ['yaml', '.json'] })
 * await getFilesRecursive('dir', { exclude: ['.yaml', 'json'] })
 * await getFilesRecursive('dir', { returnType: 'abs' })
 * ```
 */
declare const getAllFiles: (dir: string, options?: {
    /** 仅获取指定后缀的文件 与 exclude 互斥 */
    suffixs?: string[];
    /** 排除指定后缀的文件 与 suffixs 互斥 */
    exclude?: string[];
    /** 返回类型 'rel':相对路径 'abs':绝对路径 默认相对路径 */
    returnType?: "rel" | "abs";
}) => Promise<string[]>;

/**
 * 读取 JSON 文件
 * @param path 文件路径
 * @param isThrow 是否抛出异常 默认为`false`
 */
declare const readJsonSync: (path: string, isThrow?: boolean) => any;
/**
 * 写入 JSON 文件
 * @param path 文件路径
 * @param data 数据
 * @param isThrow 是否抛出异常 默认为`false`
 */
declare const writeJsonSync: (path: string, data: any, isThrow?: boolean) => boolean;
/**
 * 异步读取 JSON 文件
 * @param path 文件路径
 *  @param isThrow 是否抛出异常 默认为`false`
 */
declare const readJson: (path: string, isThrow?: boolean) => Promise<any>;
/**
 * 异步写入 JSON 文件
 * @param path 文件路径
 * @param data 数据
 * @param isThrow 是否抛出异常 默认为`false`
 */
declare const writeJson: (path: string, data: any, isThrow?: boolean) => Promise<boolean>;
/** JSON 文件操作 */
declare const json$1: {
    /** 同步读取 */
    readSync: (path: string, isThrow?: boolean) => any;
    /** 同步写入 */
    writeSync: (path: string, data: any, isThrow?: boolean) => boolean;
    /** 异步读取 */
    read: (path: string, isThrow?: boolean) => Promise<any>;
    /** 异步写入 */
    write: (path: string, data: any, isThrow?: boolean) => Promise<boolean>;
};

/**
 * @description 根据文件后缀名从指定路径下读取符合要求的文件
 * @param path - 路径
 * @param ext - 后缀名、或后缀名列表
 * @param returnType - 返回类型 `name:文件名` `rel:相对路径` `abs:绝对路径`
 * @example
 * ```ts
 * filesByExt('./plugins/karin-plugin-test', '.js')
 * // -> ['1.js', '2.js']
 * filesByExt('./plugins', ['.js', '.ts'], 'name')
 * // -> ['1.js', '2.js', '3.ts']
 * filesByExt('./plugins', '.js', 'rel')
 * // -> ['plugins/1.js', 'plugins/2.js']
 * filesByExt('./plugins', '.js', 'abs')
 * // -> ['C:/Users/karin/plugins/1.js', 'C:/Users/karin/plugins/2.js']
 * ```
 */
declare const filesByExt: (filePath: string, ext: string | string[], returnType?: "name" | "rel" | "abs") => string[];
/**
 * @description 分割路径为文件夹路径和文件名
 * @param filePath - 路径
 * @returns - 文件夹路径和文件名
 * @example
 * ```ts
 * splitPath('C:/Users/admin/1.txt')
 * // -> { dirname: 'C:/Users/admin', basename: '1.txt' }
 * ```
 */
declare const splitPath: (filePath: string) => {
    dirname: string;
    basename: string;
};
/**
 * @description 去掉相对路径的前缀和后缀
 * @param filePath - 相对路径路径
 * @example
 * ```ts
 * getRelPath('./plugins/karin-plugin-example/index.ts')
 * // -> 'plugins/karin-plugin-example/index.ts'
 * ```
 */
declare const getRelPath: (filePath: string) => string;
/**
 * 根据传入的 import.meta.url 计算相对于项目根目录的路径，返回需要的 '../' 层级。
 * @param url - import.meta.url
 * @returns 相对路径的层级数量，用 '../' 表示
 * @example
 * ```ts
 * // 在 plugins/karin-plugin-example/index.ts 中使用
 * urlToPath(import.meta.url)
 * // -> '../../'
 * ```
 */
declare const urlToPath: (url: string) => string;
/**
 * @description 检查目标路径是否处于根路径下
 * @param root 根路径
 * @param target 目标路径
 * @param isAbs 是否将传入的路径转为绝对路径
 * @returns 返回布尔值
 */
declare const isSubPath: (root: string, target: string, isAbs?: boolean) => boolean | "";
/**
 * @description 将路径统一格式
 * - 绝对路径
 * - 统一分隔符`/`
 * @param filePath - 路径
 * @returns 统一格式后的路径
 */
declare const formatPath: (filePath: string) => string;
/**
 * @description 比较两个路径是否相同
 * @param path1 - 第一个路径
 * @param path2 - 第二个路径
 * @returns 是否相同
 * @example
 * ```ts
 * isPathEqual('C:\\Users\\admin', 'C:/Users/admin')
 * // -> true
 * isPathEqual('./folder', 'folder')
 * // -> true
 * ```
 */
declare const isPathEqual: (path1: string, path2: string) => boolean;

interface CacheEntry<T = any> {
    /** 缓存数据 */
    data: T;
    /** 过期时间的时间戳（毫秒） */
    expiry: number | 0;
}
type Parser = (content: string) => any;
type RequireOptions = {
    /** 指定配置文件类型 */
    type?: 'json' | 'yaml' | 'yml';
    /** 文件编码，默认utf-8 */
    encoding?: BufferEncoding;
    /** 是否强制读取，不使用缓存 */
    force?: boolean;
    /** 过期时间，单位秒，默认300秒，0则永不过期 */
    ex?: number;
    /** 文件大小限制，单位字节，默认0无限制 */
    size?: number;
    /** 自定义解析器 */
    parser?: Parser;
    /** 是否只读缓存，为true时如果缓存不存在则返回undefined */
    readCache?: boolean;
};
type RequireFunction = <T = any>(filePath: string, options?: RequireOptions) => Promise<T>;
type RequireFunctionSync = <T = any>(filePath: string, options?: RequireOptions) => T;
/**
 * @description 清除指定缓存
 * @param filePath 文件路径
 * @returns 是否清除成功
 */
declare const clearRequireFile: (filePath: string) => boolean;
/**
 * @description 清除所有缓存
 */
declare const clearRequire: () => void;
/**
 * 异步导入文件
 * @description 缓存导入的文件 默认缓存300秒
 * @param filePath 文件路径
 * @param options 选项
 * @returns 返回文件的内容
 */
declare const requireFile: RequireFunction;
/**
 * 同步导入文件
 * @description 缓存导入的文件 默认缓存300秒
 * @param filePath 文件路径
 * @param options 选项
 * @returns 返回文件的内容
 */
declare const requireFileSync: RequireFunctionSync;

/**
 * @description 传入一个文件路径，检查是否是静态资源中的文件
 * @param filePath 文件路径
 * @returns 是否是静态资源中的文件
 */
declare const isPublic: (filePath: string) => boolean;

type YamlValue = string | boolean | number | object | any[];
type YamlComment = Record<string, string> | Record<string, {
    comment: string;
    type: 'top' | 'end';
}>;
type Save = {
    /**
     * 保存数据并写入注释 (json文件路径)
     * @param path 保存路径
     * @param value 保存的数据
     * @param commentPath 注释配置文件路径(json文件路径)
     */
    (path: string, value: any, commentPath?: string): void;
    /**
     * 保存数据并写入注释 (键值对)
     * @param path 保存路径
     * @param value 保存的数据
     * @param commentKV 键值对注释配置
     */
    (path: string, value: any, commentKV?: Record<string, string>): void;
    /**
     * 保存数据并写入注释 (javascript对象)
     * @param path 保存路径
     * @param value 保存的数据
     * @param commentJavascript javascript对象注释配置
     */
    (path: string, value: any, commentJavascript?: Record<string, {
        /** 注释类型 */
        type: 'top' | 'end';
        /** 注释内容 */
        comment: string;
    }>): void;
};
/** YAML 编辑器 */
declare class YamlEditor {
    filePath: string;
    doc: Document;
    document: Document;
    constructor(file: string);
    /**
     * 获取指定路径的值
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     */
    get(path: string): any;
    /**
     * 设置指定路径的值
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param value - 要设置的值 允许的类型：`string`, `boolean`, `number`, `object`, `array`
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    set(path: string, value: YamlValue, isSplit?: boolean): boolean;
    /**
     * 向指定路径添加新值
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param value - 要添加的值
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    add(path: string, value: YamlValue, isSplit?: boolean): boolean;
    /**
     * 删除指定路径
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     * @returns 是否删除成功
     */
    del(path: string, isSplit?: boolean): boolean;
    /**
     * 向指定路径的数组添加新值，可以选择添加到数组的开始或结束
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param value - 要添加的值
     * @param prepend - 如果为 true，则添加到数组的开头，否则添加到末尾
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    append(path: string, value: string, prepend?: boolean, isSplit?: boolean): boolean;
    /**
     * 向指定路径的数组删除值
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param value - 要删除的值
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    remove(path: string, value: YamlValue, isSplit?: boolean): boolean;
    /**
     * 检查指定路径的键是否存在
     * @param path - 路径，用点号分隔
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    has(path: string, isSplit?: boolean): boolean;
    /**
     * 查询指定路径中是否包含指定的值
     * @param path - 路径，用点号分隔
     * @param value - 要查询的值
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    hasval(path: string, value: YamlValue, isSplit?: boolean): boolean;
    /**
     * 查询指定路径中是否包含指定的值
     * @param path - 路径，用点号分隔
     * @param value - 要查询的值
     * @deprecated 请使用 `hasval` 代替
     */
    hasVal(path: string, value: YamlValue): boolean;
    /**
     * 向根节点新增元素，如果根节点不是数组，则将其转换为数组再新增元素
     * @param value - 要新增的元素
     */
    pusharr(value: YamlValue): boolean;
    /**
     * 根据索引从根节点数组删除元素
     * @param index - 要删除元素的索引
     */
    delarr(index: number): boolean;
    /**
     * 获取指定路径的pair对象
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    getpair(path: string, isSplit?: boolean): any;
    /**
     * 设置指定键的注释
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param comment - 要设置的注释
     * @param prepend - 如果为 true，则添加注释到开头，否则添加到同一行的末尾
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    comment(path: string, comment: string, prepend?: boolean, isSplit?: boolean): void;
    /**
     * 删除指定键的注释
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param type - 要删除的注释类型，`before` 为注释前，`after` 为注释后，`all` 为全部
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    uncomment(path: string, type?: 'before' | 'after' | 'all', isSplit?: boolean): void;
    /**
     * 检查注释是否存在
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param type - 要检查的注释类型，`before` 为注释前，`after` 为注释后
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    hascomment(path: string, type: 'before' | 'after', isSplit?: boolean): boolean;
    /**
     * 获取指定键的注释
     * @param path - 路径，多个路径使用`.`连接，例如：`a.b.c`
     * @param isSplit - 是否使用分割路径路径，默认为 `true`
     */
    getcomment(path: string, isSplit?: boolean): any;
    /**
     * 保存文件
     * 保存失败会抛出异常
     */
    save(): void;
}
interface ReadFunction {
    (path: string): any;
    /**
     * 保存数据并写入注释
     * @param options utf-8编码的字符串或注释配置对象
     */
    save?: (options?: string | YamlComment) => boolean;
}
/**
 * 读取并解析 yaml 文件
 * @param path yaml 文件路径
 * @returns 解析后的数据
 */
declare const read: ReadFunction;
/**
 * 写入 YAML 文件
 * @param path 文件路径
 * @param value 数据
 */
declare const write: (path: string, value: any) => boolean;
/**
 * 保存数据并写入注释
 * @param path 文件路径
 * @param value 数据 仅支持 JavaScript 对象
 * @param options 注释配置
 */
declare const save: Save;
/**
 * 为指定文件写入注释
 * @param filePath 文件路径
 * @param commentConfig 注释配置文件路径或 JSON 对象
 */
declare const comment: (filePath: string, commentConfig: string | YamlComment) => void;
/**
 * 批量添加注释
 * @param editor YamlEditor 实例
 * @param comments 注释配置对象
 */
declare const applyComments: (editor: YamlEditor, comments: YamlComment) => void;
/** YAML 工具 */
declare const yaml: {
    parse: typeof parse;
    stringify: typeof stringify;
    parseDocument: typeof parseDocument;
    Document: typeof Document;
    YAMLSeq: typeof YAMLSeq;
    YAMLMap: typeof YAMLMap;
    isMap: <K = unknown, V = unknown>(node: any) => node is YAMLMap<K, V>;
    isSeq: <T = unknown>(node: any) => node is YAMLSeq<T>;
    isPair: <K = unknown, V = unknown>(node: any) => node is _yaml.Pair<K, V>;
    /** 读取并解析 YAML 文件 */
    read: ReadFunction;
    /** 保存数据并写入注释 */
    save: Save;
    /** 为指定文件写入注释 */
    comment: (filePath: string, commentConfig: string | YamlComment) => void;
    /** 批量添加注释 */
    applyComments: (editor: YamlEditor, comments: YamlComment) => void;
};

/**
 * 监听文件变动
 * @param file 文件路径
 * @param fnc 文件变动后调用的函数
 */
declare const watch: <T>(file: string, fnc: (
/** 旧数据 */
oldData: T, 
/** 新数据 */
newData: T) => void, options?: Parameters<typeof requireFileSync>[1]) => Watch<T>;
/**
 * 传入两个配置文件路径，监听第一个的变动并返回合并后的配置
 * @param dynamicFile 动态配置文件路径
 * @param defaultCFile 默认配置文件路径
 */
declare const watchAndMerge: <T>(dynamicFile: string, defaultCFile: string, fnc: (oldData: T, newData: T) => T) => Watcher<T>;
/**
 * 监听管理器
 * @param file 文件路径
 * @param fnc 文件变动后调用的函数
 */
declare class Watch<T> {
    watcher: FSWatcher;
    file: string;
    options?: Parameters<typeof requireFileSync>[1];
    constructor(file: string, watcher: FSWatcher, options?: Parameters<typeof requireFileSync>[1]);
    /**
     * @description 获取配置数据
     */
    get value(): T;
    /**
     * @description 关闭监听器并清理全部缓存
     */
    close(): Promise<void>;
}
/**
 * 监听管理器
 * @param dynamicFile 动态配置文件路径
 * @param defaultCFile 默认配置文件路径
 */
declare class Watcher<T> {
    watcher: FSWatcher;
    dynamicFile: string;
    defaultCFile: string;
    options?: Parameters<typeof requireFileSync>[1];
    constructor(dynamicFile: string, defaultCfgFile: string, watcher: FSWatcher, options?: Parameters<typeof requireFileSync>[1]);
    /**
     * @description 获取配置数据
     */
    get value(): T | (T & any[])[number][];
    /**
     * @description 关闭监听器并清理全部缓存
     */
    close(): Promise<void>;
}

/**
 * @description 锁定对象的方法，使其不可被调用
 * @param obj 对象
 * @param key 方法名
 * @param msg 锁定时抛出的错误信息
 * @returns 唯一标识符 用于解锁
 */
declare const lockMethod: <T extends object, K extends keyof T>(obj: T, key: K, msg?: string) => () => {
    status: boolean;
    msg: string;
};
/**
 * @description 锁定对象的属性，使其不可被修改
 * @param obj 对象
 * @param key 属性
 */
declare const lockProp: <T extends object, K extends keyof T>(obj: T, key: K) => void;
/**
 * @description `锁定属性` `锁定方法` `解锁方法`
 */
declare const lock: {
    /** 锁定属性 */
    prop: <T extends object, K extends keyof T>(obj: T, key: K) => void;
    /** 锁定方法 */
    method: <T extends object, K extends keyof T>(obj: T, key: K, msg?: string) => () => {
        status: boolean;
        msg: string;
    };
};

/** 版本号对比模式 */
type CompareMode = {
    /**
     * 版本号对比模式，怎么对比才算是有更新
     *
     * **xyz 模式（默认）**
     * - 只看前三段数字 `X.Y.Z`，忽略预发布/构建后缀。
     * - 示例：
     *   - 本地 `2.6.7`，远程 `2.6.8` → 有更新
     *   - 本地 `2.6.7-beta.1`，远程 `2.6.7` → 无更新（都视为 `2.6.7`）
     *   - 本地 `1.0.0+20230101`，远程 `1.0.1` → 有更新（只看 `1.0.0` vs `1.0.1`）
     *   - 本地 `3.2.0-rc.3`，远程 `3.2.0` → 无更新（都视为 `3.2.0`）
     *
     * **semver 模式（语义化版本）**
     * - 严格遵循 [SemVer](https://semver.org/) 规则。
     * - 示例：
     *   - 本地 `2.6.7-beta.1`，远程 `2.6.6` → 本地更高，已最新，不提示升级
     *   - 本地 `1.0.0-alpha`，远程 `1.0.0` → 远程更高，提示升级
     *   - 本地 `1.0.0+20230101`，远程 `1.0.0` → 仅比较版本核心，不比较构建元数据，视为相同
     *   - 本地 `2.0.0-beta.2`，远程 `2.0.0-beta.10` → 远程更高，提示升级（按预发布号逐段比较）
     *   - 本地 `3.1.0-rc.1`，远程 `3.1.0` → 远程更高，提示升级（稳定版 > 预发布）
     *
     * @default 'xyz'
     */
    compare?: 'xyz' | 'semver';
};
/**
 * @description 传入npm包名 检查是否存在更新
 * @param name 包名
 * @param opts 额外参数
 * @returns 是否存在更新 true: 存在更新 false: 无更新
 */
declare const checkPkgUpdate: (name: string, opts?: CompareMode) => Promise<{
    /** 存在更新 */
    status: "yes";
    /** 本地版本号 */
    local: string;
    /** 远程版本号 */
    remote: string;
} | {
    /** 无更新 */
    status: "no";
    /** 本地版本号 */
    local: string;
} | {
    /** 检查发生错误 */
    status: "error";
    /** 错误信息 */
    error: Error;
}>;
/**
 * @description 获取指定包的本地版本号 如果获取失败则会获取package.json中的版本号
 * @param name 包名
 */
declare const getPkgVersion: (name: string) => Promise<string>;
/**
 * @description 获取指定包的远程版本号
 * @param name 包名
 * @param tag 标签，默认为 `latest`
 */
declare const getRemotePkgVersion: (name: string, tag?: string) => Promise<string>;
/**
 * @description 更新指定的npm插件
 * @param name 包名
 * @param tag 标签 默认 `latest`
 */
declare const updatePkg: (name: string, tag?: string) => Promise<{
    /** 更新失败 */
    status: "failed";
    /** 更新失败信息 */
    data: string | ExecException$1;
} | {
    /** 更新成功 */
    status: "ok";
    /** 更新成功信息 */
    data: string;
    /** 本地版本号 */
    local: string;
    /** 远程版本号 */
    remote: string;
}>;
/**
 * @description 更新全部npm插件
 */
declare const updateAllPkg: () => Promise<string>;
/**
 * @description 检查git插件是否有更新
 * @param filePath 插件路径
 * @param time 任务执行超时时间 默认120s
 */
declare const checkGitPluginUpdate: (filePath: string, time?: number) => Promise<{
    /** 存在更新 */
    status: "yes";
    /** 更新内容 */
    data: string;
    /** 落后次数 */
    count: number;
} | {
    /** 无更新 */
    status: "no";
    /** 最后更新时间描述 */
    data: string;
} | {
    /** 检查发生错误 */
    status: "error";
    data: Error;
}>;
/**
 * @description 获取指定仓库的提交记录
 * @param options 参数
 * @returns 提交记录
 */
declare const getCommit: (options: {
    /** 指令命令路径 */
    path: string;
    /** 获取几次提交 默认1次 */
    count?: number;
    /** 指定哈希 */
    hash?: string;
    /** 指定分支 */
    branch?: string;
}) => Promise<string>;
/**
 * @description 获取指定仓库最后一次提交哈希值
 * @param filePath - 插件相对路径
 * @param short - 是否获取短哈希 默认true
 */
declare const getHash: (filePath: string, short?: boolean) => Promise<string>;
/**
 * 获取指定仓库最后一次提交时间日期
 * @param filePath - 插件相对路径
 * @returns 最后一次提交时间
 * @example
 * ```ts
 * console.log(await getTime('./plugins/karin-plugin-example'))
 * // -> '2021-09-01 12:00:00'
 * ```
 */
declare const getTime: (filePath: string) => Promise<string>;
/**
 * @description 更新指定git插件
 * @param filePath 插件路径
 * @param cmd 执行命令 默认`git pull`
 * @param time 任务执行超时时间 默认120s
 */
declare const updateGitPlugin: (filePath: string, cmd?: string, time?: number) => Promise<{
    /** 更新失败 */
    status: "failed";
    /** 更新失败信息 */
    data: string | ExecException$1;
} | {
    /** 更新成功 */
    status: "ok";
    /** 更新成功信息 */
    data: string;
    /** 更新详情 */
    commit: string;
} | {
    /** 检查发生错误 */
    status: "error";
    data: Error;
}>;
/**
 * @description 更新所有git插件
 * @param time 任务执行超时时间 默认120s
 */
declare const updateAllGitPlugin: (cmd?: string, time?: number) => Promise<string>;

/**
 * 提取指定版本号的更新日志
 * @param version 版本号，可包含预发布/构建元数据（如 `-beta`）
 * @param data `CHANGELOG.md` 文件内容
 * @returns 命中的更新日志字符串；无法定位返回 `null`
 * @description
 * - 先将版本规范化为稳定版 `x.y.z`；
 * - 不存在时按新 -> 旧顺序回退到不超过目标稳定版的最新版本。
 */
declare const log: (version: string, data: string) => string | null;
/**
 * 从指定版本开始提取连续的更新日志
 */
declare function logs(options: LogsOptions): string;
/**
 * 从指定版本开始提取连续的更新日志
 * @param version 起始版本号
 * @param data `CHANGELOG.md` 文件内容
 * @param length 提取条数，默认为 1
 * @param reverse 是否反向提取；`false` 向后，`true` 向前
 * @param opts 版本号对比模式
 * @returns 拼接后的更新日志字符串；找不到起始版本返回空字符串
 * @description
 * - 起始版本会规范化并回退到不超过目标稳定版的最新版本；
 * - 切片范围将做边界裁剪以避免越界。
 * @deprecated 此调用方式将在未来版本废弃，请改用对象参数重载 logs({ ... }) 进行调用
 */
declare function logs(version: string, data: string, length?: number, reverse?: boolean, opts?: CompareMode): string;
/**
 * 提取指定版本区间的更新日志
 */
declare function range(options: RangeOptions): string;
/**
 * 提取指定版本区间的更新日志
 * @param data `CHANGELOG.md` 文件内容
 * @param startVersion 起始版本号（较旧）
 * @param endVersion 结束版本号（较新）
 * @param opts 版本号对比模式
 * @returns 拼接后的更新日志字符串；若任一版本无法定位返回空字符串
 * @description
 * - CHANGELOG 的版本排序约定为从新到旧；
 * - 若传入版本不存在，将回退到不超过目标稳定版的最新版本；
 * - 当 `start > end` 时会自动调整为有效区间。
 * @deprecated 此调用方式将在未来版本废弃，请改用对象参数重载 range({ ... }) 进行调用
 */
declare function range(data: string, startVersion: string, endVersion: string, opts?: CompareMode): string;
/**
 * 对更新日志进行解析并形成对象
 * @param data 更新日志内容
 * @returns 以版本号为键的更新日志对象
 */
declare const parseChangelog: (data: string) => Record<string, string>;
/** logs 方法的配置 */
type LogsOptions = {
    /** 起始版本号 */
    version: string;
    /** CHANGELOG.md 内容 */
    data: string;
    /**
     * 提取条数
     * @default 1
     */
    length?: number;
    /**
     * 是否反向提取
     * @default false
     */
    reverse?: boolean;
    /**
     * 版本号对比模式，怎么对比才算是有更新
     *
     * **xyz 模式（默认）**
     * - 只看前三段数字 `X.Y.Z`，忽略预发布/构建后缀。
     * - 示例：
     *   - 本地 `2.6.7`，远程 `2.6.8` → 有更新
     *   - 本地 `2.6.7-beta.1`，远程 `2.6.7` → 无更新（都视为 `2.6.7`）
     *   - 本地 `1.0.0+20230101`，远程 `1.0.1` → 有更新（只看 `1.0.0` vs `1.0.1`）
     *   - 本地 `3.2.0-rc.3`，远程 `3.2.0` → 无更新（都视为 `3.2.0`）
     *
     * **semver 模式（语义化版本）**
     * - 严格遵循 [SemVer](https://semver.org/) 规则。
     * - 示例：
     *   - 本地 `2.6.7-beta.1`，远程 `2.6.6` → 本地更高，已最新，不提示升级
     *   - 本地 `1.0.0-alpha`，远程 `1.0.0` → 远程更高，提示升级
     *   - 本地 `1.0.0+20230101`，远程 `1.0.0` → 仅比较版本核心，不比较构建元数据，视为相同
     *   - 本地 `2.0.0-beta.2`，远程 `2.0.0-beta.10` → 远程更高，提示升级（按预发布号逐段比较）
     *   - 本地 `3.1.0-rc.1`，远程 `3.1.0` → 远程更高，提示升级（稳定版 > 预发布）
     *
     * @default 'xyz'
     */
    compare?: CompareMode['compare'];
};
/** range 方法的配置 */
type RangeOptions = {
    /** CHANGELOG.md 内容 */
    data: string;
    /** 起始版本号（较旧） */
    startVersion: string;
    /** 结束版本号（较新） */
    endVersion: string;
    /**
     * 版本号对比模式，怎么对比才算是有更新
     *
     * **xyz 模式（默认）**
     * - 只看前三段数字 `X.Y.Z`，忽略预发布/构建后缀。
     * - 示例：
     *   - 本地 `2.6.7`，远程 `2.6.8` → 有更新
     *   - 本地 `2.6.7-beta.1`，远程 `2.6.7` → 无更新（都视为 `2.6.7`）
     *   - 本地 `1.0.0+20230101`，远程 `1.0.1` → 有更新（只看 `1.0.0` vs `1.0.1`）
     *   - 本地 `3.2.0-rc.3`，远程 `3.2.0` → 无更新（都视为 `3.2.0`）
     *
     * **semver 模式（语义化版本）**
     * - 严格遵循 [SemVer](https://semver.org/) 规则。
     * - 示例：
     *   - 本地 `2.6.7-beta.1`，远程 `2.6.6` → 本地更高，已最新，不提示升级
     *   - 本地 `1.0.0-alpha`，远程 `1.0.0` → 远程更高，提示升级
     *   - 本地 `1.0.0+20230101`，远程 `1.0.0` → 仅比较版本核心，不比较构建元数据，视为相同
     *   - 本地 `2.0.0-beta.2`，远程 `2.0.0-beta.10` → 远程更高，提示升级（按预发布号逐段比较）
     *   - 本地 `3.1.0-rc.1`，远程 `3.1.0` → 远程更高，提示升级（稳定版 > 预发布）
     *
     * @default 'xyz'
     */
    compare?: CompareMode['compare'];
};

declare const changelog_log: typeof log;
declare const changelog_logs: typeof logs;
declare const changelog_parseChangelog: typeof parseChangelog;
declare const changelog_range: typeof range;
declare namespace changelog {
  export { changelog_log as log, changelog_logs as logs, changelog_parseChangelog as parseChangelog, changelog_range as range };
}

/** 收到消息 */
declare const RECV_MSG = "karin:count:recv";
/** 发送消息 */
declare const SEND_MSG = "karin:count:send";
/** 事件调用 */
declare const EVENT_COUNT = "karin:count:fnc";
/** 文件变动 */
declare const FILE_CHANGE = "karin:file:change";
/** 传递ws连接 */
declare const WS_CONNECTION = "ws:connection";
/** 传递onebot ws连接 */
declare const WS_CONNECTION_ONEBOT = "ws:connection:onebot";
/** 传递puppeteer ws连接 */
declare const WS_CONNECTION_PUPPETEER = "ws:connection:puppeteer";
/** 传递sandbox ws连接 */
declare const WS_CONNECTION_SANDBOX = "ws:connection:sandbox";
/** 传递虚拟终端 ws连接 */
declare const WS_CONNECTION_TERMINAL = "ws:connection:terminal";
/** 传递ws关闭 */
declare const WS_CLOSE = "ws:close";
/** 传递onebot ws关闭 */
declare const WS_CLOSE_ONEBOT = "ws:close:onebot";
/** 传递puppeteer ws关闭 */
declare const WS_CLOSE_PUPPETEER = "ws:close:puppeteer";
/** 传递sandbox ws关闭 */
declare const WS_CLOSE_SANDBOX = "ws:close:sandbox";
/** 传递 snapka ws连接 */
declare const WS_SNAPKA = "ws:connection:snapka";
/** Bot连接成功 */
declare const BOT_CONNECT = "bot.connect";
/** Bot连接断开 */
declare const BOT_DISCONNECT = "bot.disconnect";

declare const key_BOT_CONNECT: typeof BOT_CONNECT;
declare const key_BOT_DISCONNECT: typeof BOT_DISCONNECT;
declare const key_EVENT_COUNT: typeof EVENT_COUNT;
declare const key_FILE_CHANGE: typeof FILE_CHANGE;
declare const key_RECV_MSG: typeof RECV_MSG;
declare const key_SEND_MSG: typeof SEND_MSG;
declare const key_WS_CLOSE: typeof WS_CLOSE;
declare const key_WS_CLOSE_ONEBOT: typeof WS_CLOSE_ONEBOT;
declare const key_WS_CLOSE_PUPPETEER: typeof WS_CLOSE_PUPPETEER;
declare const key_WS_CLOSE_SANDBOX: typeof WS_CLOSE_SANDBOX;
declare const key_WS_CONNECTION: typeof WS_CONNECTION;
declare const key_WS_CONNECTION_ONEBOT: typeof WS_CONNECTION_ONEBOT;
declare const key_WS_CONNECTION_PUPPETEER: typeof WS_CONNECTION_PUPPETEER;
declare const key_WS_CONNECTION_SANDBOX: typeof WS_CONNECTION_SANDBOX;
declare const key_WS_CONNECTION_TERMINAL: typeof WS_CONNECTION_TERMINAL;
declare const key_WS_SNAPKA: typeof WS_SNAPKA;
declare namespace key {
  export { key_BOT_CONNECT as BOT_CONNECT, key_BOT_DISCONNECT as BOT_DISCONNECT, key_EVENT_COUNT as EVENT_COUNT, key_FILE_CHANGE as FILE_CHANGE, key_RECV_MSG as RECV_MSG, key_SEND_MSG as SEND_MSG, key_WS_CLOSE as WS_CLOSE, key_WS_CLOSE_ONEBOT as WS_CLOSE_ONEBOT, key_WS_CLOSE_PUPPETEER as WS_CLOSE_PUPPETEER, key_WS_CLOSE_SANDBOX as WS_CLOSE_SANDBOX, key_WS_CONNECTION as WS_CONNECTION, key_WS_CONNECTION_ONEBOT as WS_CONNECTION_ONEBOT, key_WS_CONNECTION_PUPPETEER as WS_CONNECTION_PUPPETEER, key_WS_CONNECTION_SANDBOX as WS_CONNECTION_SANDBOX, key_WS_CONNECTION_TERMINAL as WS_CONNECTION_TERMINAL, key_WS_SNAPKA as WS_SNAPKA };
}

type fs_CacheEntry<T = any> = CacheEntry<T>;
type fs_Parser = Parser;
type fs_PkgData = PkgData;
type fs_PkgEnv = PkgEnv;
type fs_RequireFunction = RequireFunction;
type fs_RequireFunctionSync = RequireFunctionSync;
type fs_RequireOptions = RequireOptions;
type fs_Watch<T> = Watch<T>;
declare const fs_Watch: typeof Watch;
type fs_Watcher<T> = Watcher<T>;
declare const fs_Watcher: typeof Watcher;
type fs_YamlComment = YamlComment;
type fs_YamlEditor = YamlEditor;
declare const fs_YamlEditor: typeof YamlEditor;
type fs_YamlValue = YamlValue;
declare const fs_absPath: typeof absPath;
declare const fs_applyComments: typeof applyComments;
declare const fs_base64: typeof base64;
declare const fs_buffer: typeof buffer;
declare const fs_clearRequire: typeof clearRequire;
declare const fs_clearRequireFile: typeof clearRequireFile;
declare const fs_comment: typeof comment;
declare const fs_copyConfig: typeof copyConfig;
declare const fs_copyConfigSync: typeof copyConfigSync;
declare const fs_copyFiles: typeof copyFiles;
declare const fs_copyFilesSync: typeof copyFilesSync;
declare const fs_createPluginDir: typeof createPluginDir;
declare const fs_downFile: typeof downFile;
declare const fs_downloadFile: typeof downloadFile;
declare const fs_existToMkdir: typeof existToMkdir;
declare const fs_existToMkdirSync: typeof existToMkdirSync;
declare const fs_exists: typeof exists;
declare const fs_existsSync: typeof existsSync;
declare const fs_filesByExt: typeof filesByExt;
declare const fs_formatPath: typeof formatPath;
declare const fs_getAllFiles: typeof getAllFiles;
declare const fs_getAllFilesSync: typeof getAllFilesSync;
declare const fs_getFiles: typeof getFiles;
declare const fs_getPluginInfo: typeof getPluginInfo;
declare const fs_getRelPath: typeof getRelPath;
declare const fs_isDir: typeof isDir;
declare const fs_isDirSync: typeof isDirSync;
declare const fs_isFile: typeof isFile;
declare const fs_isFileSync: typeof isFileSync;
declare const fs_isPathEqual: typeof isPathEqual;
declare const fs_isPlugin: typeof isPlugin;
declare const fs_isPublic: typeof isPublic;
declare const fs_isSubPath: typeof isSubPath;
declare const fs_key: typeof key;
declare const fs_lock: typeof lock;
declare const fs_lockMethod: typeof lockMethod;
declare const fs_lockProp: typeof lockProp;
declare const fs_log: typeof log;
declare const fs_logs: typeof logs;
declare const fs_mkdir: typeof mkdir;
declare const fs_mkdirSync: typeof mkdirSync;
declare const fs_parseChangelog: typeof parseChangelog;
declare const fs_pkgRoot: typeof pkgRoot;
declare const fs_randomStr: typeof randomStr;
declare const fs_range: typeof range;
declare const fs_read: typeof read;
declare const fs_readFile: typeof readFile;
declare const fs_readJson: typeof readJson;
declare const fs_readJsonSync: typeof readJsonSync;
declare const fs_requireFile: typeof requireFile;
declare const fs_requireFileSync: typeof requireFileSync;
declare const fs_rmSync: typeof rmSync;
declare const fs_save: typeof save;
declare const fs_sep: typeof sep;
declare const fs_splitPath: typeof splitPath;
declare const fs_stream: typeof stream;
declare const fs_urlToPath: typeof urlToPath;
declare const fs_watch: typeof watch;
declare const fs_watchAndMerge: typeof watchAndMerge;
declare const fs_write: typeof write;
declare const fs_writeJson: typeof writeJson;
declare const fs_writeJsonSync: typeof writeJsonSync;
declare const fs_yaml: typeof yaml;
declare namespace fs {
  export { type fs_CacheEntry as CacheEntry, type fs_Parser as Parser, type fs_PkgData as PkgData, type fs_PkgEnv as PkgEnv, type fs_RequireFunction as RequireFunction, type fs_RequireFunctionSync as RequireFunctionSync, type fs_RequireOptions as RequireOptions, fs_Watch as Watch, fs_Watcher as Watcher, type fs_YamlComment as YamlComment, fs_YamlEditor as YamlEditor, type fs_YamlValue as YamlValue, fs_absPath as absPath, fs_applyComments as applyComments, fs_base64 as base64, fs_buffer as buffer, fs_clearRequire as clearRequire, fs_clearRequireFile as clearRequireFile, fs_comment as comment, fs_copyConfig as copyConfig, fs_copyConfigSync as copyConfigSync, fs_copyFiles as copyFiles, fs_copyFilesSync as copyFilesSync, fs_createPluginDir as createPluginDir, fs_downFile as downFile, fs_downloadFile as downloadFile, fs_existToMkdir as existToMkdir, fs_existToMkdirSync as existToMkdirSync, fs_exists as exists, fs_existsSync as existsSync, fs_filesByExt as filesByExt, fs_formatPath as formatPath, fs_getAllFiles as getAllFiles, fs_getAllFilesSync as getAllFilesSync, fs_getFiles as getFiles, fs_getPluginInfo as getPluginInfo, fs_getRelPath as getRelPath, fs_isDir as isDir, fs_isDirSync as isDirSync, fs_isFile as isFile, fs_isFileSync as isFileSync, fs_isPathEqual as isPathEqual, fs_isPlugin as isPlugin, fs_isPublic as isPublic, fs_isSubPath as isSubPath, json$1 as json, fs_key as key, fs_lock as lock, fs_lockMethod as lockMethod, fs_lockProp as lockProp, fs_log as log, fs_logs as logs, fs_mkdir as mkdir, fs_mkdirSync as mkdirSync, fs_parseChangelog as parseChangelog, fs_pkgRoot as pkgRoot, fs_randomStr as randomStr, fs_range as range, fs_read as read, fs_readFile as readFile, fs_readJson as readJson, fs_readJsonSync as readJsonSync, fs_requireFile as requireFile, fs_requireFileSync as requireFileSync, fs_rmSync as rmSync, fs_save as save, fs_sep as sep, fs_splitPath as splitPath, fs_stream as stream, fs_urlToPath as urlToPath, fs_watch as watch, fs_watchAndMerge as watchAndMerge, fs_write as write, fs_writeJson as writeJson, fs_writeJsonSync as writeJsonSync, fs_yaml as yaml };
}

declare const index$3_BOT_CONNECT: typeof BOT_CONNECT;
declare const index$3_BOT_DISCONNECT: typeof BOT_DISCONNECT;
type index$3_CacheEntry<T = any> = CacheEntry<T>;
declare const index$3_EVENT_COUNT: typeof EVENT_COUNT;
declare const index$3_FILE_CHANGE: typeof FILE_CHANGE;
type index$3_Parser = Parser;
type index$3_PkgData = PkgData;
type index$3_PkgEnv = PkgEnv;
declare const index$3_RECV_MSG: typeof RECV_MSG;
type index$3_RequireFunction = RequireFunction;
type index$3_RequireFunctionSync = RequireFunctionSync;
type index$3_RequireOptions = RequireOptions;
declare const index$3_SEND_MSG: typeof SEND_MSG;
declare const index$3_WS_CLOSE: typeof WS_CLOSE;
declare const index$3_WS_CLOSE_ONEBOT: typeof WS_CLOSE_ONEBOT;
declare const index$3_WS_CLOSE_PUPPETEER: typeof WS_CLOSE_PUPPETEER;
declare const index$3_WS_CLOSE_SANDBOX: typeof WS_CLOSE_SANDBOX;
declare const index$3_WS_CONNECTION: typeof WS_CONNECTION;
declare const index$3_WS_CONNECTION_ONEBOT: typeof WS_CONNECTION_ONEBOT;
declare const index$3_WS_CONNECTION_PUPPETEER: typeof WS_CONNECTION_PUPPETEER;
declare const index$3_WS_CONNECTION_SANDBOX: typeof WS_CONNECTION_SANDBOX;
declare const index$3_WS_CONNECTION_TERMINAL: typeof WS_CONNECTION_TERMINAL;
declare const index$3_WS_SNAPKA: typeof WS_SNAPKA;
type index$3_Watch<T> = Watch<T>;
declare const index$3_Watch: typeof Watch;
type index$3_Watcher<T> = Watcher<T>;
declare const index$3_Watcher: typeof Watcher;
type index$3_YamlComment = YamlComment;
type index$3_YamlEditor = YamlEditor;
declare const index$3_YamlEditor: typeof YamlEditor;
type index$3_YamlValue = YamlValue;
declare const index$3_absPath: typeof absPath;
declare const index$3_applyComments: typeof applyComments;
declare const index$3_base64: typeof base64;
declare const index$3_buffer: typeof buffer;
declare const index$3_clearRequire: typeof clearRequire;
declare const index$3_clearRequireFile: typeof clearRequireFile;
declare const index$3_comment: typeof comment;
declare const index$3_copyConfig: typeof copyConfig;
declare const index$3_copyConfigSync: typeof copyConfigSync;
declare const index$3_copyFiles: typeof copyFiles;
declare const index$3_copyFilesSync: typeof copyFilesSync;
declare const index$3_createPluginDir: typeof createPluginDir;
declare const index$3_downFile: typeof downFile;
declare const index$3_downloadFile: typeof downloadFile;
declare const index$3_existToMkdir: typeof existToMkdir;
declare const index$3_existToMkdirSync: typeof existToMkdirSync;
declare const index$3_exists: typeof exists;
declare const index$3_existsSync: typeof existsSync;
declare const index$3_filesByExt: typeof filesByExt;
declare const index$3_formatPath: typeof formatPath;
declare const index$3_getAllFiles: typeof getAllFiles;
declare const index$3_getAllFilesSync: typeof getAllFilesSync;
declare const index$3_getFiles: typeof getFiles;
declare const index$3_getPluginInfo: typeof getPluginInfo;
declare const index$3_getRelPath: typeof getRelPath;
declare const index$3_isDir: typeof isDir;
declare const index$3_isDirSync: typeof isDirSync;
declare const index$3_isFile: typeof isFile;
declare const index$3_isFileSync: typeof isFileSync;
declare const index$3_isPathEqual: typeof isPathEqual;
declare const index$3_isPlugin: typeof isPlugin;
declare const index$3_isPublic: typeof isPublic;
declare const index$3_isSubPath: typeof isSubPath;
declare const index$3_key: typeof key;
declare const index$3_lock: typeof lock;
declare const index$3_lockMethod: typeof lockMethod;
declare const index$3_lockProp: typeof lockProp;
declare const index$3_log: typeof log;
declare const index$3_logs: typeof logs;
declare const index$3_mkdir: typeof mkdir;
declare const index$3_mkdirSync: typeof mkdirSync;
declare const index$3_parseChangelog: typeof parseChangelog;
declare const index$3_pkgRoot: typeof pkgRoot;
declare const index$3_randomStr: typeof randomStr;
declare const index$3_range: typeof range;
declare const index$3_read: typeof read;
declare const index$3_readFile: typeof readFile;
declare const index$3_readJson: typeof readJson;
declare const index$3_readJsonSync: typeof readJsonSync;
declare const index$3_requireFile: typeof requireFile;
declare const index$3_requireFileSync: typeof requireFileSync;
declare const index$3_rmSync: typeof rmSync;
declare const index$3_save: typeof save;
declare const index$3_sep: typeof sep;
declare const index$3_splitPath: typeof splitPath;
declare const index$3_stream: typeof stream;
declare const index$3_urlToPath: typeof urlToPath;
declare const index$3_watch: typeof watch;
declare const index$3_watchAndMerge: typeof watchAndMerge;
declare const index$3_write: typeof write;
declare const index$3_writeJson: typeof writeJson;
declare const index$3_writeJsonSync: typeof writeJsonSync;
declare const index$3_yaml: typeof yaml;
declare namespace index$3 {
  export { index$3_BOT_CONNECT as BOT_CONNECT, index$3_BOT_DISCONNECT as BOT_DISCONNECT, type index$3_CacheEntry as CacheEntry, index$3_EVENT_COUNT as EVENT_COUNT, index$3_FILE_CHANGE as FILE_CHANGE, type index$3_Parser as Parser, type index$3_PkgData as PkgData, type index$3_PkgEnv as PkgEnv, index$3_RECV_MSG as RECV_MSG, type index$3_RequireFunction as RequireFunction, type index$3_RequireFunctionSync as RequireFunctionSync, type index$3_RequireOptions as RequireOptions, index$3_SEND_MSG as SEND_MSG, index$3_WS_CLOSE as WS_CLOSE, index$3_WS_CLOSE_ONEBOT as WS_CLOSE_ONEBOT, index$3_WS_CLOSE_PUPPETEER as WS_CLOSE_PUPPETEER, index$3_WS_CLOSE_SANDBOX as WS_CLOSE_SANDBOX, index$3_WS_CONNECTION as WS_CONNECTION, index$3_WS_CONNECTION_ONEBOT as WS_CONNECTION_ONEBOT, index$3_WS_CONNECTION_PUPPETEER as WS_CONNECTION_PUPPETEER, index$3_WS_CONNECTION_SANDBOX as WS_CONNECTION_SANDBOX, index$3_WS_CONNECTION_TERMINAL as WS_CONNECTION_TERMINAL, index$3_WS_SNAPKA as WS_SNAPKA, index$3_Watch as Watch, index$3_Watcher as Watcher, type index$3_YamlComment as YamlComment, index$3_YamlEditor as YamlEditor, type index$3_YamlValue as YamlValue, index$3_absPath as absPath, index$3_applyComments as applyComments, index$3_base64 as base64, index$3_buffer as buffer, index$3_clearRequire as clearRequire, index$3_clearRequireFile as clearRequireFile, index$3_comment as comment, index$3_copyConfig as copyConfig, index$3_copyConfigSync as copyConfigSync, index$3_copyFiles as copyFiles, index$3_copyFilesSync as copyFilesSync, index$3_createPluginDir as createPluginDir, index$3_downFile as downFile, index$3_downloadFile as downloadFile, index$3_existToMkdir as existToMkdir, index$3_existToMkdirSync as existToMkdirSync, index$3_exists as exists, index$3_existsSync as existsSync, fs as file, index$3_filesByExt as filesByExt, index$3_formatPath as formatPath, index$3_getAllFiles as getAllFiles, index$3_getAllFilesSync as getAllFilesSync, index$3_getFiles as getFiles, index$3_getPluginInfo as getPluginInfo, index$3_getRelPath as getRelPath, index$3_isDir as isDir, index$3_isDirSync as isDirSync, index$3_isFile as isFile, index$3_isFileSync as isFileSync, index$3_isPathEqual as isPathEqual, index$3_isPlugin as isPlugin, index$3_isPublic as isPublic, index$3_isSubPath as isSubPath, json$1 as json, index$3_key as key, index$3_lock as lock, index$3_lockMethod as lockMethod, index$3_lockProp as lockProp, index$3_log as log, index$3_logs as logs, index$3_mkdir as mkdir, index$3_mkdirSync as mkdirSync, index$3_parseChangelog as parseChangelog, index$3_pkgRoot as pkgRoot, index$3_randomStr as randomStr, index$3_range as range, index$3_read as read, index$3_readFile as readFile, index$3_readJson as readJson, index$3_readJsonSync as readJsonSync, index$3_requireFile as requireFile, index$3_requireFileSync as requireFileSync, index$3_rmSync as rmSync, index$3_save as save, index$3_sep as sep, index$3_splitPath as splitPath, index$3_stream as stream, index$3_urlToPath as urlToPath, index$3_watch as watch, index$3_watchAndMerge as watchAndMerge, index$3_write as write, index$3_writeJson as writeJson, index$3_writeJsonSync as writeJsonSync, index$3_yaml as yaml };
}

/** 获取git仓库本地分支列表返回类型 */
interface GitLocalBranches {
    /** 默认分支 */
    defaultBranch: string;
    /** 本地分支列表 */
    list: string[];
}
/** 获取git仓库远程分支列表返回类型 */
interface GitRemoteBranches {
    /** 分支名称 */
    branch: string;
    /** 短哈希 */
    short: string;
    /** 长哈希 */
    hash: string;
}
/** 获取最新提交哈希参数 */
interface GetCommitHashOptions {
    /** 分支名称 默认使用当前分支 */
    branch?: string;
    /** 是否返回短哈希 默认返回长哈希 */
    short?: boolean;
}
/**
 * 获取本地分支列表
 * @param cwd 仓库路径 默认当前目录
 * @returns 本地分支列表 包含默认分支和分支列表
 * @throws 执行发生错误 例如stdout类型错误
 */
declare const getLocalBranches: (cwd?: string) => Promise<GitLocalBranches>;
/**
 * 获取本地默认分支
 * @param cwd 仓库路径 默认当前目录
 * @returns 默认分支
 */
declare const getDefaultBranch: (cwd?: string) => Promise<string>;
/**
 * 获取git仓库远程分支列表
 * @param cwd 仓库路径
 * @returns 远程分支列表 包含哈希和分支名称
 * @throws 执行发生错误 例如stdout类型错误
 */
declare const getRemoteBranches: (cwd: string) => Promise<GitRemoteBranches[]>;
/**
 * 获取本地最新提交哈希
 * @param cwd 仓库路径
 * @param options.branch 分支名称 默认使用当前分支
 * @param options.short 是否返回短哈希 默认返回长哈希
 * @returns 最新提交哈希
 */
declare const getLocalCommitHash: (cwd: string, options?: GetCommitHashOptions) => Promise<string>;
/**
 * 获取远程最新提交哈希
 * @description 分支名称支持不带origin/前缀 会自动添加
 * @param cwd 仓库路径
 * @param options.branch 分支名称 默认值`origin/HEAD`
 * @param options.short 是否返回短哈希 默认返回长哈希
 * @returns 远程最新提交哈希
 */
declare const getRemoteCommitHash: (cwd: string, options?: GetCommitHashOptions) => Promise<string>;

/** 执行命令参数类型 */
type ExecOptions = Parameters<typeof exec$2>[1];

/** Git Pull 选项接口 */
type GitPullOptions = ExecOptions & {
    /** 自定义命令，默认为 'git pull' */
    customCmd?: string;
    /** 是否强制拉取 使用后将本地分支强制与远程分支同步 */
    force?: boolean;
    /** 如果强制拉取 同步的远程分支名称 默认`origin/HEAD` 需要携带`origin/`前缀 */
    remote?: string;
    /** 超时 */
    timeout?: number;
};
/** Git Pull 返回类型 */
interface GitPullResult {
    /** 是否成功 */
    status: boolean;
    /** 更新详情 */
    hash: {
        /** 更新前哈希 */
        before: string;
        /** 更新后哈希 */
        after: string;
    };
    /** 更新信息 */
    data: string;
}
/**
 * 拉取git仓库 俗称`更新git插件`
 * @param cwd 工作目录 默认当前目录
 * @param options 选项
 * @returns 拉取结果
 */
declare const gitPull: (cwd: string, options?: GitPullOptions) => Promise<GitPullResult>;

/**
 * @public
 * @description 日志管理器
 */
declare const logger: Logger;

/**
 * 判断给定的 hostname 或 IP 是否为本机的回环地址 支持v6(可能不全)
 * @param hostnameOrIp - 要检查的 hostname 或 IP 地址
 */
declare const isLoopback: (hostnameOrIp: string) => Promise<boolean>;
/**
 * 判断一个 v4 地址是否在回环范围内
 * @param ip - IPv4 地址字符串
 */
declare const isIPv4Loop: (ip: string) => boolean;
/**
 * 判断一个 IPv6 地址是否是回环地址 (::1 或 ::ffff:127.x.x.x)
 * @param ip - IPv6 地址字符串
 */
declare const isIPv6Loop: (ip: string) => boolean;
/**
 * 获取请求的 IP 地址
 * 优先级: x-forwarded-for > remoteAddress > ip > hostname
 * @param req - 请求对象
 */
declare const getRequestIp: (req: Request$1) => string[];
/**
 * 传入一个请求对象 判断是否为本机请求
 * @param req - 请求对象
 */
declare const isLocalRequest: (req: Request$1) => Promise<boolean>;

/**
 * 传入端口号，返回对应的pid
 * @param port - 端口号
 */
declare const getPid: (port: number) => Promise<number | null>;

/**
 * 执行 shell 命令
 * @param cmd 命令
 * @param options 选项
 * @param options.log 是否打印日志 默认不打印
 * @param options.booleanResult 是否只返回布尔值 表示命令是否成功执行 默认返回完整的结果
 * @example
 * ```ts
 * const { status, error, stdout, stderr } = await exec('ls -al')
 * // -> { status: true, error: null, stdout: '...', stderr: '...' }
 *
 * const status = await exec('ls -al', { booleanResult: true })
 * // -> true
 *
 * const { status, error, stdout, stderr } = await exec('ls -al', { log: true })
 * // -> 打印执行命令和结果
 * ```
 */
declare const exec: <T extends boolean = false>(cmd: string, options?: ExecOptions$1<T>) => Promise<ExecReturn<T>>;

/**
 * 获取kairn运行时间
 * @example
 * ```ts
 * uptime()
 * ```
 */
declare const uptime$1: () => string;
/**
 * @description 传入一个或两个时间戳
 * @description 传入一个返回当前时间 - 时间1
 * @description 传入两个返回时间2 - 时间1
 * @param time - 时间戳
 * @example
 * common.formatTime(1620000000)
 * // -> '18天'
 * common.formatTime(1620000000, 1620000000)
 * // -> '18天'
 */
declare const formatTime$1: (time: number, time2?: number) => string;

/**
 * 传入一个函数 判断是否是类
 * @param fnc 函数
 */
declare const isClass: (fnc: unknown) => fnc is Function;

/**
 * @description 拆解错误对象 用于`JSON`序列化
 * @param error 错误对象
 * @returns 拆解后的错误对象
 */
declare const stringifyError: (error?: Error | null) => {
    name: string | undefined;
    message: string | undefined;
    stack: string | undefined;
};
/**
 * 将错误对象转为字符串
 * @param error 错误对象
 * @returns 错误字符串
 */
declare const errorToString: (error?: Error | null) => string;

/**
 * 检查端口是否可用
 * @param port - 端口号
 * @returns 端口可用返回true，否则返回false
 */
declare const checkPort: (port: number) => Promise<boolean>;
/**
 * 等待端口可用
 * @param port - 端口号
 * @param maxAttempts - 最大尝试次数
 * @param interval - 检查间隔(ms)
 * @returns 端口是否可用
 */
declare const waitPort: (port: number, maxAttempts?: number, interval?: number) => Promise<boolean>;
/**
 * 结束指定PID或端口的程序
 * @param identifier - PID号或端口号
 * @param isPort - 是否为端口号
 * @returns 是否成功结束程序
 */
declare const killApp: (identifier: number, isPort?: boolean) => Promise<boolean>;

/**
 * @description ffmpeg命令
 * @param cmd 命令
 * @param options 参数
 */
declare const ffmpeg: <T extends boolean = false>(cmd: string, options?: ExecOptions$1<T>) => Promise<ExecReturn<T>>;
/**
 * @description ffprobe命令
 * @param cmd 命令
 * @param options 参数
 */
declare const ffprobe: <T extends boolean = false>(cmd: string, options?: ExecOptions$1<T>) => Promise<ExecReturn<T>>;
/**
 * @description ffplay命令
 * @param cmd 命令
 * @param options 参数
 */
declare const ffplay: <T extends boolean = false>(cmd: string, options?: ExecOptions$1<T>) => Promise<ExecReturn<T>>;

/**
 * 动态导入模块
 * @param url 模块地址 仅支持绝对路径 无需传递 `file://` 前缀
 * @param isRefresh 是否重新加载 不使用缓存
 */
declare const importModule: <T = any>(url: string, isRefresh?: boolean) => Promise<ImportModuleResult<T>>;
/**
 * 动态导入模块
 * @param url 模块地址 仅支持绝对路径 无需传递 `file://` 前缀
 * @param options 选项
 * @param options.isRefresh 是否重新加载 不使用缓存
 * @param options.isImportDefault 是否返回默认导出
 */
declare const imports: <T = any>(url: string, options?: {
    isRefresh?: boolean;
    isImportDefault?: boolean;
}) => Promise<T>;

/** 是否为windows */
declare const isWin: boolean;
/** 是否为linux */
declare const isLinux: boolean;
/** 是否为mac */
declare const isMac: boolean;
/** 是否为docker */
declare const isDocker: boolean;
/** 是否为root用户 仅linux */
declare const isRoot: boolean;

/**
 * 重启Bot
 * @param selfId - 机器人的id 传e.self_id
 * @param contact - 事件联系人信息 也就是从哪来的这条消息 传e.contact即可
 * @param messageId - 消息id 传e.message_id
 * @param isFront - 是否为前台重启 默认是 不支持的环境会强制为pm2重启
 * @param reloadDeps - 是否为重新加载依赖 默认是false
 */
declare const restart: (selfId: string, contact: Contact, messageId: string, isFront?: boolean, reloadDeps?: boolean) => Promise<{
    status: "success" | "failed";
    data: string | Error;
}>;
/**
 * 直接重启
 * @param options - 重启选项
 */
declare const restartDirect: (options?: {
    /** 是否为pm2重启 */
    isPm2?: boolean;
    /** 是否为重新加载依赖 */
    reloadDeps?: boolean;
}) => Promise<void>;

/** fileToUrl Handler键 */
declare const fileToUrlHandlerKey = "fileToUrl";
/**
 * 文件转换为url
 */
declare const fileToUrl: FileToUrlHandler;

/**
 * 一个简单的版本范围检查函数
 * @param satisfies 版本范围
 * @param version 版本
 * @description 检查版本是否在范围内
 * @example
 * ```ts
 * console.log(satisfies('^1.0.0', '1.0.1')) // true
 * console.log(satisfies('^1.0.0', '2.0.0')) // false
 * console.log(satisfies('^1.0.0', '0.0.1')) // false
 * console.log(satisfies('>=1.0.0', '1.0.0')) // true
 * console.log(satisfies('>=1.0.0', '0.0.1')) // false
 * console.log(satisfies('<=1.0.0', '1.0.0')) // true
 * console.log(satisfies('<=1.0.0', '2.0.0')) // false
 * console.log(satisfies('>=1.0.0 <2.0.0', '1.0.0')) // true
 * console.log(satisfies('1.0.0-alpha', '1.0.0-beta')) // false
 * console.log(satisfies('1.0.0-beta', '1.0.0-alpha')) // false
 * console.log(satisfies('^1.0.0-beta', '1.0.0-alpha')) // false
 * console.log(satisfies('>=1.0.0-beta', '1.0.0-alpha')) // false
 * console.log(satisfies('^1.0.0-alpha', '1.0.0-beta')) // true
 * console.log(satisfies('^1.0.0-beta', '1.0.0-beta')) // true
 * console.log(satisfies('^1.0.0-alpha', '1.0.0-alpha')) // true
 *
 * // 通配符示例
 * console.log(satisfies('1.0.x', '1.0.1')) // true
 * console.log(satisfies('1.0.x', '1.1.0')) // false
 * console.log(satisfies('1.x.x', '1.2.3')) // true
 * console.log(satisfies('1.x.0', '1.2.0')) // true
 * console.log(satisfies('1.x.0', '1.2.1')) // false
 * ```
 */
declare const satisfies: (satisfies: string, version: string) => boolean;

type index$2_CompareMode = CompareMode;
declare const index$2_checkGitPluginUpdate: typeof checkGitPluginUpdate;
declare const index$2_checkPkgUpdate: typeof checkPkgUpdate;
declare const index$2_checkPort: typeof checkPort;
declare const index$2_errorToString: typeof errorToString;
declare const index$2_exec: typeof exec;
declare const index$2_ffmpeg: typeof ffmpeg;
declare const index$2_ffplay: typeof ffplay;
declare const index$2_ffprobe: typeof ffprobe;
declare const index$2_fileToUrl: typeof fileToUrl;
declare const index$2_fileToUrlHandlerKey: typeof fileToUrlHandlerKey;
declare const index$2_getCommit: typeof getCommit;
declare const index$2_getHash: typeof getHash;
declare const index$2_getPid: typeof getPid;
declare const index$2_getPkgVersion: typeof getPkgVersion;
declare const index$2_getRemotePkgVersion: typeof getRemotePkgVersion;
declare const index$2_getRequestIp: typeof getRequestIp;
declare const index$2_getTime: typeof getTime;
declare const index$2_importModule: typeof importModule;
declare const index$2_imports: typeof imports;
declare const index$2_isClass: typeof isClass;
declare const index$2_isDocker: typeof isDocker;
declare const index$2_isIPv4Loop: typeof isIPv4Loop;
declare const index$2_isIPv6Loop: typeof isIPv6Loop;
declare const index$2_isLinux: typeof isLinux;
declare const index$2_isLocalRequest: typeof isLocalRequest;
declare const index$2_isLoopback: typeof isLoopback;
declare const index$2_isMac: typeof isMac;
declare const index$2_isRoot: typeof isRoot;
declare const index$2_isWin: typeof isWin;
declare const index$2_killApp: typeof killApp;
declare const index$2_lock: typeof lock;
declare const index$2_lockMethod: typeof lockMethod;
declare const index$2_lockProp: typeof lockProp;
declare const index$2_restart: typeof restart;
declare const index$2_restartDirect: typeof restartDirect;
declare const index$2_satisfies: typeof satisfies;
declare const index$2_stringifyError: typeof stringifyError;
declare const index$2_updateAllGitPlugin: typeof updateAllGitPlugin;
declare const index$2_updateAllPkg: typeof updateAllPkg;
declare const index$2_updateGitPlugin: typeof updateGitPlugin;
declare const index$2_updatePkg: typeof updatePkg;
declare const index$2_waitPort: typeof waitPort;
declare namespace index$2 {
  export { type index$2_CompareMode as CompareMode, index$2_checkGitPluginUpdate as checkGitPluginUpdate, index$2_checkPkgUpdate as checkPkgUpdate, index$2_checkPort as checkPort, index$2_errorToString as errorToString, index$2_exec as exec, index$2_ffmpeg as ffmpeg, index$2_ffplay as ffplay, index$2_ffprobe as ffprobe, index$2_fileToUrl as fileToUrl, index$2_fileToUrlHandlerKey as fileToUrlHandlerKey, formatTime$1 as formatTime, index$2_getCommit as getCommit, index$2_getHash as getHash, index$2_getPid as getPid, index$2_getPkgVersion as getPkgVersion, index$2_getRemotePkgVersion as getRemotePkgVersion, index$2_getRequestIp as getRequestIp, index$2_getTime as getTime, index$2_importModule as importModule, index$2_imports as imports, index$2_isClass as isClass, index$2_isDocker as isDocker, index$2_isIPv4Loop as isIPv4Loop, index$2_isIPv6Loop as isIPv6Loop, index$2_isLinux as isLinux, index$2_isLocalRequest as isLocalRequest, index$2_isLoopback as isLoopback, index$2_isMac as isMac, index$2_isRoot as isRoot, index$2_isWin as isWin, index$2_killApp as killApp, index$2_lock as lock, index$2_lockMethod as lockMethod, index$2_lockProp as lockProp, index$2_restart as restart, index$2_restartDirect as restartDirect, index$2_satisfies as satisfies, index$2_stringifyError as stringifyError, index$2_updateAllGitPlugin as updateAllGitPlugin, index$2_updateAllPkg as updateAllPkg, index$2_updateGitPlugin as updateGitPlugin, index$2_updatePkg as updatePkg, uptime$1 as uptime, index$2_waitPort as waitPort };
}

/**
 * 构建文本元素
 * @param text 文本内容
 */
declare const text: (text: string) => TextElement;
/**
 * 构建At元素
 * @param targetId 目标id atall=all at在线成员=online
 * @param name At的名称
 */
declare const at: (targetId: string, name?: string) => AtElement;
/**
 * 构建表情元素
 * @param id 表情ID
 * @param isBig 是否大表情，默认不是
 */
declare const face: (id: number, isBig?: boolean) => FaceElement;
/**
 * 构建回复元素
 * @param messageId 回复的消息ID
 */
declare const reply: (messageId: string) => ReplyElement;
/**
 * 构建图片元素
 * @param file 图片url、路径或者base64
 * @param fileType 图片类型
 * @param options 其他可选参数
 */
declare const image: (file: string, options?: Partial<ImageElement>) => ImageElement;
/**
 * 构建视频元素
 * @param file 视频url、路径或者base64
 * @param options 其他可选参数
 */
declare const video: (file: string, options?: Partial<Omit<VideoElement, "type" | "file">>) => VideoElement;
/**
 * 构建语音元素
 * @param file 语音文件url、路径或者base64
 * @param magic 是否为魔法语音 默认不是
 * @param options 其他可选参数
 */
declare const record: (file: string, magic?: boolean, options?: Partial<Omit<RecordElement, "type" | "file" | "magic">>) => RecordElement;
/**
 * 构建JSON元素
 * @param data JSON内容
 */
declare const json: (data: string) => JsonElement;
/**
 * 构建XML元素
 * @param data XML内容
 */
declare const xml: (data: string) => XmlElement;
/**
 * 构建Markdown元素
 * @param markdown Markdown内容
 * @param config 配置参数
 */
declare const markdown: (markdown: string, config?: MarkdownElement["config"]) => MarkdownElement;
/**
 * 构建Markdown模板元素
 * @param templateId 模板ID
 * @param params 模板参数
 */
declare const markdownTpl: (templateId: string, params: MarkdownTplElement["params"]) => MarkdownTplElement;
/**
 * 构建被动事件元素
 * @param id 被动事件ID
 * @param source 事件id来源 默认为msg
 */
declare const pasmsg: (id: string, source?: PasmsgElement["source"]) => PasmsgElement;
/**
 * 构建多行按钮元素
 * @param data 按钮行数组
 */
declare const keyboard: (data: Array<Array<KarinButton>>) => KeyboardElement;
/**
 * 构建单行按钮元素
 * @param data 按钮数组
 */
declare const button: (data: KarinButton | Array<KarinButton>) => ButtonElement;
/**
 * 构建长消息元素
 * @param id 消息ID
 */
declare const longMsg: (id: string) => LongMsgElement;
/**
 * 构建原始元素
 * @param data 原始数据
 */
declare const raw: (data: any) => RawElement;
/**
 * 构建篮球元素
 * @param id 篮球ID
 */
declare const basketball: (id: number) => BasketballElement;
/**
 * 构建骰子元素
 * @param id 骰子ID
 */
declare const dice: (id: number) => DiceElement;
/**
 * 构建猜拳元素
 * @param id 猜拳ID
 */
declare const rps: (id: number) => RpsElement;
/**
 * 构建弹射表情元素
 * @param id 表情ID
 * @param count 表情数量
 */
declare const bubbleFace: (id: number, count: number) => BubbleFaceElement;
/**
 * 构建天气元素
 * @param city 城市名称
 * @param code 城市代码
 */
declare const weather: (city: string, code: string) => WeatherElement;
/**
 * 构建位置元素
 * @param lat 纬度
 * @param lon 经度
 * @param title 标题
 * @param address 地址
 */
declare const location: (lat: number, lon: number, title: string, address: string) => LocationElement;
/**
 * 构建分享元素
 * @param url 分享链接
 * @param title 分享标题
 * @param content 分享内容
 * @param image 分享图片
 */
declare const share: (url: string, title: string, content: string, image: string) => ShareElement;
/**
 * 构建礼物元素
 * @param qq QQ号
 * @param id 礼物ID
 */
declare const gift: (qq: number, id: number) => GiftElement;
/**
 * 构建商城表情元素
 * @param id 表情ID
 */
declare const marketFace: (id: string) => MarketFaceElement;
/**
 * 构建分享名片元素
 * @param scene 分享类型
 * @param peer 被推荐人的QQ号或者被推荐群的群号
 */
declare const contact: (scene: "group" | "friend", peer: string) => ContactElement;
/**
 * 构建常规音乐元素
 * @param id 歌曲ID或自定义音乐选项
 * @param platform 音乐平台
 */
declare const music: (platform: ReadyMusicElement["platform"], id: string) => ReadyMusicElement;
/**
 * 构建自定义音乐元素
 * @param url 跳转链接
 * @param audio 音乐音频链接
 * @param title 标题
 * @param author 歌手
 * @param pic 封面
 */
declare const customMusic: (url: string, audio: string, title: string, author: string, pic: string) => CustomMusicElement;
/**
 * 构建自定义转发节点元素
 * @param userId 目标ID
 * @param nickname 目标名称
 * @param message 转发的消息元素结构
 * @param options 外显设置 暂未实现
 */
declare const node: (userId: CustomNodeElement["userId"], nickname: CustomNodeElement["nickname"], message: CustomNodeElement["message"], options?: CustomNodeElement["options"]) => CustomNodeElement;
/**
 * 构建直接转发节点元素
 * @param id 消息ID
 */
declare const nodeDirect: (id: string) => DirectNodeElement;
/**
 * 构建文件元素
 * @deprecated 此类型不支持直接发送 请使用`uploadFile`方法
 * @param file 文件url、路径或者base64
 * @param options 其他可选参数
 */
declare const file: (file: string, options?: Partial<FileElement>) => FileElement;

declare const segment_at: typeof at;
declare const segment_basketball: typeof basketball;
declare const segment_bubbleFace: typeof bubbleFace;
declare const segment_button: typeof button;
declare const segment_contact: typeof contact;
declare const segment_customMusic: typeof customMusic;
declare const segment_dice: typeof dice;
declare const segment_face: typeof face;
declare const segment_file: typeof file;
declare const segment_gift: typeof gift;
declare const segment_image: typeof image;
declare const segment_json: typeof json;
declare const segment_keyboard: typeof keyboard;
declare const segment_location: typeof location;
declare const segment_longMsg: typeof longMsg;
declare const segment_markdown: typeof markdown;
declare const segment_markdownTpl: typeof markdownTpl;
declare const segment_marketFace: typeof marketFace;
declare const segment_music: typeof music;
declare const segment_node: typeof node;
declare const segment_nodeDirect: typeof nodeDirect;
declare const segment_pasmsg: typeof pasmsg;
declare const segment_raw: typeof raw;
declare const segment_record: typeof record;
declare const segment_reply: typeof reply;
declare const segment_rps: typeof rps;
declare const segment_share: typeof share;
declare const segment_text: typeof text;
declare const segment_video: typeof video;
declare const segment_weather: typeof weather;
declare const segment_xml: typeof xml;
declare namespace segment {
  export { segment_at as at, segment_basketball as basketball, segment_bubbleFace as bubbleFace, segment_button as button, segment_contact as contact, segment_customMusic as customMusic, segment_dice as dice, segment_face as face, segment_file as file, segment_gift as gift, segment_image as image, segment_json as json, segment_keyboard as keyboard, segment_location as location, segment_longMsg as longMsg, segment_markdown as markdown, segment_markdownTpl as markdownTpl, segment_marketFace as marketFace, segment_music as music, segment_node as node, segment_nodeDirect as nodeDirect, segment_pasmsg as pasmsg, segment_raw as raw, segment_record as record, segment_reply as reply, segment_rps as rps, segment_share as share, segment_text as text, segment_video as video, segment_weather as weather, segment_xml as xml };
}

/**
 * 将消息元素转换为字符串
 * @param data 消息元素
 * @returns 消息字符串和原始字符串
 */
declare const createRawMessage: (data: Elements[]) => {
    /** 原始消息字符串: `[at:10001]这是一条测试的文本消息` */
    raw: string;
    /**
     * - 经过处理的纯文本
     * - 可用于正则匹配
     * - tips: 此时还没有处理bot前缀
     */
    msg: string;
};
/**
 * 消息元素归一化 主要处理字符串文本
 * @param elements 消息
 */
declare const makeMessage: (elements: SendMessage) => Array<Elements>;
/**
 * 制作简单转发，返回segment.node[]。仅简单包装node，也可以自己组装
 * @param elements
 * @param fakeId 转发用户的QQ号 必填
 * @param fakeName 转发用户显示的昵称 必填
 */
declare const makeForward: (elements: SendMessage | Array<Elements[]>, fakeId?: string, fakeName?: string) => Array<CustomNodeElement>;

interface RaceRequestConfig extends AxiosRequestConfig {
    /** 响应成功状态码 默认[200] */
    successCodes?: number[];
}
/**
 * 竞速请求 返回最先成功响应的数据
 * @param urls - 请求地址数组
 * @param config - 请求配置 默认 { timeout: 10000, method: 'HEAD', successCodes: [200] }
 * @returns 返回最先成功响应的数据
 * @example
 * const urls = ['https://api.github.com', 'https://api.gitee.com']
 * const data = await raceRequest(urls)
 * console.log(data)
 *
 * @example
 * const urls = ['https://api.github.com/post', 'https://api.gitee.com/post']
 * const data = await raceRequest(urls, {
 *   method: 'post',
 *   data: { foo: 'bar' },
 *   timeout: 10000,
 *   successCodes: [200, 201]
 * })
 * console.log(data)
 */
declare const raceRequest: <R = AxiosRequestConfig, T = any>(urls: string[], config?: RaceRequestConfig) => Promise<AxiosResponse<T, R> | null>;
/**
 * 测试网络请求
 * @template D - 请求数据类型
 * @template T - 是否返回详细信息
 * @template R - 是否为竞速模式
 * @param urls - 请求地址数组
 * @param config - 扩展的请求配置，包含成功状态码列表和是否返回详细信息选项
 * @returns 根据配置返回不同格式的结果
 * @example
 * const urls = ['https://api.github.com', 'https://api.gitee.com']
 * const data = await pingRequest(urls)
 * console.log(data)
 * // -> ['https://api.github.com']
 *
 * @example
 * const urls = ['https://api.github.com', 'https://api.gitee.com']
 * const data = await pingRequest(urls, { detailed: true })
 * console.log(data)
 * // -> [{ url: 'https://api.github.com', success: true, duration: 100, error: null }]
 *
 * @example
 * const urls = ['https://api.github.com', 'https://api.gitee.com']
 * const data = await pingRequest(urls, { isRace: true })
 * console.log(data)
 * // -> 'https://api.github.com' 启用竞速模式，返回第一个成功的请求结果
 */
declare const pingRequest: <D = any, T extends boolean = false, R extends boolean = false>(urls: string[], config?: ExtendedAxiosRequestConfig<D, T, R>) => Promise<PingRequestResult<T, R>>;
/**
 * 返回最快的npm registry
 * @description 阿里云兜底
 * @returns 返回最快的npm registry
 */
declare const getFastRegistry: () => Promise<string>;
/**
 * 获取指定仓库的package.json
 * @param owner - 仓库所属用户名
 * @param repo - 仓库名
 * @returns 返回指定仓库的package.json
 */
declare const getPackageJson: (owner: string, repo: string) => Promise<any>;

/**
 * 构建符合 https://github.akams.cn/ 标准的github加速源
 * @param owner - 仓库所属用户名
 * @param repo - 仓库名
 * @returns 返回符合标准的github加速源
 */
declare const buildGithub: (proxy: string) => GithubConfig;
/**
 * 解析github地址
 * @param url - github地址
 * @returns 返回解析后的地址
 */
declare const parseGithubUrl: (url: string) => {
    owner: string;
    repo: string;
    path: string;
};
/**
 * Gihub加速 获取当前最快的源
 * @param urls - 请求地址数组
 * @param owner - 仓库所属用户名
 * @param repo - 仓库名
 * @returns 返回最快的源
 */
declare const getFastGithub: (type: "raw" | "clone") => Promise<GithubConfig>;

/**
 * INI文件解析器，专用于解析和保存 .npmrc 格式的文件
 */
interface INIParser {
    /**
     * 从指定路径读取并解析INI文件
     * @param filePath - 文件路径
     * @returns 解析后的键值对对象
     */
    read: (filePath: string) => Record<string, string>;
    /**
     * 将键值对对象保存到指定路径
     * @param data - 要保存的键值对数据
     * @param filePath - 保存的文件路径
     * @returns 是否保存成功
     */
    write: (data: Record<string, string>, filePath: string) => boolean;
}
/**
 * 创建并返回INI解析器对象
 * @returns INI解析器对象
 */
declare const createINIParser: () => INIParser;
/**
 * INI解析器
 */
declare const ini: INIParser;

/**
 * 比较两个对象数组，找出它们之间的差异
 * @description 使用深度比较方式，返回在旧数组中被移除的对象和在新数组中新增的对象
 * @param old 旧数组 - 作为比较基准的原始数组
 * @param data 新数组 - 需要与基准数组进行比较的目标数组
 * @returns 包含差异的对象
 *          - removed: 在旧数组中存在但在新数组中不存在的对象集合
 *          - added: 在新数组中存在但在旧数组中不存在的对象集合
 *          - common: 在两个数组中都存在的对象集合
 * @example
 * const diff = diffArray(
 *   [{ self_id: 123, token: '123' }, { self_id: 222, token: '123' }],
 *   [{ self_id: 123, token: '123' }, { self_id: 333, token: '123' }]
 * )
 * // 结果: {
 * //   removed: [{ self_id: 222, token: '123' }],
 * //   added: [{ self_id: 333, token: '123' }],
 * //   common: [{ self_id: 123, token: '123' }]
 * // }
 */
declare const diffArray: <T extends Record<string, any>, K extends Record<string, any>>(old: T[], data: K[]) => {
    removed: T[];
    added: K[];
    common: T[];
};
/**
 * 比较两个单维数组，找出它们之间的差异
 * @description 返回在旧数组中被移除的元素和在新数组中新增的元素
 * @param old 旧数组 - 作为比较基准的原始数组
 * @param data 新数组 - 需要与基准数组进行比较的目标数组
 * @returns 包含差异的对象
 *          - removed: 在旧数组中存在但在新数组中不存在的元素集合
 *          - added: 在新数组中存在但在旧数组中不存在的元素集合
 *          - common: 在两个数组中都存在的元素集合
 * @example
 * const result = diffSimpleArray([1, 2, 3], [2, 3, 4])
 * // 结果: {
 * //   removed: [1],
 * //   added: [4],
 * //   common: [2, 3]
 * // }
 */
declare const diffSimpleArray: <T>(old: T[], data: T[]) => {
    removed: T[];
    added: T[];
    common: T[];
};
/**
 * 确保数值在指定范围内
 * @param value 需要限制的数值
 * @param min 最小值
 * @param max 最大值
 * @returns 限制在范围内的数值
 * @example clamp(5, 0, 10) // 返回 5
 *          clamp(-1, 0, 10) // 返回 0
 *          clamp(11, 0, 10) // 返回 10
 */
declare const clamp: (value: number, min: number, max: number) => number;
/**
 * 生成指定范围内的随机整数
 * @param min 最小值（包含）
 * @param max 最大值（包含）
 * @returns 随机整数
 * @example random(1, 10) // 返回 1-10 之间的随机整数
 */
declare const random: (min: number, max: number) => number;
/**
 * 格式化数字，添加千位分隔符
 * @param num 需要格式化的数字
 * @param digits 保留小数位数，默认为 0
 * @returns 格式化后的字符串
 * @example formatNumber(1234567) // 返回 "1,234,567"
 *          formatNumber(1234.567, 2) // 返回 "1,234.57"
 */
declare const formatNumber: (num: number, digits?: number) => string;
/**
 * 计算百分比
 * @param value 当前值
 * @param total 总值
 * @param digits 保留小数位数，默认为 2
 * @returns 百分比值
 * @example percentage(75, 200) // 返回 37.5
 */
declare const percentage: (value: number, total: number, digits?: number) => number;
/**
 * 将数字转换为带单位的字符串（K, M, B）
 * @param num 需要转换的数字
 * @param digits 保留小数位数，默认为 1
 * @returns 带单位的字符串
 * @example formatUnit(1234) // 返回 "1.2K"
 *          formatUnit(1234567) // 返回 "1.2M"
 *          formatUnit(1234567890) // 返回 "1.2B"
 */
declare const formatUnit: (num: number, digits?: number) => string;
/**
 * 判断一个数是否为偶数
 * @param num 需要判断的数字
 * @returns 是否为偶数
 * @example isEven(2) // 返回 true
 *          isEven(3) // 返回 false
 */
declare const isEven: (num: number) => boolean;
/**
 * 计算数组的平均值
 * @param numbers 数字数组
 * @returns 平均值
 * @example average([1, 2, 3, 4, 5]) // 返回 3
 */
declare const average: (numbers: number[]) => number;
/**
 * 将数字四舍五入到指定小数位
 * @param num 需要处理的数字
 * @param decimals 小数位数，默认为 0
 * @returns 处理后的数字
 * @example round(1.234, 2) // 返回 1.23
 *          round(1.235, 2) // 返回 1.24
 */
declare const round: (num: number, decimals?: number) => number;
/**
 * 判断是否为数字 处理NaN的情况
 * @param num 需要判断的数字
 * @param defaultValue 默认值 如果非数字 返回默认值
 * @returns 处理后的数字
 * @example isNumber(NaN) // 返回 0
 *          isNumber(123) // 返回 123
 *          isNumber('abc', 123) // 返回 123
 */
declare const isNumber: (num: unknown, defaultValue?: number) => number;
/**
 * 判断数组中的元素是否为数字
 * @description 从索引0开始寻找，如果找到数字则返回数字，否则返回默认值
 * @param arr 需要判断的数组
 * @param defaultValue 默认值 如果非数字 返回默认值
 * @returns 数字或默认值
 * @example isNumberInArray([1, '2', 3], 0) // 返回 1
 *          isNumberInArray(['1', '2', '3'], 0) // 返回 0
 */
declare const isNumberInArray: <T = number>(arr: unknown[], defaultValue?: number) => T;
/**
 * 创建一个自增ID生成器
 * @description 返回一个函数，每次调用时返回一个递增的唯一ID
 * @param start 起始值，默认为 0
 * @returns 返回一个函数，调用时返回下一个ID
 * @example
 * const getId = createIdGenerator()
 * getId() // 返回 1
 * getId() // 返回 2
 * getId() // 返回 3
 *
 * const getIdFrom100 = createIdGenerator(100)
 * getIdFrom100() // 返回 101
 * getIdFrom100() // 返回 102
 */
declare const createIdGenerator: (start?: number) => () => number;

/**
 * 字符串工具
 */
declare const strToBool: {
    /**
     * 将数组中的所有元素转换为字符串 使用`String`转换
     * @param arr 需要转换的数组
     * @returns 转换后的字符串
     * @example strToBool.array([1, '2']) // ['1', '2']
     *          strToBool.array(['3', null, undefined, NaN, '']) // ['3']
     */
    array: (arr: unknown[]) => string[];
    /**
     * 排除数组中所有非字符串的元素
     * @param arr 需要转换的数组
     * @returns 转换后的字符串
     * @example strToBool.arrayExcludeNonString(['1', '2', '3']) // ['1', '2', '3']
     *          strToBool.arrayExcludeNonString(['1', '2', '3', null, undefined, NaN, '']) // ['1', '2', '3']
     */
    arrayExcludeNonString: (arr: unknown[]) => string[];
    /**
     * 将字符串转换为布尔值
     * @param str 需要转换的字符串
     * @returns 转换后的布尔值
     * @example strToBool.string('true') // true
     *          strToBool.string('1') // true
     *          strToBool.string('yes') // true
     *          strToBool.string('on') // true
     *          strToBool.string('false') // false
     *          strToBool.string('0') // false
     *          strToBool.string('no') // false
     */
    string: (str: string) => boolean;
    /**
     * 将字符串转换为数字
     * @param str 需要转换的字符串
     * @param defaultValue 默认值 如果非数字 返回默认值
     * @returns 转换后的数字
     * @example strToBool.number('1') // 1
     *          strToBool.number('2') // 2
     *          strToBool.number('3') // 3
     *          strToBool.number('abc', 123) // 123
     */
    number: (str: string, defaultValue?: number) => number;
    /**
     * 将字符串数组转换为数字数组
     * @param arr 需要转换的数组
     * @returns 转换后的数字数组
     * @example strToBool.arrayNumber(['1', '2', '3']) // [1, 2, 3]
     */
    arrayNumber: (arr: string[]) => number[];
    /**
     * 传入一个数组 按照索引返回数组 并且将这个数组转换为字符串数组 去掉重复、非字符串的元素
     * @param arr 需要转换的数组
     * @param index 需要返回的索引
     * @returns 转换后的字符串数组
     * @example strToBool.arrayString(['1', '2', '3'], 0) // ['1']
     */
    arrayString: (arr: unknown[]) => string[];
    /**
     * 合并多个数组为一个并去重 如果不是数组将会跳过
     * @param arr 需要合并的数组
     * @returns 合并后的数组
     * @example strToBool.mergeArray(['1', '2', '3'], ['4', '5', '6']) // ['1', '2', '3', '4', '5', '6']
     *          strToBool.mergeArray(['4', '5', '6'], ['4', '5', '6']) // ['4', '5', '6']
     */
    mergeArray: <T>(...arr: unknown[]) => T[];
};

/**
 * 休眠函数
 * @param ms 毫秒
 * @example
 * ```ts
 * await sleep(1000)
 * ```
 */
declare const sleep: (ms: number) => Promise<unknown>;

/**
 * 获取运行时间
 * @example
 * ```ts
 * uptime()
 * // -> '1天2小时3分钟4秒'
 * // -> '2小时3分钟4秒'
 * // -> '3分钟4秒'
 * // -> '4秒'
 * ```
 */
declare const uptime: () => string;

type AxiosFn = {
    /**
     * 对axios进行简单封装，超时、错误后返回null，不会抛出异常
     * @param param axios参数
     */
    (param: AxiosRequestConfig): Promise<AxiosResponse<any> | null | undefined>;
    /**
     * 对axios进行简单封装，超时、错误后返回null，不会抛出异常
     * @param url 请求地址
     * @param type 请求类型
     * @param param axios参数
     */
    (url: string, type: 'get' | 'post', param?: AxiosRequestConfig): Promise<AxiosResponse<any> | null | undefined>;
};
interface NpmInfo {
    plugin: string;
    path: string;
    file: string;
    isMain: boolean;
}
/**
 * axios请求
 * @description 401时返回 `undefined`
 * @param paramOrUrl axios参数或url
 * @param type 请求类型 只有在传入url时有效
 * @param param axios参数 只有在传入url时有效
 * @example
 * ```ts
 * await axios({ url: 'https://example.com', method: 'get' })
 * await axios({ url: 'https://example.com', method: 'post', data: { key: 'value' } })
 * await axios('https://example.com', 'post', { data: { key: 'value' } })
 * await axios('https://example.com', 'get')
 * // -> null 或 axios返回值
 * ```
 */
declare const axios: AxiosFn;
/**
 * @description 传入一个或两个时间戳
 * @description 传入一个返回当前时间 - 时间1
 * @description 传入两个返回时间2 - 时间1
 * @param time - 时间戳
 * @example
 * common.formatTime(1620000000)
 * // -> '18天'
 * common.formatTime(1620000000, 1620000000)
 * // -> '18天'
 */
declare const formatTime: (time: number, time2?: number) => string;
/**
 * @deprecated 已废弃 建议使用`yaml`模块
 * 更新yaml文件
 * @param filePath - 文件路径
 * @param settings - 设置项
 */
declare const updateYaml: (filePath: string, settings: Array<{
    /** 键路径 */
    key: string;
    /** 要写入的内容 */
    val: any;
    /** 需要写入的注释 */
    comment: string;
    /** 注释在开头还是结尾 */
    type?: "top" | "end";
}>) => void;
/**
 * @deprecated 已废弃 请使用`getNpmPlugins`、`getNpmPluginsInfo`
 * 获取npm插件列表
 * @param showDetails - 是否返回详细信息
 * 默认只返回插件npm包名，为true时返回详细的{dir, name}[]
 */
declare const getNpmPlugins: (showDetails?: boolean) => Promise<string[] | PkgInfo[]>;
/**
 * @deprecated 已废弃
 * 获取git插件列表
 * @param isPack - 是否屏蔽不带package.json的插件，默认为false
 */
declare const getPlugins$1: (_?: boolean) => Promise<string[]>;
/**
 * @deprecated 已废弃
 * 获取git插件列表
 * @param isPack - 是否屏蔽不带package.json的插件，默认为false
 */
declare const getGitPlugins: (isPack?: boolean) => Promise<string[] | PkgInfo[]>;
/**
 * 传入图片数组，拼接成一个图片
 * @param images - 图片数组 支持路径和带前缀base64字符串`(base64://...)`
 * @param perRow - 每行图片数量 默认3
 * @returns 返回base64 不含`data:image/png;base64` `base64://`等前缀
 */
declare const mergeImage: (images: string[], perRow?: number) => Promise<{
    base64: string;
    height: number;
    width: number;
}>;
/**
 * 将全部图片转为绝对路径
 * @param images - 图片数组
 * @param root - 根目录
 * @returns 返回绝对路径数组
 */
declare const getAbsPath: (images: string[], root: string) => string[];

type index$1_AxiosFn = AxiosFn;
type index$1_NpmInfo = NpmInfo;
declare const index$1_absPath: typeof absPath;
declare const index$1_average: typeof average;
declare const index$1_axios: typeof axios;
declare const index$1_base64: typeof base64;
declare const index$1_buffer: typeof buffer;
declare const index$1_clamp: typeof clamp;
declare const index$1_createIdGenerator: typeof createIdGenerator;
declare const index$1_createRawMessage: typeof createRawMessage;
declare const index$1_diffArray: typeof diffArray;
declare const index$1_diffSimpleArray: typeof diffSimpleArray;
declare const index$1_downFile: typeof downFile;
declare const index$1_formatNumber: typeof formatNumber;
declare const index$1_formatTime: typeof formatTime;
declare const index$1_formatUnit: typeof formatUnit;
declare const index$1_getAbsPath: typeof getAbsPath;
declare const index$1_getGitPlugins: typeof getGitPlugins;
declare const index$1_getNpmPlugins: typeof getNpmPlugins;
declare const index$1_getRelPath: typeof getRelPath;
declare const index$1_isDir: typeof isDir;
declare const index$1_isEven: typeof isEven;
declare const index$1_isNumber: typeof isNumber;
declare const index$1_isNumberInArray: typeof isNumberInArray;
declare const index$1_isPlugin: typeof isPlugin;
declare const index$1_karinToQQBot: typeof karinToQQBot;
declare const index$1_makeForward: typeof makeForward;
declare const index$1_makeMessage: typeof makeMessage;
declare const index$1_mergeImage: typeof mergeImage;
declare const index$1_percentage: typeof percentage;
declare const index$1_qqbotToKarin: typeof qqbotToKarin;
declare const index$1_random: typeof random;
declare const index$1_round: typeof round;
declare const index$1_sleep: typeof sleep;
declare const index$1_splitPath: typeof splitPath;
declare const index$1_strToBool: typeof strToBool;
declare const index$1_stream: typeof stream;
declare const index$1_updateYaml: typeof updateYaml;
declare const index$1_uptime: typeof uptime;
declare const index$1_urlToPath: typeof urlToPath;
declare namespace index$1 {
  export { type index$1_AxiosFn as AxiosFn, type index$1_NpmInfo as NpmInfo, index$1_absPath as absPath, index$1_average as average, index$1_axios as axios, index$1_base64 as base64, index$1_buffer as buffer, karinToQQBot as buttonToQQBot, index$1_clamp as clamp, index$1_createIdGenerator as createIdGenerator, index$1_createRawMessage as createRawMessage, index$1_diffArray as diffArray, index$1_diffSimpleArray as diffSimpleArray, index$1_downFile as downFile, existToMkdir as exists, index$1_formatNumber as formatNumber, index$1_formatTime as formatTime, index$1_formatUnit as formatUnit, index$1_getAbsPath as getAbsPath, index$1_getGitPlugins as getGitPlugins, index$1_getNpmPlugins as getNpmPlugins, getPlugins$1 as getPlugins, index$1_getRelPath as getRelPath, index$1_isDir as isDir, index$1_isEven as isEven, index$1_isNumber as isNumber, index$1_isNumberInArray as isNumberInArray, index$1_isPlugin as isPlugin, index$1_karinToQQBot as karinToQQBot, index$1_makeForward as makeForward, index$1_makeMessage as makeMessage, createRawMessage as makeMessageLog, index$1_mergeImage as mergeImage, mkdirSync as mkdir, index$1_percentage as percentage, getPluginInfo as pkgJson, pkgRoot as pkgroot, index$1_qqbotToKarin as qqbotToKarin, index$1_random as random, readJsonSync as readJson, read as readYaml, index$1_round as round, index$1_sleep as sleep, index$1_splitPath as splitPath, index$1_strToBool as strToBool, index$1_stream as stream, index$1_updateYaml as updateYaml, index$1_uptime as uptime, index$1_urlToPath as urlToPath, writeJsonSync as writeJson, write as writeYaml };
}

/**
 * 传入一个数组 将数组中所有元素为字符串
 * @param data 数据
 */
declare const formatArray: (data: any[]) => string[];
/**
 * 初始化count
 * @param count 计数器
 * @param key 键
 */
declare const initCount: (count: Record<string, {
    /** 上一分钟调用次数 */
    start: number;
    /** 当前调用次数 */
    count: number;
}>, key: string) => void;
/**
 * @internal
 * 传入一个对象 将对象中的嵌套数组中所有元素为字符串
 * @param data 数据
 * @returns 统一后的数据
 */
declare const formatObject: <T extends Record<string, any>>(data: T) => T;
/**
 * @internal
 * @description 创建缓存对象
 */
declare const createCount: () => Record<string, {
    /** 上一分钟调用次数 */
    start: number;
    /** 当前调用次数 */
    count: number;
}>;
/**
 * 获取缓存配置
 */
declare const getCacheCfg: <T>(cache: Record<string, T>, count: ReturnType<typeof createCount>, keys: string[]) => T;
/**
 * 定时清理缓存
 * @param data 数据
 * @param count 计数器
 * @param cache 缓存
 */
declare const clearCache: <T extends GroupsObjectValue | PrivatesObjectValue>(count: ReturnType<typeof createCount>, staticCache: Record<string, T>, dynamicCache: Record<string, T>) => void;

/**
 * @description 默认配置
 */
declare const defaultConfig: {
    adapter: Adapters;
    config: Config;
    groups: Groups;
    pm2: PM2;
    redis: Redis;
    render: Renders$1;
    privates: Privates;
};

/**
 * 获取配置yaml
 * @param name 文件名称
 * @param type 文件类型 用户配置/默认配置
 * @param isRefresh 是否刷新缓存
 */
declare const getYaml: <T extends keyof FileListMap>(name: T, type: "user" | "default", isRefresh?: boolean) => FileListMap[T];
/**
 * @description 修改框架配置
 * @param name 文件名称
 * @param data 配置数据
 */
declare const setYaml: <T extends keyof FileListMap>(name: T, data: T extends "groups" ? Groups : T extends "privates" ? Privates : Record<string, any>) => boolean;
/**
 * @description 修改框架配置 修改系统配置
 * @param name 文件名称
 * @param data 配置数据
 */
declare const setConfig: <T extends keyof FileListMap>(name: T, data: T extends "groups" ? Groups : T extends "privates" ? Privates : Record<string, any>) => boolean;
/**
 * 清空指定目录下的全部文件 不删除目录
 * @param dir 目录
 */
declare const clearFiles: (dir: string) => void;
/**
 * 更新日志等级
 * @param level 日志等级
 * @returns 返回更新后的日志等级
 */
declare const updateLevel: (level?: LogMethodNames) => string;

/** node-karin的package.json */
declare const pkg: () => Package;

/**
 * @public 公开Api
 * @description 获取adapter.json
 */
declare const adapter: () => Adapters;
/**
 * @public 公开Api
 * @description onebotWs请求超时时间
 */
declare const timeout: () => number;
/**
 * @public 公开Api
 * @description wsServer 鉴权token
 */
declare const webSocketServerToken: () => string;

/**
 * @public 公开Api
 * @description 获取配置 `config.json`
 */
declare const config: () => Config;
/**
 * @public 公开Api
 * @description 获取Bot主人列表
 */
declare const master: () => string[];
/**
 * @public 公开Api
 * @description 获取Bot管理员列表
 */
declare const admin: () => string[];

/**
 * @public 公开Api
 * @description 获取ffmpeg路径
 */
declare const ffmpegPath: () => string;
/**
 * @public 公开Api
 * @description 获取ffprobe路径
 */
declare const ffprobePath: () => string;
/**
 * @public 公开Api
 * @description 获取ffplay路径
 */
declare const ffplayPath: () => string;
/**
 * @public 公开Api
 * @description 获取http端口
 */
declare const port: () => number;
/**
 * @public 公开Api
 * @description 获取http主机
 */
declare const host: () => string;
/**
 * @public 公开Api
 * @description 获取鉴权秘钥
 */
declare const authKey: () => string;
/**
 * @public 公开Api
 * @description 修改`.env`文件 此方法仅允许写入单个键值对 如需写入多个键值对和注释 请使用`writeEnv`方法
 * @param data - 需要更新的环境变量键值对
 * @returns 是否更新成功
 */
declare const setEnv: (data: Record<string, any>) => boolean;
/**
 * @public 公开Api
 * @description 获取.env文件内容
 */
declare const getEnv: (filePath?: string) => Record<string, {
    /** 值 */
    value: string;
    /** 注释 */
    comment: string;
}>;
/**
 * @public 公开Api
 * @description 获取.env文件内容
 */
declare const env: () => Env;
/**
 * 写入单个或多个环境变量
 * @param data 要写入的环境变量
 * @param cwd env文件路径 默认系统.env文件
 * @param isCover 如果键已经存在 是否覆盖已有的值 默认否
 */
declare const writeEnv: (data: {
    key: string;
    value: string;
    comment: string;
} | {
    key: string;
    value: string;
    comment: string;
}[], cwd?: string, isCover?: boolean) => void;

/**
 * @public 公开Api
 * @description 获取群聊、频道配置
 * @returns 群聊、频道配置
 */
declare const groups: () => {
    get: () => Record<string, GroupsObjectValue>;
};
/**
 * @public 公开Api
 * @description 获取指定群聊配置
 * @param groupId 群号
 * @param selfId 机器人ID
 */
declare const getGroupCfg: (groupId: string, selfId: string) => Groups[number];
/**
 * @public 公开Api
 * @description 获取指定频道配置
 * @param guildId 频道ID
 * @param channelId 子频道ID
 * @param selfId 机器人ID
 */
declare const getGuildCfg: (guildId: string, channelId: string, selfId: string) => Groups[number];
/**
 * @web 获取配置文件 不走缓存
 * @param dir 配置文件根目录
 * @returns 配置文件数据
 */
declare const getGroupsFileData: (dir: string) => Record<string, GroupsObjectValue>;

/**
 * @public 公开Api
 * @description 获取私聊配置
 * @returns 私聊配置
 */
declare const privates: () => Record<string, PrivatesObjectValue>;
/**
 * @public 公开Api
 * @description 获取指定好友配置
 * @param userId 用户ID
 * @param selfId 机器人ID
 */
declare const getFriendCfg: (userId: string, selfId: string) => PrivatesObjectValue;
/**
 * @public 公开Api
 * @description 获取指定频道私信配置
 * @param userId 用户ID
 * @param selfId 机器人ID
 */
declare const getDirectCfg: (userId: string, selfId: string) => PrivatesObjectValue;
/**
 * @web 获取配置文件 不走缓存
 * @param dir 配置文件根目录
 * @returns 配置文件数据
 */
declare const getPrivatesFileData: (dir: string) => Record<string, PrivatesObjectValue>;

/**
 * @public 公开Api
 * @description 获取渲染配置
 * @deprecated 请使用 `getRenderCfg` 代替
 */
declare const render$1: () => Renders$1;
/**
 * @public 公开Api
 * @description 获取渲染配置
 */
declare const getRenderCfg: () => Renders$1;

/** pm2配置 */
declare const pm2: () => PM2;
/**
 * pm2 入口配置
 */
declare const initPm2: () => void;

/** redis配置 */
declare const redis$1: () => Redis;

/**
 * @internal

 * @description 初始全部化配置文件
 * @param dir 配置文件根目录
 */
declare const initConfigCache: (dir: string) => void;

declare const index_adapter: typeof adapter;
declare const index_admin: typeof admin;
declare const index_authKey: typeof authKey;
declare const index_clearCache: typeof clearCache;
declare const index_clearFiles: typeof clearFiles;
declare const index_config: typeof config;
declare const index_createCount: typeof createCount;
declare const index_defaultConfig: typeof defaultConfig;
declare const index_env: typeof env;
declare const index_ffmpegPath: typeof ffmpegPath;
declare const index_ffplayPath: typeof ffplayPath;
declare const index_ffprobePath: typeof ffprobePath;
declare const index_formatArray: typeof formatArray;
declare const index_formatObject: typeof formatObject;
declare const index_getCacheCfg: typeof getCacheCfg;
declare const index_getDirectCfg: typeof getDirectCfg;
declare const index_getEnv: typeof getEnv;
declare const index_getFriendCfg: typeof getFriendCfg;
declare const index_getGroupCfg: typeof getGroupCfg;
declare const index_getGroupsFileData: typeof getGroupsFileData;
declare const index_getGuildCfg: typeof getGuildCfg;
declare const index_getPrivatesFileData: typeof getPrivatesFileData;
declare const index_getRenderCfg: typeof getRenderCfg;
declare const index_getYaml: typeof getYaml;
declare const index_groups: typeof groups;
declare const index_host: typeof host;
declare const index_initConfigCache: typeof initConfigCache;
declare const index_initCount: typeof initCount;
declare const index_initPm2: typeof initPm2;
declare const index_master: typeof master;
declare const index_pkg: typeof pkg;
declare const index_pm2: typeof pm2;
declare const index_port: typeof port;
declare const index_privates: typeof privates;
declare const index_setConfig: typeof setConfig;
declare const index_setEnv: typeof setEnv;
declare const index_setYaml: typeof setYaml;
declare const index_timeout: typeof timeout;
declare const index_updateLevel: typeof updateLevel;
declare const index_webSocketServerToken: typeof webSocketServerToken;
declare const index_writeEnv: typeof writeEnv;
declare namespace index {
  export { index_adapter as adapter, index_admin as admin, index_authKey as authKey, index_clearCache as clearCache, index_clearFiles as clearFiles, index_config as config, index_createCount as createCount, index_defaultConfig as defaultConfig, index_env as env, index_ffmpegPath as ffmpegPath, index_ffplayPath as ffplayPath, index_ffprobePath as ffprobePath, index_formatArray as formatArray, index_formatObject as formatObject, index_getCacheCfg as getCacheCfg, index_getDirectCfg as getDirectCfg, index_getEnv as getEnv, index_getFriendCfg as getFriendCfg, index_getGroupCfg as getGroupCfg, index_getGroupsFileData as getGroupsFileData, index_getGuildCfg as getGuildCfg, index_getPrivatesFileData as getPrivatesFileData, index_getRenderCfg as getRenderCfg, index_getYaml as getYaml, index_groups as groups, index_host as host, index_initConfigCache as initConfigCache, index_initCount as initCount, index_initPm2 as initPm2, index_master as master, index_pkg as pkg, index_pm2 as pm2, index_port as port, index_privates as privates, redis$1 as redis, render$1 as render, index_setConfig as setConfig, index_setEnv as setEnv, index_setYaml as setYaml, index_timeout as timeout, index_updateLevel as updateLevel, index_webSocketServerToken as webSocketServerToken, index_writeEnv as writeEnv };
}

/**
 * karin内部路由
 */
declare const router: Router;

/** 基本路由 */
declare const BASE_ROUTER = "/api/v1";
/** 登录路由 */
declare const LOGIN_ROUTER = "/login";
/** 刷新令牌路由 */
declare const REFRESH_ROUTER = "/refresh";
/** 获取系统配置路由 */
declare const GET_CONFIG_ROUTER = "/config/new/get";
/** 保存系统配置路由 */
declare const SAVE_CONFIG_ROUTER = "/config/new/save";
/** 获取日志路由 */
declare const GET_LOG_ROUTER = "/log";
/** 设置日志等级路由 */
declare const SET_LOG_LEVEL_ROUTER = "/logs/level";
/** 获取日志文件列表路由 */
declare const GET_LOG_FILE_LIST_ROUTER = "/logs/list";
/** 获取指定日志文件路由 */
declare const GET_LOG_FILE_ROUTER = "/logs/file";
/** 退出karin路由 */
declare const EXIT_ROUTER = "/exit";
/** 重启karin路由 */
declare const RESTART_ROUTER = "/restart";
/** 获取网络状态路由 */
declare const GET_NETWORK_STATUS_ROUTER = "/system/get/network";
/** 更新karin路由 */
declare const UPDATE_CORE_ROUTER = "/system/update";
/** 获取所有bot列表路由 */
declare const GET_BOTS_ROUTER = "/system/get/bots";
/** console适配器路由 */
declare const CONSOLE_ROUTER = "/console/{*path}";
/** ping路由 */
declare const PING_ROUTER = "/ping";
/** 系统状态路由 */
declare const SYSTEM_STATUS_ROUTER = "/status/system";
/** 系统信息路由 */
declare const SYSTEM_INFO_ROUTER = "/info";
/** 系统ws连接 */
declare const SYSTEM_STATUS_WS_ROUTER = "/status/ws";
/** karin状态 */
declare const SYSTEM_STATUS_KARIN_ROUTER = "/status/karin";
/** 获取在线插件列表 */
declare const GET_ONLINE_PLUGIN_LIST_ROUTER = "/plugin/index";
/** 获取插件列表 */
declare const GET_PLUGIN_LIST_ROUTER = "/plugin/list";
/** 获取插件应用 */
declare const GET_PLUGIN_APPS_ROUTER = "/plugin/apps";
/** 获取插件文件 */
declare const GET_PLUGIN_FILE_ROUTER = "/plugin/file";
/** 获取可更新插件 */
declare const GET_UPDATABLE_PLUGINS_ROUTER = "/plugin/updates";
/** 批量更新插件 */
declare const BATCH_UPDATE_PLUGINS_ROUTER = "/plugin/update/batch";
/** 获取插件配置 */
declare const GET_PLUGIN_CONFIG_ROUTER = "/plugin/config/get";
/** 保存插件配置 */
declare const SAVE_PLUGIN_CONFIG_ROUTER = "/plugin/config/save";
/** 判断插件配置是否存在 */
declare const IS_PLUGIN_CONFIG_EXIST_ROUTER = "/plugin/config/is-exist";
/** 更新插件 */
declare const UPDATE_PLUGIN_ROUTER = "/plugin/update";
/** 安装插件 */
declare const INSTALL_PLUGIN_ROUTER = "/plugin/install";
/** 卸载插件 */
declare const UNINSTALL_PLUGIN_ROUTER = "/plugin/uninstall";
/** 获取任务状态 */
declare const GET_TASK_STATUS_ROUTER = "/plugin/task";
/** 获取任务列表 */
declare const GET_TASK_LIST_ROUTER = "/plugin/task/list";
/** 更新任务状态 */
declare const UPDATE_TASK_STATUS_ROUTER = "/plugin/task/status";
/** 获取本地插件列表 */
declare const GET_LOCAL_PLUGIN_LIST_ROUTER = "/plugin/local";
/** 创建终端 */
declare const CREATE_TERMINAL_ROUTER = "/terminal/create";
/** 获取终端列表 */
declare const GET_TERMINAL_LIST_ROUTER = "/terminal/list";
/** 关闭终端 */
declare const CLOSE_TERMINAL_ROUTER = "/terminal/close";
/** 检查是否安装了指定的npm包 */
declare const CHECK_PLUGIN_ROUTER = "/system/check/plugin";
/** 安装webui插件 */
declare const INSTALL_WEBUI_PLUGIN_ROUTER = "/plugin/webui/install";
/** 获取webui插件列表 */
declare const GET_WEBUI_PLUGIN_LIST_ROUTER = "/plugin/webui/list";
/** 卸载webui插件 */
declare const UNINSTALL_WEBUI_PLUGIN_ROUTER = "/plugin/webui/uninstall";
/** 获取WebUI插件版本 */
declare const GET_WEBUI_PLUGIN_VERSIONS_ROUTER = "/plugin/webui/versions";
/** 更新WebUI插件到指定版本 */
declare const UPDATE_WEBUI_PLUGIN_VERSION_ROUTER = "/plugin/webui/update-version";
/** 获取任务列表 */
declare const TASK_LIST_ROUTER = "/task/list";
/** 执行任务 */
declare const TASK_RUN_ROUTER = "/task/run";
/** 获取任务日志 */
declare const TASK_LOGS_ROUTER = "/task/logs";
/** 删除任务记录 */
declare const TASK_DELETE_ROUTER = "/task/delete_record";
/** 插件管理 */
declare const PLUGIN_ADMIN_ROUTER = "/plugin/admin";
/** @version 1.8.0 获取插件管理所需的插件信息列表 */
declare const GET_PLUGIN_LIST_PLUGIN_ADMIN_ROUTER = "/plugin/detail/list";
/** @version 1.8.0 获取依赖列表 */
declare const GET_DEPENDENCIES_LIST_ROUTER = "/dependencies/list";
/** @version 1.8.0 依赖管理路由 */
declare const MANAGE_DEPENDENCIES_ROUTER = "/dependencies/manage";
/** @version 1.8.0 获取.npmrc文件列表 */
declare const GET_NPMRC_LIST_ROUTER = "/dependencies/npmrc/list";
/** @version 1.8.0 获取npm config文件内容 */
declare const GET_NPM_CONFIG_ROUTER = "/dependencies/npmrc/get";
/** @version 1.8.0 获取npm registry、proxy、https-proxy配置 */
declare const GET_NPM_BASE_CONFIG_ROUTER = "/dependencies/npm/base";
/** @version 1.8.0 保存npmrc文件 */
declare const SAVE_NPMRC_ROUTER = "/dependencies/npmrc/save";
/** @version 1.8.0 获取已加载命令插件缓存信息列表 */
declare const GET_LOADED_COMMAND_PLUGIN_CACHE_LIST_ROUTER = "/plugin/loaded/command";
/** @version 1.8.0 获取插件市场列表 */
declare const GET_PLUGIN_MARKET_LIST_ROUTER = "/plugin/market";
/** @version 1.8.0 获取本地插件列表 用于插件索引页面渲染简约列表 */
declare const GET_LOCAL_PLUGIN_FRONTEND_LIST_ROUTER = "/plugin/local/frontend";

/** HTTP状态码 */
declare enum HTTPStatusCode {
    /** 成功 */
    OK = 200,
    /** 请求错误 */
    BadRequest = 400,
    /** 未授权 */
    Unauthorized = 401,
    /** 禁止访问 */
    Forbidden = 403,
    /** 未找到 */
    NotFound = 404,
    /** 方法不允许 */
    MethodNotAllowed = 405,
    /** 请求体过大 */
    PayloadTooLarge = 413,
    /** 服务器错误 */
    InternalServerError = 500,
    /** 访问令牌已过期 */
    AccessTokenExpired = 419,
    /** 刷新令牌已过期 */
    RefreshTokenExpired = 420
}
/**
 * 创建响应
 * @param res 响应
 * @param code 状态码
 * @param data 数据
 * @param message 消息
 * @returns 响应
 * @template T 数据类型
 * @example createResponse(res, HTTPStatusCode.OK, { message: '成功' })
 * @example createResponse(res, HTTPStatusCode.BadRequest, { message: '参数错误' })
 * @example createResponse(res, HTTPStatusCode.InternalServerError, { message: '服务器错误' })
 */
declare const createResponse: <T>(res: Response, code: HTTPStatusCode, data?: T, message?: string) => void;
/**
 * 创建成功响应
 * @param res 响应
 * @param data 数据
 * @param message 消息
 * @returns 响应
 * @template T 数据类型
 * @example createSuccessResponse(res, null, '成功')
 * @example createSuccessResponse(res, data)
 */
declare const createSuccessResponse: <T>(res: Response, data?: T, message?: string) => void;
/**
 * 创建未鉴权响应
 * @param res 响应
 * @param message 消息
 * @returns 响应
 * @example createUnauthorizedResponse(res)
 * @example createUnauthorizedResponse(res, '未授权')
 * @example createUnauthorizedResponse(res, '登录已过期')
 * @example createUnauthorizedResponse(res, '登录信息已失效')
 */
declare const createUnauthorizedResponse: (res: Response, message?: string) => void;
/**
 * 创建访问令牌已过期响应
 * @param res 响应
 * @param message 消息
 * @returns 响应
 * @example createAccessTokenExpiredResponse(res)
 * @example createAccessTokenExpiredResponse(res, '访问令牌已过期')
 */
declare const createAccessTokenExpiredResponse: (res: Response, message?: string) => void;
/**
 * 创建刷新令牌已过期响应
 * @param res 响应
 * @param message 消息
 * @returns 响应
 * @example createRefreshTokenExpiredResponse(res)
 * @example createRefreshTokenExpiredResponse(res, '刷新令牌已过期')
 */
declare const createRefreshTokenExpiredResponse: (res: Response, message?: string) => void;
/**
 * 创建未找到响应
 * @param res 响应
 * @param message 消息
 * @returns 响应
 * @example createNotFoundResponse(res)
 * @example createNotFoundResponse(res, '未找到')
 * @example createNotFoundResponse(res, '数据不存在')
 * @example createNotFoundResponse(res, '资源不存在')
 */
declare const createNotFoundResponse: (res: Response, message?: string) => void;
/**
 * 创建服务器错误响应
 * @param res 响应
 * @param message 消息
 * @returns 响应
 * @example createServerErrorResponse(res)
 * @example createServerErrorResponse(res, '服务器错误')
 * @example createServerErrorResponse(res, '系统错误')
 * @example createServerErrorResponse(res, '未知错误')
 */
declare const createServerErrorResponse: (res: Response, message?: string) => void;
/**
 * 创建参数错误响应
 * @param res 响应
 * @param message 消息
 * @returns 响应
 * @example createBadRequestResponse(res)
 * @example createBadRequestResponse(res, '参数错误')
 * @example createBadRequestResponse(res, '请求参数错误')
 * @example createBadRequestResponse(res, '参数不正确')
 */
declare const createBadRequestResponse: (res: Response, message?: string) => void;
/**
 * 创建请求过大响应
 * @param res 响应
 * @param message 消息
 * @returns 响应
 * @example createPayloadTooLargeResponse(res)
 * @example createPayloadTooLargeResponse(res, '请求体过大')
 */
declare const createPayloadTooLargeResponse: (res: Response, message?: string) => void;
/**
 * 创建方法不允许响应
 * @param res 响应
 * @param message 消息
 * @returns 响应
 * @example createMethodNotAllowedResponse(res)
 */
declare const createMethodNotAllowedResponse: (res: Response, message?: string) => void;
/**
 * 创建禁止访问响应
 * @param res 响应
 * @param message 消息
 * @returns 响应
 * @example createForbiddenResponse(res)
 * @example createForbiddenResponse(res, '禁止访问')
 * @example createForbiddenResponse(res, '无权限访问')
 * @example createForbiddenResponse(res, '权限不足')
 */
declare const createForbiddenResponse: (res: Response, message?: string) => void;

/**
 * MIME 类型映射
 * @param filePath 文件路径
 * @returns MIME 类型
 */
declare const getMimeType: (filePath: string) => string;

/**
 * 鉴权中间件
 * @param req 请求
 * @param res 响应
 * @param next 下一个中间件
 */
declare const authMiddleware: RequestHandler;

/**
 * @public
 * @description express 服务
 */
declare const app: Express;
/**
 * @public
 * @description http 服务
 */
declare const server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;

/**
 * ws请求回调
 */
interface Echo {
    /** 状态 */
    status: 'failed' | 'ok';
    /**
     * 状态码
     * - http:
     *   - 如果 access token 未提供，状态码为 401（关于 access token，见 鉴权）
     *   - 如果 access token 不符合，状态码为 403
     *   - 如果 POST 请求的 Content-Type 不支持，状态码为 406
     *   - 如果 POST 请求的正文格式不正确，状态码为 400
     *   - 如果 API 不存在，状态码为 404
     *   - 剩下的所有情况，无论操作实际成功与否，状态码都是 200
     * - ws:
     *   - HTTP 状态码反应的错误情况被移动到响应 JSON 的 retcode 字段
     *   - 例如，HTTP 返回 404 的情况，在响应 JSON 的 retcode 字段返回 1404
     *   - 实际上 1401 和 1403 并不会真的返回，因为如果建立连接时鉴权失败，连接会直接断开，根本不可能进行到后面的 API 调用阶段
     */
    retcode: number;
    /** 数据 */
    data: unknown;
    /** 请求ID */
    echo: string;
    /** GoCQ拓展: 错误消息, 仅在 API 调用失败时有该字段 */
    msg?: string;
    /** GoCQ拓展: 对错误的详细解释(中文), 仅在 API 调用失败时有该字段 */
    wording?: string;
}

/**
 * 上报事件类型枚举
 */
declare enum EventPostType {
    /** 消息 */
    Message = "message",
    /** 请求 */
    Request = "request",
    /** 通知 */
    Notice = "notice",
    /** 元事件 */
    MetaEvent = "meta_event",
    /** GoCQ拓展: Bot自身上报 */
    MessageSent = "message_sent"
}
/**
 * 所有事件都继承自这个类型
 */
interface EventBase {
    /** 事件发生的unix时间戳 */
    time: number;
    /** 收到事件的机器人 QQ 号 */
    self_id: number;
    /** 表示该上报的类型, 消息, 消息发送, 请求, 通知, 或元事件 */
    post_type: EventPostType;
}

/**
 * OneBot消息段类型
 * - text: 纯文本
 * - face: QQ表情
 * - image: 图片
 * - record: 语音
 * - video: 视频
 * - at: `@某人`
 * - rps: 猜拳魔法表情
 * - dice: 掷骰子魔法表情
 * - shake: 窗口抖动（戳一戳）
 * - poke: 戳一戳
 * - anonymous: 匿名发消息
 * - share: 链接分享
 * - contact: 推荐好友/群
 * - location: 位置
 * - music: 音乐分享
 * - reply: 回复
 * - forward: 合并转发`(适用于forward_id)`
 * - node: 合并转发
 * - xml: XML消息段
 * - json: JSON消息段
 * - file: 文件消息段
 *
 * GoCQ拓展:
 * - redbag: 红包`(收)`
 * - gift: 礼物`(发 仅群聊)`
 *
 * 社区拓展:
 * - markdown: markdown消息段
 */
declare enum OneBotMessageType {
    /** 纯文本 */
    Text = "text",
    /** QQ表情 */
    Face = "face",
    /** 图片 */
    Image = "image",
    /** 语音 */
    Record = "record",
    /** 视频 */
    Video = "video",
    /** @某人 */
    At = "at",
    /** 猜拳魔法表情 */
    Rps = "rps",
    /** 掷骰子魔法表情 */
    Dice = "dice",
    /** 窗口抖动（戳一戳） */
    Shake = "shake",
    /** 戳一戳 */
    Poke = "poke",
    /** 匿名发消息 */
    Anonymous = "anonymous",
    /** 链接分享 */
    Share = "share",
    /** 推荐好友/群 */
    Contact = "contact",
    /** 位置 */
    Location = "location",
    /** 音乐分享 */
    Music = "music",
    /** 回复 */
    Reply = "reply",
    /** 合并转发 */
    Forward = "forward",
    /** 合并转发节点 */
    Node = "node",
    /** XML消息段 */
    Xml = "xml",
    /** JSON消息段 */
    Json = "json",
    /** 文件消息段 */
    File = "file",
    /** GoCQ拓展: 红包`(收)` */
    Redbag = "redbag",
    /**
     * GoCQ拓展: 礼物`(发)`
     * - 范围: 仅群聊
     * - 参考: {@link https://docs.go-cqhttp.org/cqcode/#礼物}
     */
    Gift = "gift",
    /** 社区拓展: markdown消息段 */
    Markdown = "markdown"
}
interface MessageBase {
    type: OneBotMessageType;
}
/** 纯文本 */
interface TextMessage extends MessageBase {
    type: OneBotMessageType.Text;
    data: {
        text: string;
    };
}
/** QQ表情 */
interface FaceMessage extends MessageBase {
    type: OneBotMessageType.Face;
    data: {
        id: string;
    };
}
/** 图片消息段 */
interface ImageMessage extends MessageBase {
    type: OneBotMessageType.Image;
    data: {
        file: string;
        /** 图片类型 `flash` 表示闪照, `show` 表示秀图 默认普通图片 */
        type?: 'flash' | 'show';
        url?: string;
        cache?: 0 | 1;
        proxy?: 0 | 1;
        timeout?: number;
        /** 拓展: 图片摘要 */
        summary?: string;
        /** 拓展: 图片宽度 */
        width?: number;
        /** 拓展: 图片高度 */
        height?: number;
        /** 拓展: 图片ID */
        fid?: string;
        /** 拓展: md5 */
        md5?: string;
        /** 拓展: 图片大小 */
        size?: number;
    };
}
/** 语音消息段 */
interface RecordMessage extends MessageBase {
    type: OneBotMessageType.Record;
    data: {
        file: string;
        magic?: 0 | 1;
        url?: string;
        cache?: 0 | 1;
        proxy?: 0 | 1;
        timeout?: number;
    };
}
/** 短视频消息段 */
interface VideoMessage extends MessageBase {
    type: OneBotMessageType.Video;
    data: {
        file: string;
        url?: string;
        cache?: 0 | 1;
        proxy?: 0 | 1;
        timeout?: number;
    };
}
/** @某人消息段 */
interface AtMessage extends MessageBase {
    type: OneBotMessageType.At;
    data: {
        qq: string | 'all';
        name?: string;
    };
}
/** 猜拳魔法表情消息段 */
interface RpsMessage extends MessageBase {
    type: OneBotMessageType.Rps;
    data: {};
}
/** 掷骰子魔法表情消息段 */
interface DiceMessage extends MessageBase {
    type: OneBotMessageType.Dice;
    data: {};
}
/** 窗口抖动（戳一戳）消息段 */
interface ShakeMessage extends MessageBase {
    type: OneBotMessageType.Shake;
    data: {};
}
/** 戳一戳消息段 */
interface PokeMessage extends MessageBase {
    type: OneBotMessageType.Poke;
    data: {
        type: string;
        id: string;
        name?: string;
    };
}
/** 匿名发消息消息段 */
interface AnonymousMessage extends MessageBase {
    type: OneBotMessageType.Anonymous;
    data: {
        ignore?: 0 | 1;
    };
}
/** 链接分享消息段 */
interface ShareMessage extends MessageBase {
    type: OneBotMessageType.Share;
    data: {
        url: string;
        title: string;
        content?: string;
        image?: string;
    };
}
/** 推荐好友/群消息段 */
interface ContactMessage extends MessageBase {
    type: OneBotMessageType.Contact;
    data: {
        type: 'qq' | 'group';
        id: string;
    };
}
/** 位置消息段 */
interface LocationMessage extends MessageBase {
    type: OneBotMessageType.Location;
    data: {
        lat: string;
        lon: string;
        title?: string;
        content?: string;
    };
}
/** 音乐分享消息段 */
interface MusicMessage extends MessageBase {
    type: OneBotMessageType.Music;
    data: {
        type: 'qq' | '163' | 'xm';
        id: string;
    } | {
        type: 'custom';
        url: string;
        audio: string;
        title: string;
        content?: string;
        image?: string;
    };
}
/** 回复消息段 */
interface ReplyMessage extends MessageBase {
    type: OneBotMessageType.Reply;
    data: {
        id: string;
    };
}
/** 合并转发消息段 */
interface ForwardMessage extends MessageBase {
    type: OneBotMessageType.Forward;
    data: {
        id: string;
    };
}
/** XML消息段 */
interface XmlMessage extends MessageBase {
    type: OneBotMessageType.Xml;
    data: {
        data: string;
    };
}
/** JSON消息段 */
interface JsonMessage extends MessageBase {
    type: OneBotMessageType.Json;
    data: {
        data: string;
    };
}
/** 合并转发节点: `发` */
interface NodeIDMessage extends MessageBase {
    type: OneBotMessageType.Node;
    data: {
        id: string;
    };
}
/** 合并转发自定义节点 */
interface NodeCustomMessage extends MessageBase {
    type: OneBotMessageType.Node;
    data: {
        user_id: string;
        nickname: string;
        content: OneBotMessage[];
        /** napcat拓展: 小卡片中间的外显 */
        news?: Array<{
            text: string;
        }>;
        /** napcat拓展: 消息列表的外显 */
        prompt?: string;
        /** napcat拓展: 小卡片底下文本: 查看1条转发消息 */
        summary?: string;
        /** napcat拓展: 小卡片标题 */
        source?: string;
    };
}
/** 合并转发消息段 */
type NodeMessage = NodeIDMessage | NodeCustomMessage;
/** 文件消息段 `收` */
interface FileMessage<T = any> extends MessageBase {
    type: OneBotMessageType.File;
    data: T;
}
/** OneBot11消息段 */
type OneBotMessage = TextMessage | FaceMessage | ImageMessage | RecordMessage | VideoMessage | AtMessage | RpsMessage | DiceMessage | ShakeMessage | PokeMessage | AnonymousMessage | ShareMessage | ContactMessage | LocationMessage | MusicMessage | ReplyMessage | ForwardMessage | XmlMessage | JsonMessage | FileMessage | NodeMessage;

/**
 * 群聊角色枚举
 */
declare enum GroupRole {
    /** 群主 */
    Owner = "owner",
    /** 管理员 */
    Admin = "admin",
    /** 成员 */
    Member = "member"
}
/** 性别枚举 */
declare enum Sex {
    /** 男 */
    Male = "male",
    /** 女 */
    Female = "female",
    /** 未知 */
    Unknown = "unknown"
}
/**
 * 发送者 私聊
 */
interface SenderPrivate {
    /** 发送者 QQ 号 */
    user_id: number;
    /** 昵称 不存在则为空字符串 */
    nickname: string;
    /** 性别 */
    sex: Sex;
    /** 年龄 */
    age: number;
}
/**
 * 发送者 群聊
 */
interface SenderGroup extends SenderPrivate {
    /** 群名片/备注 */
    card: string;
    /** 地区 */
    area: string;
    /** 成员等级 */
    level: string;
    /** 角色 */
    role: GroupRole;
    /** 专属头衔 */
    title: string;
}

/**
 * 消息类型枚举
 */
declare enum MessageType {
    /** 私聊消息 */
    Private = "private",
    /** 群消息 */
    Group = "group"
}
/**
 * 私聊消息子类型枚举
 */
declare enum MessageSubType {
    /** 好友消息 */
    Friend = "friend",
    /** 群临时会话 */
    Group = "group",
    /** 其他 */
    Other = "other",
    /** 普通消息 (非标准,兼容某些实现) */
    Normal = "normal"
}
/**
 * 私聊消息事件类型
 */
interface MessagePrivateEvent extends EventBase {
    /** 消息事件 */
    post_type: EventPostType.Message;
    /** 消息类型 */
    message_type: MessageType.Private;
    /** 消息子类型 */
    sub_type: MessageSubType.Friend | MessageSubType.Other | MessageSubType.Normal;
    /** 消息 ID */
    message_id: number;
    /** 发送者 QQ 号 */
    user_id: number;
    /** 消息内容 */
    message: OneBotMessage[];
    /** 原始消息内容 */
    raw_message: string;
    /** 字体 */
    font: number;
    /** 发送人信息 */
    sender: SenderPrivate;
}
/**
 * 群消息事件类型
 */
interface MessageGroupEvent extends EventBase {
    /** 消息事件 */
    post_type: EventPostType.Message;
    /** 消息类型 */
    message_type: MessageType.Group;
    /** 消息子类型 匿名没有了`(直接写死)` */
    sub_type: 'normal';
    /** 消息 ID */
    message_id: number;
    /** 群号 */
    group_id: number;
    /** 发送者 QQ 号 */
    user_id: number;
    /** @deprecated 匿名信息 */
    anonymous: Record<string, never>;
    /** 消息内容 */
    message: OneBotMessage[];
    /** 原始消息内容 */
    raw_message: string;
    /** 字体 */
    font: number;
    /** 发送人信息 */
    sender: SenderGroup;
}
/**
 * 群临时会话事件类型
 */
interface MessageTempEvent extends Omit<MessagePrivateEvent, 'sub_type'> {
    sub_type: MessageSubType.Group;
    /** 发送人信息 */
    sender: SenderPrivate & {
        /** 群号 */
        group_id: number;
    };
}
/** OneBot 消息事件类型 */
type OneBotMessageEvent = MessagePrivateEvent | MessageGroupEvent | MessageTempEvent;

/**
 * 私聊消息发送事件类型
 */
interface MessageSentPrivateEvent extends Omit<MessagePrivateEvent, 'post_type'> {
    /** 消息发送事件 */
    post_type: EventPostType.MessageSent;
}
/**
 * 群消息发送事件类型
 */
interface MessageSentGroupEvent extends Omit<MessageGroupEvent, 'post_type'> {
    /** 消息发送事件 */
    post_type: EventPostType.MessageSent;
}
/** OneBot 消息发送事件类型 */
type OneBotMessageSentEvent = MessageSentPrivateEvent | MessageSentGroupEvent;

/**
 * 元事件类型枚举
 */
declare enum MetaEventType {
    /** 生命周期 */
    Lifecycle = "lifecycle",
    /** 心跳 */
    Heartbeat = "heartbeat"
}
/**
 * 生命周期子类型枚举
 */
declare enum LifecycleSubType {
    /** OneBot 启用 */
    Enable = "enable",
    /** OneBot 停用 */
    Disable = "disable",
    /** WebSocket 连接成功 */
    Connect = "connect"
}
/**
 * 元事件基础接口
 */
interface MetaEvent extends EventBase {
    /** 元事件 */
    post_type: EventPostType.MetaEvent;
}
/**
 * 生命周期元事件
 */
interface LifecycleMetaEvent extends MetaEvent {
    /** 元事件类型 */
    meta_event_type: MetaEventType.Lifecycle;
    /** 事件子类型 */
    sub_type: LifecycleSubType;
}
/**
 * 心跳元事件
 */
interface HeartbeatMetaEvent extends MetaEvent {
    /** 元事件类型 */
    meta_event_type: MetaEventType.Heartbeat;
    /** 状态信息 */
    status: Record<string, unknown>;
    /** 到下次心跳的间隔，单位毫秒 */
    interval: number;
}
/** OneBot 元事件类型 */
type OneBotMetaEvent = LifecycleMetaEvent | HeartbeatMetaEvent;

/**
 * 通知类型枚举
 */
declare enum NoticeType {
    /** 群文件上传 */
    GroupUpload = "group_upload",
    /** 群管理员变动 */
    GroupAdmin = "group_admin",
    /** 群成员减少 */
    GroupDecrease = "group_decrease",
    /** 群成员增加 */
    GroupIncrease = "group_increase",
    /** 群禁言 */
    GroupBan = "group_ban",
    /** 好友添加 */
    FriendAdd = "friend_add",
    /** 群消息撤回 */
    GroupRecall = "group_recall",
    /** 好友消息撤回 */
    FriendRecall = "friend_recall",
    /** 通知 */
    Notify = "notify",
    /** napcat表情回应 */
    Nc_EmojiLike = "group_msg_emoji_like",
    /** Lagrange表情回应 */
    Lgl_EmojiLike = "reaction",
    /** 精华消息变动 */
    GroupEssence = "essence",
    /** 群成员名片更新 */
    GroupCard = "group_card",
    /** 好友离线文件 Lagrange.OneBot */
    Lgl_FriendOfflineFile = "offline_file",
    /** Bot下线 */
    BotOffline = "bot_offline"
}
/**
 * 群管理员变动子类型枚举
 */
declare enum GroupAdminSubType {
    /** 设置管理员 */
    Set = "set",
    /** 取消管理员 */
    Unset = "unset"
}
/**
 * 群成员减少子类型枚举
 */
declare enum GroupDecreaseSubType {
    /** 主动退群 */
    Leave = "leave",
    /** 成员被踢 */
    Kick = "kick",
    /** 登录号被踢 */
    KickMe = "kick_me"
}
/**
 * 群成员增加子类型枚举
 */
declare enum GroupIncreaseSubType {
    /** 管理员已同意入群 */
    Approve = "approve",
    /** 管理员邀请入群 */
    Invite = "invite"
}
/**
 * 群禁言子类型枚举
 */
declare enum GroupBanSubType {
    /** 禁言 */
    Ban = "ban",
    /** 解除禁言 */
    LiftBan = "lift_ban"
}
/**
 * 通知子类型枚举
 */
declare enum NotifySubType {
    /** 戳一戳 */
    Poke = "poke",
    /** 红包运气王 */
    LuckyKing = "lucky_king",
    /** 群成员荣誉变更 */
    Honor = "honor"
}
/**
 * 群成员荣誉类型枚举
 */
declare enum HonorType {
    /** 龙王 */
    Talkative = "talkative",
    /** 群聊之火 */
    Performer = "performer",
    /** 快乐源泉 */
    Emotion = "emotion"
}
/**
 * 文件信息接口
 */
interface FileInfo {
    /** 文件 ID */
    id: string;
    /** 文件名 */
    name: string;
    /** 文件大小（字节数） */
    size: number;
    /** busid */
    busid: number;
}
/**
 * 群文件上传通知事件
 */
interface GroupUploadNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.GroupUpload;
    /** 群号 */
    group_id: number;
    /** 发送者 QQ 号 */
    user_id: number;
    /** 文件信息 */
    file: FileInfo;
}
/**
 * 群管理员变动通知事件
 */
interface GroupAdminNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.GroupAdmin;
    /** 事件子类型 */
    sub_type: GroupAdminSubType;
    /** 群号 */
    group_id: number;
    /** 管理员 QQ 号 */
    user_id: number;
}
/**
 * 群成员减少通知事件
 */
interface GroupDecreaseNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.GroupDecrease;
    /** 事件子类型 */
    sub_type: GroupDecreaseSubType;
    /** 群号 */
    group_id: number;
    /** 操作者 QQ 号 */
    operator_id: number;
    /** 离开者 QQ 号 */
    user_id: number;
}
/**
 * 群成员增加通知事件
 */
interface GroupIncreaseNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.GroupIncrease;
    /** 事件子类型 */
    sub_type: GroupIncreaseSubType;
    /** 群号 */
    group_id: number;
    /** 操作者 QQ 号 */
    operator_id: number;
    /** 加入者 QQ 号 */
    user_id: number;
}
/**
 * 群禁言通知事件
 */
interface GroupBanNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.GroupBan;
    /** 事件子类型 */
    sub_type: GroupBanSubType;
    /** 群号 */
    group_id: number;
    /** 操作者 QQ 号 */
    operator_id: number;
    /** 被禁言 QQ 号 */
    user_id: number;
    /** 禁言时长，单位秒 */
    duration: number;
}
/**
 * 好友添加通知事件
 */
interface FriendAddNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.FriendAdd;
    /** 新添加好友 QQ 号 */
    user_id: number;
}
/**
 * 群消息撤回通知事件
 */
interface GroupRecallNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.GroupRecall;
    /** 群号 */
    group_id: number;
    /** 消息发送者 QQ 号 */
    user_id: number;
    /** 操作者 QQ 号 */
    operator_id: number;
    /** 被撤回的消息 ID */
    message_id: number;
}
/**
 * 好友消息撤回通知事件
 */
interface FriendRecallNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.FriendRecall;
    /** 好友 QQ 号 */
    user_id: number;
    /** 被撤回的消息 ID */
    message_id: number;
}
/**
 * 群内戳一戳通知事件
 */
interface PokeNotifyEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.Notify;
    /** 提示类型 */
    sub_type: NotifySubType.Poke;
    /** 群号 */
    group_id: number;
    /** 发送者 QQ 号 */
    user_id: number;
    /** 被戳者 QQ 号 */
    target_id: number;
}
/**
 * 群红包运气王通知事件
 */
interface LuckyKingNotifyEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.Notify;
    /** 提示类型 */
    sub_type: NotifySubType.LuckyKing;
    /** 群号 */
    group_id: number;
    /** 红包发送者 QQ 号 */
    user_id: number;
    /** 运气王 QQ 号 */
    target_id: number;
}
/**
 * 群成员荣誉变更通知事件
 */
interface HonorNotifyEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.Notify;
    /** 提示类型 */
    sub_type: NotifySubType.Honor;
    /** 群号 */
    group_id: number;
    /** 荣誉类型 */
    honor_type: HonorType;
    /** 成员 QQ 号 */
    user_id: number;
}
/**
 * Napcat 群消息表情回应通知事件
 */
interface NcGroupEmojiLikeNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.Nc_EmojiLike;
    /** 群号 */
    group_id: number;
    /** 发送者 QQ 号 */
    user_id: number;
    /** 消息 ID */
    message_id: number;
    /** 表情信息 */
    likes: Array<{
        count: number;
        /** 表情ID参考: https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#EmojiType */
        emoji_id: number;
    }>;
}
/**
 * Lagrange 表情回应通知事件
 */
interface LglEmojiLikeNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.Lgl_EmojiLike;
    /** 提示类型 */
    sub_type: 'remove' | 'add';
    /** 群号 */
    group_id: number;
    /** 发送者 QQ 号 */
    operator_id: number;
    /** 消息 ID */
    message_id: number;
    /** 表情ID */
    code: string;
    /** 表情数量 */
    count: number;
}
/**
 * 精华消息变动通知事件
 */
interface GroupEssenceNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.GroupEssence;
    /** 操作类型 */
    sub_type: 'add' | 'delete';
    /** 群号 */
    group_id: number;
    /** 精华消息 ID */
    message_id: number;
    /** 消息发送者 */
    sender_id: number;
    /** 操作者id */
    operator_id: number;
}
/**
 * 群成员名片更新通知事件
 */
interface GroupCardNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.GroupCard;
    /** 通知类型 */
    time: number;
    /** 事件类型 */
    self_id: number;
    /** 群号 */
    group_id: number;
    /** 用户ID */
    user_id: number;
    /** 新名片 */
    card_new: string;
    /** 旧名片 */
    card_old: string;
}
/**
 * Lagrange 好友离线文件通知事件
 */
interface LglFriendOfflineFileNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.Lgl_FriendOfflineFile;
    /** 好友 QQ 号 */
    user_id: number;
    /** 文件信息 */
    file: {
        /** 文件 ID */
        id: string;
        /** 文件名 */
        name: string;
        /** 文件大小 */
        size: number;
        /** 文件 hash */
        hash: string;
        /** 文件 URL */
        url: string;
    };
}
/**
 * Bot下线通知事件
 */
interface BotOfflineNoticeEvent extends EventBase {
    /** 通知事件 */
    post_type: EventPostType.Notice;
    /** 通知类型 */
    notice_type: NoticeType.BotOffline;
    /** 下线标签（原因） */
    tag: string;
    /** 下线消息 */
    message: string;
}
/** OneBot 通知事件类型 */
type OneBotNoticeEvent = GroupUploadNoticeEvent | GroupAdminNoticeEvent | GroupDecreaseNoticeEvent | GroupIncreaseNoticeEvent | GroupBanNoticeEvent | FriendAddNoticeEvent | GroupRecallNoticeEvent | FriendRecallNoticeEvent | PokeNotifyEvent | LuckyKingNotifyEvent | HonorNotifyEvent | NcGroupEmojiLikeNoticeEvent | LglEmojiLikeNoticeEvent | GroupEssenceNoticeEvent | GroupCardNoticeEvent | LglFriendOfflineFileNoticeEvent | BotOfflineNoticeEvent;

/**
 * 请求类型枚举
 */
declare enum RequestType {
    /** 好友请求 */
    Friend = "friend",
    /** 群请求 */
    Group = "group"
}
/**
 * 群请求子类型枚举
 */
declare enum GroupRequestSubType {
    /** 加群请求 */
    Add = "add",
    /** 邀请入群 */
    Invite = "invite"
}
/**
 * 加好友请求事件类型
 */
interface FriendRequestEvent extends EventBase {
    /** 请求事件 */
    post_type: EventPostType.Request;
    /** 请求类型 */
    request_type: RequestType.Friend;
    /** 发送请求的用户 QQ 号 */
    user_id: number;
    /** 验证信息 */
    comment: string;
    /** 请求 flag，在调用处理请求的 API 时需要传入 */
    flag: string;
}
/**
 * 加群请求/邀请事件类型
 */
interface GroupRequestEvent extends EventBase {
    /** 请求事件 */
    post_type: EventPostType.Request;
    /** 请求类型 */
    request_type: RequestType.Group;
    /** 请求子类型，分别表示加群请求、邀请登录号入群 */
    sub_type: GroupRequestSubType;
    /** 群号 */
    group_id: number;
    /** 发送请求的用户 QQ 号 */
    user_id: number;
    /** 验证信息 */
    comment: string;
    /** 请求 flag，在调用处理请求的 API 时需要传入 */
    flag: string;
}
/** OneBot 请求事件类型 */
type OneBotRequestEvent = FriendRequestEvent | GroupRequestEvent;

/** OneBot 上报事件类型 */
type OneBotEvent = OneBotMessageEvent | OneBotMessageSentEvent | OneBotMetaEvent | OneBotNoticeEvent | OneBotRequestEvent;
/** OneBot WebSocket 上报事件类型 */
type OneBotWsEvent = OneBotEvent | Echo;

/** OneBot 错误类型 */
declare enum OneBotErrorType {
    /** 常规错误 */
    ERROR = 1001,
    /** ws、http客户端独有: 初始化失败，正在尝试重连`(http是心跳)` */
    CONNECTION_FAILED = 2002,
    /** ws客户端独有: 初始化失败，重连关闭 */
    RECONNECTING = 2003,
    /** ws、http客户端独有: 初始化失败，重连达到上限`(http是心跳)` */
    RECONNECT_FAILED = 2004,
    /** ws服务端独有: 鉴权失败 */
    AUTH_FAILED = 3001,
    /** ws服务端独有: Authorization头格式错误 */
    AUTH_INVALID_FORMAT = 3002
}
/** OneBot 关闭类型 */
declare enum OneBotCloseType {
    /** 常规关闭 */
    ERROR = 1001,
    /** 主动关闭 */
    MANUAL_CLOSE = 1002,
    /** ws客户端独有:重连上限 */
    MAX_RETRIES = 2001,
    /** ws客户端独有: 服务端关闭 */
    SERVER_CLOSE = 2002,
    /** ws客户端独有: 连接已经建立后异常关闭 */
    CONNECTION_FAILED = 2003,
    /** http客户端独有: 首次心跳失败 */
    HEARTBEAT_FAILED = 3001,
    /** http客户端独有: 心跳失败次数超过最大重试次数 */
    HEARTBEAT_FAILED_MAX_RETRIES = 3002
}
/** OneBot 事件类型 */
declare enum OneBotEventKey {
    /** 连接成功 */
    OPEN = "open",
    /** 错误 */
    ERROR = "error",
    /** 关闭 */
    CLOSE = "close",
    /** 收到API请求 */
    SEND_API = "sendApi",
    /** 收到API响应 */
    RESPONSE = "response",
    /** 收到事件上报 */
    EVENT = "event",
    /** 收到消息事件上报 */
    MESSAGE = "message",
    /** 收到通知事件上报 */
    NOTICE = "notice",
    /** 收到请求事件上报 */
    REQUEST = "request",
    /** 收到元事件上报 */
    META_EVENT = "meta_event",
    /** 收到Bot自身消息上报 */
    MESSAGE_SENT = "message_sent"
}
/** OneBot 事件类型 */
interface OneBotOnEvent {
    /** 连接成功 */
    [OneBotEventKey.OPEN]: void;
    /** 错误 */
    [OneBotEventKey.ERROR]: {
        /** 错误 */
        error: Error;
        /** 错误类型 */
        type: Exclude<OneBotErrorType, OneBotErrorType.CONNECTION_FAILED | OneBotErrorType.RECONNECT_FAILED>;
    } | {
        /** 错误 */
        error: Error;
        /** 错误类型 */
        type: OneBotErrorType.CONNECTION_FAILED;
        /** 重连次数 */
        reconnectAttempt: number;
        /** 重试间隔 */
        reconnectInterval: number;
        /** 最大重试次数 */
        maxReconnectAttempt: number;
    } | {
        /** 错误 */
        error: Error;
        /** 错误类型 */
        type: OneBotErrorType.RECONNECT_FAILED;
        /** 总重连次数 */
        totalReconnectAttempt: number;
        /** 最大重试次数 */
        maxReconnectAttempt: number;
    };
    /** 关闭 */
    [OneBotEventKey.CLOSE]: OneBotCloseType;
    /** 收到API请求 */
    [OneBotEventKey.SEND_API]: {
        /** 请求ID */
        echo: string;
        /** API动作 */
        action: string;
        /** API参数 */
        params: object;
        /** JSON序列化之后的参数 */
        request: string;
    };
    /** 收到API响应 */
    [OneBotEventKey.RESPONSE]: {
        /** 请求ID */
        echo: string;
        /** API动作 */
        action: string;
        /** API参数 */
        params: object;
        /** JSON序列化之后的参数 */
        request: string;
        /** 响应 */
        data: object;
    };
    /** 收到事件上报 */
    [OneBotEventKey.EVENT]: OneBotWsEvent;
    /** 收到消息事件上报 */
    [OneBotEventKey.MESSAGE]: OneBotMessageEvent;
    /** 收到Bot自身消息上报 */
    [OneBotEventKey.MESSAGE_SENT]: OneBotMessageSentEvent;
    /** 收到通知事件上报 */
    [OneBotEventKey.NOTICE]: OneBotNoticeEvent;
    /** 收到请求事件上报 */
    [OneBotEventKey.REQUEST]: OneBotRequestEvent;
    /** 收到元事件上报 */
    [OneBotEventKey.META_EVENT]: OneBotMetaEvent;
    [key: `echo:${bigint}`]: Echo;
    [key: `echo:${string}`]: Echo;
}

declare enum OneBotMessageApiAction {
    sendMsg = "send_msg",
    sendPrivateMsg = "send_private_msg",
    sendGroupMsg = "send_group_msg",
    deleteMsg = "delete_msg",
    getMsg = "get_msg",
    getForwardMsg = "get_forward_msg",
    setMessageReaction = "set_message_reaction",
    nc_fetchEmojiLike = "fetch_emoji_like",
    lgl_joinGroupEmojiChain = ".join_group_emoji_chain",
    lgl_joinFriendEmojiReaction = ".join_friend_emoji_reaction",
    lgl_sendGroupBotCallback = "send_group_bot_callback",
    nc_markPrivateMsgAsRead = "mark_private_msg_as_read",
    nc_markGroupMsgAsRead = "mark_group_msg_as_read",
    nc_markAllAsRead = "_mark_all_as_read",
    nc_forwardFriendSingleMsg = "forward_friend_single_msg",
    nc_forwardGroupSingleMsg = "forward_group_single_msg",
    sendForwardMsg = "send_forward_msg",
    sendGroupForwardMsg = "send_group_forward_msg",
    sendPrivateForwardMsg = "send_private_forward_msg",
    getGroupMsgHistory = "get_group_msg_history",
    nc_getFriendMsgHistory = "nc_get_friend_msg_history",
    lgl_getFriendMsgHistory = "lgl_get_friend_msg_history",
    lgl_getGroupMsgHistory = "lgl_get_group_msg_history",
    nc_getGroupMsgHistory = "nc_get_group_msg_history",
    getAiCharacters = "get_ai_characters",
    sendGroupAiRecord = "send_group_ai_record",
    lgl_markMsgAsRead = "mark_msg_as_read",
    lgl_setGroupReaction = "set_group_reaction",
    nc_setMsgEmojiLike = "set_msg_emoji_like"
}
/**
 * 消息相关 API
 */
interface OneBotMessageApi {
    /** 发送消息`(综合接口)` */
    [OneBotMessageApiAction.sendMsg]: {
        action: 'send_msg';
        params: {
            message_type: 'private' | 'group';
            user_id: number;
            message: OneBotMessage[];
            auto_escape?: boolean;
        };
        response: {
            message_id: number;
        };
    };
    /** 发送私聊消息 */
    [OneBotMessageApiAction.sendPrivateMsg]: {
        action: 'send_private_msg';
        params: {
            user_id: number;
            message: OneBotMessage[];
            auto_escape?: boolean;
        };
        response: {
            message_id: number;
        };
    };
    /** 发送群消息 */
    [OneBotMessageApiAction.sendGroupMsg]: {
        action: 'send_group_msg';
        params: {
            group_id: number;
            message: OneBotMessage[];
            auto_escape?: boolean;
        };
        response: {
            message_id: number;
        };
    };
    /** 撤回消息 */
    [OneBotMessageApiAction.deleteMsg]: {
        action: 'delete_msg';
        params: {
            message_id: number;
        };
        response: null;
    };
    /** 获取消息 */
    [OneBotMessageApiAction.getMsg]: {
        action: 'get_msg';
        params: {
            message_id: number;
        };
        response: {
            time: number;
            message_type: 'group';
            message_id: number;
            real_id: number;
            sender: SenderGroup;
            message: OneBotMessage[];
            group_id: number;
        } | {
            time: number;
            message_type: 'private';
            message_id: number;
            real_id: number;
            sender: SenderPrivate;
            message: OneBotMessage[];
        };
    };
    /** 获取合并转发消息 */
    [OneBotMessageApiAction.getForwardMsg]: {
        action: 'get_forward_msg';
        params: {
            id: string;
        };
        response: {
            message: NodeMessage[];
        };
    };
    /** 设置消息表情回应 */
    [OneBotMessageApiAction.setMessageReaction]: {
        action: 'set_message_reaction';
        params: {
            message_id: number;
            emoji_id: string;
            set: boolean;
        };
        response: {
            result: number;
            errMsg: string;
        };
    };
    /** NapCat扩展: 获取消息的表情已回应列表 */
    [OneBotMessageApiAction.nc_fetchEmojiLike]: {
        action: 'fetch_emoji_like';
        params: {
            message_id: number;
            user_id: number;
            emojiType: number;
            count?: number;
        };
        response: {
            result: number;
            errMsg: string;
            emojiLikesList: Array<{
                tinyId: string;
                nickName: string;
                headUrl: string;
            }>;
            cookie: string;
            isLastPage: boolean;
            isFirstPage: boolean;
        };
    };
    /** Lagrange扩展: 加入群聊表情接龙 */
    [OneBotMessageApiAction.lgl_joinGroupEmojiChain]: {
        action: '.join_group_emoji_chain';
        params: {
            group_id: number;
            message_id: number;
            emoji_id: number;
        };
        response: null;
    };
    /** Lagrange扩展: 加入好友表情接龙 */
    [OneBotMessageApiAction.lgl_joinFriendEmojiReaction]: {
        action: '.join_friend_emoji_reaction';
        params: {
            user_id: number;
            message_id: number;
            emoji_id: number;
        };
        response: null;
    };
    /** Lagrange扩展: 调用群机器人回调 */
    [OneBotMessageApiAction.lgl_sendGroupBotCallback]: {
        action: 'send_group_bot_callback';
        params: {
            group_id: number;
            bot_id: number;
            data_1: string;
            data_2: string;
        };
        response: number;
    };
    /** NapCat扩展: 标记私聊消息为已读 */
    [OneBotMessageApiAction.nc_markPrivateMsgAsRead]: {
        action: 'mark_private_msg_as_read';
        params: {
            user_id?: number;
            message_id?: number;
        };
        response: null;
    };
    /** NapCat扩展: 标记群消息为已读 */
    [OneBotMessageApiAction.nc_markGroupMsgAsRead]: {
        action: 'mark_group_msg_as_read';
        params: {
            group_id?: number;
            message_id?: number;
        };
        response: null;
    };
    /** NapCat扩展: 标记所有消息为已读 */
    [OneBotMessageApiAction.nc_markAllAsRead]: {
        action: '_mark_all_as_read';
        params: Record<string, never>;
        response: null;
    };
    /** NapCat扩展: 转发好友单条消息 */
    [OneBotMessageApiAction.nc_forwardFriendSingleMsg]: {
        action: 'forward_friend_single_msg';
        params: {
            user_id: number;
            message_id: number;
        };
        response: null;
    };
    /** NapCat扩展: 转发群单条消息 */
    [OneBotMessageApiAction.nc_forwardGroupSingleMsg]: {
        action: 'forward_group_single_msg';
        params: {
            group_id: number;
            message_id: number;
        };
        response: null;
    };
    /** GoCQ扩展: 发送合并转发消息 */
    [OneBotMessageApiAction.sendForwardMsg]: {
        action: 'send_forward_msg';
        params: {
            messages: NodeMessage[];
            /** napcat拓展: 小卡片中间的外显 */
            news?: Array<{
                text: string;
            }>;
            /** napcat拓展: 消息列表的外显 */
            prompt?: string;
            /** napcat拓展: 小卡片底下文本: 查看1条转发消息 */
            summary?: string;
            /** napcat拓展: 小卡片标题 */
            source?: string;
        };
        response: {
            message_id: string;
            forward_id: string;
            /** napcat是res_id */
            res_id?: string;
        };
    };
    /** GoCQ扩展: 发送合并转发(群聊) */
    [OneBotMessageApiAction.sendGroupForwardMsg]: {
        action: 'send_group_forward_msg';
        params: {
            group_id: number;
            messages: NodeMessage[];
            /** napcat拓展: 小卡片中间的外显 */
            news?: Array<{
                text: string;
            }>;
            /** napcat拓展: 消息列表的外显 */
            prompt?: string;
            /** napcat拓展: 小卡片底下文本: 查看1条转发消息 */
            summary?: string;
            /** napcat拓展: 小卡片标题 */
            source?: string;
        };
        response: {
            message_id: string;
            forward_id: string;
            /** napcat是res_id */
            res_id?: string;
        };
    };
    /** GoCQ扩展: 发送合并转发(好友) */
    [OneBotMessageApiAction.sendPrivateForwardMsg]: {
        action: 'send_private_forward_msg';
        params: {
            user_id: number;
            messages: NodeMessage[];
            /** napcat拓展: 小卡片中间的外显 */
            news?: Array<{
                text: string;
            }>;
            /** napcat拓展: 消息列表的外显 */
            prompt?: string;
            /** napcat拓展: 小卡片底下文本: 查看1条转发消息 */
            summary?: string;
            /** napcat拓展: 小卡片标题 */
            source?: string;
        };
        response: {
            message_id: string;
            forward_id: string;
            /** napcat是res_id */
            res_id?: string;
        };
    };
    /** GoCQ扩展: 获取群消息历史记录 */
    [OneBotMessageApiAction.getGroupMsgHistory]: {
        action: 'get_group_msg_history';
        params: {
            group_id: number;
            message_seq: number;
            /** 扩展 */
            count?: number;
        };
        response: {
            messages: Array<{
                message_id: number;
                real_id: number;
                sender: SenderGroup;
                time: number;
                message: OneBotMessage[];
                raw_message: string;
            }>;
        };
    };
    /** NapCat扩展: 获取群消息历史记录 */
    [OneBotMessageApiAction.nc_getGroupMsgHistory]: {
        action: 'nc_get_group_msg_history';
        params: {
            group_id: number;
            message_seq: number;
            count?: number;
            /** 是否倒序 可选 默认false */
            reverse?: boolean;
        };
        response: {
            messages: Array<{
                message_id: number;
                real_id: number;
                sender: SenderGroup;
                time: number;
                message: OneBotMessage[];
                raw_message: string;
            }>;
        };
    };
    /** Lagrange扩展: 获取群消息历史记录 */
    [OneBotMessageApiAction.lgl_getGroupMsgHistory]: {
        action: 'get_group_msg_history';
        params: {
            group_id: number;
            message_id: number;
            count?: number;
        };
        response: {
            messages: Array<{
                message_id: number;
                real_id: number;
                sender: SenderGroup;
                time: number;
                message: OneBotMessage[];
                raw_message: string;
            }>;
        };
    };
    /** NapCat扩展: 获取好友消息历史记录 */
    [OneBotMessageApiAction.nc_getFriendMsgHistory]: {
        action: 'nc_get_friend_msg_history';
        params: {
            user_id: number;
            message_seq: number;
            count?: number;
            /** 是否倒序 可选 默认false */
            reverse?: boolean;
        };
        response: {
            messages: Array<{
                message_id: number;
                real_id: number;
                sender: SenderPrivate;
                time: number;
                message: OneBotMessage[];
                raw_message: string;
            }>;
        };
    };
    /** Lagrange扩展: 获取好友消息历史记录 */
    [OneBotMessageApiAction.lgl_getFriendMsgHistory]: {
        action: 'get_friend_msg_history';
        params: {
            user_id: number;
            message_id: number;
            count?: number;
        };
        response: {
            messages: Array<{
                message_id: number;
                real_id: number;
                sender: SenderPrivate;
                time: number;
                message: OneBotMessage[];
                raw_message: string;
            }>;
        };
    };
    /** 社区扩展: 获取 Ai 声色列表 */
    [OneBotMessageApiAction.getAiCharacters]: {
        action: 'get_ai_characters';
        params: Record<string, never>;
        response: Array<{
            character_id: string;
            character_name: string;
            preview_url: string;
        }>;
    };
    /** 社区扩展: 发送群 Ai 语音 */
    [OneBotMessageApiAction.sendGroupAiRecord]: {
        action: 'send_group_ai_record';
        params: {
            group_id: number;
            text: string;
            character_id: string;
        };
        response: {
            message_id: number;
        };
    };
    /** Lagrange扩展: 标记消息为已读 */
    [OneBotMessageApiAction.lgl_markMsgAsRead]: {
        action: 'mark_msg_as_read';
        params: {
            message_id: number;
        };
        response: null;
    };
    /** Lagrange扩展: 给消息添加表情回应 */
    [OneBotMessageApiAction.lgl_setGroupReaction]: {
        action: 'set_group_reaction';
        params: {
            group_id: number;
            message_id: number;
            code: string;
            is_add: boolean;
        };
        response: null;
    };
    /** NapCat扩展: 给消息添加表情回应 */
    [OneBotMessageApiAction.nc_setMsgEmojiLike]: {
        action: 'set_msg_emoji_like';
        params: {
            message_id: number;
            emoji_id: string;
            set: boolean;
        };
        response: {
            result: number;
            errMsg: string;
        };
    };
}

declare enum OneBotFriendApiAction {
    sendLike = "send_like",
    setFriendAddRequest = "set_friend_add_request",
    lgl_setFriendAddRequest = "lgl_set_friend_add_request",
    getStrangerInfo = "get_stranger_info",
    nc_getStrangerInfo = "nc_get_stranger_info",
    getFriendList = "get_friend_list",
    nc_getFriendList = "nc_get_friend_list",
    lgl_getFriendList = "lgl_get_friend_list",
    getUnidirectionalFriendList = "get_unidirectional_friend_list",
    nc_getUnidirectionalFriendList = "nc_get_unidirectional_friend_list",
    deleteFriend = "delete_friend",
    nc_deleteFriend = "nc_delete_friend",
    lgl_deleteFriend = "lgl_delete_friend",
    deleteUnidirectionalFriend = "delete_unidirectional_friend",
    nc_setFriendRemark = "nc_set_friend_remark",
    nc_getFriendsWithCategory = "nc_get_friends_with_category",
    nc_getDoubtFriendsAddRequest = "nc_get_doubt_friends_add_request",
    nc_setDoubtFriendsAddRequest = "nc_set_doubt_friends_add_request",
    nc_friendPoke = "nc_friend_poke",
    lgl_friendPoke = "lgl_friend_poke"
}
/**
 * 好友相关 API
 */
interface OneBotFriendApi {
    /** 发送好友赞 */
    [OneBotFriendApiAction.sendLike]: {
        action: 'send_like';
        params: {
            user_id: number;
            times?: number;
        };
        response: null;
    };
    /** 处理加好友请求 */
    [OneBotFriendApiAction.setFriendAddRequest]: {
        action: 'set_friend_add_request';
        params: {
            flag: string;
            approve: boolean;
            remark?: string;
        };
        response: null;
    };
    /** Lagrange扩展: 处理加好友请求 */
    [OneBotFriendApiAction.lgl_setFriendAddRequest]: {
        action: 'set_friend_add_request';
        params: {
            flag: string;
            approve: boolean;
            reason?: string;
        };
        response: null;
    };
    /** 获取陌生人信息 */
    [OneBotFriendApiAction.getStrangerInfo]: {
        action: 'get_stranger_info';
        params: {
            user_id: number;
            no_cache?: boolean;
        };
        response: {
            user_id: number;
            nickname: string;
            sex: Sex;
            age: number;
            [key: string]: any;
        };
    };
    /** NapCat扩展: 获取陌生人信息 */
    [OneBotFriendApiAction.nc_getStrangerInfo]: {
        action: 'get_stranger_info';
        params: {
            user_id: number;
        };
        response: {
            user_id: number;
            nickname: string;
            sex: Sex;
            age: number;
            [key: string]: any;
        };
    };
    /** 获取好友列表 */
    [OneBotFriendApiAction.getFriendList]: {
        action: 'get_friend_list';
        params: Record<string, never>;
        response: Array<{
            user_id: number;
            nickname: string;
            remark: string;
            [key: string]: any;
        }>;
    };
    /** NapCat扩展: 获取好友列表 */
    [OneBotFriendApiAction.nc_getFriendList]: {
        action: 'get_friend_list';
        params: {
            no_cache?: boolean;
        };
        response: Array<{
            user_id: number;
            nickname: string;
            remark: string;
            birthday_year: number;
            birthday_month: number;
            birthday_day: number;
            age: number;
            phone_num: string;
            email: string;
            category_id: number;
            sex: Sex;
            level: number;
        }>;
    };
    /** Lagrange扩展: 获取好友列表 */
    [OneBotFriendApiAction.lgl_getFriendList]: {
        action: 'get_friend_list';
        params: Record<string, never>;
        response: Array<{
            user_id: number;
            nickname: string;
            remark: string;
            q_id: string;
            group: {
                group_id: number;
                group_name: string;
            };
        }>;
    };
    /** GoCQ扩展: 获取单向好友列表 */
    [OneBotFriendApiAction.getUnidirectionalFriendList]: {
        action: 'get_unidirectional_friend_list';
        params: Record<string, never>;
        response: Array<{
            user_id: number;
            nickname: string;
        }>;
    };
    /** NapCat扩展: 获取单向好友列表 */
    [OneBotFriendApiAction.nc_getUnidirectionalFriendList]: {
        action: 'get_unidirectional_friend_list';
        params: Record<string, never>;
        response: Array<{
            uin: number;
            uid: string;
            nick_name: string;
            age: number;
            source: string;
        }>;
    };
    /** GoCQ扩展: 删除好友 */
    [OneBotFriendApiAction.deleteFriend]: {
        action: 'delete_friend';
        params: {
            user_id: number;
        };
        response: null;
    };
    /** NapCat扩展: 删除好友 */
    [OneBotFriendApiAction.nc_deleteFriend]: {
        action: 'delete_friend';
        params: {
            user_id: number;
            friend_id?: number;
            temp_block?: boolean;
            temp_both_del?: boolean;
        };
        response: {
            result: number;
            errMsg: string;
        };
    };
    /** Lagrange扩展: 删除好友 */
    [OneBotFriendApiAction.lgl_deleteFriend]: {
        action: 'delete_friend';
        params: {
            user_id: number;
            block: boolean;
        };
        response: null;
    };
    /** GoCQ扩展: 删除单向好友 */
    [OneBotFriendApiAction.deleteUnidirectionalFriend]: {
        action: 'delete_unidirectional_friend';
        params: {
            user_id: number;
        };
        response: null;
    };
    /** NapCat扩展: 设置好友备注 */
    [OneBotFriendApiAction.nc_setFriendRemark]: {
        action: 'set_friend_remark';
        params: {
            user_id: number;
            remark: string;
        };
        response: null;
    };
    /** NapCat扩展: 获取分类的好友列表 */
    [OneBotFriendApiAction.nc_getFriendsWithCategory]: {
        action: 'get_friends_with_category';
        params: Record<string, never>;
        response: Array<{
            categoryId: number;
            categorySortId: number;
            categoryName: string;
            categoryMbCount: number;
            onlineCount: number;
            buddyList: Array<{
                birthday_year: number;
                birthday_month: number;
                birthday_day: number;
                user_id: number;
                age: number;
                phone_num: string;
                email: string;
                category_id: number;
                nickname: string;
                remark: string;
                sex: Sex;
                level: number;
            }>;
        }>;
    };
    /** NapCat扩展: 获取可疑好友请求 */
    [OneBotFriendApiAction.nc_getDoubtFriendsAddRequest]: {
        action: 'get_doubt_friends_add_request';
        params: Record<string, never>;
        response: Array<{
            flag: string;
            uin: string;
            nick: string;
            source: string;
            reason: string;
            msg: string;
            group_code: string;
            time: string;
            type: string;
        }>;
    };
    /** NapCat扩展: 处理可疑好友请求 */
    [OneBotFriendApiAction.nc_setDoubtFriendsAddRequest]: {
        action: 'set_doubt_friends_add_request';
        params: {
            request_id: string;
            approve: boolean;
        };
        response: null;
    };
    /** NapCat扩展: 好友戳一戳 */
    [OneBotFriendApiAction.nc_friendPoke]: {
        action: 'friend_poke';
        params: {
            user_id?: number;
            target_id?: number;
        };
        response: null;
    };
    /** Lagrange扩展: 好友戳一戳 */
    [OneBotFriendApiAction.lgl_friendPoke]: {
        action: 'friend_poke';
        params: {
            user_id?: number;
            target_id?: number;
        };
        response: null;
    };
}

declare enum OneBotGroupApiAction {
    setGroupKick = "set_group_kick",
    setGroupBan = "set_group_ban",
    setGroupAnonymousBan = "set_group_anonymous_ban",
    setGroupWholeBan = "set_group_whole_ban",
    setGroupAdmin = "set_group_admin",
    setGroupAnonymous = "set_group_anonymous",
    setGroupCard = "set_group_card",
    setGroupName = "set_group_name",
    setGroupLeave = "set_group_leave",
    lgl_setGroupLeave = "lgl_set_group_leave",
    lgl_groupPoke = "group_poke",
    setGroupSpecialTitle = "set_group_special_title",
    getGroupInfo = "get_group_info",
    getGroupList = "get_group_list",
    getGroupMemberInfo = "get_group_member_info",
    getGroupMemberList = "get_group_member_list",
    getGroupHonorInfo = "get_group_honor_info",
    setGroupAddRequest = "set_group_add_request",
    setGroupPortrait = "set_group_portrait",
    setEssenceMsg = "set_essence_msg",
    deleteEssenceMsg = "delete_essence_msg",
    getEssenceMsgList = "get_essence_msg_list",
    sendGroupSign = "send_group_sign",
    getGroupNotice = "_get_group_notice",
    sendGroupNotice = "_send_group_notice",
    delGroupNotice = "_del_group_notice",
    getGroupSystemMsg = "get_group_system_msg",
    getGroupAtAllRemain = "get_group_at_all_remain",
    lgl_setGroupBotStatus = "set_group_bot_status",
    nc_setGroupKickMembers = "set_group_kick_members",
    nc_setGroupRobotAddOption = "set_group_robot_add_option",
    nc_setGroupAddOption = "set_group_add_option",
    nc_setGroupSearch = "set_group_search",
    nc_setGroupRemark = "set_group_remark",
    nc_groupPoke = "group_poke",
    nc_getGroupInfoEx = "get_group_info_ex",
    nc_getGroupDetailInfo = "get_group_detail_info",
    nc_getGroupIgnoreAddRequest = "get_group_ignore_add_request",
    nc_getGroupShutList = "get_group_shut_list",
    nc_getGroupIgnoredNotifies = "get_group_ignored_notifies"
}
/**
 * 群组相关 API
 */
interface OneBotGroupApi {
    /** 群组踢人 */
    [OneBotGroupApiAction.setGroupKick]: {
        action: 'set_group_kick';
        params: {
            group_id: number;
            user_id: number;
            reject_add_request?: boolean;
        };
        response: null;
    };
    /** 群组单人禁言 */
    [OneBotGroupApiAction.setGroupBan]: {
        action: 'set_group_ban';
        params: {
            group_id: number;
            user_id: number;
            duration?: number;
        };
        response: null;
    };
    /** 群组匿名用户禁言 */
    [OneBotGroupApiAction.setGroupAnonymousBan]: {
        action: 'set_group_anonymous_ban';
        params: {
            group_id: number;
            anonymous?: {
                id: number;
                name: string;
                flag: string;
            };
            flag?: string;
            duration?: number;
        };
        response: null;
    };
    /** 群组全员禁言 */
    [OneBotGroupApiAction.setGroupWholeBan]: {
        action: 'set_group_whole_ban';
        params: {
            group_id: number;
            enable?: boolean;
        };
        response: null;
    };
    /** 群组设置管理员 */
    [OneBotGroupApiAction.setGroupAdmin]: {
        action: 'set_group_admin';
        params: {
            group_id: number;
            user_id: number;
            enable?: boolean;
        };
        response: null;
    };
    /** 群组匿名 */
    [OneBotGroupApiAction.setGroupAnonymous]: {
        action: 'set_group_anonymous';
        params: {
            group_id: number;
            enable?: boolean;
        };
        response: null;
    };
    /** 设置群名片（群备注） */
    [OneBotGroupApiAction.setGroupCard]: {
        action: 'set_group_card';
        params: {
            group_id: number;
            user_id: number;
            card?: string;
        };
        response: null;
    };
    /** 设置群名 */
    [OneBotGroupApiAction.setGroupName]: {
        action: 'set_group_name';
        params: {
            group_id: number;
            group_name: string;
        };
        response: null;
    };
    /** 退出群组 */
    [OneBotGroupApiAction.setGroupLeave]: {
        action: 'set_group_leave';
        params: {
            group_id: number;
            is_dismiss?: boolean;
        };
        response: null;
    };
    /** Lagrange扩展: 退出群组 */
    [OneBotGroupApiAction.lgl_setGroupLeave]: {
        action: 'set_group_leave';
        params: {
            group_id: number;
        };
        response: null;
    };
    /** 设置群组专属头衔 */
    [OneBotGroupApiAction.setGroupSpecialTitle]: {
        action: 'set_group_special_title';
        params: {
            group_id: number;
            user_id: number;
            special_title?: string;
            duration?: number;
        };
        response: null;
    };
    /** 获取群信息 */
    [OneBotGroupApiAction.getGroupInfo]: {
        action: 'get_group_info';
        params: {
            group_id: number;
            no_cache?: boolean;
        };
        response: {
            group_id: number;
            group_name: string;
            member_count: number;
            max_member_count: number;
            owner_id: number;
            admin_flag?: boolean;
            admin_list?: Array<{
                user_id: number;
                nickname: string;
                role: string;
            }>;
            create_time?: number;
            category?: number;
            group_level?: number;
            group_create_time?: number;
            group_memo?: string;
        };
    };
    /** 获取群列表 */
    [OneBotGroupApiAction.getGroupList]: {
        action: 'get_group_list';
        params: {};
        response: Array<{
            group_id: number;
            group_name: string;
            member_count: number;
            max_member_count: number;
        }>;
    };
    /** 获取群成员信息 */
    [OneBotGroupApiAction.getGroupMemberInfo]: {
        action: 'get_group_member_info';
        params: {
            group_id: number;
            user_id: number;
            no_cache?: boolean;
        };
        response: {
            group_id: number;
            user_id: number;
            nickname: string;
            card: string;
            sex: Sex;
            age: number;
            area: string;
            join_time: number;
            last_sent_time: number;
            level: string;
            role: string;
            unfriendly: boolean;
            title: string;
            title_expire_time: number;
            card_changeable: boolean;
            shut_up_timestamp: number;
        };
    };
    /** 获取群成员列表 */
    [OneBotGroupApiAction.getGroupMemberList]: {
        action: 'get_group_member_list';
        params: {
            group_id: number;
            no_cache?: boolean;
        };
        response: Array<{
            group_id: number;
            user_id: number;
            nickname: string;
            card: string;
            sex: Sex;
            age: number;
            area: string;
            join_time: number;
            last_sent_time: number;
            level: string;
            role: string;
            unfriendly: boolean;
            title: string;
            title_expire_time: number;
            card_changeable: boolean;
            shut_up_timestamp: number;
        }>;
    };
    /** 获取群荣誉信息 */
    [OneBotGroupApiAction.getGroupHonorInfo]: {
        action: 'get_group_honor_info';
        params: {
            group_id: number;
            type: string;
        };
        response: {
            group_id: number;
            current_talkative?: {
                user_id: number;
                nickname: string;
                avatar: string;
                day_count: number;
            };
            talkative_list?: Array<{
                user_id: number;
                nickname: string;
                avatar: string;
                description: string;
            }>;
            performer_list?: Array<{
                user_id: number;
                nickname: string;
                avatar: string;
                description: string;
            }>;
            legend_list?: Array<{
                user_id: number;
                nickname: string;
                avatar: string;
                description: string;
            }>;
            strong_newbie_list?: Array<{
                user_id: number;
                nickname: string;
                avatar: string;
                description: string;
            }>;
            emotion_list?: Array<{
                user_id: number;
                nickname: string;
                avatar: string;
                description: string;
            }>;
        };
    };
    /** 处理加群请求/邀请 */
    [OneBotGroupApiAction.setGroupAddRequest]: {
        action: 'set_group_add_request';
        params: {
            flag: string;
            sub_type: 'add' | 'invite';
            approve: boolean;
            reason?: string;
        };
        response: null;
    };
    /** GOCQ拓展: 设置群头像 */
    [OneBotGroupApiAction.setGroupPortrait]: {
        action: 'set_group_portrait';
        params: {
            group_id: number;
            file: string;
            cache?: number;
        };
        response: null;
    };
    /** GOCQ拓展: 设置精华消息 */
    [OneBotGroupApiAction.setEssenceMsg]: {
        action: 'set_essence_msg';
        params: {
            message_id: number;
        };
        response: null;
    };
    /** GOCQ拓展: 移出精华消息 */
    [OneBotGroupApiAction.deleteEssenceMsg]: {
        action: 'delete_essence_msg';
        params: {
            message_id: number;
        };
        response: null;
    };
    /** GOCQ拓展: 获取精华消息列表 */
    [OneBotGroupApiAction.getEssenceMsgList]: {
        action: 'get_essence_msg_list';
        params: {
            group_id: number;
        };
        response: Array<{
            sender_id: number;
            sender_nick: string;
            sender_time: number;
            operator_id: number;
            operator_nick: string;
            operator_time: number;
            message_id: number;
            content: string;
        }>;
    };
    /** GOCQ拓展: 群打卡 */
    [OneBotGroupApiAction.sendGroupSign]: {
        action: 'send_group_sign';
        params: {
            group_id: number;
        };
        response: null;
    };
    /** GOCQ拓展: 获取群公告 */
    [OneBotGroupApiAction.getGroupNotice]: {
        action: '_get_group_notice';
        params: {
            group_id: number;
        };
        response: Array<{
            sender_id: number;
            publish_time: number;
            message: {
                text: string;
                images: Array<{
                    height: string;
                    width: string;
                    id: string;
                }>;
            };
        }>;
    };
    /** GOCQ拓展: 发送群公告 */
    [OneBotGroupApiAction.sendGroupNotice]: {
        action: '_send_group_notice';
        params: {
            group_id: number;
            content: string;
            image?: string;
        };
        response: null;
    };
    /** GOCQ拓展: 删除群公告 */
    [OneBotGroupApiAction.delGroupNotice]: {
        action: '_del_group_notice';
        params: {
            group_id: number;
            notice_id: string;
        };
        response: null;
    };
    /** GOCQ拓展: 获取群系统消息 */
    [OneBotGroupApiAction.getGroupSystemMsg]: {
        action: 'get_group_system_msg';
        params: {};
        response: {
            invited_requests: Array<{
                request_id: number;
                invitor_uin: number;
                invitor_nick: string;
                group_id: number;
                group_name: string;
                checked: boolean;
                actor: number;
            }>;
            join_requests: Array<{
                request_id: number;
                requester_uin: number;
                requester_nick: string;
                message: string;
                group_id: number;
                group_name: string;
                checked: boolean;
                actor: number;
            }>;
        };
    };
    /** GOCQ拓展: 获取群@全体成员剩余次数 */
    [OneBotGroupApiAction.getGroupAtAllRemain]: {
        action: 'get_group_at_all_remain';
        params: {
            group_id: number;
        };
        response: {
            can_at_all: boolean;
            remain_at_all_count_for_group: number;
            remain_at_all_count_for_uin: number;
        };
    };
    /** Lagrange拓展: 设置群Bot发言状态 */
    [OneBotGroupApiAction.lgl_setGroupBotStatus]: {
        action: 'set_group_bot_status';
        params: {
            group_id: number;
            status: 'normal' | 'readonly';
        };
        response: null;
    };
    /** NapCat拓展: 群组踢多人 */
    [OneBotGroupApiAction.nc_setGroupKickMembers]: {
        action: 'set_group_kick_members';
        params: {
            group_id: number;
            user_ids: Array<number>;
            reject_add_request?: boolean;
        };
        response: null;
    };
    /** NapCat拓展: 设置机器人进群选项 */
    [OneBotGroupApiAction.nc_setGroupRobotAddOption]: {
        action: 'set_group_robot_add_option';
        params: {
            group_id: number;
            option: 'ignore' | 'discuss' | 'agree' | 'reject';
        };
        response: null;
    };
    /** NapCat拓展: 设置群添加选项 */
    [OneBotGroupApiAction.nc_setGroupAddOption]: {
        action: 'set_group_add_option';
        params: {
            group_id: number;
            option: 'ignore' | 'discuss' | 'agree' | 'reject';
        };
        response: null;
    };
    /** NapCat拓展: 设置群搜索 */
    [OneBotGroupApiAction.nc_setGroupSearch]: {
        action: 'set_group_search';
        params: {
            group_id: number;
            enable: boolean;
        };
        response: null;
    };
    /** NapCat拓展: 设置群备注 */
    [OneBotGroupApiAction.nc_setGroupRemark]: {
        action: 'set_group_remark';
        params: {
            group_id: number;
            remark: string;
        };
        response: null;
    };
    /** NapCat拓展: 群内戳一戳 */
    [OneBotGroupApiAction.nc_groupPoke]: {
        action: 'group_poke';
        params: {
            group_id: number;
            user_id: number;
        };
        response: null;
    };
    /** Lagrange拓展: 群内戳一戳 */
    [OneBotGroupApiAction.lgl_groupPoke]: {
        action: 'group_poke';
        params: {
            group_id: number;
            user_id: number;
        };
        response: null;
    };
    /** NapCat拓展: 获取群信息扩展 */
    [OneBotGroupApiAction.nc_getGroupInfoEx]: {
        action: 'get_group_info_ex';
        params: {
            group_id: number;
        };
        response: {
            group_id: number;
            group_name: string;
            member_count: number;
            max_member_count: number;
            owner_id: number;
            admin_flag: boolean;
            last_join_time: number;
            group_flag: number;
            group_flag_ext: number;
            group_create_time: number;
            group_level: number;
            group_face: number;
            group_default_page: number;
            group_info_seq: number;
            group_roaming_time: number;
            group_option: Array<{
                option: number;
                value: number;
            }>;
            group_admin_option: Array<{
                option: number;
                value: number;
            }>;
        };
    };
    /** NapCat拓展: 获取群详细信息 */
    [OneBotGroupApiAction.nc_getGroupDetailInfo]: {
        action: 'get_group_detail_info';
        params: {
            group_id: number;
        };
        response: {
            group_id: number;
            group_name: string;
            create_time: number;
            member_count: number;
            max_member_count: number;
            member_admin_count: number;
            introduce: string;
            grade: number;
            active_member_count: number;
            certification_type: number;
            certification_text: string;
            group_flag: number;
            type_flag: number;
        };
    };
    /** NapCat拓展: 获取群忽略添加请求 */
    [OneBotGroupApiAction.nc_getGroupIgnoreAddRequest]: {
        action: 'get_group_ignore_add_request';
        params: {
            group_id: number;
        };
        response: Array<{
            request_id: number;
            message: string;
            group_id: number;
            group_name: string;
            checked: boolean;
            actor: number;
            requester_uin: number;
            requester_nick: string;
        }>;
    };
    /** NapCat拓展: 获取群禁言列表 */
    [OneBotGroupApiAction.nc_getGroupShutList]: {
        action: 'get_group_shut_list';
        params: {
            group_id: number;
        };
        response: Array<{
            uin: number;
            user_id: number;
            nick: string;
            shut_up_timestamp: number;
        }>;
    };
    /** NapCat扩展: 获取群过滤系统消息 */
    [OneBotGroupApiAction.nc_getGroupIgnoredNotifies]: {
        action: 'get_group_ignored_notifies';
        params: {
            group_id: number;
        };
        response: {
            InvitedRequest: Array<{
                request_id: number;
                invitor_uin: number;
                invitor_nick: string;
                group_id: number;
                message: string;
                group_name: string;
                checked: boolean;
                actor: number;
                requester_nick: string;
            }>;
            join_requests: Array<{
                request_id: number;
                requester_nick: string;
                message: string;
                group_id: number;
                group_name: string;
                checked: boolean;
                actor: number;
                invitor_uin: number;
                invitor_nick: string;
            }>;
        };
    };
}

declare enum OneBotBotApiAction {
    getLoginInfo = "get_login_info",
    getVersionInfo = "get_version_info",
    getStatus = "get_status",
    getCookies = "get_cookies",
    nc_getCookies = "nc_get_cookies",
    getCsrfToken = "get_csrf_token",
    getCredentials = "get_credentials",
    getRecord = "get_record",
    nc_getRecord = "nc_get_record",
    getImage = "get_image",
    nc_getImage = "nc_get_image",
    canSendImage = "can_send_image",
    canSendRecord = "can_send_record",
    setQqProfile = "set_qq_profile",
    qidianGetAccountInfo = "qidian_get_account_info",
    getModelShow = "_get_model_show",
    setModelShow = "_set_model_show",
    getOnlineClients = "get_online_clients",
    fetchCustomFace = "fetch_custom_face",
    setQqAvatar = "set_qq_avatar",
    getRkey = "get_rkey",
    nc_getRkey = "nc_get_rkey",
    lgl_getMfaceKey = "get_mface_key",
    nc_getRkeyServer = "get_rkey_server",
    nc_setDiyOnlineStatus = "set_diy_online_status",
    nc_setOnlineStatus = "set_online_status",
    nc_setInputStatus = "set_input_status",
    nc_getProfileLike = "get_profile_like",
    nc_getRobotUinRange = "get_robot_uin_range",
    nc_setSelfLongnick = "set_self_longnick",
    nc_getRecentContact = "get_recent_contact",
    nc_getUserStatus = "get_user_status",
    nc_getClientkey = "get_clientkey"
}
/**
 * 机器人相关 API
 */
interface OneBotBotApi {
    /** 获取登录号信息 */
    [OneBotBotApiAction.getLoginInfo]: {
        action: 'get_login_info';
        params: Record<string, never>;
        response: {
            user_id: number;
            nickname: string;
        };
    };
    /** 获取版本信息 */
    [OneBotBotApiAction.getVersionInfo]: {
        action: 'get_version_info';
        params: Record<string, never>;
        response: {
            app_name: string;
            app_version: string;
            protocol_version: string;
        };
    };
    /** 获取状态 */
    [OneBotBotApiAction.getStatus]: {
        action: 'get_status';
        params: Record<string, never>;
        response: {
            online: boolean;
            good: boolean;
            stat: Record<string, any>;
            [key: string]: any;
        };
    };
    /** 获取Cookies */
    [OneBotBotApiAction.getCookies]: {
        action: 'get_cookies';
        params: {
            domain: string;
        };
        response: {
            cookies: string;
        };
    };
    /** NapCat扩展: 获取Cookies */
    [OneBotBotApiAction.nc_getCookies]: {
        action: 'get_cookies';
        params: {
            domain: string;
        };
        response: {
            cookies: string;
            bkn: string;
        };
    };
    /** 获取CSRF Token */
    [OneBotBotApiAction.getCsrfToken]: {
        action: 'get_csrf_token';
        params: Record<string, never>;
        response: {
            token: number;
        };
    };
    /** 获取QQ相关接口凭证 */
    [OneBotBotApiAction.getCredentials]: {
        action: 'get_credentials';
        params: {
            domain: string;
        };
        response: {
            cookies: string;
            csrf_token: number;
        };
    };
    /** 获取语音 */
    [OneBotBotApiAction.getRecord]: {
        action: 'get_record';
        params: {
            file: string;
            out_format: string;
        };
        response: {
            file: string;
        };
    };
    /** NapCat扩展: 获取语音 */
    [OneBotBotApiAction.nc_getRecord]: {
        action: 'get_record';
        params: {
            file?: string;
            file_id?: string;
            out_format: string;
        };
        response: {
            file: string;
            url: string;
            file_size: string;
            file_name: string;
            base64: string;
        };
    };
    /** 获取图片 */
    [OneBotBotApiAction.getImage]: {
        action: 'get_image';
        params: {
            file: string;
        };
        response: {
            file: string;
        };
    };
    /** NapCat扩展: 获取图片 */
    [OneBotBotApiAction.nc_getImage]: {
        action: 'get_image';
        params: {
            file?: string;
            file_id?: string;
        };
        response: {
            file: string;
            url: string;
            file_size: string;
            file_name: string;
            base64: string;
        };
    };
    /** 检查是否可以发送图片 */
    [OneBotBotApiAction.canSendImage]: {
        action: 'can_send_image';
        params: Record<string, never>;
        response: {
            yes: boolean;
        };
    };
    /** 检查是否可以发送语音 */
    [OneBotBotApiAction.canSendRecord]: {
        action: 'can_send_record';
        params: Record<string, never>;
        response: {
            yes: boolean;
        };
    };
    /** 设置登录号资料 */
    [OneBotBotApiAction.setQqProfile]: {
        action: 'set_qq_profile';
        params: {
            nickname: string;
            company: string;
            email: string;
            college: string;
            personal_note: string;
        };
        response: null;
    };
    /** 获取企点账号信息 */
    [OneBotBotApiAction.qidianGetAccountInfo]: {
        action: 'qidian_get_account_info';
        params: Record<string, never>;
        response: {
            master_id: number;
            ext_name: string;
            create_time: number;
        };
    };
    /** 获取在线机型 */
    [OneBotBotApiAction.getModelShow]: {
        action: '_get_model_show';
        params: {
            model: string;
        };
        response: {
            variants: Array<{
                model_show: string;
                need_pay: boolean;
            }>;
        };
    };
    /** 设置在线机型 */
    [OneBotBotApiAction.setModelShow]: {
        action: '_set_model_show';
        params: {
            model: string;
            model_show: string;
        };
        response: null;
    };
    /** 获取当前账号在线客户端列表 */
    [OneBotBotApiAction.getOnlineClients]: {
        action: 'get_online_clients';
        params: {
            no_cache?: boolean;
        };
        response: {
            clients: Array<{
                app_id: number;
                device_name: string;
                device_kind: string;
            }>;
        };
    };
    /** 社区扩展: 获取已收藏的QQ表情列表 */
    [OneBotBotApiAction.fetchCustomFace]: {
        action: 'fetch_custom_face';
        params: Record<string, never>;
        response: {
            faces: Array<{
                id: string;
                url: string;
            }>;
        };
    };
    /** 社区扩展: 设置QQ头像 */
    [OneBotBotApiAction.setQqAvatar]: {
        action: 'set_qq_avatar';
        params: {
            file: string;
        };
        response: void;
    };
    /** 社区扩展: 获取rkey */
    [OneBotBotApiAction.getRkey]: {
        action: 'get_rkey';
        params: Record<string, never>;
        response: Array<{
            type: 'private' | 'group';
            rkey: string;
            created_at: number;
            ttl: number;
        }> | {
            rkeys: Array<{
                type: 'private' | 'group';
                rkey: string;
                created_at: number;
                ttl: number;
            }>;
        };
    };
    /** NapCat扩展: 获取NC版rkey */
    [OneBotBotApiAction.nc_getRkey]: {
        action: 'nc_get_rkey';
        params: Record<string, never>;
        response: {
            rkey: string;
            ttl: number;
            time: number;
            type: number;
        };
    };
    /** Lagrange扩展: 获取mface key */
    [OneBotBotApiAction.lgl_getMfaceKey]: {
        action: 'get_mface_key';
        params: Record<string, never>;
        response: {
            key: string;
        };
    };
    /** NapCat扩展: 获取rkey服务器 */
    [OneBotBotApiAction.nc_getRkeyServer]: {
        action: 'get_rkey_server';
        params: Record<string, never>;
        response: {
            server: string;
        };
    };
    /** NapCat扩展: 设置自定义在线状态 */
    [OneBotBotApiAction.nc_setDiyOnlineStatus]: {
        action: 'set_diy_online_status';
        params: {
            face: number;
            text: string;
        };
        response: {
            result: number;
            message: string;
        };
    };
    /** NapCat扩展: 设置在线状态 */
    [OneBotBotApiAction.nc_setOnlineStatus]: {
        action: 'set_online_status';
        params: {
            status: number;
        };
        response: {
            result: number;
            message: string;
        };
    };
    /** NapCat扩展: 设置输入状态 */
    [OneBotBotApiAction.nc_setInputStatus]: {
        action: 'set_input_status';
        params: {
            user_id: number;
            typing: boolean;
        };
        response: {
            result: number;
            message: string;
        };
    };
    /** NapCat扩展: 获取个人资料点赞 */
    [OneBotBotApiAction.nc_getProfileLike]: {
        action: 'get_profile_like';
        params: {
            user_id: number;
        };
        response: {
            likeCount: number;
            voteInfo: {
                userInfos: Array<{
                    age: number;
                    bAvailableCnt: number;
                    bTodayVotedCnt: number;
                    count: number;
                    customId: number;
                    gender: number;
                    giftCount: number;
                    isFriend: boolean;
                    isSvip: boolean;
                    isvip: boolean;
                    lastCharged: number;
                    latestTime: number;
                    nick: string;
                    src: number;
                    uid: string;
                    uin: number;
                }>;
                total_count: number;
                new_count: number;
                new_nearby_count: number;
                last_visit_time: number;
            };
        };
    };
    /** NapCat扩展: 获取官方机器人账号范围 */
    [OneBotBotApiAction.nc_getRobotUinRange]: {
        action: 'get_robot_uin_range';
        params: Record<string, never>;
        response: Array<{
            minUin: string;
            maxUin: string;
        }>;
    };
    /** NapCat扩展: 设置自己的个性签名 */
    [OneBotBotApiAction.nc_setSelfLongnick]: {
        action: 'set_self_longnick';
        params: {
            longNick: string;
        };
        response: {
            result: number;
            errMsg: string;
        };
    };
    /** NapCat扩展: 获取最近联系人 */
    [OneBotBotApiAction.nc_getRecentContact]: {
        action: 'get_recent_contact';
        params: {
            count?: number;
        };
        response: Array<{
            peerUin: number;
            remark: string;
            msgTime: number;
            chatType: number;
            msgId: number;
            sendNickName: string;
            sendMemberName: string;
            peerName: string;
            lastestMsg?: {
                self_id: number;
                user_id: number;
                time: number;
                real_seq: string;
                message_type: string;
                sender: {
                    user_id: number;
                    nickname: string;
                    sex: Sex;
                    age: number;
                    card: string;
                    role: string;
                };
                raw_message: string;
                font: number;
                sub_type: string;
                message: Array<{
                    type: string;
                    data: {
                        text: string;
                    };
                }>;
                message_format: string;
                post_type: string;
                group_id: number;
            };
        }>;
    };
    /** NapCat扩展: 获取用户状态 */
    [OneBotBotApiAction.nc_getUserStatus]: {
        action: 'get_user_status';
        params: {
            user_id: number;
        };
        response: {
            status: number;
            ext_status: number;
        };
    };
    /** NapCat扩展: 获取clientkey */
    [OneBotBotApiAction.nc_getClientkey]: {
        action: 'get_clientkey';
        params: Record<string, never>;
        response: {
            clientkey: string;
        };
    };
}

declare enum OneBotOtherApiAction {
    restartOneBot = "set_restart",
    cleanCache = "clean_cache",
    downloadFile = "download_file",
    nc_downloadFile = "nc_download_file",
    checkUrlSafely = "check_url_safely",
    getWordSlices = ".get_word_slices",
    handleQuickOperation = ".handle_quick_operation",
    ocrImage = "ocr_image",
    dotOcrImage = ".ocr_image",
    nc_ocrImage = "nc_ocr_image",
    nc_translateEn2zh = "translate_en2zh",
    nc_clickInlineKeyboardButton = "click_inline_keyboard_button",
    nc_arkSharePeer = "ArkSharePeer",
    nc_arkShareGroup = "ArkShareGroup",
    nc_createCollection = "create_collection",
    nc_getCollectionList = "get_collection_list",
    nc_botExit = "bot_exit",
    nc_sendPacket = "send_packet",
    nc_getPacketStatus = "nc_get_packet_status",
    nc_getMiniAppArk = "get_mini_app_ark",
    nc_getAiRecord = "get_ai_record",
    nc_sendPoke = "send_poke"
}
/**
 * 其他 API
 */
interface OneBotOtherApi {
    /** 重启 OneBot 实现 */
    [OneBotOtherApiAction.restartOneBot]: {
        action: 'set_restart';
        params: {
            delay?: number;
        };
        response: null;
    };
    /** 清理缓存 */
    [OneBotOtherApiAction.cleanCache]: {
        action: 'clean_cache';
        params: Record<string, never>;
        response: null;
    };
    /** 下载文件到缓存目录 */
    [OneBotOtherApiAction.downloadFile]: {
        action: 'download_file';
        params: {
            url: string;
            thread_count?: number;
            headers?: Array<string>;
        };
        response: {
            file: string;
        };
    };
    /** NapCat扩展: 下载文件到缓存目录 */
    [OneBotOtherApiAction.nc_downloadFile]: {
        action: 'download_file';
        params: {
            url: string;
            base64?: string;
            name?: string;
            headers?: Array<string>;
        };
        response: {
            file: string;
        };
    };
    /** 检查链接安全性 */
    [OneBotOtherApiAction.checkUrlSafely]: {
        action: 'check_url_safely';
        params: {
            url: string;
        };
        response: {
            level: number;
        };
    };
    /** 获取中文分词 */
    [OneBotOtherApiAction.getWordSlices]: {
        action: '.get_word_slices';
        params: {
            content: string;
        };
        response: {
            slices: Array<string>;
        };
    };
    /** 对事件执行快速操作 */
    [OneBotOtherApiAction.handleQuickOperation]: {
        action: '.handle_quick_operation';
        params: {
            context: object;
            operation: object;
        };
        response: null;
    };
    /** OCR图片 */
    [OneBotOtherApiAction.ocrImage]: {
        action: 'ocr_image';
        params: {
            image: string;
        };
        response: {
            texts: Array<{
                text: string;
                confidence: number;
                coordinates: Array<{
                    x: number;
                    y: number;
                }>;
            }>;
            language: string;
        };
    };
    /** OCR图片 (别名) */
    [OneBotOtherApiAction.dotOcrImage]: {
        action: '.ocr_image';
        params: {
            image: string;
        };
        response: {
            texts: Array<{
                text: string;
                confidence: number;
                coordinates: Array<{
                    x: number;
                    y: number;
                }>;
            }>;
            language: string;
        };
    };
    /** NapCat扩展: OCR图片 */
    [OneBotOtherApiAction.nc_ocrImage]: {
        action: 'ocr_image';
        params: {
            image: string;
        };
        response: Array<{
            text: string;
            pt1: {
                x: string;
                y: string;
            };
            pt2: {
                x: string;
                y: string;
            };
            pt3: {
                x: string;
                y: string;
            };
            pt4: {
                x: string;
                y: string;
            };
            charBox: Array<{
                charText: string;
                charBox: {
                    pt1: {
                        x: string;
                        y: string;
                    };
                    pt2: {
                        x: string;
                        y: string;
                    };
                    pt3: {
                        x: string;
                        y: string;
                    };
                    pt4: {
                        x: string;
                        y: string;
                    };
                };
            }>;
            score: string;
        }>;
    };
    /** NapCat扩展: 英文翻译为中文 */
    [OneBotOtherApiAction.nc_translateEn2zh]: {
        action: 'translate_en2zh';
        params: {
            text: string;
        };
        response: {
            result: string;
        };
    };
    /** NapCat扩展: 点击按钮 */
    [OneBotOtherApiAction.nc_clickInlineKeyboardButton]: {
        action: 'click_inline_keyboard_button';
        params: {
            message_id: number;
            button_index: number;
        };
        response: {
            result: boolean;
        };
    };
    /** NapCat扩展: 获取推荐好友/群聊卡片 */
    [OneBotOtherApiAction.nc_arkSharePeer]: {
        action: 'ArkSharePeer';
        params: {
            user_id: number;
        };
        response: {
            data: string;
        };
    };
    /** NapCat扩展: 获取推荐群聊卡片 */
    [OneBotOtherApiAction.nc_arkShareGroup]: {
        action: 'ArkShareGroup';
        params: {
            group_id: number;
        };
        response: {
            data: string;
        };
    };
    /** NapCat扩展: 创建收藏 */
    [OneBotOtherApiAction.nc_createCollection]: {
        action: 'create_collection';
        params: {
            message_id: number;
        };
        response: {
            result: boolean;
        };
    };
    /** NapCat扩展: 获取收藏列表 */
    [OneBotOtherApiAction.nc_getCollectionList]: {
        action: 'get_collection_list';
        params: Record<string, never>;
        response: Array<{
            id: string;
            content: string;
            time: number;
        }>;
    };
    /** NapCat扩展: 退出机器人 */
    [OneBotOtherApiAction.nc_botExit]: {
        action: 'bot_exit';
        params: Record<string, never>;
        response: null;
    };
    /** NapCat扩展: 发送自定义组包 */
    [OneBotOtherApiAction.nc_sendPacket]: {
        action: 'send_packet';
        params: Record<string, any>;
        response: Record<string, any>;
    };
    /** NapCat扩展: 获取packet状态 */
    [OneBotOtherApiAction.nc_getPacketStatus]: {
        action: 'nc_get_packet_status';
        params: Record<string, never>;
        response: null;
    };
    /** NapCat扩展: 获取小程序卡片 */
    [OneBotOtherApiAction.nc_getMiniAppArk]: {
        action: 'get_mini_app_ark';
        params: {
            type?: string;
            title?: string;
            desc?: string;
            picUrl?: string;
            jumpUrl?: string;
            webUrl?: string;
            iconUrl?: string;
            appId?: string;
            scene?: string;
            templateType?: string;
            businessType?: string;
            verType?: string;
            shareType?: string;
            versionId?: string;
            sdkId?: string;
            withShareTicket?: string;
            rawArkData?: boolean;
        };
        response: {
            data: {
                appName?: string;
                appView?: string;
                ver?: string;
                desc?: string;
                prompt?: string;
                metaData?: string;
                config?: string;
                app?: string;
                view?: string;
                meta?: string;
                miniappShareOrigin?: number;
                miniappOpenRefer?: string;
            };
        };
    };
    /** NapCat扩展: 获取AI语音 */
    [OneBotOtherApiAction.nc_getAiRecord]: {
        action: 'get_ai_record';
        params: {
            character: string;
            group_id: number;
            text: string;
        };
        response: string;
    };
    /** NapCat扩展: 发送戳一戳 */
    [OneBotOtherApiAction.nc_sendPoke]: {
        action: 'send_poke';
        params: {
            user_id?: string;
            group_id?: string;
            target_id?: string;
        };
        response: null;
    };
}

declare enum OneBotFileApiAction {
    getGroupFileUrl = "get_group_file_url",
    getPrivateFileUrl = "get_private_file_url",
    lgl_getPrivateFileUrl = "lgl_get_private_file_url",
    uploadGroupFile = "upload_group_file",
    uploadPrivateFile = "upload_private_file",
    getGroupFileSystemInfo = "get_group_file_system_info",
    getGroupRootFiles = "get_group_root_files",
    getGroupFilesByFolder = "get_group_files_by_folder",
    createGroupFileFolder = "create_group_file_folder",
    deleteGroupFolder = "delete_group_folder",
    deleteGroupFile = "delete_group_file",
    nc_deleteGroupFile = "nc_delete_group_file",
    lgl_uploadImage = "lgl_upload_image",
    moveGroupFile = "move_group_file",
    lgl_renameGroupFileFolder = "lgl_rename_group_file_folder",
    nc_transGroupFile = "nc_trans_group_file",
    nc_renameGroupFile = "nc_rename_group_file",
    nc_getFile = "nc_get_file"
}
/**
 * 文件相关 API
 */
interface OneBotFileApi {
    /** GoQC扩展: 获取群文件资源链接 */
    [OneBotFileApiAction.getGroupFileUrl]: {
        action: 'get_group_file_url';
        params: {
            group_id: number;
            file_id: string;
            /** 废弃属性 */
            busid?: number;
        };
        response: {
            url: string;
        };
    };
    /** GoQC扩展: 获取私聊文件资源链接 */
    [OneBotFileApiAction.getPrivateFileUrl]: {
        action: 'get_private_file_url';
        params: {
            user_id: number;
            file_id: string;
            busid?: number;
        };
        response: {
            url: string;
        };
    };
    /** Lagrange扩展: 获取私聊文件资源链接 */
    [OneBotFileApiAction.lgl_getPrivateFileUrl]: {
        action: 'get_private_file_url';
        params: {
            user_id: number;
            file_id: string;
            file_hash?: string;
        };
        response: {
            url: string;
        };
    };
    /** GoQC扩展: 上传群文件 */
    [OneBotFileApiAction.uploadGroupFile]: {
        action: 'upload_group_file';
        params: {
            group_id: number;
            file: string;
            name: string;
            folder?: string;
        };
        response: null;
    };
    /** GoQC扩展: 上传私聊文件 */
    [OneBotFileApiAction.uploadPrivateFile]: {
        action: 'upload_private_file';
        params: {
            user_id: number;
            file: string;
            name: string;
        };
        response: null;
    };
    /** GoQC扩展: 获取群文件系统信息 */
    [OneBotFileApiAction.getGroupFileSystemInfo]: {
        action: 'get_group_file_system_info';
        params: {
            group_id: number;
        };
        response: {
            file_count: number;
            limit_count: number;
            used_space: number;
            total_space: number;
        };
    };
    /** GoQC扩展: 获取群根目录文件列表 */
    [OneBotFileApiAction.getGroupRootFiles]: {
        action: 'get_group_root_files';
        params: {
            group_id: number;
        };
        response: {
            files: Array<{
                group_id: number;
                file_id: string;
                file_name: string;
                busid: number;
                file_size: number;
                upload_time: number;
                dead_time: number;
                modify_time: number;
                download_times: number;
                uploader: number;
                uploader_name: string;
            }>;
            folders: Array<{
                group_id: number;
                folder_id: string;
                folder_name: string;
                create_time: number;
                creator: number;
                creator_name: string;
                total_file_count: number;
            }>;
        };
    };
    /** GoQC扩展: 获取群子目录文件列表 */
    [OneBotFileApiAction.getGroupFilesByFolder]: {
        action: 'get_group_files_by_folder';
        params: {
            group_id: number;
            folder_id: string;
        };
        response: {
            files: Array<{
                group_id: number;
                file_id: string;
                file_name: string;
                busid: number;
                file_size: number;
                upload_time: number;
                dead_time: number;
                modify_time: number;
                download_times: number;
                uploader: number;
                uploader_name: string;
            }>;
            folders: Array<{
                group_id: number;
                folder_id: string;
                folder_name: string;
                create_time: number;
                creator: number;
                creator_name: string;
                total_file_count: number;
            }>;
        };
    };
    /** GoQC扩展: 创建群文件文件夹 */
    [OneBotFileApiAction.createGroupFileFolder]: {
        action: 'create_group_file_folder';
        params: {
            group_id: number;
            name: string;
        };
        response: null;
    };
    /** GoQC扩展: 删除群文件文件夹 */
    [OneBotFileApiAction.deleteGroupFolder]: {
        action: 'delete_group_folder';
        params: {
            group_id: number;
            folder_id: string;
        };
        response: null;
    };
    /** GoQC扩展: 删除群文件 */
    [OneBotFileApiAction.deleteGroupFile]: {
        action: 'delete_group_file';
        params: {
            group_id: number;
            file_id: string;
            busid: number;
        };
        response: null;
    };
    /** NapCat/Lagrange扩展: 删除群文件 */
    [OneBotFileApiAction.nc_deleteGroupFile]: {
        action: 'delete_group_file';
        params: {
            group_id: number;
            file_id: string;
        };
        response: null;
    };
    /** Lagrange扩展: 上传图片 */
    [OneBotFileApiAction.lgl_uploadImage]: {
        action: 'upload_image';
        params: {
            file: string;
        };
        response: {
            file: string;
            url: string;
        };
    };
    /** 社区扩展: 移动群文件 */
    [OneBotFileApiAction.moveGroupFile]: {
        action: 'move_group_file';
        params: {
            group_id: number;
            file_id: string;
            folder_id: string;
        };
        response: {
            success: boolean;
        };
    };
    /** Lagrange扩展: 重命名群文件文件夹 */
    [OneBotFileApiAction.lgl_renameGroupFileFolder]: {
        action: 'rename_group_file_folder';
        params: {
            group_id: number;
            folder_id: string;
            new_name: string;
        };
        response: {
            success: boolean;
        };
    };
    /** NapCat扩展: 转发群文件 */
    [OneBotFileApiAction.nc_transGroupFile]: {
        action: 'trans_group_file';
        params: {
            group_id: number;
            file_id: string;
        };
        response: {
            ok: boolean;
        };
    };
    /** NapCat扩展: 重命名群文件 */
    [OneBotFileApiAction.nc_renameGroupFile]: {
        action: 'rename_group_file';
        params: {
            group_id: number;
            file_id: string;
            current_parent_directory: string;
            new_name: string;
        };
        response: {
            ok: boolean;
        };
    };
    /** NapCat扩展: 获取文件 */
    [OneBotFileApiAction.nc_getFile]: {
        action: 'get_file';
        params: {
            file: string;
        };
        response: {
            file: string;
            url: string;
            file_size: string;
            file_name: string;
            base64: string;
        };
    };
}

/**
 * OneBot API 接口
 */
interface OneBotApi extends OneBotMessageApi, OneBotFriendApi, OneBotGroupApi, OneBotBotApi, OneBotOtherApi, OneBotFileApi {
}

/**
 * OneBot核心类
 * @extends EventEmitter
 */
declare abstract class OneBotCore extends EventEmitter$1 {
    /** 是否主动关闭 */
    _manualClosed: boolean;
    /** 协议信息 */
    protocol: {
        /** 协议名称 例如`NapCat` */
        name: string;
        /** 协议版本 */
        version: string;
        /** 协议连接时间 */
        connectTime: number;
    };
    /** 机器人信息 */
    self: {
        /** 机器人ID */
        id: number;
        /** 机器人昵称 */
        nickname: string;
        /** 机器人头像 */
        avatar: string;
    };
    /** 配置 */
    _options: {
        timeout: number;
    };
    constructor(options?: {
        timeout?: number;
    });
    /**
     * 判断是否为echo事件
     * @param data - 事件数据
     */
    isEcho(data: OneBotWsEvent): data is Echo;
    /**
     * 将`base64://`转为`base64://...`
     */
    _formatBase64(base64: string): string;
    /**
     * 格式化API动作
     * @param action - API动作
     * @returns 格式化后的API动作
     */
    _formatAction(action: string): string;
    /**
     * 格式化Api返回错误
     */
    _formatApiError(action: string, params: string, error: unknown): Error;
    /**
     * 初始化Bot基本信息
     * @param maxRetries - 最大重试次数
     * @param retryInterval - 重试间隔(毫秒)
     * @returns 是否初始化成功
     */
    _initBotInfo(maxRetries?: number, retryInterval?: number): Promise<boolean>;
    /**
   * 添加事件监听
   * @param event - 事件名称 请导入`OneBotEventKey`枚举使用
   * @param listener - 事件监听器
   */
    on<K extends keyof OneBotOnEvent>(event: K, listener: (arg: OneBotOnEvent[K]) => void): this;
    /**
     * 添加一次性事件监听
     * @param event - 事件名称 请导入`OneBotEventKey`枚举使用
     * @param listener - 事件监听器
     */
    once<K extends keyof OneBotOnEvent>(event: K, listener: (arg: OneBotOnEvent[K]) => void): this;
    /**
     * 触发事件
     * @param event - 事件名称 请导入`OneBotEventKey`枚举使用
     * @param arg - 事件参数
     */
    emit<K extends keyof OneBotOnEvent>(event: K, arg?: OneBotOnEvent[K]): boolean;
    /**
     * 移除事件监听
     * @param event - 事件名称 请导入`OneBotEventKey`枚举使用
     * @param listener - 事件监听器
     */
    off<K extends keyof OneBotOnEvent>(event: K, listener: (arg: OneBotOnEvent[K]) => void): this;
    /**
     * 移除事件监听
     * @param event - 事件名称 请导入`OneBotEventKey`枚举使用
     * @param listener - 事件监听器
     */
    removeListener<K extends keyof OneBotOnEvent>(event: K, listener: (arg: OneBotOnEvent[K]) => void): this;
    /**
     * 移除所有事件监听
     * @param event - 事件名称 请导入`OneBotEventKey`枚举使用
     */
    removeAllListeners<K extends keyof OneBotOnEvent>(event?: K): this;
    /**
     * 获取事件监听器
     * @param event - 事件名称 请导入`OneBotEventKey`枚举使用
     * @returns 事件监听器
     */
    listeners<K extends keyof OneBotOnEvent>(event: K): Function[];
    /**
     * 获取事件监听器数量
     * @param event - 事件名称 请导入`OneBotEventKey`枚举使用
     * @returns 事件监听器数量
     */
    listenerCount<K extends keyof OneBotOnEvent>(event: K): number;
    /** 机器人ID */
    get self_id(): number;
    /**
     * 初始化
     */
    init(): Promise<void>;
    /**
     * 事件分发
     * @param data - 事件数据
     */
    _dispatch(data: OneBotEvent): void;
    /**
     * 发送API请求
     * @param action - API动作
     * @param params - API参数
     * @param timeout - 超时时间
     * @returns
     */
    sendApi<T extends keyof OneBotApi>(_action: T, _params: OneBotApi[T]['params'], _timeout?: number): Promise<OneBotApi[T]['response']>;
    /**
     * 发送消息
     * @param message_type - 消息类型
     * @param user_id - 用户ID
     * @param message - 消息
     * @returns 消息ID
     */
    sendMsg(message_type: 'private' | 'group', user_id: number, message: OneBotMessage[]): Promise<{
        message_id: number;
    }>;
    /**
     * 发送私聊消息
     * @param user_id - 用户ID
     * @param message - 消息
     * @returns 消息ID
     */
    sendPrivateMsg(user_id: number, message: OneBotMessage[]): Promise<{
        message_id: number;
    }>;
    /**
     * 发送群消息
     * @param group_id - 群ID
     * @param message - 消息
     * @returns 消息ID
     */
    sendGroupMsg(group_id: number, message: OneBotMessage[]): Promise<{
        message_id: number;
    }>;
    /**
     * 撤回消息
     * @param message_id - 消息ID
     * @returns
     */
    deleteMsg(message_id: number): Promise<null>;
    /**
     * 获取消息
     * @param message_id - 消息ID
     * @returns 消息详情
     */
    getMsg(message_id: number): Promise<{
        time: number;
        message_type: "group";
        message_id: number;
        real_id: number;
        sender: SenderGroup;
        message: OneBotMessage[];
        group_id: number;
    } | {
        time: number;
        message_type: "private";
        message_id: number;
        real_id: number;
        sender: SenderPrivate;
        message: OneBotMessage[];
    }>;
    /**
     * 获取合并转发消息
     * @param id - 合并转发ID
     * @returns 合并转发消息
     */
    getForwardMsg(id: string): Promise<{
        message: NodeMessage[];
    }>;
    /**
     * 设置消息表情回应
     * @param message_id - 消息ID
     * @param emoji_id - 表情ID
     * @param set - 设置或取消
     * @returns 操作结果
     */
    setMessageReaction(message_id: number, emoji_id: string, set: boolean): Promise<{
        result: number;
        errMsg: string;
    }>;
    /**
     * NapCat扩展: 获取消息的表情已回应列表
     * @param message_id - 消息ID
     * @param user_id - 用户ID
     * @param emojiType - 表情类型
     * @param count - 数量
     * @returns 表情回应列表
     */
    nc_fetchEmojiLike(message_id: number, user_id: number, emojiType: number, count?: number): Promise<{
        result: number;
        errMsg: string;
        emojiLikesList: Array<{
            tinyId: string;
            nickName: string;
            headUrl: string;
        }>;
        cookie: string;
        isLastPage: boolean;
        isFirstPage: boolean;
    }>;
    /**
     * Lagrange扩展: 加入群聊表情接龙
     * @param group_id - 群ID
     * @param message_id - 消息ID
     * @param emoji_id - 表情ID
     * @returns
     */
    lgl_joinGroupEmojiChain(group_id: number, message_id: number, emoji_id: number): Promise<null>;
    /**
     * Lagrange扩展: 加入好友表情接龙
     * @param user_id - 用户ID
     * @param message_id - 消息ID
     * @param emoji_id - 表情ID
     * @returns
     */
    lgl_joinFriendEmojiReaction(user_id: number, message_id: number, emoji_id: number): Promise<null>;
    /**
     * Lagrange扩展: 调用群机器人回调
     * @param group_id - 群ID
     * @param bot_id - 机器人ID
     * @param data_1 - 数据1
     * @param data_2 - 数据2
     * @returns 机器人Uin
     */
    lgl_sendGroupBotCallback(group_id: number, bot_id: number, data_1: string, data_2: string): Promise<number>;
    /**
     * NapCat扩展: 标记私聊消息为已读
     * @param user_id - 用户ID
     * @param message_id - 消息ID
     * @returns
     */
    nc_markPrivateMsgAsRead(user_id?: number, message_id?: number): Promise<null>;
    /**
     * NapCat扩展: 标记群消息为已读
     * @param group_id - 群ID
     * @param message_id - 消息ID
     * @returns
     */
    nc_markGroupMsgAsRead(group_id?: number, message_id?: number): Promise<null>;
    /**
     * NapCat扩展: 标记所有消息为已读
     * @returns
     */
    nc_markAllAsRead(): Promise<null>;
    /**
     * NapCat扩展: 转发好友单条消息
     * @param user_id - 用户ID
     * @param message_id - 消息ID
     * @returns
     */
    nc_forwardFriendSingleMsg(user_id: number, message_id: number): Promise<null>;
    /**
     * NapCat扩展: 转发群单条消息
     * @param group_id - 群ID
     * @param message_id - 消息ID
     * @returns
     */
    nc_forwardGroupSingleMsg(group_id: number, message_id: number): Promise<null>;
    /**
     * GoCQ扩展: 发送合并转发消息
     * @param messages - 消息节点列表
     * @param options - 外显参数
     * @returns 消息ID
     */
    sendForwardMsg(messages: NodeMessage[], options?: {
        news?: Array<{
            text: string;
        }>;
        prompt?: string;
        summary?: string;
        source?: string;
    }): Promise<{
        message_id: string;
        forward_id: string;
        res_id?: string;
    }>;
    /**
     * GoCQ扩展: 发送合并转发(群聊)
     * @param group_id - 群ID
     * @param messages - 消息节点列表
     * @param options - 外显参数
     * @returns 消息ID
     */
    sendGroupForwardMsg(group_id: number, messages: NodeMessage[], options?: {
        news?: Array<{
            text: string;
        }>;
        prompt?: string;
        summary?: string;
        source?: string;
    }): Promise<{
        message_id: string;
        forward_id: string;
        res_id?: string;
    }>;
    /**
     * GoCQ扩展: 发送合并转发(好友)
     * @param user_id - 用户ID
     * @param messages - 消息节点列表
     * @param options - 外显参数
     * @returns 消息ID
     */
    sendPrivateForwardMsg(user_id: number, messages: NodeMessage[], options?: {
        news?: Array<{
            text: string;
        }>;
        prompt?: string;
        summary?: string;
        source?: string;
    }): Promise<{
        message_id: string;
        forward_id: string;
        res_id?: string;
    }>;
    /**
     * GoCQ扩展: 获取群消息历史记录
     * @param group_id - 群ID
     * @param message_seq - 起始消息序号
     * @param count - 获取消息条数 (扩展)
     * @returns 消息历史记录
     */
    getGroupMsgHistory(group_id: number, message_seq: number, count?: number): Promise<{
        messages: Array<{
            message_id: number;
            real_id: number;
            sender: SenderGroup;
            time: number;
            message: OneBotMessage[];
            raw_message: string;
        }>;
    }>;
    /**
     * NapCat扩展: 获取群消息历史记录
     * @param group_id - 群ID
     * @param message_seq - 起始消息序列号
     * @param count - 获取消息条数 (扩展)
     * @param reverse - 是否倒序 (扩展)
     * @returns 消息历史记录
     */
    nc_getGroupMsgHistory(group_id: number, message_seq: number, count?: number, 
    /** 是否倒序 可选 默认false */
    reverse?: boolean): Promise<{
        messages: Array<{
            message_id: number;
            real_id: number;
            sender: SenderGroup;
            time: number;
            message: OneBotMessage[];
            raw_message: string;
        }>;
    }>;
    /**
     * Lagrange扩展: 获取群消息历史记录
     * @param group_id - 群ID
     * @param message_id - 起始消息ID
     * @param count - 获取消息条数 (扩展)
     * @returns 消息历史记录
     */
    lgl_getGroupMsgHistory(group_id: number, message_id: number, count?: number): Promise<{
        messages: Array<{
            message_id: number;
            real_id: number;
            sender: SenderGroup;
            time: number;
            message: OneBotMessage[];
            raw_message: string;
        }>;
    }>;
    /**
     * NapCat扩展: 获取好友消息历史记录
     * @param user_id - 用户ID
     * @param message_seq - 起始消息序列号
     * @param count - 获取消息条数 (扩展)
     * @param reverse - 是否倒序 (扩展)
     * @returns 消息历史记录
     */
    nc_getFriendMsgHistory(user_id: number, message_seq: number, count?: number, 
    /** 是否倒序 可选 默认false */
    reverse?: boolean): Promise<{
        messages: Array<{
            message_id: number;
            real_id: number;
            sender: SenderPrivate;
            time: number;
            message: OneBotMessage[];
            raw_message: string;
        }>;
    }>;
    /**
     * Lagrange扩展: 获取好友消息历史记录
     * @param user_id - 用户ID
     * @param message_id - 起始消息ID
     * @param count - 获取消息条数 (扩展)
     * @returns 消息历史记录
     */
    lgl_getFriendMsgHistory(user_id: number, message_id: number, count?: number): Promise<{
        messages: Array<{
            message_id: number;
            real_id: number;
            sender: SenderPrivate;
            time: number;
            message: OneBotMessage[];
            raw_message: string;
        }>;
    }>;
    /**
     * 获取 Ai 声色列表
     * @returns Ai声色列表
     */
    getAiCharacters(): Promise<{
        character_id: string;
        character_name: string;
        preview_url: string;
    }[]>;
    /**
     * 发送群 Ai 语音
     * @param group_id - 群ID
     * @param text - 文本内容
     * @param character_id - 角色ID
     * @returns 消息ID
     */
    sendGroupAiRecord(group_id: number, text: string, character_id: string): Promise<{
        message_id: number;
    }>;
    /**
     * Lagrange扩展: 标记消息为已读
     * @param message_id - 消息ID
     * @returns
     */
    lgl_markMsgAsRead(message_id: number): Promise<null>;
    /**
     * Lagrange扩展: 给消息添加表情回应
     * @param group_id - 群ID
     * @param message_id - 消息ID
     * @param code - 表情ID
     * @param is_add - 是否为添加
     * @returns
     */
    lgl_setGroupReaction(group_id: number, message_id: number, code: string, is_add: boolean): Promise<null>;
    /**
     * NapCat扩展: 给消息添加表情回应
     * @param message_id - 消息ID
     * @param emoji_id - 表情ID
     * @param set - 设置或取消
     * @returns 操作结果
     */
    nc_setMsgEmojiLike(message_id: number, emoji_id: string, set: boolean): Promise<{
        result: number;
        errMsg: string;
    }>;
    /**
     * 发送好友赞
     * @param user_id - 用户ID
     * @param times - 赞的次数
     */
    sendLike(user_id: number, times?: number): Promise<null>;
    /**
     * 处理加好友请求
     * @param flag - 请求标识
     * @param approve - 是否同意
     * @param remark - 备注
     */
    setFriendAddRequest(flag: string, approve: boolean, remark?: string): Promise<null>;
    /**
     * Lagrange扩展: 处理加好友请求
     * @param flag - 请求标识
     * @param approve - 是否同意
     * @param reason - 理由
     */
    lgl_setFriendAddRequest(flag: string, approve: boolean, reason?: string): Promise<null>;
    /**
     * 获取陌生人信息
     * @param user_id - 用户ID
     * @param no_cache - 是否不使用缓存
     */
    getStrangerInfo(user_id: number, no_cache?: boolean): Promise<{
        [key: string]: any;
        user_id: number;
        nickname: string;
        sex: Sex;
        age: number;
    }>;
    /**
     * NapCat扩展: 获取陌生人信息
     * @param user_id - 用户ID
     */
    nc_getStrangerInfo(user_id: number): Promise<{
        [key: string]: any;
        user_id: number;
        nickname: string;
        sex: Sex;
        age: number;
    }>;
    /**
     * 获取好友列表
     */
    getFriendList(): Promise<{
        [key: string]: any;
        user_id: number;
        nickname: string;
        remark: string;
    }[]>;
    /**
     * NapCat扩展: 获取好友列表
     * @param no_cache - 是否不使用缓存
     */
    nc_getFriendList(no_cache?: boolean): Promise<{
        user_id: number;
        nickname: string;
        remark: string;
        birthday_year: number;
        birthday_month: number;
        birthday_day: number;
        age: number;
        phone_num: string;
        email: string;
        category_id: number;
        sex: Sex;
        level: number;
    }[]>;
    /**
     * Lagrange扩展: 获取好友列表
     */
    lgl_getFriendList(): Promise<{
        user_id: number;
        nickname: string;
        remark: string;
        q_id: string;
        group: {
            group_id: number;
            group_name: string;
        };
    }[]>;
    /**
     * GoCQ扩展: 获取单向好友列表
     */
    getUnidirectionalFriendList(): Promise<{
        user_id: number;
        nickname: string;
    }[]>;
    /**
     * NapCat扩展: 获取单向好友列表
     */
    nc_getUnidirectionalFriendList(): Promise<{
        uin: number;
        uid: string;
        nick_name: string;
        age: number;
        source: string;
    }[]>;
    /**
     * GoCQ扩展: 删除好友
     * @param user_id - 用户ID
     */
    deleteFriend(user_id: number): Promise<null>;
    /**
     * NapCat扩展: 删除好友
     * @param user_id - 用户ID
     * @param friend_id - 好友ID
     * @param temp_block - 临时拉黑
     * @param temp_both_del - 临时双向删除
     */
    nc_deleteFriend(user_id: number, friend_id?: number, temp_block?: boolean, temp_both_del?: boolean): Promise<{
        result: number;
        errMsg: string;
    }>;
    /**
     * Lagrange扩展: 删除好友
     * @param user_id - 用户ID
     * @param block - 是否拉黑
     */
    lgl_deleteFriend(user_id: number, block: boolean): Promise<null>;
    /**
     * GoCQ扩展: 删除单向好友
     * @param user_id - 用户ID
     */
    deleteUnidirectionalFriend(user_id: number): Promise<null>;
    /**
     * NapCat扩展: 设置好友备注
     * @param user_id - 用户ID
     * @param remark - 备注
     */
    nc_setFriendRemark(user_id: number, remark: string): Promise<null>;
    /**
     * NapCat扩展: 获取分类的好友列表
     */
    nc_getFriendsWithCategory(): Promise<{
        categoryId: number;
        categorySortId: number;
        categoryName: string;
        categoryMbCount: number;
        onlineCount: number;
        buddyList: Array<{
            birthday_year: number;
            birthday_month: number;
            birthday_day: number;
            user_id: number;
            age: number;
            phone_num: string;
            email: string;
            category_id: number;
            nickname: string;
            remark: string;
            sex: Sex;
            level: number;
        }>;
    }[]>;
    /**
     * NapCat扩展: 获取可疑好友请求
     */
    nc_getDoubtFriendsAddRequest(): Promise<{
        flag: string;
        uin: string;
        nick: string;
        source: string;
        reason: string;
        msg: string;
        group_code: string;
        time: string;
        type: string;
    }[]>;
    /**
     * NapCat扩展: 处理可疑好友请求
     * @param request_id - 请求ID
     * @param approve - 是否同意
     */
    nc_setDoubtFriendsAddRequest(request_id: string, approve: boolean): Promise<null>;
    /**
     * NapCat扩展: 好友戳一戳
     * @param user_id - 用户ID
     * @param target_id - 目标ID
     */
    nc_friendPoke(user_id?: number, target_id?: number): Promise<null>;
    /** Lagrange扩展: 好友戳一戳
     * @param user_id - 用户ID
     * @param target_id - 目标ID
     */
    lgl_friendPoke(user_id?: number, target_id?: number): Promise<null>;
    /**
     * 群组踢人
     * @param group_id - 群ID
     * @param user_id - 用户ID
     * @param reject_add_request - 是否拒绝再次加群
     */
    setGroupKick(group_id: number, user_id: number, reject_add_request?: boolean): Promise<null>;
    /**
     * 群组单人禁言
     * @param group_id - 群ID
     * @param user_id - 用户ID
     * @param duration - 禁言时长
     */
    setGroupBan(group_id: number, user_id: number, duration?: number): Promise<null>;
    /**
     * 群组匿名用户禁言
     * @param group_id - 群ID
     * @param anonymous - 匿名对象
     * @param flag - 匿名标识
     * @param duration - 禁言时长
     */
    setGroupAnonymousBan(group_id: number, anonymous?: {
        id: number;
        name: string;
        flag: string;
    }, flag?: string, duration?: number): Promise<null>;
    /**
     * 群组全员禁言
     * @param group_id - 群ID
     * @param enable - 是否启用
     */
    setGroupWholeBan(group_id: number, enable?: boolean): Promise<null>;
    /**
     * 群组设置管理员
     * @param group_id - 群ID
     * @param user_id - 用户ID
     * @param enable - 是否设置为管理员
     */
    setGroupAdmin(group_id: number, user_id: number, enable?: boolean): Promise<null>;
    /**
     * 群组匿名
     * @param group_id - 群ID
     * @param enable - 是否启用
     */
    setGroupAnonymous(group_id: number, enable?: boolean): Promise<null>;
    /**
     * 设置群名片（群备注）
     * @param group_id - 群ID
     * @param user_id - 用户ID
     * @param card - 名片
     */
    setGroupCard(group_id: number, user_id: number, card?: string): Promise<null>;
    /**
     * 设置群名
     * @param group_id - 群ID
     * @param group_name - 群名
     */
    setGroupName(group_id: number, group_name: string): Promise<null>;
    /**
     * 退出群组
     * @param group_id - 群ID
     * @param is_dismiss - 是否解散
     */
    setGroupLeave(group_id: number, is_dismiss?: boolean): Promise<null>;
    /**
     * Lagrange扩展: 退出群组
     * @param group_id - 群ID
     */
    lgl_setGroupLeave(group_id: number): Promise<null>;
    /**
     * 设置群组专属头衔
     * @param group_id - 群ID
     * @param user_id - 用户ID
     * @param special_title - 头衔
     * @param duration - 时长
     */
    setGroupSpecialTitle(group_id: number, user_id: number, special_title?: string, duration?: number): Promise<null>;
    /**
     * 获取群信息
     * @param group_id - 群ID
     * @param no_cache - 是否不使用缓存
     */
    getGroupInfo(group_id: number, no_cache?: boolean): Promise<{
        group_id: number;
        group_name: string;
        member_count: number;
        max_member_count: number;
        owner_id: number;
        admin_flag?: boolean;
        admin_list?: Array<{
            user_id: number;
            nickname: string;
            role: string;
        }>;
        create_time?: number;
        category?: number;
        group_level?: number;
        group_create_time?: number;
        group_memo?: string;
    }>;
    /**
     * 获取群列表
     */
    getGroupList(): Promise<{
        group_id: number;
        group_name: string;
        member_count: number;
        max_member_count: number;
    }[]>;
    /**
     * 获取群成员信息
     * @param group_id - 群ID
     * @param user_id - 用户ID
     * @param no_cache - 是否不使用缓存
     */
    getGroupMemberInfo(group_id: number, user_id: number, no_cache?: boolean): Promise<{
        group_id: number;
        user_id: number;
        nickname: string;
        card: string;
        sex: Sex;
        age: number;
        area: string;
        join_time: number;
        last_sent_time: number;
        level: string;
        role: string;
        unfriendly: boolean;
        title: string;
        title_expire_time: number;
        card_changeable: boolean;
        shut_up_timestamp: number;
    }>;
    /**
     * 获取群成员列表
     * @param group_id - 群ID
     * @param no_cache - 是否不使用缓存
     */
    getGroupMemberList(group_id: number, no_cache?: boolean): Promise<{
        group_id: number;
        user_id: number;
        nickname: string;
        card: string;
        sex: Sex;
        age: number;
        area: string;
        join_time: number;
        last_sent_time: number;
        level: string;
        role: string;
        unfriendly: boolean;
        title: string;
        title_expire_time: number;
        card_changeable: boolean;
        shut_up_timestamp: number;
    }[]>;
    /**
     * 获取群荣誉信息
     * @param group_id - 群ID
     * @param type - 荣誉类型
     */
    getGroupHonorInfo(group_id: number, type: string): Promise<{
        group_id: number;
        current_talkative?: {
            user_id: number;
            nickname: string;
            avatar: string;
            day_count: number;
        };
        talkative_list?: Array<{
            user_id: number;
            nickname: string;
            avatar: string;
            description: string;
        }>;
        performer_list?: Array<{
            user_id: number;
            nickname: string;
            avatar: string;
            description: string;
        }>;
        legend_list?: Array<{
            user_id: number;
            nickname: string;
            avatar: string;
            description: string;
        }>;
        strong_newbie_list?: Array<{
            user_id: number;
            nickname: string;
            avatar: string;
            description: string;
        }>;
        emotion_list?: Array<{
            user_id: number;
            nickname: string;
            avatar: string;
            description: string;
        }>;
    }>;
    /**
     * 处理加群请求/邀请
     * @param flag - 请求标识
     * @param sub_type - 类型
     * @param approve - 是否同意
     * @param reason - 理由
     */
    setGroupAddRequest(flag: string, sub_type: 'add' | 'invite', approve: boolean, reason?: string): Promise<null>;
    /**
     * GoCQ拓展: 设置群头像
     * @param group_id - 群ID
     * @param file - 文件
     * @param cache - 缓存
     */
    setGroupPortrait(group_id: number, file: string, cache?: number): Promise<null>;
    /**
     * GoCQ拓展: 设置精华消息
     * @param message_id - 消息ID
     */
    setEssenceMsg(message_id: number): Promise<null>;
    /**
     * GoCQ拓展: 移出精华消息
     * @param message_id - 消息ID
     */
    deleteEssenceMsg(message_id: number): Promise<null>;
    /**
     * GoCQ拓展: 获取精华消息列表
     * @param group_id - 群ID
     */
    getEssenceMsgList(group_id: number): Promise<{
        sender_id: number;
        sender_nick: string;
        sender_time: number;
        operator_id: number;
        operator_nick: string;
        operator_time: number;
        message_id: number;
        content: string;
    }[]>;
    /**
     * GoCQ拓展: 群打卡
     * @param group_id - 群ID
     */
    sendGroupSign(group_id: number): Promise<null>;
    /**
     * GoCQ拓展: 获取群公告
     * @param group_id - 群ID
     */
    getGroupNotice(group_id: number): Promise<{
        sender_id: number;
        publish_time: number;
        message: {
            text: string;
            images: Array<{
                height: string;
                width: string;
                id: string;
            }>;
        };
    }[]>;
    /**
     * GoCQ拓展: 发送群公告
     * @param group_id - 群ID
     * @param content - 内容
     * @param image - 图片
     */
    sendGroupNotice(group_id: number, content: string, image?: string): Promise<null>;
    /**
     * GoCQ拓展: 删除群公告
     * @param group_id - 群ID
     * @param notice_id - 公告ID
     */
    delGroupNotice(group_id: number, notice_id: string): Promise<null>;
    /**
     * GoCQ拓展: 获取群系统消息
     */
    getGroupSystemMsg(): Promise<{
        invited_requests: Array<{
            request_id: number;
            invitor_uin: number;
            invitor_nick: string;
            group_id: number;
            group_name: string;
            checked: boolean;
            actor: number;
        }>;
        join_requests: Array<{
            request_id: number;
            requester_uin: number;
            requester_nick: string;
            message: string;
            group_id: number;
            group_name: string;
            checked: boolean;
            actor: number;
        }>;
    }>;
    /**
     * GoCQ拓展: 获取群@全体成员剩余次数
     * @param group_id - 群ID
     */
    getGroupAtAllRemain(group_id: number): Promise<{
        can_at_all: boolean;
        remain_at_all_count_for_group: number;
        remain_at_all_count_for_uin: number;
    }>;
    /**
     * Lagrange拓展: 设置群Bot发言状态
     * @param group_id - 群ID
     * @param status - 状态
     */
    lgl_setGroupBotStatus(group_id: number, status: 'normal' | 'readonly'): Promise<null>;
    /**
     * NapCat拓展: 群组踢多人
     * @param group_id - 群ID
     * @param user_ids - 用户ID数组
     * @param reject_add_request - 是否拒绝再次加群
     */
    nc_setGroupKickMembers(group_id: number, user_ids: number[], reject_add_request?: boolean): Promise<null>;
    /**
     * NapCat拓展: 设置机器人进群选项
     * @param group_id - 群ID
     * @param option - 选项
     */
    nc_setGroupRobotAddOption(group_id: number, option: 'ignore' | 'discuss' | 'agree' | 'reject'): Promise<null>;
    /**
     * NapCat拓展: 设置群添加选项
     * @param group_id - 群ID
     * @param option - 选项
     */
    nc_setGroupAddOption(group_id: number, option: 'ignore' | 'discuss' | 'agree' | 'reject'): Promise<null>;
    /**
     * NapCat拓展: 设置群搜索
     * @param group_id - 群ID
     * @param enable - 是否启用
     */
    nc_setGroupSearch(group_id: number, enable: boolean): Promise<null>;
    /**
     * NapCat拓展: 设置群备注
     * @param group_id - 群ID
     * @param remark - 备注
     */
    nc_setGroupRemark(group_id: number, remark: string): Promise<null>;
    /**
     * NapCat拓展: 群内戳一戳
     * @param group_id - 群ID
     * @param user_id - 用户ID
     */
    nc_groupPoke(group_id: number, user_id: number): Promise<null>;
    /** Lagrange拓展: 群内戳一戳
     * @param group_id - 群ID
     * @param user_id - 用户ID
     */
    lgl_groupPoke(group_id: number, user_id: number): Promise<null>;
    /**
     * NapCat拓展: 获取群信息扩展
     * @param group_id - 群ID
     */
    nc_getGroupInfoEx(group_id: number): Promise<{
        group_id: number;
        group_name: string;
        member_count: number;
        max_member_count: number;
        owner_id: number;
        admin_flag: boolean;
        last_join_time: number;
        group_flag: number;
        group_flag_ext: number;
        group_create_time: number;
        group_level: number;
        group_face: number;
        group_default_page: number;
        group_info_seq: number;
        group_roaming_time: number;
        group_option: Array<{
            option: number;
            value: number;
        }>;
        group_admin_option: Array<{
            option: number;
            value: number;
        }>;
    }>;
    /**
     * NapCat拓展: 获取群详细信息
     * @param group_id - 群ID
     */
    nc_getGroupDetailInfo(group_id: number): Promise<{
        group_id: number;
        group_name: string;
        create_time: number;
        member_count: number;
        max_member_count: number;
        member_admin_count: number;
        introduce: string;
        grade: number;
        active_member_count: number;
        certification_type: number;
        certification_text: string;
        group_flag: number;
        type_flag: number;
    }>;
    /**
     * NapCat拓展: 获取群忽略添加请求
     * @param group_id - 群ID
     */
    nc_getGroupIgnoreAddRequest(group_id: number): Promise<{
        request_id: number;
        message: string;
        group_id: number;
        group_name: string;
        checked: boolean;
        actor: number;
        requester_uin: number;
        requester_nick: string;
    }[]>;
    /**
     * NapCat拓展: 获取群禁言列表
     * @param group_id - 群ID
     */
    nc_getGroupShutList(group_id: number): Promise<{
        uin: number;
        user_id: number;
        nick: string;
        shut_up_timestamp: number;
    }[]>;
    /**
     * NapCat扩展: 获取群过滤系统消息
     * @param group_id - 群ID
     */
    nc_getGroupIgnoredNotifies(group_id: number): Promise<{
        InvitedRequest: Array<{
            request_id: number;
            invitor_uin: number;
            invitor_nick: string;
            group_id: number;
            message: string;
            group_name: string;
            checked: boolean;
            actor: number;
            requester_nick: string;
        }>;
        join_requests: Array<{
            request_id: number;
            requester_nick: string;
            message: string;
            group_id: number;
            group_name: string;
            checked: boolean;
            actor: number;
            invitor_uin: number;
            invitor_nick: string;
        }>;
    }>;
    /**
     * GoCQ扩展: 获取群文件资源链接
     * @param group_id - 群ID
     * @param file_id - 文件ID
     * @param busid - 业务ID 废弃属性
     */
    getGroupFileUrl(group_id: number, file_id: string, busid?: number): Promise<{
        url: string;
    }>;
    /**
     * GoCQ扩展: 获取私聊文件资源链接
     * @param user_id - 用户ID
     * @param file_id - 文件ID
     * @param busid - 业务ID 废弃属性
     */
    getPrivateFileUrl(user_id: number, file_id: string, busid?: number): Promise<{
        url: string;
    }>;
    /**
     * Lagrange扩展: 获取私聊文件资源链接
     * @param user_id - 用户ID
     * @param file_id - 文件ID
     * @param file_hash - 文件哈希
     */
    lgl_getPrivateFileUrl(user_id: number, file_id: string, file_hash?: string): Promise<{
        url: string;
    }>;
    /**
     * GoCQ扩展: 上传群文件
     * @param group_id - 群ID
     * @param file - 文件路径
     * @param name - 文件名
     * @param folder - 文件夹
     */
    uploadGroupFile(group_id: number, file: string, name: string, folder?: string): Promise<null>;
    /**
     * GoCQ扩展: 上传私聊文件
     * @param user_id - 用户ID
     * @param file - 文件路径
     * @param name - 文件名
     */
    uploadPrivateFile(user_id: number, file: string, name: string): Promise<null>;
    /**
     * GoCQ扩展: 获取群文件系统信息
     * @param group_id - 群ID
     */
    getGroupFileSystemInfo(group_id: number): Promise<{
        file_count: number;
        limit_count: number;
        used_space: number;
        total_space: number;
    }>;
    /**
     * GoCQ扩展: 获取群根目录文件列表
     * @param group_id - 群ID
     */
    getGroupRootFiles(group_id: number): Promise<{
        files: Array<{
            group_id: number;
            file_id: string;
            file_name: string;
            busid: number;
            file_size: number;
            upload_time: number;
            dead_time: number;
            modify_time: number;
            download_times: number;
            uploader: number;
            uploader_name: string;
        }>;
        folders: Array<{
            group_id: number;
            folder_id: string;
            folder_name: string;
            create_time: number;
            creator: number;
            creator_name: string;
            total_file_count: number;
        }>;
    }>;
    /**
     * GoCQ扩展: 获取群子目录文件列表
     * @param group_id - 群ID
     * @param folder_id - 文件夹ID
     */
    getGroupFilesByFolder(group_id: number, folder_id: string): Promise<{
        files: Array<{
            group_id: number;
            file_id: string;
            file_name: string;
            busid: number;
            file_size: number;
            upload_time: number;
            dead_time: number;
            modify_time: number;
            download_times: number;
            uploader: number;
            uploader_name: string;
        }>;
        folders: Array<{
            group_id: number;
            folder_id: string;
            folder_name: string;
            create_time: number;
            creator: number;
            creator_name: string;
            total_file_count: number;
        }>;
    }>;
    /**
     * GoCQ扩展: 创建群文件文件夹
     * @param group_id - 群ID
     * @param name - 文件夹名
     */
    createGroupFileFolder(group_id: number, name: string): Promise<null>;
    /**
     * GoCQ扩展: 删除群文件文件夹
     * @param group_id - 群ID
     * @param folder_id - 文件夹ID
     */
    deleteGroupFolder(group_id: number, folder_id: string): Promise<null>;
    /**
     * GoCQ扩展: 删除群文件
     * @param group_id - 群ID
     * @param file_id - 文件ID
     * @param busid - 业务ID
     */
    deleteGroupFile(group_id: number, file_id: string, busid: number): Promise<null>;
    /**
     * NapCat/Lagrange扩展: 删除群文件
     * @param group_id - 群ID
     * @param file_id - 文件ID
     */
    nc_deleteGroupFile(group_id: number, file_id: string): Promise<null>;
    /**
     * Lagrange扩展: 上传图片
     * @param file - 文件路径
     */
    lgl_uploadImage(file: string): Promise<{
        file: string;
        url: string;
    }>;
    /**
     * 社区扩展: 移动群文件
     * @param group_id - 群ID
     * @param file_id - 文件ID
     * @param folder_id - 文件夹ID
     */
    moveGroupFile(group_id: number, file_id: string, folder_id: string): Promise<{
        success: boolean;
    }>;
    /**
     * Lagrange扩展: 重命名群文件文件夹
     * @param group_id - 群ID
     * @param folder_id - 文件夹ID
     * @param new_name - 新名称
     */
    lgl_renameGroupFileFolder(group_id: number, folder_id: string, new_name: string): Promise<{
        success: boolean;
    }>;
    /**
     * NapCat扩展: 转发群文件
     * @param group_id - 群ID
     * @param file_id - 文件ID
     */
    nc_transGroupFile(group_id: number, file_id: string): Promise<{
        ok: boolean;
    }>;
    /**
     * NapCat扩展: 重命名群文件
     * @param group_id - 群ID
     * @param file_id - 文件ID
     * @param current_parent_directory - 当前父目录
     * @param new_name - 新名称
     */
    nc_renameGroupFile(group_id: number, file_id: string, current_parent_directory: string, new_name: string): Promise<{
        ok: boolean;
    }>;
    /**
     * NapCat扩展: 获取文件
     * @param file_id - 文件ID
     */
    nc_getFile(file: string): Promise<{
        file: string;
        url: string;
        file_size: string;
        file_name: string;
        base64: string;
    }>;
    /**
     * 获取登录号信息
     */
    getLoginInfo(): Promise<{
        user_id: number;
        nickname: string;
    }>;
    /**
     * 获取版本信息
     */
    getVersionInfo(): Promise<{
        app_name: string;
        app_version: string;
        protocol_version: string;
    }>;
    /**
     * 获取状态
     */
    getStatus(): Promise<{
        [key: string]: any;
        online: boolean;
        good: boolean;
        stat: Record<string, any>;
    }>;
    /**
     * 获取Cookies
     * @param domain - 域名
     */
    getCookies(domain: string): Promise<{
        cookies: string;
    }>;
    /**
     * NapCat扩展: 获取Cookies
     * @param domain - 域名
     */
    nc_getCookies(domain: string): Promise<{
        cookies: string;
        bkn: string;
    }>;
    /**
     * 获取CSRF Token
     */
    getCsrfToken(): Promise<{
        token: number;
    }>;
    /**
     * 获取QQ相关接口凭证
     * @param domain - 域名
     */
    getCredentials(domain: string): Promise<{
        cookies: string;
        csrf_token: number;
    }>;
    /**
     * 获取语音
     * @param file - 文件名
     * @param out_format - 输出格式
     */
    getRecord(file: string, out_format: string): Promise<{
        file: string;
    }>;
    /**
     * NapCat扩展: 获取语音
     * @param out_format - 输出格式
     * @param file - 文件名
     * @param file_id - 文件ID
     */
    nc_getRecord(out_format: string, file?: string, file_id?: string): Promise<{
        file: string;
        url: string;
        file_size: string;
        file_name: string;
        base64: string;
    }>;
    /**
     * 获取图片
     * @param file - 文件名
     */
    getImage(file: string): Promise<{
        file: string;
    }>;
    /**
     * NapCat扩展: 获取图片
     * @param file - 文件名
     * @param file_id - 文件ID
     */
    nc_getImage(file?: string, file_id?: string): Promise<{
        file: string;
        url: string;
        file_size: string;
        file_name: string;
        base64: string;
    }>;
    /**
     * 检查是否可以发送图片
     */
    canSendImage(): Promise<{
        yes: boolean;
    }>;
    /**
     * 检查是否可以发送语音
     */
    canSendRecord(): Promise<{
        yes: boolean;
    }>;
    /**
     * 设置登录号资料
     * @param nickname - 昵称
     * @param company - 公司
     * @param email - 邮箱
     * @param college - 学校
     * @param personal_note - 个性签名
     */
    setQqProfile(nickname: string, company: string, email: string, college: string, personal_note: string): Promise<null>;
    /**
     * 获取企点账号信息
     */
    qidianGetAccountInfo(): Promise<{
        master_id: number;
        ext_name: string;
        create_time: number;
    }>;
    /**
     * 获取在线机型
     * @param model - 机型
     */
    getModelShow(model: string): Promise<{
        variants: Array<{
            model_show: string;
            need_pay: boolean;
        }>;
    }>;
    /**
     * 设置在线机型
     * @param model - 机型
     * @param model_show - 展示名
     */
    setModelShow(model: string, model_show: string): Promise<null>;
    /**
     * 获取当前账号在线客户端列表
     * @param no_cache - 是否不使用缓存
     */
    getOnlineClients(no_cache?: boolean): Promise<{
        clients: Array<{
            app_id: number;
            device_name: string;
            device_kind: string;
        }>;
    }>;
    /**
     * 社区扩展: 获取已收藏的QQ表情列表
     */
    fetchCustomFace(): Promise<{
        faces: Array<{
            id: string;
            url: string;
        }>;
    }>;
    /**
     * 社区扩展: 设置QQ头像
     * @param file - 文件路径
     */
    setQqAvatar(file: string): Promise<void>;
    /**
     * 社区扩展: 获取rkey
     */
    getRkey(): Promise<{
        type: "private" | "group";
        rkey: string;
        created_at: number;
        ttl: number;
    }[] | {
        rkeys: Array<{
            type: "private" | "group";
            rkey: string;
            created_at: number;
            ttl: number;
        }>;
    }>;
    /**
     * NapCat扩展: 获取NC版rkey
     */
    nc_getRkey(): Promise<{
        rkey: string;
        ttl: number;
        time: number;
        type: number;
    }>;
    /**
     * Lagrange扩展: 获取mface key
     */
    lgl_getMfaceKey(): Promise<{
        key: string;
    }>;
    /**
     * NapCat扩展: 获取rkey服务器
     */
    nc_getRkeyServer(): Promise<{
        server: string;
    }>;
    /**
     * NapCat扩展: 设置自定义在线状态
     * @param face - 头像
     * @param text - 状态文本
     */
    nc_setDiyOnlineStatus(face: number, text: string): Promise<{
        result: number;
        message: string;
    }>;
    /**
     * NapCat扩展: 设置在线状态
     * @param status - 状态
     */
    nc_setOnlineStatus(status: number): Promise<{
        result: number;
        message: string;
    }>;
    /**
     * NapCat扩展: 设置输入状态
     * @param user_id - 用户ID
     * @param typing - 是否正在输入
     */
    nc_setInputStatus(user_id: number, typing: boolean): Promise<{
        result: number;
        message: string;
    }>;
    /**
     * NapCat扩展: 获取个人资料点赞
     * @param user_id - 用户ID
     */
    nc_getProfileLike(user_id: number): Promise<{
        likeCount: number;
        voteInfo: {
            userInfos: Array<{
                age: number;
                bAvailableCnt: number;
                bTodayVotedCnt: number;
                count: number;
                customId: number;
                gender: number;
                giftCount: number;
                isFriend: boolean;
                isSvip: boolean;
                isvip: boolean;
                lastCharged: number;
                latestTime: number;
                nick: string;
                src: number;
                uid: string;
                uin: number;
            }>;
            total_count: number;
            new_count: number;
            new_nearby_count: number;
            last_visit_time: number;
        };
    }>;
    /**
     * NapCat扩展: 获取官方机器人账号范围
     */
    nc_getRobotUinRange(): Promise<{
        minUin: string;
        maxUin: string;
    }[]>;
    /**
     * NapCat扩展: 设置自己的个性签名
     * @param longNick - 个性签名
     */
    nc_setSelfLongnick(longNick: string): Promise<{
        result: number;
        errMsg: string;
    }>;
    /**
     * NapCat扩展: 获取最近联系人
     * @param count - 数量
     */
    nc_getRecentContact(count?: number): Promise<{
        peerUin: number;
        remark: string;
        msgTime: number;
        chatType: number;
        msgId: number;
        sendNickName: string;
        sendMemberName: string;
        peerName: string;
        lastestMsg?: {
            self_id: number;
            user_id: number;
            time: number;
            real_seq: string;
            message_type: string;
            sender: {
                user_id: number;
                nickname: string;
                sex: Sex;
                age: number;
                card: string;
                role: string;
            };
            raw_message: string;
            font: number;
            sub_type: string;
            message: Array<{
                type: string;
                data: {
                    text: string;
                };
            }>;
            message_format: string;
            post_type: string;
            group_id: number;
        };
    }[]>;
    /**
     * NapCat扩展: 获取用户状态
     * @param user_id - 用户ID
     */
    nc_getUserStatus(user_id: number): Promise<{
        status: number;
        ext_status: number;
    }>;
    /**
     * NapCat扩展: 获取clientkey
     */
    nc_getClientkey(): Promise<{
        clientkey: string;
    }>;
    /**
     * 重启 OneBot 实现
     * @param delay - 延迟
     */
    restartOneBot(delay?: number): Promise<null>;
    /**
     * 清理缓存
     */
    cleanCache(): Promise<null>;
    /**
     * 下载文件到缓存目录
     * @param url - 链接
     * @param thread_count - 线程数
     * @param headers - 请求头
     */
    downloadFile(url: string, thread_count?: number, headers?: Array<string>): Promise<{
        file: string;
    }>;
    /**
     * NapCat扩展: 下载文件到缓存目录
     * @param url - 链接
     * @param base64 - base64
     * @param name - 文件名
     * @param headers - 请求头
     */
    nc_downloadFile(url: string, base64?: string, name?: string, headers?: Array<string>): Promise<{
        file: string;
    }>;
    /**
     * 检查链接安全性
     * @param url - 链接
     */
    checkUrlSafely(url: string): Promise<{
        level: number;
    }>;
    /**
     * 获取中文分词
     * @param content - 内容
     */
    getWordSlices(content: string): Promise<{
        slices: Array<string>;
    }>;
    /**
     * 对事件执行快速操作
     * @param context - 上下文
     * @param operation - 操作
     */
    handleQuickOperation(context: object, operation: object): Promise<null>;
    /**
     * OCR图片
     * @param image - 图片
     */
    ocrImage(image: string): Promise<{
        texts: Array<{
            text: string;
            confidence: number;
            coordinates: Array<{
                x: number;
                y: number;
            }>;
        }>;
        language: string;
    }>;
    /**
     * OCR图片 (别名)
     * @param image - 图片
     */
    dotOcrImage(image: string): Promise<{
        texts: Array<{
            text: string;
            confidence: number;
            coordinates: Array<{
                x: number;
                y: number;
            }>;
        }>;
        language: string;
    }>;
    /**
     * NapCat扩展: OCR图片
     * @param image - 图片
     */
    nc_ocrImage(image: string): Promise<{
        text: string;
        pt1: {
            x: string;
            y: string;
        };
        pt2: {
            x: string;
            y: string;
        };
        pt3: {
            x: string;
            y: string;
        };
        pt4: {
            x: string;
            y: string;
        };
        charBox: Array<{
            charText: string;
            charBox: {
                pt1: {
                    x: string;
                    y: string;
                };
                pt2: {
                    x: string;
                    y: string;
                };
                pt3: {
                    x: string;
                    y: string;
                };
                pt4: {
                    x: string;
                    y: string;
                };
            };
        }>;
        score: string;
    }[]>;
    /**
     * NapCat扩展: 英文翻译为中文
     * @param text - 英文
     */
    nc_translateEn2zh(text: string): Promise<{
        result: string;
    }>;
    /**
     * NapCat扩展: 点击按钮
     * @param message_id - 消息ID
     * @param button_index - 按钮索引
     */
    nc_clickInlineKeyboardButton(message_id: number, button_index: number): Promise<{
        result: boolean;
    }>;
    /**
     * NapCat扩展: 获取推荐好友/群聊卡片
     * @param user_id - 用户ID
     */
    nc_arkSharePeer(user_id: number): Promise<{
        data: string;
    }>;
    /**
     * NapCat扩展: 获取推荐群聊卡片
     * @param group_id - 群ID
     */
    nc_arkShareGroup(group_id: number): Promise<{
        data: string;
    }>;
    /**
     * NapCat扩展: 创建收藏
     * @param message_id - 消息ID
     */
    nc_createCollection(message_id: number): Promise<{
        result: boolean;
    }>;
    /**
     * NapCat扩展: 获取收藏列表
     */
    nc_getCollectionList(): Promise<{
        id: string;
        content: string;
        time: number;
    }[]>;
    /**
     * NapCat扩展: 退出机器人
     */
    nc_botExit(): Promise<null>;
    /**
     * NapCat扩展: 发送自定义组包
     * @param args - 参数
     */
    nc_sendPacket(args: Record<string, any>): Promise<Record<string, any>>;
    /**
     * NapCat扩展: 获取packet状态
     */
    nc_getPacketStatus(): Promise<null>;
    /**
     * NapCat扩展: 获取小程序卡片
     * @param args - 参数
     */
    nc_getMiniAppArk(args: {
        type?: string;
        title?: string;
        desc?: string;
        picUrl?: string;
        jumpUrl?: string;
        webUrl?: string;
        iconUrl?: string;
        appId?: string;
        scene?: string;
        templateType?: string;
        businessType?: string;
        verType?: string;
        shareType?: string;
        versionId?: string;
        sdkId?: string;
        withShareTicket?: string;
        rawArkData?: boolean;
    }): Promise<{
        data: {
            appName?: string;
            appView?: string;
            ver?: string;
            desc?: string;
            prompt?: string;
            metaData?: string;
            config?: string;
            app?: string;
            view?: string;
            meta?: string;
            miniappShareOrigin?: number;
            miniappOpenRefer?: string;
        };
    }>;
    /**
     * NapCat扩展: 发送戳一戳
     * @param args - 参数
     */
    nc_sendPoke(args: {
        user_id?: string;
        group_id?: string;
        target_id?: string;
    }): Promise<null>;
}

/** http 客户端请求参数 */
type OneBotHttpClientOptions = {
    /** self_id */
    self_id: number;
    /** OneBot httpHost 地址 */
    httpHost: string;
    /** OneBot http鉴权秘钥 */
    OneBotAccessToken?: string;
    /** 上报事件鉴权秘钥 */
    accessToken?: string;
    /** 心跳 默认5000ms */
    heartbeat?: number;
    /** 头部 */
    headers?: Record<string, string>;
    /** 最大重连次数 默认100次 */
    maxReconnectAttempts?: number;
} & OneBotCore['_options'];
/** http客户端内部配置 */
type OneBotHttpClientInternalOptions = Required<Omit<OneBotHttpClientOptions, 'firstHeartbeatTimeout'>>;
/**
 * OneBot http 核心类
 */
declare class OneBotHttp extends OneBotCore {
    /** 是否已初始化 */
    _initialized: boolean;
    /** 心跳失败次数 */
    _heartbeatFailCount: number;
    /** 配置 */
    _options: OneBotHttpClientInternalOptions;
    /** 心跳计时器 */
    _heartbeatInterval?: NodeJS.Timeout;
    constructor(options: OneBotHttpClientOptions);
    /**
     * 发送第一次心跳
     */
    _sendFirstHeartbeat(): Promise<void>;
    /**
     * 获取格式化后的配置
     * @param options - 配置选项
     * @returns 内部配置
     */
    static getOptions(options: OneBotHttpClientOptions): OneBotHttpClientInternalOptions;
    /**
     * 获取格式化后的配置
     * @param options - 配置选项
     * @returns 内部配置
     */
    getOptions(options: OneBotHttpClientOptions): OneBotHttpClientInternalOptions;
    /**
     * 发送API请求
     * @param action - API动作
     * @param params - API参数
     * @param timeout - 超时时间
     * @returns 返回API响应 注意: 返回的是response.data，而不是response
     */
    sendApi<T extends keyof OneBotApi>(action: T, params: OneBotApi[T]['params'], timeout?: number): Promise<OneBotApi[T]['response']>;
    /**
     * 发送心跳
     * @param isInit - 是否是初始化
     */
    private _sendHeartbeat;
    /**
     * 停止心跳
     */
    private _stopHeartbeat;
    /**
     * 开始心跳
     */
    private _startHeartbeat;
    /**
     * 初始化
     */
    init(): Promise<void>;
    /**
     * 关闭连接
     */
    close(): void;
    /**
     * 更新配置
     * @param options 新配置
     */
    updateOptions(options: Partial<OneBotHttpClientOptions>): Promise<void>;
    /**
     * 收到事件
     * @description 事件仅接受原始请求体，请不要使用JSON.parse(event)
     * @param event - 事件 原始请求体
     * @param headers - 头部
     */
    handleEvent(event: string, headers: IncomingHttpHeaders): void;
    /**
     * 校验一个事件是否合法
     * @param event - 事件
     * @param headers - 头部
     * @returns 是否合法
     */
    verifyEvent(event: string, headers: IncomingHttpHeaders): boolean;
    /**
     * 重新连接
     * @description 适用于产生close事件之后，需要重新使用当前实例
     * @description `温馨提示，所有on方法都需要重新注册`
     */
    reconnect(): Promise<void>;
}

/** WebSocket 基础选项 */
type OneBotWsBaseOptions = OneBotCore['_options'];
/** WebSocket 客户端请求参数 */
type OneBotWsClientOptions$1 = {
    /** 鉴权秘钥 */
    accessToken?: string;
    /** 头部 */
    headers?: Record<string, string>;
    /** 是否自动重连 */
    autoReconnect?: boolean;
    /** 重连间隔 默认5000ms */
    reconnectInterval?: number;
    /** 最大重连次数 默认100次 */
    maxReconnectAttempts?: number;
} & OneBotWsBaseOptions;
/** WebSocket 服务端请求参数 */
type OneBotWsServerOptions$1 = {
    /** 鉴权秘钥，客户端连接时需要提供相同的token */
    accessToken?: string;
} & OneBotWsBaseOptions;

/**
 * OneBot WebSocket 基类
 * 提供客户端和服务端共享的基本功能
 */
declare abstract class OneBotWsBase extends OneBotCore {
    /** 请求ID */
    echo: bigint;
    /** 是否setSocket */
    _setSocket: boolean;
    /** WebSocket实例 */
    protected _socket: WebSocket;
    constructor(socket: WebSocket, options?: OneBotWsBaseOptions);
    /**
     * 获取关闭类型
     */
    static get CloseType(): {
        /** 常规关闭 */
        ERROR: OneBotCloseType;
        /** 主动关闭 */
        MANUAL_CLOSE: OneBotCloseType;
        /** 客户端独有:重连上限 */
        MAX_RETRIES: OneBotCloseType;
        /** 客户端独有: 服务端关闭 */
        SERVER_CLOSE: OneBotCloseType;
    };
    /**
     * 获取错误类型
     */
    static get ErrorType(): {
        /** 常规错误 */
        ERROR: OneBotErrorType;
        /** 客户端独有: 初始化失败，正在尝试重连 */
        CONNECTION_FAILED: OneBotErrorType;
        /** 客户端独有: 初始化失败，重连关闭 */
        RECONNECTING: OneBotErrorType;
        /** 客户端独有: 初始化失败，重连达到上限 */
        RECONNECT_FAILED: OneBotErrorType;
        /** 服务端独有: 鉴权失败 */
        AUTH_FAILED: OneBotErrorType;
    };
    /**
     * 关闭连接
     */
    close(): void;
    /**
     * 更新socket
     * @param socket - 新的socket
     * @return 返回一个状态函数 请在处理设置socket相关后调用 否则close事件无法触发
     */
    setSocket(socket: WebSocket): () => void;
    /**
     * 初始化WebSocket连接
     */
    init(): Promise<void>;
    /**
     * 发送API请求
     * @param action - API动作
     * @param params - API参数
     * @param timeout - 超时时间
     * @returns 返回API响应 注意: 返回的是response.data，而不是response
     */
    sendApi<T extends keyof OneBotApi>(action: T, params: OneBotApi[T]['params'], timeout?: number): Promise<OneBotApi[T]['response']>;
}

/**
 * OneBot WebSocket 客户端内部选项
 */
type OneBotWsClientOptions = Required<OneBotWsBase['_options'] & OneBotWsClientOptions$1>;
/**
 * OneBot WebSocket 客户端类
 */
declare class OneBotWsClient extends OneBotWsBase {
    #private;
    _options: OneBotWsClientOptions;
    /** 重连尝试次数 */
    _reconnectAttempts: number;
    /** 连接URL */
    _url: string;
    constructor(socket: WebSocket, url: string, options: OneBotWsClientOptions$1);
    /**
     * 更新socket
     * @param socket - 新的socket
     * @returns 返回一个状态函数 请在处理设置socket相关后调用 否则close事件无法触发
     */
    setSocket(socket: WebSocket): () => void;
    /**
     * 获取当前URL
     */
    getUrl(): string;
    /**
     * 获取重连尝试次数
     */
    getReconnectAttempts(): number;
    /**
     * 重置重连尝试次数
     */
    resetReconnectAttempts(): void;
    /**
     * 是否已手动关闭
     */
    isManualClosed(): boolean;
    /**
     * 设置自动重连选项
     */
    setAutoReconnect(enable: boolean): void;
    /**
     * 设置重连间隔
     */
    setReconnectInterval(interval: number): void;
    /**
     * 设置最大重连次数
     */
    setMaxReconnectAttempts(max: number): void;
    /**
     * 获取格式化之后的参数
     * @param options - 连接配置
     * @returns 格式化之后的参数
     */
    getOptions(options: Partial<OneBotWsClientOptions>): OneBotWsClientOptions;
    /**
     * 重连
     * @param url - 连接URL
     * @param options - 连接配置 默认使用当前配置
     * @returns 是否重连成功
     */
    reconnect(url: string, options?: OneBotWsClientOptions$1): Promise<boolean>;
    /**
     * 设置事件监听器
     * @private
     */
    private _setupEventListeners;
}

/**
 * OneBot WebSocket 服务端内部选项
 */
type OneBotWsServerOptions = Required<OneBotWsServerOptions$1>;
/**
 * OneBot WebSocket 服务端类
 */
declare class OneBotWsServer extends OneBotWsBase {
    #private;
    /** 请求对象 */
    private _request;
    constructor(socket: WebSocket, request: IncomingMessage, options: OneBotWsServerOptions$1);
    init(): Promise<void>;
    /**
     * 更新socket
     */
    setSocket(socket: WebSocket): () => void;
    /**
     * 获取格式化之后的参数
     * @param options - 配置选项
     * @returns 格式化之后的参数
     */
    getOptions(options: OneBotWsServerOptions$1): OneBotWsServerOptions;
    /**
     * 获取客户端信息
     */
    getClientInfo(): {
        ip: string | undefined;
        headers: http.IncomingHttpHeaders;
    };
    /**
     * 获取请求对象
     */
    getRequest(): IncomingMessage;
    /**
     * 设置事件监听器
     * @private
     */
    private _setupEventListeners;
}

/**
 * OneBot实例类型
 */
type OneBotType = OneBotHttp | OneBotWsClient | OneBotWsServer;

declare class AdapterOneBot<T extends OneBotType> extends AdapterBase {
    #private;
    _onebot: T;
    constructor(_onebot: T);
    init(): Promise<void>;
    /**
     * 注册机器人
     */
    registerBot(): void;
    /**
     * 卸载注册的机器人
     */
    unregisterBot(): void;
    /** 设置登录号信息 */
    setAdapterInfo(): void;
    /**
     * 设置登录号详细信息
     */
    setBotInfo(): Promise<void>;
    sendApi<T extends keyof OneBotApi>(action: T, params: OneBotApi[T]['params'], timeout?: number): Promise<OneBotApi[T]['response']>;
    /**
     * onebot11转karin
     * @param data onebot11格式消息
     * @param contact 联系人信息 如果需要转换napcat的文件消息则需要传入
     * @return karin格式消息
     */
    AdapterConvertKarin(data: Array<OneBotMessage>): Promise<Elements[]>;
    /**
     * karin转onebot11
     * @param data karin格式消息
     */
    KarinConvertAdapter(data: Array<SendElement>): OneBotMessage[];
    /**
     * 获取头像url
     * @param userId 头像大小，默认`0`
     * @param size 头像大小，默认`0`
     * @returns 头像的url地址
     */
    getAvatarUrl(userId?: string, size?: number): Promise<string>;
    /**
     * 获取群头像
     * @param groupId 群号
     * @param size 头像大小，默认`0`
     * @param history 历史头像记录，默认`0`，若要获取历史群头像则填写1,2,3...
     * @returns 群头像的url地址
     */
    getGroupAvatarUrl(groupId: string, size?: number, history?: number): Promise<string>;
    /**
     * 发送消息
     * @param contact
     * @param elements
     * @returns 消息ID
     */
    sendMsg(contact: Contact, elements: Array<SendElement>, retryCount?: number): Promise<SendMsgResults>;
    /**
     * 发送长消息
     * @param contact 目标信息
     * @param resId 资源ID
     */
    sendLongMsg(contact: Contact, resId: string): Promise<{
        messageId: string;
        messageTime: number;
        rawData: {
            message_id: number;
        };
        message_id: string;
        message_time: number;
        time: number;
    }>;
    /**
     * 撤回消息
     * @param contact ob11无需提供contact参数
     * @param messageId 消息ID
     */
    recallMsg(_: Contact, messageId: string): Promise<void>;
    /**
     * 获取消息
     * @param contact 联系人信息
     * @param messageId 消息ID
     */
    getMsg(_contact: Contact | string, messageId?: string): Promise<{
        time: number;
        messageId: string;
        message_id: string;
        message_seq: number;
        messageSeq: number;
        contact: Contact;
        sender: {
            userId: string;
            uid: string;
            uin: number;
            nick: string;
            name: string;
            sex: Sex;
            role: Role;
            card: string;
            title: string;
            level: number;
            area: string;
        } | {
            userId: string;
            uid: string;
            sex: Sex;
            role: Role;
            uin: number;
            nick: string;
            name: string;
            card?: undefined;
            title?: undefined;
            level?: undefined;
            area?: undefined;
        };
        elements: Elements[];
    }>;
    /**
     * 获取msgId获取历史消息
     * @param contact 目标信息
     * @param startMsgId 起始消息ID
     * @param count 获取消息数量 默认为1
     * @returns 包含历史消息的数组
     */
    getHistoryMsg(contact: Contact, startMsgId: string | number, count: number): Promise<{
        time: number;
        messageId: string;
        messageSeq: any;
        message_id: string;
        message_seq: any;
        contact: Contact;
        sender: GroupSender;
        elements: Elements[];
    }[]>;
    /**
     * 发送好友赞
     * @param targetId 目标ID
     * @param count 赞的次数
     * @returns 此接口的返回值不值得信任
     */
    sendLike(targetId: string, count: number): Promise<void>;
    /**
     * 群踢人
     * @param groupId 群ID
     * @param targetId 被踢出目标的ID 任选其一
     * @param rejectAddRequest 是否拒绝再次申请，默认为false
     * @param kickReason 踢出原因，可选
     * @returns 此接口的返回值不值得信任
     */
    groupKickMember(groupId: string, targetId: string, rejectAddRequest?: boolean, _?: string): Promise<void>;
    /**
     * 禁言群成员
     * @param groupId 群ID
     * @param targetId 被禁言目标的ID 任选其一
     * @param duration 禁言时长 单位:秒
     * @returns 此接口的返回值不值得信任
     */
    setGroupMute(groupId: string, targetId: string, duration: number): Promise<void>;
    /**
     * 群全员禁言
     * @param groupId 群ID
     * @param isBan 是否开启全员禁言
     * @returns 此接口的返回值不值得信任
     */
    setGroupAllMute(groupId: string, isBan: boolean): Promise<void>;
    /**
     * 设置群管理员
     * @param groupId 群ID
     * @param targetId 目标用户的ID
     * @param isAdmin 是否设置为管理员
     * @returns 此接口的返回值不值得信任
     */
    setGroupAdmin(groupId: string, targetId: string, isAdmin: boolean): Promise<void>;
    /**
     * 设置群名片
     * @param groupId 群ID
     * @param targetId 目标用户的ID
     * @param card 新的群名片
     * @returns 此接口的返回值不值得信任
     */
    setGroupMemberCard(groupId: string, targetId: string, card: string): Promise<void>;
    /**
     * 设置群名
     * @param groupId 群ID
     * @param groupName 新的群名
     * @returns 此接口的返回值不值得信任
     */
    setGroupName(groupId: string, groupName: string): Promise<void>;
    /**
     * 退出群组
     * @param groupId 群ID
     * @param isDismiss 如果Bot是群主，是否解散群
     * @returns 此接口的返回值不值得信任
     */
    setGroupQuit(groupId: string, isDismiss: boolean): Promise<void>;
    /**
     * 设置群专属头衔 仅群主可用
     * @param groupId 群ID
     * @param targetId 目标用户的ID
     * @param title 新的专属头衔
     * @returns 此接口的返回值不值得信任
     */
    setGroupMemberTitle(groupId: string, targetId: string, title: string): Promise<void>;
    /**
     * 获取陌生人信息
     * @param targetId 用户ID 任选其一
     * @returns 陌生人信息数组
     */
    getStrangerInfo(targetId: string): Promise<{
        userId: string;
        user_id: string;
        /** 用户UID */
        uid: any;
        /** 用户UIN */
        uin: string;
        /** qid */
        qid: any;
        /** 名称 */
        nick: string;
        /** 备注 */
        remark: string;
        /** 用户等级 */
        level: number;
        /** 生日 */
        birthday: string;
        /** 登录天数 */
        login_day: any;
        /** 点赞数 */
        vote_cnt: number;
        /** 学校是否已核实 */
        is_school_verified: undefined;
        /**
       * 年龄
       * 拓展字段
       */
        age: number;
        /**
       * 性别
       * 拓展字段
       */
        sex: Sex;
        /** 大会员 */
        big_vip: undefined;
        /** 好莱坞/腾讯视频会员 */
        hollywood_vip: undefined;
        /** QQ会员 */
        qq_vip: any;
        /** QQ超级会员 */
        super_vip: undefined;
        /** 是否已经赞过 */
        voted: undefined;
        nickname: string;
    }>;
    /**
     * 获取好友列表
     * @param refresh 是否刷新好友列表
     * @returns 好友列表数组
     */
    getFriendList(_?: boolean): Promise<{
        userId: string;
        user_id: string;
        /** 用户UID */
        uid: string;
        /** 用户UIN */
        uin: string;
        /** qid */
        qid: any;
        /** 昵称 */
        nick: string;
        /** 昵称 */
        name: string;
        /** 用户等级 */
        level: number;
        /** 生日 */
        birthday: string;
        /** 登录天数 */
        login_day: any;
        /** 点赞数 */
        vote_cnt: number;
        /** 学校是否已核实 */
        is_school_verified: undefined;
        /**
         * 年龄
         * 拓展字段
         */
        age: any;
        /**
         * 性别
         * 拓展字段
         */
        sex: any;
        /** 大会员 */
        big_vip: undefined;
        /** 好莱坞/腾讯视频会员 */
        hollywood_vip: undefined;
        /** QQ会员 */
        qq_vip: any;
        /** QQ超级会员 */
        super_vip: undefined;
        /** 是否已经赞过 */
        voted: undefined;
        nickname: string;
        remark: string;
    }[]>;
    /** 获取好友列表 */
    GetFriendList(): Promise<{
        userId: string;
        user_id: string;
        /** 用户UID */
        uid: string;
        /** 用户UIN */
        uin: string;
        /** qid */
        qid: any;
        /** 昵称 */
        nick: string;
        /** 昵称 */
        name: string;
        /** 用户等级 */
        level: number;
        /** 生日 */
        birthday: string;
        /** 登录天数 */
        login_day: any;
        /** 点赞数 */
        vote_cnt: number;
        /** 学校是否已核实 */
        is_school_verified: undefined;
        /**
         * 年龄
         * 拓展字段
         */
        age: any;
        /**
         * 性别
         * 拓展字段
         */
        sex: any;
        /** 大会员 */
        big_vip: undefined;
        /** 好莱坞/腾讯视频会员 */
        hollywood_vip: undefined;
        /** QQ会员 */
        qq_vip: any;
        /** QQ超级会员 */
        super_vip: undefined;
        /** 是否已经赞过 */
        voted: undefined;
        nickname: string;
        remark: string;
    }[]>;
    /**
     * 获取群信息
     * @param groupId 群ID
     * @param noCache 是否刷新缓存
     * @returns 群信息
     */
    getGroupInfo(groupId: string, noCache?: boolean): Promise<{
        groupId: string;
        groupName: string;
        groupRemark: string;
        maxMemberCount: number;
        memberCount: number;
        groupDesc: string;
        avatar: string;
        group_name: string;
        group_remark: string;
        max_member_count: number;
        member_count: number;
        group_uin: string;
        admins: {
            userId: string;
            name: string;
            role: Role;
        }[];
        owner: string;
    }>;
    /**
     * 获取群列表
     * @param refresh 是否刷新好友列表
     * @returns 群列表数组
     */
    getGroupList(_refresh?: boolean): Promise<{
        groupId: string;
        groupName: string;
        groupRemark: string;
        maxMemberCount: number;
        memberCount: number;
        groupDesc: string;
        avatar: string;
        group_name: string;
        group_remark: string;
        max_member_count: number;
        member_count: number;
        group_uin: string;
        admins: never[];
        owner: string;
    }[]>;
    /**
     * 获取群成员信息
     * 此接口在非QQ平台上很难获取到标准信息，因此返回的数据可能会有所不同
     * @param groupId 群ID
     * @param targetId 目标用户的ID
     * @param refresh 是否刷新缓存
     * @returns 群成员信息
     */
    getGroupMemberInfo(groupId: string, targetId: string, refresh?: boolean): Promise<{
        userId: string;
        uid: string;
        uin: string;
        nick: string;
        role: Role;
        age: number;
        uniqueTitle: string;
        card: string;
        joinTime: number;
        lastActiveTime: number;
        level: number;
        shutUpTime: number;
        distance: undefined;
        honors: never[];
        unfriendly: boolean;
        sex: Sex;
        sender: GroupSender;
        group_id: number;
        user_id: number;
        nickname: string;
        area: string;
        join_time: number;
        last_sent_time: number;
        title: string;
        title_expire_time: number;
        card_changeable: boolean;
        shut_up_timestamp: number;
    }>;
    /**
     * 获取群成员列表
     * @param groupId 群ID
     * @param refresh 是否刷新缓存
     * @returns 群成员列表数组
     */
    getGroupMemberList(groupId: string, refresh?: boolean): Promise<{
        userId: string;
        uid: string;
        uin: string;
        nick: string;
        role: Role;
        age: number;
        uniqueTitle: string;
        card: string;
        joinTime: number;
        lastActiveTime: number;
        level: number;
        shutUpTime: number;
        distance: undefined;
        honors: never[];
        unfriendly: boolean;
        sex: Sex;
        sender: GroupSender;
        group_id: number;
        user_id: number;
        nickname: string;
        area: string;
        join_time: number;
        last_sent_time: number;
        title: string;
        title_expire_time: number;
        card_changeable: boolean;
        shut_up_timestamp: number;
    }[]>;
    /**
     * 获取群荣誉信息
     * @param groupId 群ID
     * @param refresh 是否刷新缓存
     * @returns 群荣誉信息数组
     */
    getGroupHonor(groupId: string): Promise<QQGroupHonorInfo[]>;
    /**
     * 设置消息表情回应
     * @param contact 目标信息
     * @param messageId 消息ID
     * @param faceId 表情ID
     * @returns 此接口的返回值不值得信任
     */
    setMsgReaction(contact: Contact, messageId: string, faceId: number | string, isSet: boolean): Promise<void>;
    /**
     * 获取版本信息
     */
    getVersion(): Promise<{
        name: string;
        app_name: string;
        version: string;
        protocol: string;
    }>;
    DownloadForwardMessage(_: string): Promise<any>;
    /**
     * 获取精华消息
     * @param groupId 群ID
     * @param page 页码
     * @param pageSize 每页数量
     * @returns EssenceMessageBody对象
     */
    getGroupHighlights(groupId: string, _: number, __: number): Promise<(GetGroupHighlightsResponse & {
        group_id: string;
        sender_uid: string;
        sender_uin: string;
        sender_nick: string;
        operator_uid: string;
        operator_uin: string;
        operator_nick: string;
        operation_time: number;
        message_time: number;
        message_id: string;
        message_seq: number;
        json_elements: string;
    })[]>;
    /**
     * 上传群文件、私聊文件
     * @param contact 目标信息
     * @param file 本地文件绝对路径
     * @param name 文件名称 必须提供
     * @param folder 父目录ID 不提供则上传到根目录 仅在群聊时有效
     * @returns 此接口的返回值不值得信任
     */
    uploadFile(contact: Contact, file: string, name: string, folder?: string): Promise<void>;
    /**
     * 设置、取消群精华消息
     * @param groupId 群ID
     * @param messageId 群消息ID
     * @param create true为添加精华消息，false为删除精华消息 默认为true
     */
    setGroupHighlights(_: string, messageId: string, create: boolean): Promise<void>;
    /**
     * 戳一戳用户
     * @param _contact 事件来源
     * @param _targetId 被戳目标ID
     * @param _count 戳一戳次数，默认1
     */
    pokeUser(_contact: Contact, _targetId: string, _count?: number): Promise<boolean>;
    /**
     * 设置好友请求结果
     * @param requestId 请求事件ID
     * @param isApprove 是否同意
     * @param remark 好友备注 同意时有效
     * @returns 设置结果
     */
    setFriendApplyResult(requestId: string, isApprove: boolean, remark?: string): Promise<void>;
    /**
     * 设置申请加入群请求结果
     * @param requestId 请求事件ID
     * @param isApprove 是否同意
     * @param denyReason 拒绝理由 拒绝时有效
     * @returns 此接口的返回值不值得信任
     */
    setGroupApplyResult(requestId: string, isApprove: boolean, denyReason?: string): Promise<void>;
    /**
     * 设置邀请加入群请求结果
     * @param requestId 请求事件ID
     * @param isApprove 是否同意
     * @returns 此接口的返回值不值得信任
     */
    setInvitedJoinGroupResult(requestId: string, isApprove: boolean): Promise<void>;
    /**
       * 合并转发 karin -> adapter
       * @param elements 消息元素
       * @param options 首层小卡片外显参数
       * @returns 适配器消息元素
       */
    forwardKarinConvertAdapter(elements: Array<NodeElement>, options?: ForwardOptions): Array<NodeMessage>;
    /**
     * 发送合并转发消息
     * @param contact 目标信息
     * @param elements 消息元素
     * @param options 首层小卡片外显参数
     */
    sendForwardMsg(contact: Contact, elements: NodeElement[], options?: ForwardOptions): Promise<{
        messageId: string;
        forwardId: string;
        message_id: string;
        forward_id: string;
        res_id?: string;
    }>;
    /**
     * 获取文件url
     * @description napcat支持仅提供fid获取url`(但是你要伪造一个假的contact...)`
     * @param contact 目标信息
     * @param fid 文件id
     * @returns 文件url
     */
    getFileUrl(contact: Contact, fid: string): Promise<string>;
    /**
     * 获取群文件系统信息
     * @param groupId 群ID
     * @returns 群文件系统信息
     */
    getGroupFileSystemInfo(groupId: string): Promise<{
        fileCount: number;
        limitCount: number;
        usedSpace: number;
        totalSpace: number;
        file_count: number;
        limit_count: number;
        used_space: number;
        total_space: number;
    }>;
    /**
     * 获取群文件列表
     * @param groupId 群ID
     * @param folderId 文件夹ID
     * @returns 群文件列表
     */
    getGroupFileList(groupId: string, folderId?: string): Promise<{
        files: {
            fid: string;
            name: string;
            size: number;
            uploadTime: number;
            expireTime: number;
            modifyTime: number;
            downloadCount: number;
            uploadId: string;
            uploadName: string;
            sha1: string;
            sha3: string;
            md5: string;
        }[];
        folders: {
            id: string;
            name: string;
            fileCount: number;
            createTime: number;
            creatorId: string;
            creatorName: string;
        }[];
    }>;
    /**
     * 获取 Cookies
     * @param domain The domain to get cookies from
     */
    getCookies(domain: string): Promise<{
        cookie: string;
        cookies: string;
    }>;
    /**
     * 获取 QQ 相关接口凭证
     * @param domain The domain to get credentials from
     */
    getCredentials(domain: string): Promise<{
        cookies: string;
        csrf_token: number;
    }>;
    /**
     * 获取 CSRF Token
     */
    getCSRFToken(): Promise<{
        token: number;
    }>;
    /**
     * 设置头像
     * @param file base64:// file:// http(s)://
     * @returns 是否设置成功
     */
    setAvatar(file: string): Promise<void>;
    /**
     * 获取群 Ai 语音可用声色列表
     * @returns 声色列表
     */
    getAiCharacters(): Promise<{
        character_id: string;
        character_name: string;
        preview_url: string;
    }[]>;
    /**
     * 设置群 Ai 语音声色
     * @param groupId 群号
     * @param character 声色ID
     * @param text 转换的文本
     */
    sendAiCharacter(groupId: string, character: string, text: string): Promise<{
        messageId: string;
    }>;
    /**
     * 获取 rkey
     * @returns rkey
     */
    getRkey(): Promise<{
        type: "private" | "group";
        rkey: string;
        created_at: number;
        ttl: number;
    }[]>;
}

/** OneBot适配器缓存Map */
declare const cacheMap: {
    wsServer: Map<string, AdapterOneBot<OneBotWsServer>>;
    wsClient: Map<string, AdapterOneBot<OneBotWsClient>>;
    http: Map<string, AdapterOneBot<OneBotHttp>>;
};

/**
 * 处理日志中可能存在的base64字符串
 * @param str 需要处理的字符串
 * @returns 处理后的字符串
 */
declare const formatLogString: (str: string) => string;
/**
 * 构建错误信息
 * @param selfId 机器人ID
 * @param action 请求的action
 * @param request 请求的参数
 * @param error 错误信息
 */
declare const buildError: (selfId: string, action: string, request: string, error?: unknown) => Error | undefined;
/**
 * 转换单个onebot消息为karin格式
 * @param message onebot消息
 * @param onebot 机器人实例
 * @returns karin格式的消息元素
 */
declare const convertOneBotMessageToKarin: (message: OneBotMessage, onebot: AdapterOneBot<OneBotType>) => Promise<Elements>;
/**
   * onebot11转karin
   * @param data onebot11格式消息
   * @param onebot 机器人实例
   * @return karin格式消息
   */
declare const AdapterConvertKarin: (data: OneBotMessage[], onebot: AdapterOneBot<OneBotType>) => Promise<Array<Elements>>;
/**
 * 获取文件消息段
 * @param file 文件信息
 * @param adapter 机器人实例
 * @param contact 联系人信息
 * @returns 文件消息段
 */
declare const getFileMessage: (file: any, adapter: AdapterOneBot<OneBotType>) => Promise<FileElement>;
/**
 * 处理非本地ws的文件
 * @param file 文件路径
 */
declare const fileToBase64: (file: string, url: string) => string;
/**
   * karin转onebot11
   * @param data karin格式消息
   */
declare const KarinConvertAdapter: (data: Array<SendElement>, onebot: AdapterOneBot<OneBotType>) => OneBotMessage[];

/**
 * @internal
 * @description 初始化OneBot适配器
 */
declare const initOneBotAdapter: () => Promise<void>;

/**
 * 创建OneBot WebSocket服务器
 * @param socket - WebSocket实例
 * @param request - 请求对象
 * @returns 适配器实例
 */
declare const createOneBotWsServer: (socket: WebSocket, request: IncomingMessage) => Promise<void>;
/**
 * @description 创建OneBot客户端
 * @param url 连接地址
 * @param token 鉴权token
 */
declare const createOneBotClient: (url: string, token?: string) => Promise<void>;
/**
 * @description 创建OneBot Http适配器
 * @param options 适配器配置
 */
declare const createOneBotHttp: (options: Adapters["onebot"]["http_server"][number]) => Promise<AdapterOneBot<OneBotHttp> | undefined>;
/**
 * 断开全部OneBot服务端
 */
declare const disconnectAllOneBotServer: () => void;

/**
 * 创建消息事件
 * @param event onebot11消息事件
 * @param bot 标准api实例
 */
declare const createMessage: (event: OneBotMessageEvent, bot: AdapterOneBot<OneBotType>) => Promise<void>;

/**
 * 创建通知事件
 * @param event onebot11通知事件
 * @param bot 标准api实例
 */
declare const createNotice: (event: OneBotNoticeEvent, bot: AdapterOneBot<OneBotType>) => void;

/**
 * 创建请求事件
 * @param event onebot11请求事件
 * @param bot 标准api实例
 */
declare const createRequest: (event: OneBotRequestEvent, bot: AdapterOneBot<OneBotType>) => void;

/** 渲染函数类型 */
interface Render {
    <T extends Options>(options: T): Promise<RenderResult<T>>;
    <T extends Snapka>(options: T): Promise<SnapkaResult<T>>;
}
/**
 * @description 注册渲染器
 * @param id 渲染器ID
 * @param render 渲染函数
 * @returns 渲染器索引
 */
declare const registerRender: (id: string, render: Render) => number;
/**
 * @description 卸载渲染器
 * @param index 渲染器索引
 * @returns 是否卸载成功
 */
declare const unregisterRender: (index: number) => boolean;
/**
 * @description 返回渲染器实例 未键入随机
 * @param id 渲染器ID
 * @returns 渲染器实例
 */
declare const getRender: (id?: string | number) => {
    /** 渲染器索引 唯一标识符 */
    index: number;
    /** 渲染器ID */
    id: string;
    /** 渲染函数 */
    render: Render;
};
/**
 * @description 调用标准渲染器
 * @param options 渲染器参数
 * @param id 指定渲染器ID
 */
declare const callRender: <T extends Options>(options: T, id?: string) => Promise<RenderResult<T & {
    encoding: string;
}>>;
/**
 * @description 获取全部渲染器数量
 * @returns 渲染器数量
 */
declare const getRenderCount: () => number;
/**
 * @description 获取全部渲染器列表
 * @returns 渲染器列表
 */
declare const getRenderList: () => {
    /** 渲染器索引 唯一标识符 */
    index: number;
    /** 渲染器ID */
    id: string;
    /** 渲染函数 */
    render: Render;
}[];
/**
 * @description 快速渲染
 * @param data html路径、http地址
 * @returns 返回图片base64或数组
 */
declare const renderHtml: (data: string) => Promise<string>;
/**
 * @description 快速分片渲染
 * @param file html路径、http地址
 * @param multiPage 分片高度 未传递为自动计算
 */
declare const renderMultiHtml: (file: string, multiPage?: number | boolean) => Promise<string[]>;
declare class RenderCache {
    /**
     * 注册渲染器
     * @param data 渲染器数据
     * @param data.id 渲染器ID
     * @param data.type 渲染器类型
     * @param ata.render 渲染器标准方法
     * @returns 渲染器索引
     */
    app(data: {
        id: string;
        type?: 'image' | string;
        render: Render;
    }): number;
    /**
       * 卸载渲染器
       * @param index 渲染器索引
       * @returns 是否卸载成功
       */
    unapp(index: number): boolean;
    /**
       * 返回渲染器实例 未键入id返回第一个
       * @param id 渲染器ID
       * @returns 渲染器实例
       */
    App(id?: string): {
        /** 渲染器索引 唯一标识符 */
        index: number;
        /** 渲染器ID */
        id: string;
        /** 渲染函数 */
        render: Render;
    };
    /**
       * 调用标准渲染器
       */
    render<T extends Options>(options: T, id?: string): Promise<RenderResult<T>>;
    /**
       * 快速渲染
       * @param data html路径、http地址
       * @returns 返回图片base64或数组
       */
    renderHtml(data: string): Promise<string>;
    /**
       * 快速分片渲染
       * @param data html路径、http地址
       * @param multiPage 分片高度 自动计算传true
       */
    renderMultiHtml(data: string, multiPage?: number | boolean): Promise<string[]>;
}
/**
   * 渲染器管理器
   */
declare const render: RenderCache;
/**
   * @description 即将废弃，请使用 `render`
  */
declare const Renderer: RenderCache;

/**
 * webui 配置
 * @param config 配置
 * @returns 配置
 */
declare const defineConfig: <T>(config: DefineConfig<T>) => DefineConfig<T>;

/**
 * 手风琴组件
 */
declare const accordion: {
    /**
     * 创建基础手风琴组件
     * @param key 唯一标识符
     * @param options 手风琴配置
     */
    create: (key: string, options?: Omit<AccordionProps, "key" | "componentType">) => AccordionProps;
    /**
     * 创建默认配置的手风琴组件
     * @param key 唯一标识符
     */
    default: (key: string) => AccordionProps;
    /**
     * 创建手风琴子项
     * @param key 唯一标识符
     * @param options 手风琴子项配置
     */
    createItem: (key: string, options?: Omit<AccordionItemProps, "key" | "componentType">) => AccordionItemProps;
};
/**
 * 手风琴Pro组件
 */
declare const accordionPro: {
    /**
     * 创建基础手风琴Pro组件
     * @param key 唯一标识符
     * @param data 渲染数据
     * @param options 手风琴Pro配置
     */
    create: (key: string, data: Record<string, any>[], options?: Omit<AccordionProProps, "key" | "componentType" | "data">) => AccordionProProps;
};
/**
 * 手风琴子项组件
 */
declare const accordionItem: {
    /**
     * 创建手风琴子项
     * @param key 唯一标识符
     * @param options 手风琴子项配置
     */
    create: (key: string, options?: Omit<AccordionItemProps, "key" | "componentType">) => AccordionItemProps;
    /**
     * 创建默认配置的手风琴子项
     * @param key 唯一标识符
     * @param title 标题
     * @param children 子组件
     */
    default: (key: string, title: string, children?: Children[]) => AccordionItemProps;
};

/**
 * 输入框
 */
declare const input: {
    /**
     * 创建基础输入框
     * @param key 唯一标识符
     * @param options 输入框配置
     */
    create: (key: string, options: Omit<InputProps, "key" | "componentType">) => InputProps;
    /**
     * 创建输入框组
     * @param key 唯一标识符
     * @param options 输入框组配置
     */
    group: (key: string, options: Omit<InputGroupProps, "key" | "componentType">) => InputGroupProps;
    /**
     * 字符串输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    string: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * 数字输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    number: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * 布尔值输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    boolean: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * 日期输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    date: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * 时间输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    time: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * 日期时间输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    datetime: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * 邮箱输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    email: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * URL输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    url: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * 电话输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    tel: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * 密码输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    password: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * 颜色输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    color: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
    /**
     * JSON输入框
     * @param key 唯一标识符
     * @param config 输入框配置
     */
    json: (key: string, config?: Partial<Omit<InputProps, "key" | "componentType">>) => InputProps;
};

/**
 * 开关组件
 */
declare const switchComponent: {
    /**
     * 创建基础开关
     * @param key 唯一标识符
     * @param options 开关配置
     */
    create: (key: string, options?: Omit<SwitchProps, "key" | "componentType">) => SwitchProps;
    /**
     * 自定义开关
     * @param key 唯一标识符
     * @param config 开关配置
     */
    options: (key: string, config?: Partial<Omit<SwitchProps, "key" | "componentType">>) => SwitchProps;
};

/**
 * 分隔线组件
 */
declare const divider: {
    /**
     * 创建基础分隔线
     * @param key 唯一标识符
     * @param options 分隔线配置
     */
    create: (key: string, options?: Omit<DividerProps, "key" | "componentType">) => DividerProps;
    /**
     * 创建水平分隔线
     * @param key 唯一标识符
     * @param config 分隔线配置
     */
    horizontal: (key: string, config?: Partial<Omit<DividerProps, "key" | "componentType">>) => DividerProps;
    /**
     * 创建垂直分隔线
     * @param key 唯一标识符
     * @param config 分隔线配置
     */
    vertical: (key: string, config?: Partial<Omit<DividerProps, "key" | "componentType">>) => DividerProps;
};

/**
 * cron编辑器组件
 */
declare const cron: {
    /**
     * 创建基础分隔线
     * @param key 唯一标识符
     * @param options 分隔线配置
     */
    create: (key: string, options?: Omit<CronProps, "key" | "componentType">) => CronProps;
};

/**
 * 下拉选择框
 */
declare const select: {
    /**
     * 创建基础下拉选项
     * @param key 唯一标识符
     * @param options 下拉选项配置
     */
    createItem: (key: string, options: Omit<SelectItem, "key" | "componentType" | "className">) => SelectItem;
    /**
     * 创建下拉选择框
     * @param key 唯一标识符
     * @param options 下拉选择框配置
     */
    create: (key: string, options: Omit<SelectProps, "key" | "componentType">) => SelectProps;
    /**
     * 默认下拉选择框
     * @param key 唯一标识符
     * @param config 下拉选择框配置
     */
    default: (key: string, config?: Partial<Omit<SelectProps, "key" | "componentType">>) => SelectProps;
    /**
     * 必选下拉选择框
     * @param key 唯一标识符
     * @param config 下拉选择框配置
     */
    required: (key: string, config: Partial<Omit<SelectProps, "key" | "componentType">>) => SelectProps;
    /**
     * 禁用下拉选择框
     * @param key 唯一标识符
     * @param config 下拉选择框配置
     */
    disabled: (key: string, config: Partial<Omit<SelectProps, "key" | "componentType">>) => SelectProps;
    /**
     * 只读下拉选择框
     * @param key 唯一标识符
     * @param config 下拉选择框配置
     */
    readonly: (key: string, config: Partial<Omit<SelectProps, "key" | "componentType">>) => SelectProps;
    /**
     * 错误状态下拉选择框
     * @param key 唯一标识符
     * @param config 下拉选择框配置
     */
    invalid: (key: string, config: Partial<Omit<SelectProps, "key" | "componentType">>) => SelectProps;
};

/**
 * 单选框
 */
declare const radio: {
    /**
     * 创建基础单选框
     * @param key 唯一标识符
     * @param options 单选框配置
     */
    create: (key: string, options: Omit<Radio, "key" | "componentType" | "className">) => Radio;
    /**
     * 创建单选框组
     * @param key 唯一标识符
     * @param options 单选框组配置
     */
    group: (key: string, options: Omit<RadioGroupProps, "key" | "componentType">) => RadioGroupProps;
    /**
     * 默认单选框组
     * @param key 唯一标识符
     * @param config 单选框组配置
     */
    defaultGroup: (key: string, config?: Partial<Omit<RadioGroupProps, "key" | "componentType">>) => RadioGroupProps;
    /**
     * 默认单选框
     * @param key 唯一标识符
     * @param config 单选框配置
     */
    default: (key: string, config?: Partial<Omit<Radio, "key" | "componentType" | "className">>) => Radio;
    /**
     * 必选单选框
     * @param key 唯一标识符
     * @param config 单选框配置
     */
    required: (key: string, config?: Partial<Omit<Radio, "key" | "componentType" | "className">>) => Radio;
    /**
     * 禁用单选框
     * @param key 唯一标识符
     * @param config 单选框配置
     */
    disabled: (key: string, config?: Partial<Omit<Radio, "key" | "componentType" | "className">>) => Radio;
    /**
     * 只读单选框
     * @param key 唯一标识符
     * @param config 单选框配置
     */
    readonly: (key: string, config?: Partial<Omit<Radio, "key" | "componentType" | "className">>) => Radio;
    /**
     * 错误状态单选框
     * @param key 唯一标识符
     * @param config 单选框配置
     */
    invalid: (key: string, config?: Partial<Omit<Radio, "key" | "componentType" | "className">>) => Radio;
};

/**
 * 复选框
 */
declare const checkbox: {
    /**
     * 创建基础复选框
     * @param key 唯一标识符
     * @param options 复选框配置
     */
    create: (key: string, options: Omit<CheckboxProps, "key" | "componentType" | "className">) => CheckboxProps;
    /**
     * 创建复选框组
     * @param key 唯一标识符
     * @param options 复选框组配置
     */
    group: (key: string, options: Omit<CheckboxGroupProps, "key" | "componentType">) => CheckboxGroupProps;
    /**
     * 默认复选框组
     * @param key 唯一标识符
     * @param config 复选框组配置
     */
    defaultGroup: (key: string, config?: Partial<Omit<CheckboxGroupProps, "key" | "componentType">>) => CheckboxGroupProps;
    /**
     * 默认复选框
     * @param key 唯一标识符
     * @param config 复选框配置
     */
    default: (key: string, config?: Partial<Omit<CheckboxProps, "key" | "componentType" | "className">>) => CheckboxProps;
    /**
     * 必选复选框
     * @param key 唯一标识符
     * @param config 复选框配置
     */
    required: (key: string, config?: Partial<Omit<CheckboxProps, "key" | "componentType" | "className">>) => CheckboxProps;
    /**
     * 禁用复选框
     * @param key 唯一标识符
     * @param config 复选框配置
     */
    disabled: (key: string, config?: Partial<Omit<CheckboxProps, "key" | "componentType" | "className">>) => CheckboxProps;
    /**
     * 只读复选框
     * @param key 唯一标识符
     * @param config 复选框配置
     */
    readonly: (key: string, config?: Partial<Omit<CheckboxProps, "key" | "componentType" | "className">>) => CheckboxProps;
    /**
     * 不确定状态复选框
     * @param key 唯一标识符
     * @param config 复选框配置
     */
    indeterminate: (key: string, config?: Partial<Omit<CheckboxProps, "key" | "componentType" | "className">>) => CheckboxProps;
    /**
     * 错误状态复选框
     * @param key 唯一标识符
     * @param config 复选框配置
     */
    invalid: (key: string, config?: Partial<Omit<CheckboxProps, "key" | "componentType" | "className">>) => CheckboxProps;
};

type Components = {
    /** 分隔线 */
    divider: typeof divider;
    /** 输入框 */
    input: typeof input;
    /** 开关 */
    switch: typeof switchComponent;
    /** 手风琴 */
    accordion: typeof accordion;
    /** 手风琴Pro */
    accordionPro: typeof accordionPro;
    /** 手风琴项 */
    accordionItem: typeof accordionItem;
    /** 单选框 */
    radio: typeof radio;
    /** 多选框 */
    checkbox: typeof checkbox;
    /** cron */
    cron: typeof cron;
    /** 下拉选择框 */
    select: typeof select;
};
/** 前端配置组件 */
declare const components: Components;
type ComponentsClass = typeof divider | ReturnType<typeof input.create> | ReturnType<typeof switchComponent.create>;

/**
 * 未找到匹配插件钩子
 */
declare const empty: ((callback: HookCallback<Message>, options?: HookOptions) => number) & {
    /**
     * 添加未找到匹配插件消息钩子
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    message(callback: HookCallback<Message>, options?: HookOptions): number;
    /**
     * 添加未找到匹配插件通知钩子
     * @param callback 通知处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    notice(callback: GeneralHookCallback<Notice>, options?: HookOptions): number;
    /**
     * 添加未找到匹配插件请求钩子
     * @param callback 请求处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    request(callback: GeneralHookCallback<Request>, options?: HookOptions): number;
    /**
     * 删除未找到匹配插件钩子
     * @param id 钩子ID
     */
    remove(id: number): void;
};

/**
 * 消息hook
 */
declare const message: ((callback: HookCallback<Message>, options?: HookOptions) => number) & {
    /**
     * 添加好友消息钩子
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    friend(callback: HookCallback<FriendMessage>, options?: HookOptions): number;
    /**
     * 添加群消息钩子
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    group(callback: HookCallback<GroupMessage>, options?: HookOptions): number;
    /**
     * 添加频道消息钩子
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    guild(callback: HookCallback<GuildMessage>, options?: HookOptions): number;
    /**
     * 添加临时消息钩子
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    direct(callback: HookCallback<DirectMessage>, options?: HookOptions): number;
    /**
     * 添加临时消息钩子
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    groupTemp(callback: HookCallback<GroupTempMessage>, options?: HookOptions): number;
    /**
     * 删除钩子
     * @param id 钩子ID
     */
    remove(id: number): void;
};

/** 发送消息钩子 */
declare const sendMsg: {
    /**
     * 添加普通消息钩子 `也就是调用 bot.sendMsg 时触发 此时会先进入这个 hook 才会到 bot.sendMsg`
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    message: (callback: NormalMessageCallback, options?: HookOptions) => number;
    /**
     * 添加转发消息钩子 `也就是调用 bot.sendForwardMsg 时触发 此时会先进入这个 hook 才会到 bot.sendForwardMsg`
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    forward: (callback: ForwardMessageCallback, options?: HookOptions) => number;
    /**
     * 添加普通消息发送后钩子 `也就是调用 bot.sendMsg 处理完成返回结果前触发 此时会先进入这个 hook 才会正常返回结果`
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    afterMessage: (callback: AfterMessageCallback, options?: HookOptions) => number;
    /**
     * 添加转发消息发送后钩子 `也就是调用 bot.sendForwardMsg 处理完成返回结果前触发 此时会先进入这个 hook 才会正常返回结果`
     * @param callback 消息处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    afterForward: (callback: AfterForwardMessageCallback, options?: HookOptions) => number;
    /**
     * 删除钩子
     * @param id 钩子ID
     */
    remove: (id: number) => void;
};

type Plugin = typeof cache.command[number];
/**
 * 事件调用插件钩子
 */
declare const eventCall: ((callback: EventCallCallback<Message, Plugin>, options?: HookOptions) => number) & {
    /**
     * 添加群聊事件调用钩子
     * @param callback 事件处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    group(callback: EventCallCallback<GroupMessage, Plugin>, options?: HookOptions): number;
    /**
     * 添加频道事件调用钩子
     * @param callback 事件处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    guild(callback: EventCallCallback<GuildMessage, Plugin>, options?: HookOptions): number;
    /**
     * 添加群临时事件调用钩子
     * @param callback 事件处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    groupTemp(callback: EventCallCallback<GroupTempMessage, Plugin>, options?: HookOptions): number;
    /**
     * 添加好友事件调用钩子
     * @param callback 事件处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    friend(callback: EventCallCallback<FriendMessage, Plugin>, options?: HookOptions): number;
    /**
     * 添加私聊事件调用钩子
     * @param callback 事件处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    direct(callback: EventCallCallback<DirectMessage, Plugin>, options?: HookOptions): number;
    /**
     * 添加通知事件调用钩子
     * @param callback 事件处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    notice(callback: EventCallCallback<Notice, (typeof cache.accept)[number]>, options?: HookOptions): number;
    /**
     * 添加请求事件调用钩子
     * @param callback 事件处理回调函数
     * @param options 钩子配置项
     * @returns 钩子ID
     */
    request(callback: EventCallCallback<Request, (typeof cache.accept)[number]>, options?: HookOptions): number;
    /**
     * 删除钩子
     * @param id 钩子ID
     */
    remove(id: number): void;
};

/**
 * 消息钩子系统类型
 */
type HooksType = {
    /** 消息hook */
    message: typeof message;
    /** 发送消息钩子 */
    sendMsg: typeof sendMsg;
    /** 未找到匹配插件钩子 */
    empty: typeof empty;
    /** 事件调用插件钩子 */
    eventCall: typeof eventCall;
};
/**
 * 消息钩子系统
 */
declare const hooks: HooksType;

/**
 * @description 处理模板
 * @param options 截图参数
 * @deprecated 请使用`renderTemplate`
 */
declare const renderTpl: (options: Options) => Options;

/**
 * ===================================================================
 * 主函数模块
 * ===================================================================
 */
/**
 * 获取插件
 * @param type 获取插件的方式
 * @param isInfo 是否获取插件详细信息，否则返回插件名称列表
 * @param isForce 是否强制更新缓存
 * @param _isFirst 是否第一次获取
 * @returns 插件列表或详细信息
 * @version 1.0.0
 * ```json // 注意 返回非详细信息时候，插件名称会附带类型前缀
 * [
 *  "npm:plugin-name",
 *  "git:plugin-name",
 *  "app:plugin-name"
 * ]
 * ```
 */
declare const getPlugins: <T extends boolean = false>(type: GetPluginType, isInfo?: T, isForce?: boolean, _isFirst?: boolean) => Promise<GetPluginReturn<T>>;

/**
 * @description 简单的kv存储
 */
declare class SQLiteWrapper {
    dbPath: string;
    _db: Database;
    constructor(dbPath: string);
    _init(): Promise<this>;
    /**
     * 设置键值对
     * @param key 键名
     * @param value 值
     * @returns 操作是否成功
     */
    set<T>(key: string, value: T): Promise<boolean>;
    /**
     * 获取所有匹配模式的键
     * @param pattern 匹配模式，支持SQL LIKE语法的通配符
     * @returns 匹配的键列表，失败时返回空数组
     */
    keys(pattern?: string): Promise<string[]>;
    /**
     * 获取键对应的值
     * @param key 键名
     * @returns 值，如果键不存在或值损坏则返回null
     */
    get<T>(key: string): Promise<T | null>;
    /**
     * 删除键
     * @param key 要删除的键
     * @returns 是否删除成功
     */
    del(key: string): Promise<boolean>;
}

/**
 * @description kv数据库
 */
declare let db: SQLiteWrapper;

/**
 * @public
 * @description Redis数据库
 */
declare let redis: Client;
/** Redis 客户端类型 */
type Client = RedisClientType & {
    id: 'redis' | 'mock';
};

/**
 * @public
 * @description 启动框架
 */
declare const start: () => Promise<void>;

export { type Accept, type AccordionItemProps, type AccordionKV, type AccordionProProps, type AccordionProResult, type AccordionProps, type AccordionResult, type AccountInfo, type Adapter, AdapterBase, type AdapterCommunication, AdapterConvertKarin, type AdapterInfo, AdapterOneBot, type AdapterOptions, type AdapterPlatform, type AdapterProtocol, type AdapterStandard, type AdapterType, type Adapters, type AddDependenciesParams, type AddTaskResult, type AfterForwardMessageCallback, type AfterMessageCallback, type AllPluginMethods, type Apps, type ArrayField, type AtElement, type Author, BASE_ROUTER, BATCH_UPDATE_PLUGINS_ROUTER, BOT_CONNECT, BOT_DISCONNECT, type BaseContact, BaseEvent, type BaseEventOptions, type BaseEventType, type BaseForwardCallback, type BaseMessageCallback, type BasketballElement, Bot, BotOfflineNotice, type BotOfflineOptions, type BoundingBox, type BubbleFaceElement, type Button, type ButtonElement, CHECK_PLUGIN_ROUTER, CLOSE_TERMINAL_ROUTER, CONSOLE_ROUTER, CREATE_TERMINAL_ROUTER, type Cache, type CacheEntry, type CheckboxField, type CheckboxGroupProps, type CheckboxProps, type CheckboxResult, type Children, type CmdFnc, type Command, type CommandClass, type CompareMode, type ComponentConfig, type ComponentProps, type ComponentType, type Components, type ComponentsClass, type Config, type Contact, type ContactElement, type Count, type CreateGroupFolderResponse, type CreatePty, type CreateTask, type CreateTaskParams, type CreateTaskResult, type CronProps, type CustomMusicElement, type CustomNodeElement, type DbStreamStatus, type DbStreams, type DefineConfig, type DependenciesManage, type DependenciesManageBase, type Dependency, type DiceElement, type DirectContact, DirectMessage, type DirectMessageOptions, type DirectNodeElement, type DirectSender, type DividerField, type DividerProps, type DownloadFileErrorResult, type DownloadFileOptions, type DownloadFileResponse, type DownloadFileResult, type DownloadFileSuccessResult, type DownloadFilesOptions, EVENT_COUNT, EXIT_ROUTER, type ElementTypes, type Elements, type Env, type Event, type EventCallCallback, type EventCallHookItem, type EventParent, type EventToSubEvent, type ExecOptions$1 as ExecOptions, type ExecReturn, type ExecType, type ExtendedAxiosRequestConfig, FILE_CHANGE, type FaceElement, type FieldType, type FileElement, type FileList, type FileListMap, type FileToUrlHandler, type FileToUrlResult, type FormField, type ForwardMessageCallback, type ForwardOptions, type FriendContact, type FriendData, FriendDecreaseNotice, type FriendDecreaseOptions, FriendIncreaseNotice, type FriendIncreaseOptions, FriendMessage, type FriendMessageOptions, type FriendNoticeEventMap, type FriendRequestEventMap, type FriendRequestOptions, type FriendSender, type FrontendInstalledPluginListResponse, GET_BOTS_ROUTER, GET_CONFIG_ROUTER, GET_DEPENDENCIES_LIST_ROUTER, GET_LOADED_COMMAND_PLUGIN_CACHE_LIST_ROUTER, GET_LOCAL_PLUGIN_FRONTEND_LIST_ROUTER, GET_LOCAL_PLUGIN_LIST_ROUTER, GET_LOG_FILE_LIST_ROUTER, GET_LOG_FILE_ROUTER, GET_LOG_ROUTER, GET_NETWORK_STATUS_ROUTER, GET_NPMRC_LIST_ROUTER, GET_NPM_BASE_CONFIG_ROUTER, GET_NPM_CONFIG_ROUTER, GET_ONLINE_PLUGIN_LIST_ROUTER, GET_PLUGIN_APPS_ROUTER, GET_PLUGIN_CONFIG_ROUTER, GET_PLUGIN_FILE_ROUTER, GET_PLUGIN_LIST_PLUGIN_ADMIN_ROUTER, GET_PLUGIN_LIST_ROUTER, GET_PLUGIN_MARKET_LIST_ROUTER, GET_TASK_LIST_ROUTER, GET_TASK_STATUS_ROUTER, GET_TERMINAL_LIST_ROUTER, GET_UPDATABLE_PLUGINS_ROUTER, GET_WEBUI_PLUGIN_LIST_ROUTER, GET_WEBUI_PLUGIN_VERSIONS_ROUTER, type GeneralHookCallback, type GeneralHookItem, type GetAiCharactersResponse, type GetAtAllCountResponse, type GetBot, type GetCommitHashOptions, type GetConfigRequest, type GetConfigResponse, type GetGroupFileListResponse, type GetGroupFileSystemInfoResponse, type GetGroupHighlightsResponse, type GetGroupMuteListResponse, type GetPluginLocalOptions, type GetPluginLocalReturn, type GetPluginReturn, type GetPluginType, type GetRkeyResponse, type GiftElement, type GitLocalBranches, type GitPullOptions, type GitPullResult, type GitRemoteBranches, type GithubConfig, type GoToOptions, GroupAdminChangedNotice, type GroupAdminChangedOptions, GroupApplyRequest, type GroupApplyRequestOptions, GroupCardChangedNotice, type GroupCardChangedOptions, type GroupContact, type GroupData, GroupFileUploadedNotice, type GroupFileUploadedOptions, GroupHlightsChangedNotice, type GroupHlightsChangedOptions, GroupHonorChangedNotice, type GroupHonorChangedOptions, type GroupInfo, GroupInviteRequest, type GroupInviteRequestOptions, GroupLuckKingNotice, type GroupLuckKingOptions, GroupMemberBanNotice, type GroupMemberBanOptions, type GroupMemberData, GroupMemberDecreaseNotice, type GroupMemberDecreaseOptions, GroupMemberIncreaseNotice, type GroupMemberIncreaseOptions, type GroupMemberInfo, GroupMemberTitleUpdatedNotice, type GroupMemberUniqueTitleChangedOptions, GroupMessage, type GroupMessageOptions, GroupMessageReactionNotice, type GroupMessageReactionOptions, GroupNotice, type GroupNoticeEventMap, GroupPokeNotice, type GroupPokeOptions, GroupRecallNotice, type GroupRecallOptions, type GroupRequestEventMap, type GroupSender, GroupSignInNotice, type GroupSignInOptions, type GroupTempContact, GroupTempMessage, type GroupTempMessageOptions, type GroupTempSender, GroupWholeBanNotice, type GroupWholeBanOptions, type Groups, type GroupsObjectValue, type GuildContact, GuildMessage, type GuildMessageOptions, type GuildSender, HTTPStatusCode, type Handler, type HandlerType, type HookCache, type HookCallback, type HookEmitForward, type HookEmitMessage, type HookNext, type HookOptions, type HooksType, INSTALL_PLUGIN_ROUTER, INSTALL_WEBUI_PLUGIN_ROUTER, IS_PLUGIN_CONFIG_EXIST_ROUTER, type Icon, type ImageElement, type ImportModuleResult, type InputGroupProps, type InputProps, type InputResult, type JsonElement, type JwtVerifyBase, type JwtVerifyError, type JwtVerifyExpired, type JwtVerifyResult, type JwtVerifySuccess, type JwtVerifyUnauthorized, type KarinButton, KarinConvertAdapter, type KarinPluginAppsType, type KeyboardElement, LOGIN_ROUTER, type LoadPluginResult, type LoadedPluginCacheList, type LocalApiResponse, type LocationElement, type Log, LogMethodNames, Logger, LoggerLevel, type LongMsgElement, MANAGE_DEPENDENCIES_ROUTER, type MarkdownElement, type MarkdownTplElement, type MarketFaceElement, type Message, MessageBase$1 as MessageBase, type MessageEventMap, type MessageEventSub, type MessageHookItem, type MessageOptions, type MessageResponse, type MusicElement, type MusicPlatform, type NetworkStatus, type NodeElement, type NormalMessageCallback, type Notice, type NoticeAndRequest, NoticeBase, type NoticeEventMap, type NoticeEventSub, type NoticeOptions, type NpmBaseConfigResponse, type NpmRegistryResponse, type NpmrcFileResponse, type NumberField, type ObjectArrayField, type ObjectField, createMessage as OneBotCreateMessage, createNotice as OneBotCreateNotice, createRequest as OneBotCreateRequest, type Option, type Options, PING_ROUTER, PLUGIN_ADMIN_ROUTER, type PM2, type Package, type Parser, type PasmsgElement, type Permission, type PingRequestResult, type PkgData, type PkgEnv, type PkgInfo, Plugin$1 as Plugin, type PluginAdminCustomInstall, type PluginAdminCustomInstallApp, type PluginAdminInstall, type PluginAdminListResponse, type PluginAdminMarketInstall, type PluginAdminMarketInstallApp, type PluginAdminParams, type PluginAdminResult, type PluginAdminUninstall, type PluginAdminUpdate, type PluginFile, type PluginFncTypes, type PluginLists, type PluginMarketAuthor, type PluginMarketLocalBase, type PluginMarketLocalOptions, type PluginMarketOptions, type PluginMarketRequest, type PluginMarketResponse, type PluginOptions, type PluginRule, type PluginUpdateInfo, type PnpmDependencies, type PnpmDependency, type Point, PrivateApplyRequest, type PrivateApplyRequestOptions, PrivateFileUploadedNotice, type PrivateFileUploadedOptions, PrivatePokeNotice, type PrivatePokeOptions, PrivateRecallNotice, type PrivateRecallOptions, type Privates, type PrivatesObjectValue, type PuppeteerLifeCycleEvent, type QQBotButton, type QQButtonTextType, type QQGroupFileInfo, type QQGroupFolderInfo, type QQGroupHonorInfo, RECV_MSG, REFRESH_ROUTER, RESTART_ROUTER, type RaceResult, type Radio, type RadioField, type RadioGroupProps, type RadioResult, type RawElement, type ReadyMusicElement, ReceiveLikeNotice, type ReceiveLikeOptions, type RecordElement, type Redis, type RemoveDependenciesParams, type Render, type RenderResult, Renderer, type Renders$1 as Renders, type Reply, type ReplyElement, type Request, RequestBase, type RequestEventMap, type RequestEventSub, type RequestOptions, type RequireFunction, type RequireFunctionSync, type RequireOptions, type Role, type RpsElement, SAVE_CONFIG_ROUTER, SAVE_NPMRC_ROUTER, SAVE_PLUGIN_CONFIG_ROUTER, SEND_MSG, SET_LOG_LEVEL_ROUTER, SYSTEM_INFO_ROUTER, SYSTEM_STATUS_KARIN_ROUTER, SYSTEM_STATUS_ROUTER, SYSTEM_STATUS_WS_ROUTER, type SandBoxAccountInfo, type SandboxMsgRecord, type SandboxSendApi, type SandboxSendSendFriendMsg, type SandboxSendSendGroupMsg, type SandboxSendSendMsg, type SaveConfigResponse, type SaveResult, type Scene, type ScreenshotClip, type ScreenshotOptions, type SectionField, type SelectField, type SelectItem, type SelectProps, type SendElement, type SendForwardMessageResponse, type SendMessage, type SendMsgHookItem, type SendMsgResults, type Sender, type SenderBase, type SenderGroup$1 as SenderGroup, type Sex$1 as Sex, type ShareElement, type Snapka, type SnapkaResult, type SrcReply, type StandardResult, type SwitchField, type SwitchProps, type SwitchResult, TASK_DELETE_ROUTER, TASK_LIST_ROUTER, TASK_LOGS_ROUTER, TASK_RUN_ROUTER, type Task, type TaskCallbacks, type TaskEntity, TaskExecutionType, type TaskExecutor, type TaskFilter, type TaskStatus, type TaskType, type TerminalInstance, type TerminalShell, type TestNetworkRequestDetail, type TextElement, type TextField, type TitleField, UNINSTALL_PLUGIN_ROUTER, UNINSTALL_WEBUI_PLUGIN_ROUTER, UPDATE_CORE_ROUTER, UPDATE_PLUGIN_ROUTER, UPDATE_TASK_STATUS_ROUTER, UPDATE_WEBUI_PLUGIN_VERSION_ROUTER, type UnionMessage, type UnregisterBot, type UpgradeDependenciesParams, type UserInfo, type ValidationRule, type ValueType, type VideoElement, WS_CLOSE, WS_CLOSE_ONEBOT, WS_CLOSE_PUPPETEER, WS_CLOSE_SANDBOX, WS_CONNECTION, WS_CONNECTION_ONEBOT, WS_CONNECTION_PUPPETEER, WS_CONNECTION_SANDBOX, WS_CONNECTION_TERMINAL, WS_SNAPKA, type WaitForOptions, Watch, Watcher, type WeatherElement, type XmlElement, type YamlComment, YamlEditor, type YamlValue, absPath, accordion, accordionItem, accordionPro, app, applyComments, authMiddleware, base64, buffer, buildError, buildGithub, buttonHandle, cacheMap, callRender, changelog, checkGitPluginUpdate, checkPkgUpdate, checkPort, clearRequire, clearRequireFile, comment, index$1 as common, components, index as config, contact$1 as contact, contactDirect, contactFriend, contactGroup, contactGroupTemp, contactGuild, convertOneBotMessageToKarin, copyConfig, copyConfigSync, copyFiles, copyFilesSync, createAccessTokenExpiredResponse, createBadRequestResponse, createBotOfflineNotice, createDirectMessage, createForbiddenResponse, createFriendDecreaseNotice, createFriendIncreaseNotice, createFriendMessage, createGroupAdminChangedNotice, createGroupApplyRequest, createGroupCardChangedNotice, createGroupFileUploadedNotice, createGroupHlightsChangedNotice, createGroupHonorChangedNotice, createGroupInviteRequest, createGroupLuckKingNotice, createGroupMemberAddNotice, createGroupMemberBanNotice, createGroupMemberDelNotice, createGroupMemberTitleUpdatedNotice, createGroupMessage, createGroupMessageReactionNotice, createGroupPokeNotice, createGroupRecallNotice, createGroupSignInNotice, createGroupTempMessage, createGroupWholeBanNotice, createGuildMessage, createINIParser, createMethodNotAllowedResponse, createNotFoundResponse, createOneBotClient, createOneBotHttp, createOneBotWsServer, createPayloadTooLargeResponse, createPluginDir, createPrivateApplyRequest, createPrivateFileUploadedNotice, createPrivatePokeNotice, createPrivateRecallNotice, createRawMessage, createReceiveLikeNotice, createRefreshTokenExpiredResponse, createResponse, createServerErrorResponse, createSuccessResponse, createTaskDatabase, createUnauthorizedResponse, cron, db, debug, karin as default, defineConfig, disconnectAllOneBotServer, divider, downFile, downloadFile, errorToString, exec, executeTask, existToMkdir, existToMkdirSync, exists, existsSync, ffmpeg, ffplay, ffprobe, fs as file, fileToBase64, fileToUrl, fileToUrlHandlerKey, filesByExt, formatLogString, formatPath, formatTime$1 as formatTime, index$3 as fs, getAllBot, getAllBotID, getAllBotList, getAllFiles, getAllFilesSync, getBot, getBotCount, getCommit, getDefaultBranch, getFastGithub, getFastRegistry, getFileMessage, getFiles, getHash, getLocalBranches, getLocalCommitHash, getMimeType, getPackageJson, getPid, getPkgVersion, getPluginInfo, getPlugins, getRelPath, getRemoteBranches, getRemoteCommitHash, getRemotePkgVersion, getRender, getRenderCount, getRenderList, getRequestIp, getTaskCallback, getTaskDatabase, getTime, gitPull, handler$1 as handler, hooks, importModule, imports, ini, initOneBotAdapter, initTaskSystem, input, isClass, isDir, isDirSync, isDocker, isFile, isFileSync, isIPv4Loop, isIPv6Loop, isLinux, isLocalRequest, isLoopback, isMac, isPathEqual, isPlugin, isPublic, isRoot, isSubPath, isWin, json$1 as json, karin, karinToQQBot, key, killApp, lock, lockMethod, lockProp, log, logger, logs, makeForward, makeMessage, type messageType, mkdir, mkdirSync, parseChangelog, parseGithubUrl, pingRequest, pkgRoot, qqbotToKarin, raceRequest, randomStr, range, read, readFile, readJson, readJsonSync, redis, registerBot, registerRender, removeTaskCallback, render, renderHtml, renderMultiHtml, renderTpl, requireFile, requireFileSync, restart, restartDirect, rmSync, router, satisfies, save, type screenshot, segment, select, sendMsg$1 as sendMsg, sender, senderDirect, senderFriend, senderGroup, senderGroupTemp, senderGuild, sep, server, setTaskCallback, setTaskDatabase, splitPath, start, stream, stringifyError, switchComponent, index$2 as system, taskAdd, taskExists, taskGet, taskList, taskSystem, taskUpdateLogs, taskUpdateStatus, unregisterBot, unregisterRender, updateAllGitPlugin, updateAllPkg, updateGitPlugin, updatePkg, updateTaskLogs, updateTaskStatus, uptime$1 as uptime, urlToPath, waitPort, watch, watchAndMerge, write, writeJson, writeJsonSync, yaml };
