/// <reference types="jest" />
/// <reference types="node" />

import type Chalk from 'chalk';
import type * as Cheerio from 'cheerio';
import type * as childProcess from 'child_process';
import { compile } from './path-to-regexp';
import type COS from 'cos-nodejs-sdk-v5';
import type * as CronParser from 'cron-parser';
import type * as CryptoType from 'crypto';
import type * as Dotenv from 'dotenv';
import type * as DotenvExpand from 'dotenv-expand';
import type { default as FormData_2 } from 'form-data';
import { fs } from 'fs';
import type * as FsExtra from 'fs-extra';
import type * as fsModule from 'fs';
import type * as httpModule from 'http';
import type * as JoseType from 'jose';
import type * as MiniprogramCI from 'miniprogram-ci';
import type * as NetType from 'net';
import type * as osModule from 'os';
import { parse } from './path-to-regexp';
import type * as path from 'path';
import { PlatformPath } from 'path';
import { ScoreInfoType } from '../types';
import { StdioOptions } from 'child_process';
import { tokensToFunction } from './path-to-regexp';
import { tokensToRegExp } from './path-to-regexp';
import type * as UtilType from 'util';
import { WorkBook } from 'xlsx';
import { WorkSheet } from 'xlsx';
import type * as XLSX from 'xlsx';

/**
 * 将 ArrayBuffer 转换为字符串
 * 支持多种字符编码，优先使用 TextDecoder API
 * @param buffer - 要转换的 ArrayBuffer
 * @param encoding - 字符编码，默认为 'utf-8'
 * @returns 转换后的字符串
 * @example
 * ```ts
 * const buffer = new ArrayBuffer(8);
 * const str = ab2str(buffer); // 使用 UTF-8 编码
 * const gbkStr = ab2str(buffer, 'gbk'); // 使用 GBK 编码
 * ```
 */
export declare function ab2str(buffer: ArrayBuffer, encoding?: string): string;

export declare class AccountService {
    private static _ins;
    private static _deps;
    private static _messages;
    /**
     * 注入运行所需依赖（应用启动期调用一次即可）
     *
     * 多次调用会覆盖之前的依赖，便于测试时替换。
     */
    static configure(deps: AccountServiceDeps, messages?: AccountServiceMessages): void;
    /** 获取当前注入的依赖（未注入时抛错） */
    private static getDeps;
    /** 单例 */
    static get ins(): AccountService;
    /** QQ 票据存储 key（默认 `${loginInfoStorageKey}__qq_ticket`） */
    private static getQQTicketStorageKey;
    /** 防止 wx.onShow 重复绑定 */
    private _onShowBound;
    /** 防止"切号过程中再次点击"重复触发 */
    private _switching;
    private constructor();
    /** 当前是否为 QQ 账号（基于注入的 isQQAccount） */
    isQQ(): boolean;
    /** 「切换 QQ 账号 / 切换微信账号」按钮的动态文案 */
    getSwitchButtonText(): string;
    /**
     * onLaunch / Game.bootstrap 阶段调用：
     *
     *  1) 初始化 qq-wxmini-plugin（QQ 用户访问微信小游戏的插件）
     *  2) 若当前是 QQ 环境但本地仍是微信登录态，自动清空 storage 让游戏重走 QQ 登录
     *  3) 主动绑定 wx.onShow：QQ 登录小程序返回时提取票据并换登录态
     */
    handleAppOnLaunch(): void;
    /**
     * 「切换QQ账号」点击入口
     *
     * 根据运行环境自动分流：
     *  - QQ App 环境（`checkIsQQEnv() === true`）且业务传入了 `code2QQLogin`：
     *      调用 `qqPluginLogin()` 直接拿 QQ code → 交 `code2QQLogin` 探后台换登录态。
     *      业务后台路径参考 [src/cocos/login/login.ts](../cocos/login/login.ts) 的 `loginMp`（`_ltype=tiploginqqproc`）。
     *  - 微信宿主环境（或未传 `code2QQLogin`）：
     *      `launchQQMP` → 腾讯 QQ 小程序登录 → `wx.onShow` 提取票据 → `QueryUserInfo` 换登录态。
     */
    switchToQQ(): Promise<void>;
    /**
     * 「切换微信账号」点击（当前账号是 QQ 时）
     *
     * 根据运行环境自动分流：
     *  - QQ App 环境（`checkIsQQEnv() === true`）且业务传入了 `code2WxLogin`：
     *      调用 `wxLogin()` 拿微信 code → 交 `code2WxLogin` 探后台换登录态。
     *      业务后台路径参考 [src/cocos/login/login.ts](../cocos/login/login.ts) 的 `loginMp`（`_ltype=tiploginwxproc`）。
     *  - 微信宿主环境（或未传 `code2WxLogin`）：
     *      微信小游戏本身就是微信宿主，"切回微信"等价于：清掉 QQ 登录态（loginInfo + QQ 票据缓存）
     *      → 让 SDK 重新用 wx.login 走微信登录。
     */
    switchToWx(): Promise<void>;
    /**
     * QQ App 环境下「切换 QQ 账号」的直达路径：插件 login 拿 code → 交业务探后台
     */
    private _switchToQQViaPlugin;
    /**
     * QQ App 环境下「切换微信账号」的直达路径：wx.login 拿 code → 交业务探后台
     */
    private _switchToWxViaCode;
    /**
     * 绑定 wx.onShow（幂等）：
     *   - 启动时由 handleAppOnLaunch 调用一次
     *   - 业务页面再次需要可重复调用
     */
    private _bindWxOnShow;
    /** wx.onShow 回调：处理从腾讯 QQ 小程序返回的票据 */
    private _onWxShow;
    /**
     * 用 QQ 票据换取登录态 + 重启玩家服务
     *
     * 优先级：
     *  1. 业务侧注入了 `qqTicket2Login`（推荐，如 cocos `loginMp(_ltype=tiploginqqproc, code=qqAccessToken)`）→ 走它。
     *  2. 否则 fallback 到 `queryQQLoginUserInfo`（仅适用于能统一拦截 `Logininfo` 响应头的环境）。
     */
    private _consumeQQTicket;
    /**
     * 统一登录成功收尾：clearPlayer → bootstrapPlayer → toast → onLoginSuccess → 释放 _switching
     *
     * 说明：
     *  - `switching` 语义与 UI 层「登录中」loading 是同一件事，因此在 bootstrap 完成前
     *    保持为 true；bootstrap 结果 resolve 或 reject 都释放
     *  - toast 文案根据 platform 选：QQ = switchQQSuccess；WX = switchWxSuccess
     *  - onLoginSuccess 在 toast 之后调，业务侧派事件/关登录页由回调决定
     *  - bootstrapPlayer 失败仍会触发 onLoginSuccess？NO：bootstrap 抛错代表玩家数据
     *    没拉到，登录不算完整成功，跳过 toast 与 onLoginSuccess，让业务侧看到 catch
     */
    private _finishLoginOk;
}

/**
 * AccountService 运行所需的所有外部依赖
 *
 * 全部由业务方在启动期通过 `AccountService.configure(deps)` 一次性注入。
 */
export declare interface AccountServiceDeps {
    /** QQ 互联 AppId（业务方常量） */
    qqAppId: string | number;
    /** 通用 post 方法（用于调 QueryUserInfo 接口） */
    post: QQPostFn;
    /**
     * QueryUserInfo 接口域名
     *
     * 支持函数形式以便在测试/正式环境间动态切换。
     */
    getQQLoginUserInfoHost: string | (() => string);
    /**
     * storage 适配器
     *
     * 用于读写 loginInfo / QQ 票据缓存。
     * 一般直接桥接到业务方的 oops.storage 即可。
     */
    storage: QQStorageLike;
    /** loginInfo 在 storage 中的 key（业务方决定） */
    loginInfoStorageKey: string;
    /**
     * QQ 票据在 storage 中的 key（可选）
     *
     * **不传时默认为 `${loginInfoStorageKey}__qq_ticket`**。
     *
     * 必须与 `loginInfoStorageKey` 区分开：同一个 key 会导致 QQ 票据覆盖业务方身份的
     * loginInfo（如 cocos `loginMp` 写入的 `Logininfo` header 结果）。
     */
    qqTicketStorageKey?: string;
    /** 当前是否为 QQ 账号（业务方根据自家 loginInfo 结构判断） */
    isQQAccount: () => boolean;
    /**
     * 是否「在 QQ 环境下强制 QQ 登录态」（可选）
     *
     * 默认 `() => true`，即启动期一旦检测到「QQ 环境 + 微信登录态」就清 storage
     * 让游戏重走 QQ 登录。
     *
     * 若业务期望「QQ App 下也允许手动切到微信账号」，请传入 `() => false`，
     * 或基于「用户是否手动切到微信账号」返回动态值。
     */
    shouldForceQQ?: () => boolean;
    /**
     * QQ App 环境下【切换 QQ 账号】的后台探身入口（可选）
     *
     * 不传则 fallback 到“跳腾讯 QQ 小程序”（launchQQMP）路径。
     *
     * 实现参考 [src/cocos/login/login.ts](../cocos/login/login.ts) 中的 `loginMp`：
     * 拿到 code 后调业务后台的「_ltype=tiploginqqproc」路径换登录态。
     *
     * @example
     * code2QQLogin: code => loginMp({
     *   url: getApiHost() + '/login',
     *   appid: WX_APP_ID,
     *   _ltype: 'tiploginqqproc',
     *   storage,
     *   onLoginInfo: (info) => updateLocalLoginInfo(info),
     * }),
     *
     * 注：loginMp 内部会自己调 wx.login 拿 code；AccountService 这里会优先用
     * `qqPluginLogin()` 拿到 QQ code 传入 ，以便业务后台拿到的是 QQ 账号的 code。
     */
    code2QQLogin?: (code: string) => Promise<unknown> | unknown;
    /**
     * QQ App 环境下【切换微信账号】的后台探身入口（可选）
     *
     * 不传则 fallback 到“清 storage + bootstrapPlayer”的原路径（适用于微信宿主）。
     *
     * 实现参考 [src/cocos/login/login.ts](../cocos/login/login.ts) 中的 `loginMp`：
     * 拿到 code 后调业务后台的「_ltype=tiploginwxproc」路径换登录态。
     */
    code2WxLogin?: (code: string) => Promise<unknown> | unknown;
    /**
     * 【微信宿主下】拿到 QQ 票据后的后台探身入口（可选但强烈推荐）
     *
     * 背景：微信宿主下 QQ 登录路径是
     *   1. `launchQQMP` 跳腾讯 QQ 小程序
     *   2. QQ 小程序 navigateBack 后、`wx.onShow` 从 referrerInfo 中提取到 QQ 票据
     *   3. 依据票据走业务后台换取登录态
     *
     * 本函数负责第三步。业务侧一般会用
     * [src/cocos/login/login.ts](../cocos/login/login.ts) 的 `loginMp({
     *   _ltype: 'tiploginqqproc',
     *   code: ticket.qqAccessToken,
     *   ...
     * })` 实现，`loginMp` 会负责读 `Logininfo` 响应头并写入 storage。
     *
     * **未传时的 fallback**：内部调 `queryQQLoginUserInfo`（快路，仅 H5 等响应头
     * 能被项目统一拦截的环境可用）。
     *
     * @example
     * qqTicket2Login: ticket => loginMp({
     *   url: getApiHost() + '/login',
     *   appid: WX_APP_ID,
     *   _ltype: 'tiploginqqproc',
     *   code: ticket.qqAccessToken,
     *   storage,
     *   storageKey: loginInfoStorageKey,
     * }),
     */
    qqTicket2Login?: (ticket: QQTicketInfo) => Promise<unknown> | unknown;
    /**
     * 显示 toast 提示
     *
     * 由业务方决定使用 ToastTip / wx.showToast 等何种实现。
     */
    toast: (message: string) => void;
    /** 清空玩家本地缓存（如 PlayerService.ins.clear） */
    clearPlayer: () => void;
    /**
     * 强制重新启动玩家服务（如 PlayerService.ins.bootstrap({ force: true })）
     */
    bootstrapPlayer: (options: {
        force: boolean;
    }) => Promise<unknown> | void;
    /**
     * 登录成功后的业务回调（可选）
     *
     * 触发时机：`switchToQQ` / `switchToWx` 的所有成功路径（含「已是当前账号」的幂等分支）
     * 都会在 `bootstrapPlayer` 拿到玩家数据后调用本函数。
     *
     * 典型用途：业务方在此派发全局事件、关闭登录页、上报埋点等。
     *
     * 语义：
     *  - `platform`：当前登录态平台
     *  - `reason`：本次触发原因，业务方可用来区分「首次登录 / 切号 / 幂等重登」
     *
     * @example
     * onLoginSuccess: ({ platform, reason }) => {
     *   oops.message.dispatch(EventName.AuthAccepted, { platform, reason });
     *   oops.gui.close(UIID.Auth);
     * }
     */
    onLoginSuccess?: (info: {
        platform: 'qq' | 'wx';
        reason: LoginSuccessReason;
    }) => void;
}

/**
 * AccountService 文案配置（可选覆盖默认中文文案）
 */
export declare interface AccountServiceMessages {
    alreadyQQ?: string;
    alreadyWx?: string;
    switchQQFail?: string;
    switchWxSuccess?: string;
    switchWxFail?: string;
    switchQQRetry?: string;
    switchQQSuccess?: string;
}

export declare const ACT_ID_MAP: {
    GP: string;
};

/**
 * 为 Vue 组件添加 emits 属性
 * @param {string} filePath 组件地址
 * @param {string} [fileContent] 组件内容
 * @returns {string} 新的组件内容
 *
 * @example
 * ```ts
 * addNameForComponent('xxx.vue');
 * ```
 */
export declare function addEmitsForComponent(filePath: string, fileContent?: string): string | undefined;

/**
 * 添加 MSDK 原生回调监听器
 * 用于监听原生层发送给 Web 层的消息
 * @param callback - 回调函数，接收原生层传递的数据
 * @example
 * ```ts
 * addMsdkNativeCallbackListener((data) => {
 *   console.log('收到原生消息:', data);
 * });
 * ```
 */
export declare function addMsdkNativeCallbackListener(callback: Function): void;

/**
 * 为 Vue 组件添加、修正 name 属性
 * @param {string} filePath 组件地址
 * @param {string} componentName 组件名称
 * @returns {string} 新的组件内容
 *
 * @example
 * ```ts
 * addNameForComponent('xxx.vue', 'PressUploader');
 * ```
 */
export declare function addNameForComponent(filePath: string, componentName: string): any;

/**
 * add num and avoid float number
 * @param {number} num1 第1个数字
 * @param {number} num2 第2个数字
 * @returns {number} 结果
 * @example
 * ```ts
 * addNumber(0.1, 0.2); // 0.3
 * ```
 */
export declare function addNumber(num1: number, num2: number): number;

/**
 * 添加或更新配置
 *
 * @param {object} config 配置信息
 * @param {object} config.keyValue 配置对象
 * @param {string} config.keyValue.key 配置的key
 * @param {string} config.keyValue.value 配置的value
 * @param {number} config.valueType 配置类型，1: NUMBER, 2: STRING, 3: TEXT, 4: JSON, 5: XML, 18: 日期, 20: yaml
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 * addOrUpdateRainbowKV({
 *   keyValue: {
 *     key: 'theKey',
 *     value: 'theValue',
 *   },
 *   valueType: 2,
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   }
 * }).then(() => {
 *
 * })
 */
export declare function addOrUpdateRainbowKV({ keyValue, valueType, secretInfo, }: ModifyConfigParam): Promise<object>;

/**
 * 增加配置
 *
 * @param {object} config 配置信息
 * @param {object} config.keyValue 配置对象
 * @param {string} config.keyValue.key 配置的key
 * @param {string} config.keyValue.value 配置的value
 * @param {number} config.valueType 配置类型，1: NUMBER, 2: STRING, 3: TEXT, 4: JSON, 5: XML, 18: 日期, 20: yaml
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 * addRainbowKV({
 *   keyValue: {
 *     key: 'theKey',
 *     value: 'theValue',
 *   },
 *   valueType: 2,
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   }
 * }).then(() => {
 *
 * })
 */
export declare function addRainbowKV({ keyValue, valueType, secretInfo, }: ModifyConfigParam): Promise<object>;

/**
 * 为图片增加文字
 *
 * @param {Object} config 配置
 * @param {number} config.width 宽度
 * @param {number} config.height 高度
 * @param {Array<string>} config.textList 文字列表，支持多行
 * @param {string} config.imgPath 图片路径
 * @returns {string} canvas.toDataURL生成的base64图片
 *
 * @example
 *
 * ```ts
 * const imgUrl = addTextForImg({
 *   width: 300,
 *   height: 300,
 *   textList: ['第一行', '第二行'],
 *   imgPath: './test.png',
 * })
 * ```
 */
export declare function addTextForImg({ width, height, textList, imgPath, }: {
    width: number;
    height: number;
    textList: Array<string>;
    imgPath: string;
}): Promise<string>;

export declare function aegisReportErrorV2(mAegisV2: any, options: ReportOptions): void;

export declare function aegisReportEventV2(mAegisV2: any, options: EventOptions): void;

export declare function aegisReportInfoV2(mAegisV2: any, options: ReportOptions, method?: string): void;

export declare class AegisReportInPixui {
    static options: InitAegisOptions;
    static aegis: any;
    static init(options: InitAegisOptions): Promise<any>;
    static report(info: Record<string, any>): Promise<void>;
    static info(info: Record<string, any>): Promise<void>;
}

export declare class AegisReportInterceptor implements IResponseInterceptor {
    private options;
    constructor(options: IAegisReportOptions);
    interceptor(param: IResponseInterceptorParam): [boolean, IResponseInterceptorParam];
}

export declare function aegisReportV2(mAegisV2: any, options: ReportOptions): void;

/**
 * Aegis 上报专用：请求打点拦截器
 *
 * - 业务：在「请求拦截器链」最前面加本拦截器，把 `Date.now()` 注入到 `param.__aegisStartTime`
 * - 配合 `AegisReportInterceptor`（响应拦截器）使用，能算出精确耗时 duration
 *
 * 设计原因：
 *   - `NetworkEngine` 用 reduce 串成 Promise 链，**响应拦截器拿不到「请求发起时刻」**
 *   - 只有显式在请求链里打点，响应拦截器才能 `Date.now() - startTime` 算耗时
 *   - 字段名带双下划线前缀（`__aegisStartTime`），与 `IRawRequest.__cocosOriginUrl` 一致风格，
 *     不会和业务 reqData / header 冲突
 *
 * 注意：
 *   - 该拦截器不应该被排在 `CocosHostInterceptor` 之前：domain 拼接后才算真正发起，
 *     但 Aegis 关心的是「业务调用时点」，所以其实放在最前更准确；放哪都行，只要 startTime 字段在
 *     请求链中能透传到响应拦截器
 *   - 本拦截器是 **幂等** 的：若上游拦截器已注入过 startTime，就保留上游值不覆盖
 *     （防重入 / 装饰器场景下开始时间被推迟）
 */
export declare class AegisStartTimeInterceptor implements IRequestInterceptor {
    interceptor(param: IRawRequest): [boolean, IRawRequest];
}

/**
 * 分析首页Bundle信息
 *
 * @export
 * @param config 配置
 * @param {string} config.domain 域名
 * @param {string} config.buildPath 打包路径
 * @returns {*}
 *
 * @example
 * ```ts
 * analyzeIndexBundle({
 *   domain: '',
 *   buildPath: '',
 * })
 * ```
 */
export declare function analyzeIndexBundle({ domain, buildPath }: {
    domain: string;
    buildPath: string;
}): ({
    file: string;
    size: number;
    time: number;
} | undefined)[];

declare interface AnalyzeItem {
    root: string;
    simpleRoot: string;
    project: string;
    git: string;
    analyzeDir?: string;
    needAnalyzeSubDir?: string[];
}

/**
 * 增加需要签名的 CGI 接口
 * @param cgiList 需要签名的接口地址列表
 */
export declare function appendSignCGI(cgiList?: Array<string>): void;

/**
 * 在源代码中查找 search 并替换为 replace，按 3 级策略匹配
 *
 * 策略：
 *   1. 精确匹配：原样查找 search
 *   2. 行级匹配：去除每行首尾空白后逐行对比（应对 AI 输出与源文件缩进不一致）
 *   3. 子串匹配：查找首行 trim 后的子串位置，从该位置开始截取与 search 等长的范围替换
 *
 * @param source 源代码字符串
 * @param search 要查找的字符串（可能被 AI 带了行号前缀，函数会自动清理）
 * @param replace 替换为的新字符串（同上，自动清理行号前缀）
 * @returns 替换后的字符串；查找失败返回 null
 */
export declare function applySearchReplace(fileContent: string, rawSearch: string, rawReplace: string): SearchReplaceResult;

export declare function ApprovalRainbowReleaseTask({ secretInfo, taskId, versionName, status, rejectReason, }: {
    secretInfo: ISecretInfo_3;
    taskId: string | number;
    versionName: string;
    status?: number;
    rejectReason?: string;
}): Promise<object>;

declare const AREA_MAP: {
    readonly MAINLAND: "mainland";
    readonly OVERSEAS: "overseas";
};

declare const AREA_MAP_WITH_GLOBAL: {
    readonly MAINLAND: "mainland";
    readonly OVERSEAS: "overseas";
    readonly GLOBAL: "global";
};

/** ArrayBuffer 转十六进制大写字符串 */
export declare function arrayBuffer2Hex(buf: ArrayBuffer | undefined | null): string;

export declare function asyncExportTencentDoc({ accessToken, clientId, openId, fileId, exportType, }: ISecretInfo_2 & {
    fileId: string;
    exportType: number;
}): Promise<any>;

/**
 * 基本请求
 * @private
 * @param {object} config - 配置信息
 * @returns {Promise} 请求Promise
 * @example
 * ```ts
 * baseRequestRainbow({
 *   url: '/api/some-path',
 *   data: { foo: 1 },
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'yyy',
 *     secretKey: 'zzz',
 *     envName: 'Default',
 *     groupName: 'group',
 *   },
 * }).then(res => console.log(res));
 * ```
 */
export declare function baseRequestRainbow({ url, data: reqData, secretInfo, }: ReqParam): Promise<object>;

/**
 * 批量重命名文件和文件夹（同步版本）
 * @param {string} dirPath - 要处理的目录路径
 * @param {Object} renameConfig - 重命名配置对象 { 旧名称: 新名称 }
 * @param {boolean} [recursive=true] - 是否递归处理子目录
 * @example
 * ```ts
 * batchRenameDirEntries('src/components', {
 *   'press-icon-plus': 'press-icon',
 *   'press-dialog-plus': 'press-dialog',
 * });
 * // 递归将 src/components 下名为 press-icon-plus、press-dialog-plus 的文件/文件夹重命名
 *
 * // 只重命名当前层、不递归
 * batchRenameDirEntries('src/components', { 'a': 'b' }, false);
 * ```
 */
export declare function batchRenameDirEntries(dirPath: string, renameConfig: Record<string, string>, recursive?: boolean): void;

/**
 * 批量替换文件内容（性能优化版）
 * 将同 dirList 的规则合并，每个文件只读写一次
 * @param {Array<{ list: Array, dirList: string|string[] }>} replaceList - 替换规则列表
 * @example
 * ```ts
 * batchReplaceFileContent([
 *   {
 *     list: [
 *       ['<PressIconPlus', '<PressIcon'],
 *       [/press-icon-plus/g, 'press-icon'],
 *     ],
 *     dirList: ['src/**\/*.vue'],
 *   },
 * ]);
 * // 同 dirList 的规则会被合并，避免重复读写
 * ```
 */
export declare function batchReplaceFileContent(replaceList: Array<{
    list: Array<[string | RegExp, string]>;
    dirList: string | string[];
}>): void;

/**
 * 批量发送企业微信机器人base64图片
 * - chatId 支持字符串或字符串数组，传 `'ALL'` 或 `['ALL']` 会发送给所有人
 * @param {object} config 配置信息
 * @param {string} config.img base64图片
 * @param {string | Array<string>} config.chatId 会话Id，支持单个字符串、字符串数组、`'ALL'` 或 `['ALL']`（发送给所有人）
 * @param {string} config.webhookUrl webhook地址
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * // 发送给单个会话
 * batchSendWxRobotBase64Img({
 *   img: 'xxx',
 *   chatId: 'xxx',
 *   webhookUrl: 'xxx',
 * });
 *
 * // 发送给多个会话
 * batchSendWxRobotBase64Img({
 *   img: 'xxx',
 *   chatId: ['chatId1', 'chatId2'],
 *   webhookUrl: 'xxx',
 * });
 *
 * // 发送给所有人
 * batchSendWxRobotBase64Img({
 *   img: 'xxx',
 *   chatId: 'ALL', // 或 ['ALL']
 *   webhookUrl: 'xxx',
 * });
 *
 */
export declare function batchSendWxRobotBase64Img({ img, chatId, webhookUrl, }: {
    img: string;
} & ISendReq): Promise<any>;

/**
 * 批量发送企业微信机器人Markdown消息（最常用）
 * - chatId 支持字符串或字符串数组，传 `'ALL'` 或 `['ALL']` 会发送给所有人
 * - 支持 Markdown V2 格式，通过 isV2 参数控制
 * @param {object} config 配置信息
 * @param {string} config.content Markdown消息内容
 * @param {Array<object>} [config.attachments] 附加内容
 * @param {string | Array<string>} config.chatId 会话Id，支持单个字符串、字符串数组、`'ALL'` 或 `['ALL']`（发送给所有人）
 * @param {string} config.webhookUrl webhook地址
 * @param {boolean} [config.isV2=false] 是否使用 Markdown V2 格式
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * // 发送给单个会话
 * batchSendWxRobotMarkdown({
 *   content: '## 标题\n内容',
 *   chatId: 'xxx',
 *   webhookUrl: 'xxx',
 * });
 *
 * // 发送给多个会话
 * batchSendWxRobotMarkdown({
 *   content: '## 标题\n内容',
 *   chatId: ['chatId1', 'chatId2'],
 *   webhookUrl: 'xxx',
 * });
 *
 * // 发送给所有人
 * batchSendWxRobotMarkdown({
 *   content: '## 标题\n内容',
 *   chatId: 'ALL', // 或 ['ALL']
 *   webhookUrl: 'xxx',
 * });
 *
 * // 使用 Markdown V2 格式
 * batchSendWxRobotMarkdown({
 *   content: '## 标题\n内容',
 *   chatId: 'xxx',
 *   webhookUrl: 'xxx',
 *   isV2: true,
 * });
 *
 */
export declare function batchSendWxRobotMarkdown({ content, attachments, chatId, webhookUrl, isV2, }: {
    content: string;
    attachments?: Array<object>;
    isV2?: boolean;
} & ISendReq): Promise<any>;

/**
 * 批量发送企业微信机器人文本消息
 * - chatId 支持字符串或字符串数组，传 `'ALL'` 或 `['ALL']` 会发送给所有人
 * @param {object} config 配置信息
 * @param {string} config.content 消息内容
 * @param {string | Array<string>} config.alias 被@的用户别名，支持单个字符串或字符串数组
 * @param {string | Array<string>} config.chatId 会话Id，支持单个字符串、字符串数组、`'ALL'` 或 `['ALL']`（发送给所有人）
 * @param {string} config.webhookUrl webhook地址
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * // 发送给单个会话
 * batchSendWxRobotMsg({
 *   content: '消息内容',
 *   alias: 'user1',
 *   chatId: 'xxx',
 *   webhookUrl: 'xxx',
 * });
 *
 * // 发送给多个会话并@多个用户
 * batchSendWxRobotMsg({
 *   content: '消息内容',
 *   alias: ['user1', 'user2'],
 *   chatId: ['chatId1', 'chatId2'],
 *   webhookUrl: 'xxx',
 * });
 *
 * // 发送给所有人
 * batchSendWxRobotMsg({
 *   content: '消息内容',
 *   alias: 'user1',
 *   chatId: 'ALL', // 或 ['ALL']
 *   webhookUrl: 'xxx',
 * });
 *
 */
export declare function batchSendWxRobotMsg({ content, alias, chatId, webhookUrl, }: {
    content: string;
    alias: string | Array<string>;
} & ISendReq): Promise<any>;

/**
 * 批量解除腾讯云 COS 图片封禁
 * - 对多张被封禁的图片并行执行解封操作
 * - 底层通过 Promise.allSettled 并发调用 unfreezeCosImage
 *
 * @param {object} config 配置信息
 * @param {string} config.secretId 腾讯云 SecretId
 * @param {string} config.secretKey 腾讯云 SecretKey
 * @param {string} config.bucket COS 存储桶名称（如 'my-bucket-1250000000'）
 * @param {string} config.region COS 存储桶所在区域（如 'ap-guangzhou'）
 * @param {Array<string>} config.keys 被封禁的对象键列表
 * @returns {Promise<Array<object>>} 每张图片的解封结果数组，包含 key、success、data/error 字段
 * @example
 * ```ts
 * const results = await batchUnfreezeCosImages({
 *   secretId: 'your-secret-id',
 *   secretKey: 'your-secret-key',
 *   bucket: 'my-bucket-1250000000',
 *   region: 'ap-guangzhou',
 *   keys: ['images/photo1.jpg', 'images/photo2.jpg'],
 * });
 *
 * results.forEach(r => {
 *   if (r.success) {
 *     console.log(`${r.key} 解封成功`);
 *   } else {
 *     console.error(`${r.key} 解封失败:`, r.error);
 *   }
 * });
 * ```
 */
export declare function batchUnfreezeCosImages({ secretId, secretKey, bucket, region, keys, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    keys: Array<string>;
}): Promise<Array<{
    key: string;
    success: boolean;
    data?: any;
    error?: any;
}>>;

export declare function batchUpdateTencentSheetV3({ accessToken, clientId, openId, bookId, requests, }: ISecretInfo_2 & {
    bookId: string;
    requests: Record<string, any>;
}): Promise<any>;

export declare class BluetoothBump {
    /** 我方临时 ID（每次启动随机生成，写到广播特征值里） */
    myTempId: string;
    /** 当前运行平台 */
    platform: string;
    /** 是否跳过广播（peripheral 初始化失败时降级为只扫描） */
    skipAdvertising: boolean;
    /** 是否已经成功触发过碰一碰 */
    hasBumped: boolean;
    private readonly serviceUuid;
    private readonly characteristicUuid;
    private readonly rssiThreshold;
    private readonly cooldownMs;
    private readonly lingerBeforeStopMs;
    private readonly pollIntervalMs;
    private readonly privacyContent;
    /** 匹配模式：simple（单向发现即触发）/ mutual（双向互认） */
    private readonly mode;
    private readonly peerTtlMs;
    private readonly advertiseUpdateThrottleMs;
    private readonly onBump?;
    private readonly onError?;
    private readonly onLog?;
    private readonly onDeviceFoundCallback?;
    private readonly adapter;
    private readonly now;
    private readonly setTimeoutFn;
    private readonly clearTimeoutFn;
    private readonly setIntervalFn;
    private readonly clearIntervalFn;
    private peripheralServer;
    private isDiscovering;
    private bumpedMap;
    private gracefulStopTimer;
    private pollTimer;
    /** mutual 模式：候选 peer 池，key = peerTempId */
    private seenPeers;
    /** mutual 模式：当前广播中"点名"的 peerId（为空表示还没看到任何人） */
    private currentAdvertisedPeer;
    /** mutual 模式：上次更新广播的时间戳（用于节流） */
    private lastAdvertiseUpdateAt;
    /** mutual 模式：updateAdvertisedValue 连续失败后降级为 simple（仅当前会话内） */
    private advertiseUpdateBroken;
    private deviceFoundCb;
    private adapterStateChangeCb;
    constructor(opts?: BluetoothBumpOptions, deps?: BluetoothBumpDeps);
    /** 启动碰一碰（必须在用户点击事件回调中调用） */
    start(): Promise<void>;
    /** 停止：解绑所有监听 + 停止扫描 + 停止广播 + 关闭适配器 */
    stop(): void;
    /** 启动失败的统一处理（业务方可通过 onError 拿到原始错误） */
    private handleStartError;
    /** 监听蓝牙适配器状态变化：用户打开蓝牙后自动重试 */
    private watchAdapterStateForRetry;
    /** 监听设备发现 + 启动 iOS 兜底轮询 */
    private bindDeviceFound;
    /** 调试用：定期 getBluetoothDevices，避免 iOS 上 allowDuplicatesKey 不上报重复的问题 */
    private startPolling;
    /** 处理扫到的单个设备 */
    private handleDevice;
    /**
     * mutual 模式（v2，方案2 实现）：协议双向 simple
     *
     * 设计取舍：
     *   v1 mutual 用"动态更新广播 payload 的 seenPeerId"做双向互认，但 iOS 上
     *   wx 的 updateBLEAdvertising → stop+addService+start 链路在真机上极不可靠：
     *     - deviceName 不会真正刷新（CoreBluetooth 缓存）
     *     - addService 重复注册会失败、走兜底分支后广播就停了
     *     - 高频 update 还会让 iOS 端事件循环卡死
     *   导致弱信号端永远收不到"被点名"广播 → 不弹窗。
     *
     * v2 直接退一步：
     *   - 不再动态更新广播 payload；广播一次启动后保持初始 payload 不变
     *   - 触发条件：扫到的对端必须能解析出 BUMP_ 协议 payload（协议匹配） + 本机 RSSI ≥ 阈值
     *   - "双向"靠两端都跑这套规则、各自独立达阈值时触发；阈值收紧（≈10cm）就足够防误触
     *   - iOS↔Android RSSI 不对称的代价：可能两端弹窗时差最大到秒级（取决于谁先稳定过阈值）
     *     但相比 v1 的"一端永远不弹"，这是更可接受的退化
     */
    private handleDeviceMutual;
    /** mutual 模式：更新自己广播里的 seenPeerId（带节流 + 失败降级） */
    private updateAdvertisedPeer;
    /** 触发碰一碰成功：通知业务方 + 优雅停止（保持广播一段时间） */
    private triggerBump;
    /** 仅停止扫描（保留广播） */
    private stopDiscoveryOnly;
    private log;
}

/** 主类的额外依赖（用于测试时注入假时钟、假 timer、假 adapter） */
export declare interface BluetoothBumpDeps {
    adapter?: WxBluetoothAdapter;
    now?: () => number;
    setTimeoutFn?: (fn: () => void, ms: number) => any;
    clearTimeoutFn?: (handle: any) => void;
    setIntervalFn?: (fn: () => void, ms: number) => any;
    clearIntervalFn?: (handle: any) => void;
}

/** 启动失败时通过 onError 抛出的错误信息 */
export declare interface BluetoothBumpError {
    errCode?: number;
    errMsg?: string;
    raw?: any;
}

/**
 * 匹配模式：
 *   - 'simple' ：默认行为。扫到对方且 RSSI 达标即触发（单向发现，简单快速）。
 *   - 'mutual' ：前端自撮合。双向互认后才触发：
 *       我广播里带"我看到的对方 ID"，对方广播里也带"它看到的对方 ID"；
 *       当双方广播里携带的 peerId 都指向对方时，才算配对成功。
 */
export declare type BluetoothBumpMode = 'simple' | 'mutual';

/** BluetoothBump 构造选项 */
export declare interface BluetoothBumpOptions {
    /** 服务 UUID，两端必须一致 */
    serviceUuid?: string;
    /** 特征 UUID（仅外围模式使用） */
    characteristicUuid?: string;
    /** RSSI 阈值，超过此值视为"碰到了" */
    rssiThreshold?: number;
    /** 同一设备的去重冷却时间 */
    cooldownMs?: number;
    /** 成功触发后保持广播的时长（让对方也能扫到自己） */
    lingerBeforeStopMs?: number;
    /** iOS 兜底轮询间隔 */
    pollIntervalMs?: number;
    /** 隐私协议弹窗内容（不传用默认文案） */
    privacyContent?: string;
    /**
     * 匹配模式，默认 'simple'（保持向后兼容）。
     * 选 'mutual' 开启前端自撮合（双向互认后才触发 onBump）。
     */
    mode?: BluetoothBumpMode;
    /** mutual 模式：候选 peer 信息的有效期（毫秒），过期则从候选池移除 */
    peerTtlMs?: number;
    /** mutual 模式：更新自己广播里 seenPeerId 的最小间隔（毫秒），防抖 */
    advertiseUpdateThrottleMs?: number;
    /**
     * 业务回调：碰到对方时触发
     *   - peerDeviceId：扫描层的设备地址（iOS 是本机视角的 UUID，Android 是 MAC）。
     *     ⚠️ 这个值是"扫描者本地"视角的，A 拿到的对方 deviceId 与 B 自己的 deviceId 不一定相同，
     *     不能用它跟对方的 myTempId 直接对比。
     *   - peerTempId：对方写在广播 payload 里的 myTempId（6 位字符串）。
     *     这个值是"对方应用层产生的"，A 看到的 peerTempId 与 B 的 myTempId **一定一致**，
     *     适合两台手机做配对核对（"我方 ID" vs "对方 ID"）。
     *     若对方广播解析失败则为空字符串。
     */
    onBump?: (peerDeviceId: string, rssi: number, dev: BluetoothDeviceInfo, peerTempId: string) => void;
    /** 业务回调：启动失败时触发 */
    onError?: (err: BluetoothBumpError) => void;
    /** 业务回调：日志/状态变化（用于打日志或 UI 更新） */
    onLog?: (msg: string, data?: any) => void;
    /** 业务回调：每次扫到设备（不论是否碰到）时触发，用于调试/UI 展示 */
    onDeviceFound?: (dev: BluetoothDeviceInfo) => void;
}

/** 广播载荷（mutual 模式）：固定长度 13 字节，myTempId|seenPeerId */
export declare interface BluetoothBumpPayload {
    /** 发送端自己的临时 ID（6 位大写） */
    myTempId: string;
    /** 发送端当前"看到的对方 ID"，未看到时为 '------' */
    seenPeerId: string;
}

/**
 * 蓝牙"碰一碰"对外类型定义
 */
/** 扫描到的蓝牙设备（仅声明用得到的字段，避免污染） */
export declare interface BluetoothDeviceInfo {
    deviceId: string;
    RSSI: number;
    name?: string;
    localName?: string;
    advertisData?: ArrayBuffer;
    advertisServiceUUIDs?: string[];
    serviceData?: Record<string, ArrayBuffer>;
    [key: string]: any;
}

export declare function build({ files, root, bundleName, outputDir, }: {
    files?: Array<string>;
    root?: string;
    bundleName: string;
    outputDir?: string;
}): Promise<unknown>;

/**
 * 打包并上传到服务器
 * @param {object} options 配置
 * @param {string} options.hostName 服务器名称
 * @param {string} options.hostPwd 服务器密码
 * @param {string} [options.root] 项目根目录
 * @param {string} [options.bundleName] 打包文件名称
 * @param {boolean} [options.wrapHostPwd=true] 是否用双引号包裹密码，默认为 true
 * @param {string} [options.outputDir='dist'] 打包输出目录，默认为 'dist'
 * @example
 *
 * await buildAndUpload({
 *   hostName: '9.9.9.9',
 *   hostPwd: 'xxxx',
 *   bundleName: 'cron-job-svr',
 * });
 *
 */
export declare function buildAndUpload({ root, bundleName, hostName, hostPwd, hostTargetDir, wrapHostPwd, outputDir, }: {
    root?: string;
    bundleName?: string;
    hostName: string;
    hostPwd: string;
    hostTargetDir: string;
    wrapHostPwd?: boolean;
    outputDir?: string;
}): Promise<any>;

/**
 * 构建审核通知内容数组
 *
 * 统一拼接审核通知消息，各流水线只需传入标题和差异化字段即可。
 *
 * @example H5 发布
 * ```ts
 * const content = buildAuditContent({
 *   title: '【H5发布审核】',
 *   projectName: 'pmd-mobile/match/gp',
 *   creator: 'novlan1',
 *   auditor: 'junshao',
 *   buildUrl: 'https://devops.woa.com/xxx',
 *   extraLines: [
 *     `子工程：\`gp-hor\``,
 *     `灰度比例：50%`,
 *   ],
 * });
 * ```
 *
 * @example 回滚审核
 * ```ts
 * const content = buildAuditContent({
 *   title: '【`回滚`审核】',
 *   projectName: 'pmd-mobile/match/gp',
 *   creator: 'novlan1',
 *   auditor: 'junshao',
 *   buildUrl: 'https://devops.woa.com/xxx',
 *   extraLines: [`子工程：\`gp-hor\``],
 * });
 * ```
 */
export declare function buildAuditContent(options: IBuildAuditContentOptions): string[];

/**
 * 广播设备名前缀（iOS Peripheral 唯一能下发的自定义字段就是 localName）
 * 完整格式： `BUMP_<myTempId>` 或 `BUMP_<myTempId>_<seenPeerId>`
 *
 * 原理：iOS CoreBluetooth 不允许 Peripheral 在广播包里塞 ServiceData，
 *      只允许 localName + serviceUUIDs。所以 iOS↔iOS 必须靠 localName 传 myTempId。
 *      Android 同样支持 localName，所以这套方案跨平台一致。
 */
export declare const BUMP_NAME_PREFIX = "BUMP_";

/**
 * API 适配器 —— 由业务方实现，注入到 BumpService
 *
 * 这是唯一与后端交互的接口，只要后端提供这 4 个接口，
 * 任何业务都可以复用 BumpService。
 */
export declare interface BumpApiAdapter {
    /** 发起碰一碰，获取 tempId */
    bumpStart(req: BumpStartReq): Promise<BumpStartRsp>;
    /** 上报撮合 */
    bumpReport(req: BumpReportReq): Promise<BumpReportRsp>;
    /** 领取奖励 */
    bumpReward(req: BumpRewardReq): Promise<BumpRewardRsp>;
    /** 通过 tempId 获取对端信息 */
    getPeerByTempId(req: GetPeerByTempIdReq): Promise<GetPeerByTempIdRsp>;
}

/** BumpService 派发的事件名 */
export declare const BumpEvent: {
    /** 阶段变化 */
    readonly PhaseChanged: "bump:phase-changed";
    /** 发现附近设备 */
    readonly PeerFound: "bump:peer-found";
    /** 设备离开 */
    readonly PeerLost: "bump:peer-lost";
    /** 碰蛋成功（含奖励） */
    readonly Matched: "bump:matched";
    /** 软失败（可继续选下一只） */
    readonly SoftFail: "bump:soft-fail";
    /** 硬失败（会话中断） */
    readonly Failed: "bump:failed";
    /** tempId 已刷新 */
    readonly TempIdRefreshed: "bump:tempid-refreshed";
};

/** 事件总线适配器 */
export declare interface BumpEventBus {
    emit(event: string, data?: any): void;
    on(event: string, handler: (...args: any[]) => void): void;
    off(event: string, handler: (...args: any[]) => void): void;
}

/** 日志适配器 */
export declare interface BumpLogger {
    info(msg: string, ...args: any[]): void;
    warn(msg: string, ...args: any[]): void;
    error(msg: string, ...args: any[]): void;
}

/** 后台撮合状态（BumpReport 返回） */
export declare enum BumpMatchStatus {
    Unknown = 0,
    Waiting = 1,
    Matched = 2,
    Loser = 3
}

/** bumpPeer 的返回结果 */
export declare interface BumpPeerResult {
    success: boolean;
    /** 匹配成功时的奖励信息 */
    reward?: BumpRewardRsp;
    /** 匹配 ID */
    matchId?: string;
    /** 失败时的错误文案 */
    error?: string;
    /** 后台错误码 */
    ret?: number;
    /** 正在等待对方上报 */
    waiting?: boolean;
}

/**
 * bump-service —— 碰一碰业务编排层类型定义
 *
 * 与 bluetooth-bump（纯蓝牙层）配合使用：
 *   bluetooth-bump 负责：蓝牙广播/扫描/RSSI 判定/去重
 *   bump-service   负责：状态机/API 调用/缓存/重试/事件派发
 */
/** 碰一碰阶段 */
export declare enum BumpPhase {
    /** 空闲 */
    Idle = "idle",
    /** 正在启动（调 BumpStart 拿 tempId） */
    Starting = "starting",
    /** 扫描中（蓝牙已启动，等待用户碰） */
    Scanning = "scanning",
    /** 上报中（正在调 BumpReport） */
    Reporting = "reporting",
    /** 已匹配成功 */
    Matched = "matched",
    /** 失败（蓝牙/网络硬错误） */
    Failed = "failed"
}

/** BumpReport 请求参数 */
export declare interface BumpReportReq {
    act_id?: string;
    my_temp_id: string;
    peer_temp_id: string;
    rssi?: number;
    ts?: number;
    [key: string]: any;
}

/** BumpReport 响应 */
export declare interface BumpReportRsp {
    status?: number;
    match_id?: string;
    matchId?: string;
    err_msg?: string;
    [key: string]: any;
}

/** BumpReward 请求参数 */
export declare interface BumpRewardReq {
    act_id?: string;
    match_id: string;
    [key: string]: any;
}

/** BumpReward 响应 */
export declare interface BumpRewardRsp {
    egg_result_list?: any[];
    reward_type?: string;
    reward_amount?: number;
    [key: string]: any;
}

export declare class BumpService {
    /** 当前阶段 */
    phase: BumpPhase;
    /** 我方 tempId（BumpStart 后获得） */
    myTempId: string;
    /** tempId 过期时间戳 */
    expireAt: number;
    /** 活动 ID */
    actId: string;
    /** 当前匹配 ID（Report 成功后获得） */
    matchId: string;
    /** 当前正在碰的 peerTempId */
    currentPeerTempId: string;
    /** 附近设备缓存 */
    nearbyPeers: Map<string, NearbyPeer>;
    private readonly api;
    private readonly eventBus;
    private readonly storage;
    private readonly logger;
    private readonly tempIdRefreshMs;
    private readonly peerCacheTtlMs;
    private refreshTimer;
    private pruneTimer;
    /** 正在进行中的 bumpPeer 调用（防重复点击） */
    private bumpingSet;
    constructor(options: BumpServiceOptions);
    /**
     * 启动碰一碰会话
     * 1. 调用 BumpStart 拿 tempId
     * 2. 启动 tempId 自动刷新定时器
     * 3. 加载持久化缓存
     *
     * 返回 tempId 供蓝牙层使用
     */
    start(options?: BumpStartOptions): Promise<string>;
    /**
     * 停止碰一碰会话
     */
    stop(): void;
    /**
     * 碰一碰核心流程：上报 + 领奖
     * @param peerTempId 对端的 tempId
     * @param rssi 信号强度（可选）
     */
    bumpPeer(peerTempId: string, rssi?: number): Promise<BumpPeerResult>;
    /**
     * 注册附近设备（蓝牙层 onDeviceFound 时调用）
     * @param peerTempId 对端 tempId（从 BLE payload 解析）
     * @param deviceId BLE 设备 ID
     * @param rssi 信号强度
     */
    registerNearbyPeer(peerTempId: string, deviceId: string, rssi: number): void;
    /**
     * 获取对端用户信息（用于 UI 展示昵称/头像）
     */
    fetchPeerInfo(peerTempId: string): Promise<GetPeerByTempIdRsp | null>;
    /**
     * 获取附近设备缓存快照（只返回 TTL 内的）
     */
    getNearbyPeerCache(): NearbyPeer[];
    /**
     * 手动刷新 tempId（也可由定时器自动触发）
     */
    refreshTempId(): Promise<string>;
    private setPhase;
    private fail;
    private softFail;
    private startRefreshTimer;
    private clearRefreshTimer;
    private startPruneTimer;
    private clearPruneTimer;
    private pruneExpiredPeers;
    private saveNearbyPeerCache;
    private loadNearbyPeerCache;
}

/** BumpService 配置选项 */
export declare interface BumpServiceOptions {
    /** API 调用适配器（必传，由业务方注入具体的 HTTP 实现） */
    api: BumpApiAdapter;
    /** 事件总线适配器（可选，用于派发/订阅事件） */
    eventBus?: BumpEventBus;
    /** 本地存储适配器（可选，用于缓存持久化） */
    storage?: BumpStorage;
    /** 日志适配器（可选） */
    logger?: BumpLogger;
    /** 活动 ID（可选，每次 start 时也可传入） */
    actId?: string;
    /** tempId 刷新间隔（毫秒），默认 150000（2.5 分钟，3 分钟过期前刷新） */
    tempIdRefreshMs?: number;
    /** 附近设备缓存 TTL（毫秒），默认 30 分钟 */
    peerCacheTtlMs?: number;
}

/** BumpService 启动选项 */
export declare interface BumpStartOptions {
    /** 活动 ID（覆盖构造时的 actId） */
    actId?: string;
    /** 额外传给 BumpStart 接口的字段 */
    extra?: Record<string, any>;
}

/** BumpStart 请求参数 */
export declare interface BumpStartReq {
    act_id?: string;
    [key: string]: any;
}

/** BumpStart 响应 */
export declare interface BumpStartRsp {
    temp_id?: string;
    tempId?: string;
    expire_at?: number;
    expireAt?: number;
    [key: string]: any;
}

/** 本地存储适配器 */
export declare interface BumpStorage {
    get(key: string): string | null;
    set(key: string, value: string): void;
    remove(key: string): void;
}

/**
 * 记忆函数：缓存函数的运算结果
 * @param {Function} fn 输入函数
 * @returns {any} 函数计算结果
 *
 * @example
 * function test(a) {
 *   return a + 2
 * }
 *
 * const cachedTest = cached(test)
 *
 * cachedTest(1)
 *
 * // => 3
 *
 * cachedTest(1)
 *
 * // => 3
 */
export declare function cached<T extends any, R>(fn: (arg: T) => R): (arg: T) => R;

/**
 * 添加游戏内浏览器jssdk
 * @example
 * ```ts
 * callJsBrowserAdapter();
 * ```
 */
export declare function callJsBrowserAdapter(): Promise<unknown>;

/**
 * 设置 MSDK 浏览器退出全屏，需提前加载 sdk
 * @example
 * ```ts
 * callJsReSetFullScreen();
 * ```
 */
export declare const callJsReSetFullScreen: () => void;

/**
 * 设置 MSDK 浏览器全屏，需提前加载 sdk
 * @param isFullScreen 是否全屏
 * @example
 * ```ts
 * callJsSetFullScreen();
 * callJsSetFullScreen(false);
 * ```
 */
export declare const callJsSetFullScreen: (isFullScreen?: boolean) => void;

/**
 * 横线转驼峰命名，如果第一个字符是字母，则不处理。
 * @param {string} str  输入字符串
 * @param {boolean} handleSnake  是否处理下划线，默认不处理
 * @returns {string} 处理后的字符串
 * @example
 *
 * camelize('ab-cd-ef')
 *
 * // => abCdEf
 *
 */
export declare function camelize(str?: string, handleSnake?: boolean): string;

/**
 * 字符串首位大写
 * @param {string} str 输入字符串
 * @returns {string} 处理后的字符串
 *
 * @example
 *
 * capitalize('abc')
 *
 * // => Abc
 */
export declare function capitalize(str: string): string;

/**
 * 检查 localStorage 设置，并展示vConsole
 * @example
 * ```ts
 * checkAndShowVConsole()
 * ```
 */
export declare function checkAndShowVConsole(): void;

/**
 * 统一审核结果检查
 *
 * 检查审核结果，通过则 resolve，驳回则发送企微通知并 reject。
 * 适用于 H5 发布、组件库发布等所有需要审核的流水线。
 *
 * @example H5 发布
 * ```ts
 * const { batchSendWxRobotMarkdown, checkAuditResult } = require('t-comm');
 *
 * await checkAuditResult({
 *   resultInfo,
 *   title: '【H5发布】',
 *   contentLines: [`项目: \`my-project\``, `子工程：\`my-sub\``],
 *   creator: 'novlan1',
 *   auditDesc: '需求发布',
 *   webhookUrl: '0482249e-bf24-4168-b3e2-f72d012840c2',
 *   sendMarkdown: batchSendWxRobotMarkdown,
 * });
 * ```
 */
export declare function checkAuditResult(options: ICheckAuditResultOptions & {
    /** 发送企微 Markdown 消息的函数，由调用方传入 */
    sendMarkdown: (params: {
        content: string;
        chatId: string[];
        webhookUrl: string;
    }) => Promise<any>;
}): Promise<void>;

export declare function checkExportTencentDocProgress({ accessToken, clientId, openId, fileId, operationId, }: ISecretInfo_2 & {
    fileId: string;
    operationId: string;
}): Promise<any>;

export declare function checkFileBaseMinimatch({ file, include, exclude, minimatch, }: {
    file: string;
    include: string | string[];
    exclude: string | string[];
    minimatch: Function;
}): boolean;

/**
 * 异步并行检查目录下所有 git 仓库的工作区状态
 * 相比同步版本，在仓库数量较多时有显著的性能提升
 * @param dir - 要检查的父目录路径
 * @example
 * ```ts
 * // 并行检查 ~/Documents/git 下所有子仓库
 * await checkGitClean('/Users/foo/Documents/git');
 * // 控制台会输出：
 * // [not clean]   /Users/foo/Documents/git/repoA
 * // [not push]    /Users/foo/Documents/git/repoB
 * ```
 */
export declare function checkGitClean(dir: string): Promise<void>;

/**
 * 同步版本，保持向后兼容
 * @param dir - 要检查的父目录路径
 * @example
 * ```ts
 * checkGitCleanSync('/Users/foo/Documents/git');
 * // 同步依次检查，仓库有变动或未推送会打印警告
 * ```
 */
export declare function checkGitCleanSync(dir: string): void;

/**
 * 检测当前是否为 QQ 环境（QQ 用户通过 qq-wxmini-plugin 访问微信小程序）
 *
 * 注意：必须先调用 initQQMiniPlugin（本函数内部会兜底调用）。
 *
 * @returns true 表示 QQ 环境；非微信小程序环境或插件未安装时返回 false
 */
export declare function checkIsQQEnv(): boolean;

export declare function checkJSFiles(options?: {
    whiteDir: string[];
    excludeReg: RegExp;
    log: boolean;
}): void;

/**
 * 执行代码 lint 检查（支持 ESLint 和 StyleLint），并将结果通知到企业微信群、MR 评论等。
 *
 * 支持增量模式（仅检查 sourceBranch 与 targetBranch 之间的 diff 文件）和全量模式（checkAll=true）。
 * 检查完成后可自动执行 --fix 并创建修复 MR（autoFixMR=true）。
 *
 * @param options - 配置参数
 * @param options.privateToken - Git API 私有令牌，用于操作 MR
 * @param options.gitApiPrefix - Git API 地址前缀
 * @param options.workspace - 项目工作目录绝对路径
 * @param options.mrUrl - MR 页面链接，用于消息通知中展示
 * @param options.mrId - MR ID，传入后会在 MR 中添加评论和逐行批注
 * @param options.buildUrl - 流水线构建链接，用于消息通知中展示
 * @param options.repo - 仓库名称（如 group/project）
 * @param options.repoUrl - 仓库页面链接
 * @param options.sourceBranch - 源分支名（增量模式必填）
 * @param options.targetBranch - 目标分支名（增量模式必填）
 * @param options.docLink - 说明文档链接，用于消息通知中展示
 * @param options.webhookUrl - 企业微信机器人 Webhook 地址
 * @param options.chatId - 企业微信群聊 ID 列表，默认 ['ALL']
 * @param options.checkAll - 是否全量检查，默认 false（增量模式）
 * @param options.mentionList - 需要 @ 的企业微信用户列表
 * @param options.lintFiles - 需要检查的文件类型列表，默认检查所有配置的类型
 * @param options.throwError - 检查不通过时是否抛出异常，默认 true
 * @param options.ignoreSubmodules - 是否在 lint 时忽略 git submodule，默认 true
 * @param options.autoFixMR - 是否自动执行 --fix 并创建修复 MR，默认 false
 * @param options.mrTitlePrefix - autoFixMR 创建 MR 时的标题前缀，如 '[WIP]' 可防止被自动合入
 * @param options.onReport - 上报回调，lint 完成后调用，传入错误数量等关键信息
 * @returns 返回 fileMap，包含各文件类型的 lint 结果
 * @throws 当 throwError 为 true 且存在 lint 错误时抛出异常
 *
 * @example
 * ```ts
 * import { checkLint } from 't-comm';
 *
 * await checkLint({
 *   privateToken: 'your-token',
 *   gitApiPrefix: 'https://git.woa.com/api/v3',
 *   workspace: '/path/to/project',
 *   buildUrl: 'https://ci.example.com/build/123',
 *   repo: 'group/project',
 *   sourceBranch: 'feature/xxx',
 *   targetBranch: 'master',
 *   docLink: 'https://doc.example.com/lint',
 *   webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx',
 * });
 * ```
 */
export declare function checkLint({ privateToken, gitApiPrefix, workspace, mrUrl, mrId, buildUrl, repo, repoUrl, sourceBranch, targetBranch, docLink, webhookUrl, chatId, checkAll, mentionList, lintFiles, throwError, ignoreSubmodules, autoFixMR, mrTitlePrefix, onReport, }: {
    privateToken: string;
    gitApiPrefix?: string;
    workspace: string;
    mrUrl?: string;
    mrId?: string;
    buildUrl: string;
    repo: string;
    repoUrl?: string;
    sourceBranch?: string;
    targetBranch?: string;
    docLink: string;
    webhookUrl: string;
    chatId?: string[];
    checkAll?: boolean;
    mentionList?: string[];
    lintFiles?: string[];
    throwError?: boolean;
    ignoreSubmodules?: boolean;
    /** 是否自动执行 --fix 并创建修复 MR */
    autoFixMR?: boolean;
    /** autoFixMR 创建 MR 时的标题前缀，如 '[WIP]' 可防止被自动合入 */
    mrTitlePrefix?: string;
    /**
     * 上报回调。传入后会在 lint 完成、结果解析完毕时调用，
     * 将错误数量、是否全量、mrId 等关键信息传给外部。
     */
    onReport?: (info: CheckLintReportInfo) => void | Promise<void>;
}): Promise<FileMap>;

/** checkLint 完成后传给 onReport 回调的上报信息 */
export declare type CheckLintReportInfo = {
    /** 各文件类型的错误总数 */
    totalErrors: number;
    /** 各文件类型的错误详情 */
    errorDetails: Array<{
        fileType: string;
        errorCount: number;
        fileCount: number;
    }>;
    /** 是否全量检查 */
    checkAll: boolean;
    /** MR ID */
    mrId?: string;
    /** 仓库名 */
    repo: string;
    /** 源分支 */
    sourceBranch?: string;
    /** 目标分支 */
    targetBranch?: string;
    /** 是否通过（无错误） */
    passed: boolean;
    /** lint 执行耗时（ms） */
    duration: number;
    /** 检查的文件类型列表 */
    lintFiles: string[];
    /** 完整的 fileMap 结果 */
    fileMap: FileMap;
    /** 自动修复创建的 MR 信息列表（autoFixMR 开启时才有，eslint 和 stylelint 分别创建独立 MR） */
    fixMRList?: Array<{
        /** 修复分支名 */
        fixBranch: string;
        /** 修复 MR 目标分支 */
        fixTargetBranch: string;
        /** createMR 返回的原始数据 */
        mrData?: any;
    }>;
};

/**
 * 检查是否是node环境
 * @returns {boolean} 是否node环境
 * @example

 const res = checkNodeEnv();
 // false
 */
export declare const checkNodeEnv: () => boolean;

/**
 * 检查字符串长度
 *
 * @export
 * @param {string} str 字符串
 * @param {number} [num = 30] 长度
 * @returns {boolean}
 *
 * @example
 *
 * checkStringLength('123', 2) // true
 * checkStringLength('123', 3) // true
 * checkStringLength('123', 4) // false
 *
 *
 */
export declare function checkStringLength(str?: string, num?: number): boolean;

export declare function checkTSErrorInMrOrAll({ privateToken, gitApiPrefix, workspace, repo, repoUrl, mrId, mrUrl, sourceBranch, targetBranch, checkAll, buildUrl, docLink, mentionList, postFixList, chatId, webhookUrl, command, }: {
    privateToken: string;
    gitApiPrefix?: string;
    workspace: string;
    repo: string;
    repoUrl: string;
    mrId: string;
    mrUrl: string;
    sourceBranch: string;
    targetBranch: string;
    checkAll: boolean;
    buildUrl: string;
    docLink: string;
    mentionList: string[];
    postFixList?: string[];
    chatId?: string[];
    webhookUrl: string;
    command?: string;
}): Promise<TsErrorFile[]>;

/**
 * 检查是否是ios环境
 * @returns {boolean} 是否是ios环境
 *
 * @example
 *
 * checkUAIsIOS()
 *
 * // => true
 *
 */
export declare function checkUAIsIOS(): boolean;

declare type ChildProcess = typeof childProcess;

/**
 * 将数组分割成指定长度的chunk
 *
 * @param array  数组
 * @param chunkSize 要分的组数
 * @returns 结果数组
 * @example
 * ```js
 * chunkArray([1, 2, 3, 4, 5, 6, 7, 8], 3)
 */
export declare function chunkArray<T>(array: T[], chunkSize: number): T[][];

/**
 * 清理单个 CHANGELOG 文件
 * @param {string} filePath
 * @param {boolean} dryRun
 * @returns {boolean} 是否成功
 * @example
 * ```ts
 * // 实际写入
 * cleanChangelogFile('CHANGELOG.md');
 *
 * // 预览模式，不修改文件
 * cleanChangelogFile('CHANGELOG.md', true);
 * ```
 */
export declare function cleanChangelogFile(filePath: string, dryRun?: boolean): boolean;

/**
 * 主函数
 * @example
 * ```bash
 * # 处理单个文件
 * npx t-comm clean:changelog packages/network-v2/CHANGELOG.md
 *
 * # 使用 glob 表达式处理多个文件
 * npx t-comm clean:changelog 'packages/*\/CHANGELOG.md'
 *
 * # 预览模式
 * npx t-comm clean:changelog 'packages/*\/CHANGELOG.md' --dry-run
 * ```
 */
export declare function cleanChangelogScript(args: string[]): Promise<void>;

/**
 * 通用「搜索-替换」工具
 *
 * 适用场景：AI Agent / Code Mod 需要根据"搜索-替换对"对源文件进行原地修改的场景。
 *
 * 提供两个函数：
 *   - cleanLineNumberPrefix：清理 AI 输出 search/replace 块时常带的行号前缀（如 "12| " "12 | "）
 *   - applySearchReplace：在源代码中查找 search 并替换为 replace，按 "精确 → 行级 → 子串" 三级策略匹配
 */
/**
 * 清理 AI 输出 search/replace 块时常带的行号前缀
 *
 * AI 在生成搜索字符串时，有时会无意把行号也带上，导致与源文件无法精确匹配。
 * 本函数支持 5 种常见格式：
 *   - "12| code"   → "code"
 *   - "12 | code"  → "code"
 *   - "12  code"   → "code"  (多空格分隔，仅当首行匹配且行号递增时才认为是行号)
 *   - "12: code"   → "code"
 *   - "12. code"   → "code"
 *
 * 为避免误删（如某些 markdown / 注释开头是数字），仅当：
 *   - 首行能匹配到行号格式
 *   - 后续行行号严格递增（差值为 1）
 * 时才视为带行号前缀，全部清理。
 *
 * @param text 原始字符串（来自 AI 输出的 search/replace 块）
 * @returns 清理后的字符串；不像行号前缀时原样返回
 */
export declare function cleanLineNumberPrefix(text: string): string;

/**
 * 清除全部cookie
 *
 * @param {string} domain 域名
 *
 * @example
 *
 * clearAll()
 */
export declare function clearAll(domain?: String): void;

/**
 * 清除cookie
 * @param {string} key cookie键
 *
 * @example
 *
 * clearCookie('name');
 *
 */
export declare function clearCookie(name: string): void;

/**
 * 持久化存储。清理。传 key 就删除。不传清理所有过期的。
 * @param {string} [key]
 * @returns {boolean} 是否清楚成功
 * @example
 * ```ts
 * // 清理指定 key
 * clearPersist('name');
 *
 * // 不传参数时，清理所有已过期的数据
 * clearPersist();
 * ```
 */
export declare function clearPersist(key?: string): boolean;

/**
 * 清除已保存的 QQ 登录票据
 */
export declare function clearQQTicketInfo(config: {
    storage?: QQStorageLike;
    storageKey: string;
}): void;

/**
 * QQ 环境下若检测到微信登录态则清除 storage
 *
 * 由调用方提供「当前是否为微信登录态」的判断函数，
 * 以避免本工具与具体 cookie/storage 字段耦合。
 *
 * 典型用法：
 * ```ts
 * clearWxLoginStorageIfQQEnv({
 *   isWxLoggedIn: () => cookie.get('tip_utype') === '2',
 * });
 * ```
 *
 * @param options.isWxLoggedIn 判断当前是否为微信登录态（必填）
 * @param options.clearStorage 自定义清除函数，默认 wx.clearStorageSync
 * @param options.shouldForceQQ 是否强制 QQ 登录态（即在 QQ 环境下
 *   一旦检测到微信登录态就清掉 storage 让用户重走 QQ 登录）。
 *
 *   默认 `() => true`（保留旧行为）。
 *
 *   若业务希望「QQ App 下也允许用户手动用微信账号登录」，请传入 `() => false`，
 *   或基于业务自身的「用户是否手动切到微信账号」状态返回值。
 */
export declare function clearWxLoginStorageIfQQEnv(options: {
    isWxLoggedIn: () => boolean;
    clearStorage?: () => void;
    shouldForceQQ?: () => boolean;
}): boolean;

declare interface ClickOutsideElement extends HTMLElement {
    __vueClickOutside__?: (event: MouseEvent) => void;
}

/**
 * 小程序粘贴
 *
 * @param {string} text 待复制的文本
 * @returns {Promise<void>}
 * @example
 *
 * ```ts
 * clipboardMp('stupid').then(() => {});
 * ```
 */
export declare function clipboardMp(text: string): Promise<any>;

/**
 * 复制到剪切板
 *
 * @param {string} text 待复制的文本
 * @returns {Promise<void>}
 * @example
 *
 * ```ts
 * clipboardMp('stupid').then(() => {});
 * ```
 */
export declare function clipboardWeb(text: string): Promise<void>;

/**
 * 关闭 MR（参数为 iid，内部自动转全局 id）
 *
 * 对应工蜂 API：PUT /api/v3/projects/:id/merge_request/:id  body: { state_event: 'close' }
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.mrIid MR 的项目内序号
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<MRDetail>} 关闭后的 MR 详情
 * @example
 *
 * closeMR({
 *   projectName: 'coecology/xd',
 *   mrIid: 169,
 *   privateToken: 'xxxxx',
 * }).then((mr) => {
 *   console.log(mr.state);
 * })
 */
export declare function closeMR({ projectName, mrIid, privateToken, baseUrl, }: {
    projectName: string | number;
    mrIid: number | string;
    privateToken: string;
    baseUrl?: string;
}): Promise<MRDetail>;

/**
 * 通过 MR URL 关闭一个 MR
 *
 * 内部流程：
 * 1. 调用 {@link parseMRUrl} 从 URL 中解析出 projectName + mrIid
 * 2. 调用 {@link closeMR} 完成关闭操作
 *
 * @param {object} options 输入配置
 * @param {string} options.mrUrl MR 的 URL
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<{ projectName: string; mrIid: string; raw: MRDetail }>} 解析与关闭结果
 * @example
 *
 * closeMRByUrl({
 *   mrUrl: 'https://git.woa.com/coecology/xd/-/merge_requests/169',
 *   privateToken: 'xxxxx',
 * }).then((res) => {
 *   console.log(res.projectName, res.mrIid, res.raw.state);
 * })
 */
export declare function closeMRByUrl({ mrUrl, privateToken, baseUrl, }: {
    mrUrl: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<{
    projectName: string;
    mrIid: string;
    raw: MRDetail;
}>;

/**
 * MSDK 浏览器中，关闭 webView
 * @example
 * ```ts
 * closeMsdkWebview()
 * ```
 */
export declare function closeMsdkWebview(env?: any): void;

/**
 * 关闭任务
 *
 * @param {object} config 配置信息
 * @param {string} config.taskId 任务Id
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 * closeRainbowTask({
 *   taskId: 'taskId',
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   }
 * }).then(() => {
 *
 * })
 */
export declare function closeRainbowTask({ taskId, secretInfo, }: {
    taskId: string;
    secretInfo: ISecretInfo_3;
}): Promise<object>;

/**
 * 关闭 vConsole
 * @example
 * ```ts
 * closeVConsole()
 * ```
 */
export declare function closeVConsole(): void;

/**
 * 关闭 webView，包含 msdk 浏览器和其他浏览器
 * @example
 * ```ts
 * closeWebView()
 * ```
 */
export declare function closeWebView(): void;

/**
 * 多参数空值合并函数
 * @param {...any} args - 任意数量的参数
 * @returns {any} 第一个非null/undefined的参数值
 * @example
 * ```ts
 * coalesce(null, undefined, 'hello'); // 'hello'
 * coalesce(undefined, 0, 'x'); // 0  // 0 不是 null/undefined
 * coalesce(undefined, '', 'x'); // ''  // 空串也保留
 * coalesce(null, null, null); // null  // 全部都是 null/undefined 时返回最后一个参数
 * coalesce(); // undefined
 * ```
 */
export declare function coalesce(...args: unknown[]): unknown;

/**
 * Cocos 端防刷拦截器
 *
 * 加到请求拦截器的最后，会根据加密协议在请求 header 里加上防刷签名参数。
 * 依赖业务提前请求 GetTs 接口获取加密参数（ts + encryptData）。
 *
 * 加密协议见文档：
 * https://doc.weixin.qq.com/flowchart/f4_APsAyQbdAFwbbhTs281TFe1ncmazz?scode=AJEAIQdfAAor0oxY1IAPsAyQbdAFw
 *
 * 参考 pmd-npm/packages/business/src/network/interceptor/request/common/fangshua/fangshuaInterceptor.ts
 *
 * @example
 * ```ts
 * import { CocosFangshuaInterceptor } from 't-comm/cocos/network';
 *
 * const fangshuaInterceptor = new CocosFangshuaInterceptor({
 *   storage,
 *   getTs: () => appInfo.ts,
 *   getEncryptData: () => appInfo.encryptData,
 *   crypto: {
 *     md5: (data) => CryptoJS.MD5(data).toString(),
 *     aesDecrypt: (key, encryptedHex, iv) => { ... },
 *   },
 *   debug: true, // 开启调试日志（默认 false）
 * });
 * ```
 */
export declare class CocosFangshuaInterceptor implements IRequestInterceptor {
    private options;
    constructor(options: ICocosFangshuaOptions);
    interceptor(param: IRawRequest): [boolean, IRawRequest];
    /** 仅 debug=true 时打印日志 */
    private log;
}

/**
 * 收集所有需要扫描的文件列表
 * @example
 * ```ts
 * const files = collectFiles({
 *   rootDir: '/proj',
 *   aliasMap: { src: 'src' },
 *   scanDirs: ['src/views', 'src/components'],
 *   scanRootFiles: ['vite.config.ts'],
 * });
 * ```
 */
export declare function collectFiles(options: IReplaceAliasOptions): Array<string>;

/**
 * 同步递归收集目录下所有文件路径
 * 递归遍历指定目录，收集所有文件的绝对路径到数组中
 * @param {string} dirPath 目录路径
 * @param {string[]} [fileList=[]] 用于累积结果的数组（可选，递归内部使用）
 * @returns {string[]} 所有文件的绝对路径数组
 * @example
 * ```ts
 * const files = collectFilesSync('/path/to/dir');
 * // ['/path/to/dir/a.ts', '/path/to/dir/sub/b.ts', ...]
 * ```
 */
export declare function collectFilesSync(dirPath?: string, fileList?: string[]): string[];

/**
 * 收集 `PackageSizeInfo`：
 *   - 从 `npm view <name> time` 拿到最近两个版本（新、旧）
 *   - 分别请求 registry 拿两个版本的体积，对比生成 PackageSizeInfo
 *
 * 注意：本方法依赖「发布完成后」调用，新版本必须已经在 registry 上。
 *
 * @param {object} appInfo package.json 内容，至少包含 name
 * @param {object} [options]
 * @param {string} [options.registry] 自定义 registry
 * @returns {Promise<import('t-comm').PackageSizeInfo>}
 */
export declare function collectPackageSize(appInfo: {
    name: string;
}, options?: {
    registry?: string;
}): Promise<{
    newSize: number;
    oldSize?: undefined;
    oldUnpacked?: undefined;
    newUnpacked?: undefined;
    fileCount?: undefined;
} | {
    oldSize: number;
    newSize: number;
    oldUnpacked: number;
    newUnpacked: number;
    fileCount: number;
}>;

declare interface CommitInfo {
    hash: string;
    shortHash: string;
    author: string;
    email: string;
    date: string;
    subject: string;
    body: string;
}

/**
 * 对比两个对象列表
 * @param {Array<object>} list 现在数据
 * @param {Array<object>} preList 参照数据
 * @param {string} key 唯一key名称
 * @returns {Array<object>} 对比结果，增加为list的每一项增加previousValue和ratio属性
 * @example
 * const list = [
 *   {
 *     ProjectName: { name: 'ProjectName', value: '脚手架' },
 *     PagePv: { name: 'PagePv', value: 544343 },
 *     PageUv: { name: 'PageUv', value: 225275 },
 *   }
 * ]
 *
 * const preList = [
 *   {
 *     ProjectName: { name: 'ProjectName', value: '脚手架' },
 *     PagePv: { name: 'PagePv', value: 123123 },
 *     PageUv: { name: 'PageUv', value: 33333 },
 *   }
 * ]
 *
 * compareTwoList(list, preList, 'ProjectName')
 *
 * console.log(list)
 *
 * [
 *   {
 *     ProjectName: { name: 'ProjectName', value: '脚手架' },
 *     PagePv: {
 *       name: 'PagePv',
 *       value: 544343,
 *       ratio: '+342.1%',
 *       previousValue: 123123
 *     },
 *     PageUv: {
 *       name: 'PageUv',
 *       value: 225275,
 *       ratio: '+575.8%',
 *       previousValue: 33333
 *     }
 *   }
 * ]
 */
export declare function compareTwoList(list: Array<IPreData>, preList: Array<IPreData>, key: string): IPreData[];

export declare function compareTwoObj(originObj?: Record<string, any>, newObj?: Record<string, any>): {
    ADDED: Array<string>;
    UPDATED: Array<string>;
    DELETED: Array<string>;
    originObj: object;
    newObj: object;
};

/**
 * 版本比较
 * @param {string} v1 第一个版本
 * @param {string} v2 第二个版本
 * @returns 比较结果，1 前者大，-1 后者大，0 二者相同
 * @example
 * ```ts
 * compareVersion('1.1.1', '1.2.1')
 * // -1
 * ```
 */
export declare function compareVersion(v1?: string, v2?: string): 0 | 1 | -1;

declare type Complete = (success: boolean, msg?: any) => void;

declare const COMPLEXITY_DEFAULT_CSV_HEADER: readonly ["NLOC", "CNN", "TOKEN_COUNT", "PARAMETER_COUNT", "LOC", "FUNCTION_NAME_AND_FILE_NAME", "FILE_NAME", "FUNCTION_NAME", "FUNCTION_METHOD", "START_LINE", "END_LINE"];

declare type ComplexityCsvHeader = typeof COMPLEXITY_DEFAULT_CSV_HEADER;

declare type ComplexityKey = ComplexityCsvHeader[number];

export declare type ComponentMapList = Record<string, string[]>;

/**
 * 组装`url`参数，将search参数添加在后面
 * @param {string} url 输入URL
 * @param {Object} queryObj search对象
 * @returns {string} 组装后的url
 * @example
 * // url 本身无 query 参数
 * composeUrlQuery('https://baidu.com', {
 *   name: 'mike',
 *   feel: 'cold',
 *   age: '18',
 *   from: 'test',
 * });
 * // => 'https://baidu.com?name=mike&feel=cold&age=18&from=test'
 * @example
 * // url 已有 query 参数，会与新参数合并
 * composeUrlQuery('https://baidu.com?gender=male', {
 *   name: 'mike',
 *   feel: 'cold',
 *   age: '18',
 *   from: 'test',
 * });
 * // => 'https://baidu.com?gender=male&name=mike&feel=cold&age=18&from=test'
 */
export declare function composeUrlQuery(url: string, queryObj: object): string;

/**
 * 压缩 base64 图片
 * - 通过 canvas 缩放图片到指定最大宽度，并转为 JPEG 格式降低体积
 * @param {string} base64Img base64 图片字符串（可带或不带 data:image 前缀）
 * @param {object} options 压缩选项
 * @param {number} options.maxWidth 最大宽度，默认 280
 * @param {number} options.quality JPEG 质量 0-1，默认 0.8
 * @returns {Promise<string>} 压缩后的 base64 图片字符串
 *
 * @example
 *
 * const compressed = await compressBase64Img(base64Str, { maxWidth: 280, quality: 0.8 });
 */
export declare function compressBase64Img(base64Img: string, options?: CompressOptions): Promise<string>;

export declare interface CompressOptions {
    maxWidth?: number;
    quality?: number;
}

declare type ConfigType = unknown;

export declare function configWx({ apiList, openTagList, getWxSignaturePromise, }: {
    apiList?: Array<string>;
    openTagList?: Array<string>;
    getWxSignaturePromise: IGetWxSignaturePromise;
}): Promise<unknown>;

export declare const consoleImage: (url: string) => void;

export declare function consoleInfo(shouldLog: boolean, ...args: any[]): void;

export declare function consoleLog(shouldLog: boolean, ...args: any[]): void;

/**
 * Dom转化为图片
 * @param {string} trigger  Dom的id
 * @param {string} imageElId  需要展示的图片的id
 *
 * @example
 * Dom2Image.convertDomToImage("app", "appImage");
 */
export declare function convertDomToImage(trigger: string, imageElId: string, callback: Function): void;

export declare interface ConvertExcelOptions {
    /** 支持的 ti18n keys 列表，默认使用 TI18N_KEYS */
    ti18nKeys?: readonly string[];
    /** 语言名称到 ti18n key 的映射表，默认使用 LANG_NAME_TO_TI18N_KEY */
    langNameMapping?: Record<string, Ti18nKey>;
}

/**
 * 读取 Excel，替换首行 key 为 ti18n 标准 key，输出新 Excel
 * @param inputPath 输入 Excel 路径
 * @param outputPath 输出 Excel 路径
 * @param options 转换配置选项
 * @returns 转换结果，包含 jsonData 和 activeKeys
 * @example
 * ```ts
 * // 使用默认配置
 * convertExcelToTi18n('./input.xlsx', './output.xlsx');
 *
 * // 自定义支持的语言列表
 * convertExcelToTi18n('./input.xlsx', './output.xlsx', {
 *   ti18nKeys: ['zh', 'en', 'ja', 'ko'], // 只支持中英日韩
 * });
 *
 * // 自定义语言名称映射
 * convertExcelToTi18n('./input.xlsx', './output.xlsx', {
 *   langNameMapping: {
 *     ...DEFAULT_LANG_NAME_TO_TI18N_KEY,
 *     '日语': 'ja',
 *     'japanese': 'ja',
 *     '韩语': 'ko',
 *     'korean': 'ko',
 *   },
 * });
 *
 * // 完全自定义配置
 * convertExcelToTi18n('./input.xlsx', './output.xlsx', {
 *   ti18nKeys: ['zh', 'en', 'ja'],
 *   langNameMapping: {
 *     'zh': 'zh',
 *     'en': 'en',
 *     'ja': 'ja',
 *     '中文': 'zh',
 *     '英文': 'en',
 *     '日文': 'ja',
 *   },
 * });
 * ```
 */
export declare function convertExcelToTi18n(inputPath: string, outputPath: string, options?: ConvertExcelOptions): ConvertResult;

/**
 * image url转canvas
 * @param image {Image} 图片src
 * @returns canvas
 * @example
 * ```ts
 * const img = new Image();
 * img.src = 'https://example.com/foo.png';
 * img.onload = () => {
 *   const canvas = convertImageToCanvas(img);
 *   const dataUrl = canvas.toDataURL('image/png');
 *   console.log(dataUrl);
 * };
 * ```
 */
export declare function convertImageToCanvas(image: HTMLImageElement): ICanvas;

declare interface ConvertResult {
    jsonData: Record<string, string>[];
    activeKeys: string[];
}

export declare function convertTencentFileId({ accessToken, clientId, openId, type, value, }: ISecretInfo_2 & {
    type: number;
    value: string;
}): Promise<any>;

/**
 * 拷贝目录以及子文件
 * 递归复制整个目录结构，包括所有子目录和文件
 * @param src - 源目录路径
 * @param dist - 目标目录路径
 * @param callback - 可选的回调函数，复制完成后执行
 * @example
 * ```ts
 * copyDir('/source/path', '/target/path', () => {
 *   console.log('复制完成');
 * });
 * ```
 */
export declare function copyDir(src: string, dist: string, callback?: Function): void;

/**
 * 拷贝单个文件
 * 将文件从源路径复制到目标路径
 * @param from - 源文件路径
 * @param to - 目标文件路径
 * @returns 写入操作的结果
 * @example
 * ```ts
 * copyFile('/source/file.txt', '/target/file.txt');
 * ```
 */
export declare function copyFile(from: string, to: string): void;

export declare function createAutoProtectedRuleForStoryBranch({ projectName, baseUrl, privateToken, defaultRuleName, shouldUpdateExistingBranches, }: {
    projectName: string;
    baseUrl: string;
    privateToken: string;
    defaultRuleName: string;
    shouldUpdateExistingBranches?: boolean;
}): Promise<void>;

/**
 * 创建新分支
 *
 * 对应工蜂 API：POST /api/v3/projects/:id/repository/branches
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {string} options.branchName 新分支名
 * @param {string} options.ref 基于哪个分支/commit/tag 创建
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<{ name: string } & Record<string, unknown>>} 新建分支信息
 * @example
 *
 * createBranch({
 *   projectName: 'group/sub/repo',
 *   branchName: 'feature/x',
 *   ref: 'master',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function createBranch({ projectName, branchName, ref, privateToken, baseUrl, }: {
    projectName: string | number;
    branchName: string;
    ref: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<{
    name: string;
} & Record<string, unknown>>;

/**
 * 创建canvas的table
 * @param {object} config 输入配置
 * @param {Array<object>} config.data 输入数据
 * @param {Array<string>} config.headers 表头列表
 * @param {Array<number>} config.cellWidthList 每一格的宽度列表
 * @param {string} config.title 标题
 * @returns {string} 图片url
 * @example
 *
 * const tableData = [
 *   {
 *     ProjectName: { name: 'ProjectName', value: 'ProjectA' },
 *     ALL_SUMMARY: {
 *       name: 'ALL_SUMMARY',
 *       value: 4987,
 *       ratio: '+26.2%',
 *       previousValue: 3953,
 *       idx: 0,
 *       lastIdx: 0,
 *       isMax: true,
 *       isMin: false,
 *       isSecondMax: false,
 *       isSecondMin: false,
 *     },
 *     ALL_FAIL: {
 *       // ...
 *     },
 *   },
 *   {
 *     ProjectName: { name: 'ProjectName', value: 'ProjectB' },
 *     // ...
 *   },
 * ];
 *
 * createCanvasTable({
 *   data: tableData,
 *   headers: getHeaders(tableData),
 *   title: `007日报 ${date}`,
 *   cellWidthList: [
 *     95,
 *     65,
 *     65,
 *     65,
 *   ],
 * });
 */
export declare function createCanvasTable({ data, headers, cellWidthList, title, }: {
    data: Array<{
        [k: string]: {
            value?: number;
            isMax?: boolean;
            isMin?: boolean;
            isSecondMax?: boolean;
            isSecondMin?: boolean;
            ratio?: string | number;
        };
    }>;
    headers: Array<string>;
    cellWidthList: Array<number>;
    title: string;
}): string;

export declare function createDevopsTemplateInstances({ projectId, templateId, host, pipelineName, pipelineParam, secretInfo, useTemplateSettings, }: ITemplateReq & {
    pipelineName: string;
    pipelineParam: Object;
    useTemplateSettings?: boolean;
}): Promise<any>;

/**
 * 创建一个环境切换器。
 */
export declare function createEnvSwitcher(options: IEnvSwitcherOptions): IEnvSwitcher;

/**
 * 创建 iWiki 文档
 * 支持创建 Markdown、新文档、文件夹等类型，需要提供 PaaS 认证信息
 * @param {object} config 配置信息
 * @param {string} config.prefix API 前缀地址
 * @param {string} [config.spacekey] 空间 key（与 spaceId 二选一）
 * @param {string} [config.spaceId] 空间 ID（与 spacekey 二选一）
 * @param {string} [config.contenttype='MD'] 内容类型，DOC：新文档，MD：Markdown，FOLDER：文件夹
 * @param {string} [config.title] 文档标题
 * @param {string} [config.body] 文档内容
 * @param {string|number} [config.parentid] 父目录 ID
 * @param {object} [config.otherData] 其他额外参数
 * @param {string} config.paasId PaaS 认证 ID
 * @param {string} config.paasToken PaaS 认证 Token
 * @returns {Promise<{code: string, msg: string, data: {id: string, docid: string}, request_id: string}>} 创建结果
 * @example
 * ```ts
 * const result = await createIwikiDoc({
 *   prefix: 'https://iwiki.woa.com/api',
 *   spacekey: 'my-space',
 *   title: '新文档',
 *   body: '# Hello\n内容',
 *   paasId: 'xxx',
 *   paasToken: 'xxx',
 * });
 * ```
 */
export declare function createIwikiDoc({ prefix, spacekey, spaceId, contenttype, title, body, parentid, otherData, paasId, paasToken, }: {
    prefix: string;
    spacekey?: string;
    spaceId?: string;
    contenttype?: string;
    title?: string;
    body?: string;
    parentid?: string | number;
    otherData?: any;
    paasId: string;
    paasToken: string;
}): Promise<{
    code: string;
    msg: string;
    data: {
        id: string;
        docid: string;
    };
    request_id: string;
}>;

/**
 * 创建MR
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称
 * @param {string} options.privateToken 密钥
 * @param {string} options.sourceBranch 源分支
 * @param {string} options.targetBranch 目标分支
 * @param {number} [options.approverRule=1] 审批规则
 * @param {number} [options.necessaryApproverRule=0] 必要审批规则
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * createMR({
 *   projectName: 't-comm',
 *   privateToken: 'xxxxx',
 *   sourceBranch: 'master',
 *   targetBranch: 'release',
 * }).then((resp) => {
 *
 * })
 */
export declare function createMR({ projectName, privateToken, sourceBranch, targetBranch, approverRule, necessaryApproverRule, baseUrl, titlePrefix, title: customTitle, description, assigneeList, reviewerList, }: {
    projectName: string | number;
    privateToken: string;
    sourceBranch: string;
    targetBranch: string;
    approverRule?: number;
    necessaryApproverRule?: number;
    baseUrl?: string;
    /** MR 标题前缀，如 '[WIP]' 可防止被自动合入（仅在未显式传 title 时生效） */
    titlePrefix?: string;
    /** 自定义 MR 标题；未传则自动生成 `${sourceBranch} => ${targetBranch}` */
    title?: string;
    /** MR 描述 */
    description?: string;
    /**
     * 评审人（Assignee）用户名列表（工蜂英文名/RTX）。
     * 函数内部会调用 resolveUserIds 转换为数字 ID。
     * 工蜂 v3 仅支持单个 assignee_id，传多人时取第一个能解析到的。
     */
    assigneeList?: string[];
    /**
     * Reviewers 用户名列表（工蜂英文名/RTX）。
     * 函数内部会调用 resolveUserIds 转换为数字 ID。
     * 未传时会默认使用 assigneeList 作为 reviewers（与 GitApiService 行为保持一致）。
     */
    reviewerList?: string[];
}): Promise<any>;

/**
 * 在 MR 上提交评论（Note）
 *
 * - 不传 filePath/line：普通评论（贴在 MR 讨论区）
 * - 传 filePath 和 line：行内评论（贴在 diff 指定文件的指定行）
 *
 * 对应工蜂 API：POST /api/v3/projects/:id/merge_requests/:id/notes
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.mrIid MR 的项目内序号
 * @param {string} options.body 评论内容
 * @param {string} options.privateToken 密钥
 * @param {string} [options.filePath] 行内评论：diff 中的新文件路径
 * @param {number} [options.line] 行内评论：新文件中的行号
 * @param {'new' | 'old'} [options.lineType='new'] 行内评论：行类型，默认 new
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<{ id: number }>} 新建评论的 ID
 * @example
 *
 * // 1. 普通评论
 * createMRNote({
 *   projectName: 'coecology/xd',
 *   mrIid: 169,
 *   body: 'LGTM',
 *   privateToken: 'xxxxx',
 * }).then((res) => console.log(res.id));
 *
 * // 2. 行内评论
 * createMRNote({
 *   projectName: 'coecology/xd',
 *   mrIid: 169,
 *   body: '这里可以优化',
 *   filePath: 'src/index.ts',
 *   line: 12,
 *   lineType: 'new',
 *   privateToken: 'xxxxx',
 * });
 */
export declare function createMRNote({ projectName, mrIid, body, privateToken, filePath, line, lineType, baseUrl, }: {
    projectName: string | number;
    mrIid: number | string;
    body: string;
    privateToken: string;
    filePath?: string;
    line?: number;
    lineType?: 'new' | 'old';
    baseUrl?: string;
}): Promise<{
    id: number;
}>;

/**
 * 回复 MR 上的已有评论（在讨论串中回复）
 *
 * 对应工蜂 API：POST /api/v3/projects/:id/merge_requests/:id/notes/:noteId/replies
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.mrIid MR 的项目内序号
 * @param {number | string} options.parentNoteId 要回复的父评论 ID
 * @param {string} options.body 回复内容
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<{ id: number }>} 新建回复的 ID
 * @example
 *
 * createNoteReply({
 *   projectName: 'coecology/xd',
 *   mrIid: 169,
 *   parentNoteId: 123456,
 *   body: '同意上面的意见',
 *   privateToken: 'xxxxx',
 * }).then((res) => console.log(res.id));
 */
export declare function createNoteReply({ projectName, mrIid, parentNoteId, body, privateToken, baseUrl, }: {
    projectName: string | number;
    mrIid: number | string;
    parentNoteId: number | string;
    body: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<{
    id: number;
}>;

export declare function createPrefetchTask({ secretId, secretKey, targets, zoneId, }: {
    secretId: string;
    secretKey: string;
    targets: string[];
    zoneId: string;
}): Promise<any>;

/**
 * 创建一个项目
 *
 * 对应工蜂 OpenAPI：POST /api/v3/projects
 *
 * 注意：当 `namespace_id` 不为空时，需要用户拥有在指定命名空间中创建项目的权限。
 *
 * @param {object} options 输入配置
 * @param {CreateTGitProjectParams} options.data 创建项目的参数
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<TGitProjectInfo>} 新建项目的详情
 * @example
 *
 * createProject({
 *   data: {
 *     name: 'testapi',
 *     description: '测试项目',
 *     visibility_level: 0,
 *   },
 *   privateToken: 'xxxxx',
 * }).then((info) => {
 *   console.log(info.id, info.path_with_namespace);
 * });
 */
export declare function createProject({ data, privateToken, baseUrl, }: {
    data: CreateTGitProjectParams;
    privateToken: string;
    baseUrl?: string;
}): Promise<TGitProjectInfo>;

export declare function createProtectedBranchRule({ projectName, privateToken, baseUrl, form, }: {
    projectName: string;
    privateToken: string;
    baseUrl?: string;
    form: ProtectedRuleForm;
}): Promise<Array<object>>;

export declare function createPurgeTask({ secretId, secretKey, targets, zoneId, method, type, }: {
    secretId: string;
    secretKey: string;
    targets: string[];
    zoneId: string;
    method?: IPurgeMethod;
    type?: IPurgeType;
}): Promise<any>;

/**
 * 创建发布任务
 *
 * @param {object} config 配置信息
 * @param {string} config.versionName 版本信息
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 * createRainbowPublishJob({
 *   versionName: 'version',
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   }
 * }).then(() => {
 *
 * })
 */
export declare function createRainbowPublishJob({ versionName, secretInfo, creator, approvers, type, }: {
    versionName: string;
    secretInfo: ISecretInfo_3;
    creator: string;
    approvers: string;
    type?: number;
}): Promise<object>;

/**
 * 回复代码评审中的评论（行内评论 reply）
 *
 * 对应工蜂 API：POST /api/v3/projects/:id/reviews/:reviewId/notes/:noteId/replies
 *
 * 只能回复代码行上的第一条评论，不支持回复「已是回复」的评论。
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.reviewId 评审记录 ID
 * @param {number | string} options.noteId 要回复的评论 ID
 * @param {string} options.body 回复内容
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<{ id: number }>} 新建回复的 ID
 * @example
 *
 * createReviewNoteReply({
 *   projectName: 'coecology/xd',
 *   reviewId: 9999,
 *   noteId: 123456,
 *   body: '这里应该补一下边界检查',
 *   privateToken: 'xxxxx',
 * }).then((res) => console.log(res.id));
 */
export declare function createReviewNoteReply({ projectName, reviewId, noteId, body, privateToken, baseUrl, }: {
    projectName: string | number;
    reviewId: number | string;
    noteId: number | string;
    body: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<{
    id: number;
}>;

export declare function createTencentDoc({ accessToken, clientId, openId, type, title, folderId, }: ISecretInfo_2 & {
    type: number;
    title: string;
    folderId?: string;
}): Promise<any>;

/**
 * 创建项目时的请求参数（对应工蜂 POST /api/v3/projects）
 *
 * 字段参考工蜂 OpenAPI 文档：
 * - name           项目名（必填）
 * - path           项目版本库路径，默认 path = name
 * - fork_enabled   是否可被 fork，默认 false
 * - namespace_id   所属命名空间，默认用户命名空间
 * - description    项目描述
 * - visibility_level 可视范围，默认 0
 * - create_from_id 模板项目 ID 或 项目全路径
 */
export declare interface CreateTGitProjectParams {
    /** 项目名 */
    name: string;
    /** 项目版本库路径，默认与 name 相同 */
    path?: string;
    /** 是否可被 fork，默认 false */
    fork_enabled?: boolean;
    /** 所属命名空间 ID */
    namespace_id?: number;
    /** 项目描述 */
    description?: string;
    /** 项目可视范围（0 私有 / 10 内部 / 20 公开），默认 0 */
    visibility_level?: number;
    /** 模板项目 ID 或项目全路径 */
    create_from_id?: number | string;
    /** 兼容工蜂未来扩展字段 */
    [k: string]: unknown;
}

/**
 * canvas 实现 watermark
 * @param {object} params 参数
 * @param {HTMLElement} params.container 容器
 * @param {number} params.width 图片宽
 * @param {number} params.height 图片高
 * @param {string} params.textAlign 同 ctx.textAlign
 * @param {string} params.textBaseline 同 ctx.textBaseline
 * @param {string} params.font 同 ctx.font
 * @param {string} params.fillStyle 同 ctx.fillStyle
 * @param {string} params.content 内容
 * @param {number} params.rotate 旋转角度
 * @param {number} params.zIndex 层级
 *
 * @example
 *
 * ```ts
 * const rtx = 'pony';
 *
 * createWatcherMark({
 *   content: rtx,
 *   width: '300',
 *   height: '300',
 *   textAlign: 'center',
 *   textBaseline: 'middle',
 *   font: '25px Microsoft Yahei',
 *   fillStyle: 'rgba(184, 184, 184, 0.3)',
 *   rotate: '-50',
 *   zIndex: 1000,
 * });
 * ```
 */
export declare function createWatcherMark({ container, width, height, textAlign, textBaseline, font, fillStyle, content, rotate, zIndex, }?: {
    container?: HTMLElement | undefined;
    width?: number | undefined;
    height?: number | undefined;
    textAlign?: string | undefined;
    textBaseline?: string | undefined;
    font?: string | undefined;
    fillStyle?: string | undefined;
    content?: string | undefined;
    rotate?: number | undefined;
    zIndex?: number | undefined;
}): void;

/**
 * 创建 Webhook
 *
 * 对应工蜂 API：POST /api/v3/projects/:id/hooks
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {string} options.webhookUrl 回调 URL
 * @param {string} options.privateToken 密钥
 * @param {CreateWebhookOptions} [options.events] 事件配置，默认只开 merge_requests_events
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<WebhookItem>} Webhook 条目
 * @example
 *
 * createWebhook({
 *   projectName: 'group/sub/repo',
 *   webhookUrl: 'https://my-server.com/hooks/tgit',
 *   privateToken: 'xxxxx',
 *   events: {
 *     merge_requests_events: true,
 *     note_events: true,
 *   },
 * }).then((hook) => {
 *   console.log(hook.id);
 * })
 */
export declare function createWebhook({ projectName, webhookUrl, privateToken, events, baseUrl, }: {
    projectName: string | number;
    webhookUrl: string;
    privateToken: string;
    events?: CreateWebhookOptions;
    baseUrl?: string;
}): Promise<WebhookItem>;

/** 创建 Webhook 的选项 */
export declare interface CreateWebhookOptions {
    /** 是否监听 push 事件 */
    push_events?: boolean;
    /** 是否监听 merge_requests 事件 */
    merge_requests_events?: boolean;
    /** 是否监听 issues 事件 */
    issues_events?: boolean;
    /** 是否监听 note 评论事件 */
    note_events?: boolean;
    /** 是否监听 tag push 事件 */
    tag_push_events?: boolean;
    /** 是否监听 review 事件 */
    review_events?: boolean;
    /** 是否校验 SSL */
    enable_ssl_verification?: boolean;
    /** 用于校验的 secret token（工蜂会在 X-Gitlab-Token 请求头中携带） */
    token?: string;
}

/**
 * 每日合并
 * 1. 获取昨天有活跃的分支
 * 2. 对于每个分支，进行合并并推送
 *     - 清理 Git 环境
 *     - 切到主分支，并拉最新代码
 *     - 切到当前分支，拉最新代码
 *     - 尝试执行 git merge
 *     - 对比 merge 前后的 commit 信息是否相同，作为判断 merge 是否成功的依据
 * 3. 发送机器人消息
 *
 *
 * @export
 * @async
 * @param {object} param0 参数
 * @param {string} param0.webhookUrl 机器人地址
 * @param {string} param0.appName 项目名称
 * @param {string} param0.devRoot 项目根路径
 * @param {string} param0.baseUrl 基础请求 url
 * @param {string} param0.repoName 仓库名称
 * @param {string} param0.privateToken 密钥
 * @param {boolean} [param0.isDryRun=false] 是否演练
 * @param {string} [param0.mainBranch='develop'] 主分支
 * @param {Regexp} [param0.whiteBranchReg=/^release\|develop\|hotfix\\/.+$/] 不处理的分支正则
 * @param {function} [param0.onReport] 执行完成后的结构化结果回调（可用于上报到自建后台）
 * @returns {Promise<DailyMergeReportInfo>}
 * @example
 *
 * ```ts
 * dailyMerge({
 *   webhookUrl: 'xx',
 *   appName: 'xx',
 *   devRoot: 'xx',
 *
 *   baseUrl: 'xx',
 *   repoName: 'xx',
 *   privateToken: 'xx',
 *
 *   isDryRun: false,
 *   onReport: async (info) => { await axios.post('/api/daily-merge', info); },
 * })
 * ```
 */
export declare function dailyMerge({ webhookUrl, appName, devRoot, baseUrl, quickLink, repoName, privateToken, isDryRun, mainBranch, whiteBranchReg, onReport, }: {
    webhookUrl: string;
    appName: string;
    devRoot: string;
    baseUrl: string;
    quickLink?: string;
    repoName: string;
    privateToken: string;
    isDryRun?: boolean;
    mainBranch?: string;
    whiteBranchReg?: RegExp;
    /** 执行完成后的结构化结果回调（可用于上报到自建后台） */
    onReport?: (info: DailyMergeReportInfo, err?: DailyMergeReportError) => void | Promise<void>;
}): Promise<DailyMergeReportInfo | undefined>;

/** 每个分支的处理结果 */
export declare interface DailyMergeBranchResult {
    /** 分支名 */
    name: string;
    /** 处理状态 */
    status: DailyMergeBranchStatus;
    /** 分支作者（如能从 commit 信息中拿到） */
    author?: string;
    /** 失败/跳过原因 */
    reason?: string;
    /** merge 前 commit hash */
    originCommit?: string;
    /** merge 后 commit hash */
    nowCommit?: string;
}

/** 每个分支的处理状态 */
export declare type DailyMergeBranchStatus = 'success' | 'conflict' | 'noMerge' | 'skipped' | 'pending';

/** dailyMerge 执行过程中发生的不可恢复错误 */
export declare interface DailyMergeReportError {
    /** 错误信息 */
    message: string;
    /** 错误堆栈 */
    stack?: string;
}

/** dailyMerge 整体执行结果（通过 onReport 回调传递） */
export declare interface DailyMergeReportInfo {
    /** 仓库名 */
    repoName: string;
    /** 应用名 */
    appName: string;
    /** 仓库工蜂链接 */
    repoUrl?: string;
    /** 仓库 ID */
    projectId?: string | number;
    /** 主分支 */
    mainBranch: string;
    /** 是否演练 */
    isDryRun: boolean;
    /** 启动时间（ms） */
    startTime: number;
    /** 结束时间（ms） */
    endTime: number;
    /** 耗时（ms） */
    duration: number;
    /** 各分支处理结果 */
    branches: DailyMergeBranchResult[];
    /** 汇总数 */
    summary: {
        total: number;
        success: number;
        conflict: number;
        noMerge: number;
        skipped: number;
    };
    /** 整体状态：success(全成功) / partial(部分失败) / failed(全失败) / empty(无分支) */
    status: 'success' | 'partial' | 'failed' | 'empty';
    /** 机器人通知内容（markdown） */
    robotMessage?: string;
    /** 机器人通知是否成功 */
    robotNotified?: boolean;
}

/**
 * 将日期格式化
 * @param {Date} date
 * @param {string} format
 * @returns {string} 格式化后的日期字符串
 * @example
 *
 * const date = new Date('2020-11-27 8:23:24');
 *
 * const res = dateFormat(date, 'yyyy-MM-dd hh:mm:ss')
 *
 * // 2020-11-27 08:23:24
 */
export declare function dateFormat(date: string | number | Date, fmt: string): string;

/**
 * 防抖，场景：搜索
 *
 * 触发事件后在 n 秒内函数只能执行一次，如果
 * 在 n 秒内又触发了事件，则会重新计算函数执行时间
 *
 * @param {Function} fn 主函数
 * @param {number} time 间隔时间，单位 `ms`
 * @param {boolean} immediate 是否立即执行，默认 `false`
 * @returns 闭包函数
 *
 * @example
 *
 * ```ts
 * function count() {
 *  console.log('xxxxx')
 * }
 * window.onscroll = debounce(count, 500)
 *
 * window.onscroll = debounce(count, 500, true)
 * ```
 */
export declare function debounce(fn: Function, time: number, immediate?: boolean): (...args: Array<any>) => any;

/**
 * 不用生成中间函数的防抖
 *
 * @example
 * ```ts
 * debounceRun(func, args, {
 *   funcKey: 'funcKey',
 *   wait: 500, // 默认 500
 *   throttle: false, // 是否是节流，默认 false
 *   immediate: true, // 是否立即执行，默认 true
 * })
 * ``
 */
export declare const debounceRun: (func: Function, args?: any[], options?: {
    funcKey?: any;
    wait?: number;
    throttle?: boolean;
    immediate?: boolean;
    debug?: boolean;
}) => void;

/**
 * 将 Base64 编码的字符串解码为原始字符串
 * 支持 Unicode 字符（包括中文、emoji 等），兼容小程序环境
 * @param str - Base64 编码的字符串
 * @returns 解码后的原始字符串
 * @example
 * ```ts
 * decode('SGVsbG8gV29ybGQ='); // 'Hello World'
 * decode('5L2g5aW95LiW55WM'); // '你好世界'
 * decode('8J+YgA=='); // '😀'
 * ```
 */
export declare const decode: (str: string) => string;

/**
 * 将字符串解码，与`encodeUrlParam`相对
 * @param {string} obj 输入字符串
 * @returns {object} 对象
 * @example
 * // 解码普通对象
 * decodeUrlParam('%7B%22a%22%3A1%7D');
 * // => { a: 1 }
 * @example
 * // 解码空对象
 * decodeUrlParam('%7B%7D');
 * // => {}
 * @example
 * // 解码嵌套对象
 * const encoded = encodeURIComponent(JSON.stringify({ name: 'mike', info: { age: 18 } }));
 * decodeUrlParam(encoded);
 * // => { name: 'mike', info: { age: 18 } }
 * @example
 * // 无效字符串返回空对象
 * decodeUrlParam('invalid-string');
 * // => {}
 * @example
 * // encode 和 decode 互逆
 * decodeUrlParam(encodeUrlParam({ name: 'mike', age: 18, list: [1, 2] }));
 * // => { name: 'mike', age: 18, list: [1, 2] }
 */
export declare function decodeUrlParam(str: string): object;

/**
 * PostCSS 插件：将 Vue3 的 :deep() 转换为 Vue2 的 ::v-deep，
 * 同时处理 :slotted() 和 :global() 选择器。
 * 内置平台判断，默认在所有平台执行。
 *
 * @param {object} options - 配置选项
 * @param {string[]} options.platform - 在哪些平台执行，默认所有平台
 *
 * @example
 *
 * ```js
 * // postcss.config.js
 * const { deepSelectorPlugin } = require('t-comm');
 *
 * module.exports = {
 *   plugins: [
 *     // 所有平台都执行
 *     deepSelectorPlugin(),
 *     // 仅在 h5 平台执行
 *     deepSelectorPlugin({ platform: ['h5'] }),
 *   ],
 * };
 * ```
 */
export declare const deepSelectorPlugin: {
    (options?: DeepSelectorPluginOptions): {
        postcssPlugin: string;
        Rule(rule: any): void;
    };
    postcss: boolean;
};

declare interface DeepSelectorPluginOptions {
    /** 在哪些平台执行，默认所有平台。通过 process.env.UNI_PLATFORM 判断 */
    platform?: string[];
}

/**
 * 深度赋值
 * @param keyStr 以点拼接的 key，比如 foo.bar
 * @param target 目标对象
 * @param value 目标值
 * @example
 * ```ts
 * const obj = { a: { b: 1 } };
 * deepSet('a.c', obj, 2);
 *
 * console.log(obj);
 * // { a: { b: 1, c: 2 } }
 * ```
 */
export declare function deepSet(keyStr: string, target: Record<string, any>, value: unknown): void;

/** mutual 模式：更新自己广播里 seenPeerId 的最小间隔（毫秒） */
export declare const DEFAULT_ADVERTISE_UPDATE_THROTTLE_MS = 300;

/** 自定义特征 UUID（创建外围设备时需要） */
export declare const DEFAULT_CHARACTERISTIC_UUID = "0000BEEF-0000-1000-8000-00805F9B34FB";

/** 同一台设备多次触发的去重时间（毫秒） */
export declare const DEFAULT_COOLDOWN_MS = 5000;

/** 默认存储 key */
export declare const DEFAULT_ENV_STORAGE_KEY = "pmd_api_cocos_env";

export declare const DEFAULT_GLOBAL_GET_ENV = "__pmdGetEnv__";

/** 默认全局调试函数名 */
export declare const DEFAULT_GLOBAL_SET_ENV = "__pmdSetEnv__";

/** 触发成功后保持广播的时长（毫秒），让对方也能扫到自己 */
export declare const DEFAULT_LINGER_BEFORE_STOP_MS = 50000;

/** mutual 模式：候选 peer 的 TTL（毫秒），超过未再见即从候选池移除 */
export declare const DEFAULT_PEER_TTL_MS = 3000;

/** iOS 兜底轮询间隔（毫秒） */
export declare const DEFAULT_POLL_INTERVAL_MS = 1500;

/** 默认隐私协议弹窗内容 */
export declare const DEFAULT_PRIVACY_CONTENT = "\u672C\u6E38\u620F\u9700\u8981\u4F7F\u7528\u3010\u84DD\u7259\u3011\u80FD\u529B\u3002\u70B9\u51FB\u3010\u540C\u610F\u3011\u5373\u8868\u793A\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F\u300A\u7528\u6237\u9690\u79C1\u4FDD\u62A4\u6307\u5F15\u300B\u3002";

/** QQ 登录页路径（默认值，可被参数覆盖） */
export declare const DEFAULT_QQ_LOGIN_PATH = "pagesLogin/pages/login/login";

/** 腾讯 QQ 小程序的 appId（默认值，可被参数覆盖） */
export declare const DEFAULT_QQ_MP_APP_ID = "wx26da53d900421226";

/** QueryUserInfo 接口路径（默认值，可被参数覆盖） */
export declare const DEFAULT_QUERY_USER_INFO_PATH = "pmdtrpc.commcgi.user.user/QueryUserInfo";

/** 触发"碰一碰"的 RSSI 阈值（dBm），越接近 0 表示距离越近 */
export declare const DEFAULT_RSSI_THRESHOLD = -75;

/** 自定义服务 UUID（两端必须一致，作为"同一个小游戏"的识别标记） */
export declare const DEFAULT_SERVICE_UUID = "0000FEED-0000-1000-8000-00805F9B34FB";

export declare const DEFAULT_WHITE_REG: RegExp;

/**
 * 删除分支
 *
 * 对应工蜂 API：DELETE /api/v3/projects/:id/repository/branches/:branch
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {string} options.branchName 要删除的分支名
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<unknown>} 请求 Promise
 * @example
 *
 * deleteBranch({
 *   projectName: 'group/sub/repo',
 *   branchName: 'feature/x',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function deleteBranch({ projectName, branchName, privateToken, baseUrl, }: {
    projectName: string | number;
    branchName: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<unknown>;

export declare function deleteCOSEmptyFolder({ secretId, secretKey, bucket, region, prefix, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    prefix: string;
}): Promise<unknown>;

export declare function deleteCOSLongAgoObject({ secretId, secretKey, bucket, region, prefix, keepNumber, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    prefix: string;
    keepNumber?: number;
}): Promise<unknown>;

/**
 * 批量删除 COS 存储桶中的多个对象
 * @param {object} config 配置信息
 * @param {string} config.secretId COS secretId
 * @param {string} config.secretKey COS secretKey
 * @param {Array<string>} config.keys 要删除的对象 key 列表
 * @param {string} config.bucket COS bucket
 * @param {string} config.region COS region
 * @returns {Promise<any>} 删除结果
 * @example
 * ```ts
 * await deleteCOSMultipleObject({
 *   secretId: 'xxx',
 *   secretKey: 'xxx',
 *   keys: ['static/old-file1.js', 'static/old-file2.js'],
 *   bucket: 'my-bucket-1250000000',
 *   region: 'ap-guangzhou',
 * });
 * ```
 */
export declare function deleteCOSMultipleObject({ secretId, secretKey, keys, bucket, region, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    keys: Array<string>;
}): Promise<unknown>;

/**
 * 删除目录及其所有内容
 * 递归删除目录下的所有文件和子目录
 * @param tPath - 要删除的目录路径
 * @example
 * ```ts
 * deleteFolder('/path/to/folder');
 * ```
 */
export declare function deleteFolder(tPath: string): void;

/**
 * 递归删除文件夹（可配置是否删除文件）
 * 递归遍历目录，根据配置决定是否删除文件，并删除空目录
 * @param path - 要处理的目录路径
 * @param options - 配置选项
 * @param options.deleteFile - 是否删除文件，默认为 false
 * @param options.log - 是否输出日志，默认为 false
 * @example
 * ```ts
 * // 只删除空目录
 * deleteFolderRecursive('/path/to/folder');
 *
 * // 删除所有文件和目录
 * deleteFolderRecursive('/path/to/folder', { deleteFile: true, log: true });
 * ```
 */
export declare function deleteFolderRecursive(path: string, options?: {
    deleteFile: boolean;
    log: boolean;
}): void;

/**
 * 删除一个项目
 * @param {object} options 输入配置
 * @param {string} options.id 项目id
 * @param {string} options.privateToken 密钥
 * @returns {Promise<Array<object>>} 请求Promise
 * @example
 *
 * deleteTGitProject({
 *   id: '123'
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function deleteTGitProject({ id, privateToken, baseUrl, }: {
    id: number | string;
    privateToken: string;
    baseUrl?: string;
}): Promise<Array<object>>;

/**
 * 删除 Webhook
 *
 * 对应工蜂 API：DELETE /api/v3/projects/:id/hooks/:hookId
 * @example
 *
 * deleteWebhook({
 *   projectName: 'group/sub/repo',
 *   hookId: 12345,
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function deleteWebhook({ projectName, hookId, privateToken, baseUrl, }: {
    projectName: string | number;
    hookId: number | string;
    privateToken: string;
    baseUrl?: string;
}): Promise<unknown>;

/**
 * 部署本地目录到 OA Pages
 *
 * @param options - 部署配置
 * @returns 部署结果
 *
 * @example
 * ```ts
 * import { deployPages } from 't-comm';
 *
 * // 基本用法
 * const result = await deployPages({
 *   cname: 't-comm.pages.woa.com',
 *   directory: 'docs/.vitepress/dist',
 *   visibility: 'public',
 * });
 *
 * // 传入 API Key（不依赖环境变量）
 * const result = await deployPages({
 *   cname: 't-comm',
 *   directory: './dist',
 *   apiKey: 'oa-pages-key-xxxxxxxx',
 *   visibility: 'tof',
 *   description: '我的网站',
 * });
 *
 * // 部署前先清理远程历史文件（避免容量超限上传失败）
 * await deployPages({
 *   cname: 't-comm.pages.woa.com',
 *   directory: './dist',
 *   cleanBeforeDeploy: true,
 * });
 *
 * // 仅清理 assets/ 前缀下的文件，再上传
 * await deployPages({
 *   cname: 't-comm.pages.woa.com',
 *   directory: './dist',
 *   cleanBeforeDeploy: true,
 *   cleanPrefix: 'assets/',
 * });
 * ```
 */
export declare function deployPages(options: DeployPagesOptions): Promise<DeployPagesResult>;

/**
 * 部署配置选项
 */
export declare interface DeployPagesOptions {
    /** 域名，如 t-comm.pages.woa.com 或简写 t-comm */
    cname: string;
    /** 要部署的本地目录路径 */
    directory: string;
    /** API Key，不传则从环境变量 OA_PAGES_API_KEY 获取 */
    apiKey?: string;
    /** 访问权限：public(免登录) | tof(需登录) | git(仅 git 成员) | whitelist(白名单)。新建网站默认 whitelist */
    visibility?: 'public' | 'tof' | 'git' | 'whitelist';
    /** 网站描述（最多 100 个字） */
    description?: string;
    /** 仅预览，不实际上传 */
    dryRun?: boolean;
    /**
     * 部署前是否清理远程已有文件。
     * 适用于历史文件过多导致后续上传失败的场景。
     * 默认 false。
     */
    cleanBeforeDeploy?: boolean;
    /**
     * 仅清理匹配前缀的远程文件（可传单个或多个前缀）。
     * 仅在 cleanBeforeDeploy 为 true 时生效，未传则清理全部远程文件。
     * 例如 'assets/' 仅清理 assets 目录下的文件。
     */
    cleanPrefix?: string | string[];
}

/**
 * 部署结果
 */
export declare interface DeployPagesResult {
    /** 是否成功 */
    success: boolean;
    /** 网站 URL */
    url: string;
    /** 管理页面 URL */
    adminUrl: string;
    /** 完整域名 */
    cname: string;
    /** 文件总数 */
    totalFiles: number;
    /** 批次数 */
    totalBatches: number;
    /** 部署前清理的远程文件数（仅在 cleanBeforeDeploy=true 时有意义） */
    deletedFiles?: number;
    /** 错误信息（失败时） */
    error?: string;
}

declare enum DEVICE_TYPE {
    PC = "PC",
    MOBILE_HOR = "MOBILE_HORPC",
    MOBILE_VERT = "MOBILE_VERT"
}

/**
 * 下载腾讯云COS对象内容
 *
 * @param secretId - 腾讯云API密钥ID
 * @param secretKey - 腾讯云API密钥Key
 * @param bucket - COS存储桶名称
 * @param region - COS存储桶所在区域
 * @param key - 对象键（Object Key），对象在存储桶中的唯一标识
 * @param output - 输出路径或输出流，可选参数。如果指定，对象内容将写入该路径或流
 * @returns Promise对象，成功时返回对象内容数据，失败时返回错误信息
 * @throws 当参数不全时会抛出错误
 * @example
 * ```typescript
 * // 下载到内存
 * downloadCosObject({
 *   secretId: 'your-secret-id',
 *   secretKey: 'your-secret-key',
 *   bucket: 'test-bucket',
 *   region: 'ap-beijing',
 *   key: 'path/to/file.txt'
 * })
 * .then(data => console.log(data))
 * .catch(err => console.error(err));
 *
 * // 下载到文件
 * downloadCosObject({
 *   secretId: 'your-secret-id',
 *   secretKey: 'your-secret-key',
 *   bucket: 'test-bucket',
 *   region: 'ap-beijing',
 *   key: 'path/to/file.txt',
 *   output: './local/file.txt'
 * })
 * .then(data => console.log('下载成功'))
 * .catch(err => console.error(err));
 * ```
 */
export declare function downloadCosObject({ secretId, secretKey, bucket, region, key, output, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    key: string;
    output?: string | any;
}): Promise<any>;

/**
 * 从 Blob 对象下载文件。创建一个临时链接并触发浏览器下载
 * @param blob - Blob 数据
 * @param fileName - 下载的文件名
 * @example
 * ```ts
 * const blob = new Blob(['Hello World'], { type: 'text/plain' });
 * downloadFileFromBlob({
 *   blob,
 *   fileName: 'hello.txt'
 * });
 * ```
 */
export declare function downloadFileFromBlob({ blob, fileName, }: {
    blob: BlobPart;
    fileName: string;
}): void;

/**
 * 批量下载文件为 ZIP 压缩包。将多个文件打包成 ZIP 并触发下载
 * @param fileList - 文件列表，每个文件包含 content 和 name
 * @param zipName - ZIP 文件名
 * @param saveAs - FileSaver.js 的 saveAs 函数
 * @param JSZip - JSZip 库实例
 * @returns Promise\<boolean\> - 成功返回 true，失败返回 false
 * @example
 * ```ts
 * import JSZip from 'jszip';
 * import { saveAs } from 'file-saver';
 *
 * downloadFilesToZip({
 *   fileList: [
 *     { content: 'file1 content', name: 'file1.txt' },
 *     { content: 'file2 content', name: 'file2.txt' }
 *   ],
 *   zipName: 'files.zip',
 *   saveAs,
 *   JSZip
 * }).then(success => {
 *   console.log('下载结果:', success);
 * });
 * ```
 */
export declare function downloadFilesToZip({ fileList, zipName, saveAs, JSZip, }: {
    fileList: Array<{
        content: string;
        name: string;
    }>;
    zipName: string;
    saveAs: (...args: any[]) => any;
    JSZip: any;
}): Promise<boolean>;

declare namespace drag {
    export {
        dragElement,
        DRAG_TYPE
    }
}

declare enum DRAG_TYPE {
    DOT_TO_DOT = "DOT_TO_DOT",
    STEPS = "STEPS"
}

declare function dragElement({ page, source, target, mode, reverse, stepUnit, }: {
    page: any;
    source: any;
    target: any;
    mode?: DRAG_TYPE;
    reverse?: boolean;
    stepUnit?: number;
}): Promise<void>;

export declare const e2e: {
    autoScroll(element: HTMLAnchorElement, page: any, bottomTimes?: number): Promise<void>;
    dragElement({ page, source, target, mode, reverse, stepUnit, }: {
        page: any;
        source: any;
        target: any;
        mode?: drag.DRAG_TYPE | undefined;
        reverse?: boolean | undefined;
        stepUnit?: number | undefined;
    }): Promise<void>;
    DRAG_TYPE: typeof drag.DRAG_TYPE;
    waitEle(element: HTMLSelectElement, page: any, timeout?: number): Promise<any>;
    clickBtn(btn: any): Promise<boolean>;
    findAndClick(element: HTMLSelectElement, page: any, timeout?: number): Promise<any>;
    justWait(time: number): Promise<unknown>;
    closeBlankPage(browser: any): Promise<void>;
    getRect(element: HTMLSelectElement, page: any): Promise<any>;
    getInnerText(element: HTMLSelectElement, page: any): Promise<any>;
    findListItemAndClick({ page, element, innerText, }: {
        page: any;
        element: HTMLSelectElement;
        innerText: string;
    }): Promise<void>;
    getHref(page: any): Promise<any>;
    initBrowser({ puppeteer, args, headless, devtools, }: {
        puppeteer: any;
        args?: string[] | undefined;
        headless?: boolean | undefined;
        devtools?: boolean | undefined;
    }): Promise<any>;
    getNewPage(browser: any, device: page.DEVICE_TYPE): Promise<any>;
    openOrFindPage(browser: any, href: string, device: page.DEVICE_TYPE): Promise<any>;
    setUserAgent(useragent: string, page: any): Promise<void>;
    setSessionStorage(key: string, value: string, page: any): Promise<void>;
    setRoute(page: any, route?: string): Promise<void>;
    DEVICE_TYPE: typeof page.DEVICE_TYPE;
};

/**
 * 修改分支
 *
 * 编辑给定项目的某个分支。注意：如果项目内已存在 Mainline 分支，则不允许将其他分支设置成 Mainline 类别。
 *
 * 对应工蜂 API：PUT /api/v3/projects/:id/repository/branches/:branch
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目 ID 或项目全路径 project_full_path
 * @param {string} options.branchName 分支名
 * @param {string} [options.description] 分支描述
 * @param {string} [options.branchType] 分支类别，比如 Mainline、Feature、Others 等
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<{ name: string } & Record<string, unknown>>} 修改后的分支信息
 * @example
 *
 * editBranch({
 *   projectName: 'group/sub/repo',
 *   branchName: 'feature/x',
 *   branchType: 'Feature',
 *   description: 'feature 分支',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function editBranch({ projectName, branchName, description, branchType, privateToken, baseUrl, }: {
    projectName: string | number;
    branchName: string;
    description?: string;
    branchType?: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<{
    name: string;
} & Record<string, unknown>>;

/**
 * 修改项目设置
 *
 * 对应工蜂 OpenAPI：PUT /api/v3/projects/:id
 *
 * - 修改成功返回修改后的项目信息（{@link TGitProjectInfo}）
 * - 参数错误返回 400
 *
 * @param {object} options 输入配置
 * @param {string | number} options.id 项目 ID 或项目全路径（如 `group/sub/repo`）
 * @param {EditTGitProjectParams} options.data 修改项目的参数
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<TGitProjectInfo>} 修改后的项目详情
 * @example
 *
 * editProject({
 *   id: 32833,
 *   data: {
 *     name: 'testapp',
 *     review_enabled: true,
 *   },
 *   privateToken: 'xxxxx',
 * }).then((info) => {
 *   console.log(info.name);
 * });
 */
export declare function editProject({ id, data, privateToken, baseUrl, }: {
    id: number | string;
    data: EditTGitProjectParams;
    privateToken: string;
    baseUrl?: string;
}): Promise<TGitProjectInfo>;

/**
 * 修改项目时的请求参数（对应工蜂 PUT /api/v3/projects/:id）
 *
 * 字段参考工蜂 OpenAPI 文档（均为可选）：
 * - 基础信息：name / description / default_branch / fork_enabled / visibility_level
 * - 存储限制：limit_file_size / limit_lfs_file_size
 * - 功能开关：issues_enabled / merge_requests_enabled / wiki_enabled / review_enabled
 * - tag 规则：tag_name_regex / tag_create_push_level
 * - 模板：template_repository
 * - MR 跳过规则：allow_skip_reviewer / allow_skip_owner / allow_skip_mr_check
 * - 评审 / AI：review_approval_requires_reason / auto_intelligent_review_enabled ...
 *
 * 同时保留索引签名 `[k: string]: unknown`，兼容工蜂未来扩展。
 */
export declare interface EditTGitProjectParams {
    /** 项目名 */
    name?: string;
    /** 项目描述 */
    description?: string;
    /** 项目默认分支 */
    default_branch?: string;
    /** 项目是否可以被 fork，默认 false */
    fork_enabled?: boolean;
    /** 项目可视范围 */
    visibility_level?: number;
    /** 文件大小限制，单位 MB */
    limit_file_size?: number;
    /** LFS 文件大小限制，单位 MB */
    limit_lfs_file_size?: number;
    /** 议题配置 */
    issues_enabled?: boolean;
    /** 合并请求配置 */
    merge_requests_enabled?: boolean;
    /** 维基配置 */
    wiki_enabled?: boolean;
    /** 评审配置 */
    review_enabled?: boolean;
    /** 推送或创建 tag 规则 */
    tag_name_regex?: string;
    /**
     * 推送或创建 tag 权限：
     * - 0  任何人不能推送或创建 tag
     * - 30 DEVELOPER 以上角色才能推送或创建 tag
     * - 40 MASTER 以上角色才能推送或创建 tag
     */
    tag_create_push_level?: number;
    /** 项目是否设置为模板仓库，默认 false */
    template_repository?: boolean;
    /** 允许使用 --skip-reviewer 在 MR 创建时跳过评审，默认 false */
    allow_skip_reviewer?: boolean;
    /** 允许使用 --skip-owner 在 MR 创建时跳过文件评审，默认 false */
    allow_skip_owner?: boolean;
    /** 紧急情况时允许绕过 MR 检查直接合并，默认 false */
    allow_skip_mr_check?: boolean;
    /** 开启评审同意时必须填写理由，默认 false */
    review_approval_requires_reason?: boolean;
    /** 开启 AI 自动评审，默认 false */
    auto_intelligent_review_enabled?: boolean;
    /** 是否强制 MR 中所有 AI 评论必须被响应，默认 false */
    force_intelligent_review_evaluation?: boolean;
    /** 开启 AI 描述生成，默认 false */
    auto_intelligent_review_description_enabled?: boolean;
    /** 自定义过滤文件类型（正则方式） */
    intelligent_review_exclude_path_rules?: string;
    /** 设置 AI 摘要输出语言（中英文），可选值：zh_CN, en */
    intelligent_language?: 'zh_CN' | 'en' | string;
    /** AI 评审挑剔模式，默认 0 */
    ai_review_mode?: TGitAiReviewMode;
    /** 仅响应命中自定义规则的 AI 评审意见，默认 false */
    intelligent_review_only_block_custom_rules?: boolean;
    /** 仅响应一定严重程度 AI 评审意见，0 全部 / 1 一般和严重 / 2 严重，默认 0 */
    intelligent_review_block_severity_level?: TGitAiReviewBlockSeverityLevel;
    /** 豁免分支方向正则表达式列表 */
    intelligent_review_block_exemption_directions?: TGitAiReviewExemptionDirection[];
    /** 是否启用豁免方向正则表达式，默认 false */
    intelligent_review_block_exemption_directions_enabled?: boolean;
    /** 兼容工蜂未来扩展字段 */
    [k: string]: unknown;
}

/** mutual 模式：广播 payload 占位符（未看到对方时） */
export declare const EMPTY_PEER_ID = "------";

/**
 * 使用鼠标滚轮控制元素的scrollLeft实现左右移动
 * @param {HTMLElement} element - 需要控制移动的DOM元素
 * @param {Object} [options] - 配置选项
 * @param {number} [options.speed=50] - 移动速度（像素/滚动单位）
 * @param {boolean} [options.preventDefault=true] - 是否阻止默认滚动行为
 * @param {boolean} [options.invertDirection=false] - 是否反转滚动方向
 * @example
 * ```ts
 * // 基础用法：让横向滚动容器支持鼠标滚轮横向滚动
 * const el = document.querySelector('.scroll-container') as HTMLElement;
 * const dispose = enableHorizontalScroll(el);
 *
 * // 自定义速度和方向
 * enableHorizontalScroll(el, {
 *   speed: 100,
 *   invertDirection: true,
 * });
 *
 * // 不阻止默认滚动行为（页面仍可垂直滚动）
 * enableHorizontalScroll(el, { preventDefault: false });
 *
 * // 组件销毁时取消监听
 * dispose?.();
 * ```
 */
export declare function enableHorizontalScroll(element: HTMLElement, options?: {}): (() => void) | undefined;

/**
 * 将字符串编码为 Base64 格式
 * 支持 Unicode 字符（包括中文、emoji 等），兼容小程序环境
 * @param str - 要编码的字符串
 * @returns Base64 编码后的字符串
 * @example
 * ```ts
 * encode('Hello World'); // 'SGVsbG8gV29ybGQ='
 * encode('你好世界'); // '5L2g5aW95LiW55WM'
 * encode('😀'); // '8J+YgA=='
 * ```
 */
export declare const encode: (str: string) => string;

/**
 * 把 payload 编码进设备名（iOS Peripheral 唯一可控的广播字段）。
 *   `BUMP_<myTempId>_<seenPeerId>` → 例 `BUMP_ABC123_------`（19 字符）
 *
 * 不少机型对 localName 长度有限制（iOS Peripheral 推荐 ≤ 28 字节），这里 19 字符够用。
 */
export declare function encodeBumpName(myTempId: string, seenPeerId?: string | null): string;

/**
 * 把 myTempId / seenPeerId 组装为广播 payload 字符串。
 * 固定长度，便于解析：`${myTempId}|${seenPeerId}` → 13 字节。
 *
 * - myTempId 如果不足 TEMP_ID_LENGTH 位会自动补 '-'（防御性处理）
 * - seenPeerId 为空时填占位符 '------'
 */
export declare function encodePayload(myTempId: string, seenPeerId?: string | null): string;

/**
 * 将对象字符串化
 * @param {object} obj 输入对象
 * @returns {string} 字符串
 * @example
 * // 编码普通对象
 * encodeUrlParam({ a: 1 });
 * // => '%7B%22a%22%3A1%7D'
 * @example
 * // 编码空对象
 * encodeUrlParam({});
 * // => '%7B%7D'
 * @example
 * // 编码嵌套对象（等价于 encodeURIComponent(JSON.stringify(obj))）
 * encodeUrlParam({ name: 'mike', info: { age: 18 } });
 * @example
 * // 编码数组
 * encodeUrlParam([1, 2, 3]);
 * // => encodeURIComponent('[1,2,3]')
 * @example
 * // 编码含中文的对象
 * encodeUrlParam({ name: '张三' });
 * // => encodeURIComponent(JSON.stringify({ name: '张三' }))
 */
export declare function encodeUrlParam(obj: object): string;

export declare function ensureDir(dir: string): void;

/** 当前支持的环境枚举 */
export declare type Env = 'test' | 'prod';

/** 各环境对应的服务端域名（不带协议、不带末尾斜杠） */
export declare type EnvDomainMap = Record<Env, string>;

declare const ERROR_MAP: {
    BRANCH_EXIST: string;
    SAME_CONFIG: string;
};

/**
 * 转义审核描述中的反引号，防止在企微消息中出错
 *
 * @example
 * ```ts
 * escapeAuditDesc('修复`bug`')  // => '修复\\`bug\\`'
 * ```
 */
export declare function escapeAuditDesc(desc: string): string;

/**
 * 事件总线类
 * 实现发布-订阅模式，用于组件间通信
 * @example
 * ```ts
 * const bus = new EventBus();
 *
 * // 订阅事件
 * bus.on('message', (data) => {
 *   console.log('收到消息:', data);
 * });
 *
 * // 发布事件
 * bus.emit('message', 'Hello World');
 *
 * // 取消订阅
 * bus.off('message');
 * ```
 */
export declare class EventBus {
    private events;
    constructor();
    /**
     * 发布事件
     * 触发指定事件的所有监听器
     * @param eventName - 事件名称
     * @param args - 传递给监听器的参数
     */
    emit(eventName: string, ...args: Array<any>): void;
    /**
     * 订阅事件
     * 添加事件监听器
     * @param eventName - 事件名称
     * @param fn - 监听器函数
     */
    on(eventName: string, fn: any): void;
    /**
     * 取消订阅
     * 移除指定事件的监听器
     * @param eventName - 事件名称
     * @param fn - 要移除的监听器函数，如果不传则移除该事件的所有监听器
     */
    off(eventName: string, fn: any): void;
}

declare type EventOptions = string | {
    name: string;
    [k: string]: string;
};

/**
 * excel 转 json
 * @param {object} params 参数
 * @returns jsonData
 * @example
 *
 * const options = {
 *   header: ['id', 'name', 'age'], // 可选：自定义表头
 *   range: 1,                      // 可选：跳过第一行（标题行）
 *   defval: null,                  // 可选：空单元格的默认值
 *   raw: false,                    // 可选：是否保留原始数据格式
 * };
 *
 * excelToJson({
 *   filePath: CONFIG.xlsxPath,
 *   sheetIndex: 1,
 *   options,
 * });
 *
 * // [
 * //   { id: 1, name: '2', age: '3' },
 * //   { id: 1, name: '2', age: '3' }
 * // ];
 *
 */
export declare function excelToJson({ filePath, sheetIndex, options, }: {
    filePath: string;
    sheetIndex?: number;
    options?: Record<string, any>;
}): unknown[];

/**
 * 在 Node.js 中调用 child_process.execSync 执行命令
 * 该方法会对输出结果进行处理，默认只返回指定行的内容（默认第一行）
 * @param command - 要执行的命令字符串
 * @param root - 执行命令的工作目录，默认为当前工作目录
 * @param options - 配置选项，可以是字符串（stdio）或对象
 * @param options.stdio - 标准输入输出配置，默认为 'pipe'
 * @param options.line - 返回结果的行号，默认为 0（第一行），设置为 -1 返回全部内容
 * @param options.throwError - 是否在命令执行失败时抛出错误，默认为 false
 * @returns 命令执行结果字符串
 * @example
 * ```ts
 * // 获取 git 分支名（第一行）
 * const branch = execCommand('git branch', '/path/to/repo');
 *
 * // 获取完整输出
 * const output = execCommand('ls -la', './', { line: -1 });
 *
 * // 自定义 stdio
 * const result = execCommand('npm install', './', { stdio: 'inherit' });
 * ```
 */
export declare function execCommand(command: string, root?: string, options?: string | {
    stdio?: StdioOptions;
    line?: number;
    throwError?: boolean;
}): string;

/**
 * 在目标项目中执行命令
 * @param command - 要执行的命令
 * @param targetProject - 目标项目路径
 * @example
 * ```ts
 * execCommandInTarget('npm install', '/path/to/project');
 * ```
 */
export declare function execCommandInTarget(command: string, targetProject: string): void;

/**
 * execCommand 的偏函数应用版本，固定 throwError 为 true
 * 当命令执行失败时会直接抛出错误，而非静默返回空字符串
 * @param command - 要执行的命令字符串
 * @param root - 执行命令的工作目录，默认为当前工作目录
 * @param options - 配置选项，可以是字符串（stdio）或对象（不含 throwError，因为已固定为 true）
 * @param options.stdio - 标准输入输出配置，默认为 'pipe'
 * @param options.line - 返回结果的行号，默认为 0（第一行），设置为 -1 返回全部内容
 * @returns 命令执行结果字符串
 * @example
 * ```ts
 * // 执行失败时会抛出错误
 * const branch = execCommandStrict('git branch', '/path/to/repo');
 *
 * // 配合 try-catch 使用
 * try {
 *   const result = execCommandStrict('some-command');
 * } catch (err) {
 *   console.error('命令执行失败:', err);
 * }
 * ```
 */
export declare function execCommandStrict(command: string, root?: string, options?: string | {
    stdio?: StdioOptions;
    line?: number;
}): string;

export declare function exportTencentDoc({ accessToken, clientId, openId, fileId, exportType, waitTime, }: ISecretInfo_2 & {
    fileId: string;
    exportType: number;
    waitTime?: number;
}): Promise<string | undefined>;

/**
 * 将属性混合到目标对象中
 * @param {object} to 目标对象
 * @param {object} from 原始对象
 * @returns 处理后的对象
 *
 * @example
 * const a = { name: 'lee' }
 * const b = { age: 3 }
 * extend(a, b)
 *
 * console.log(a)
 *
 * // => { name: 'lee', age: 3 }
 */
export declare function extend(to: Record<string, any>, from: Record<string, any>): object;

/**
 * 拼接额外参数
 * @param {string} url 地址
 * @param {string} removeKeyArr 待添加的参数对象
 * @returns 重新拼接的地址
 * @example
 * // 地址是 hash 模式参数
 * extendUrlParams('http://www.test.com/#/detail?a=1&b=2&c=3', { d: 4 });
 * // => 'http://www.test.com/#/detail?a=1&b=2&c=3&d=4'
 * @example
 * // 地址 history 模式参数并存
 * extendUrlParams('http://www.test.com?a=1&b=2&c=3', { d: 4 });
 * // => 'http://www.test.com/?a=1&b=2&c=3&d=4'
 * @example
 * // 地址 history 模式参数并存 + 强制 history 模式返回
 * extendUrlParams('http://www.test.com?a=1&b=2&c=3', { d: 4 }, true);
 * // => 'http://www.test.com/?a=1&b=2&c=3&d=4'
 * @example
 * // hash 模式和 history 模式参数并存
 * extendUrlParams('http://www.test.com?a=1&b=2&c=3#/detail?d=4', { e: 5 });
 * // => 'http://www.test.com/#/detail?a=1&b=2&c=3&d=4&e=5'
 * @example
 * // 地址是 hash 模式和 history 模式参数并存，且是多个参数
 * extendUrlParams('http://www.test.com?d=4&f=6#/detail?a=1&b=2&c=3', { e: 5, g: 7 });
 * // => 'http://www.test.com/#/detail?d=4&f=6&a=1&b=2&c=3&e=5&g=7'
 */
export declare function extendUrlParams(url?: string, extParamsObj?: {}, forceHistoryMode?: boolean): string;

/**
 * 提取 Vue 组件的 class
 * @param {obj} params 参数
 * @param {string} params.filePath 源文件地址
 * @param {string} [params.targetFilePath] 输出文件地址
 * @param {Regexp} [params.extractRegexp] 提取正则
 * @example
 *
 * ```ts
 * extractClass({
 *   filePath: 'xxx.vue',
 * })
 * ```
 */
export declare function extractClass({ filePath, targetFilePath, extractRegexp, }: {
    filePath: string;
    targetFilePath?: string;
    extractRegexp?: RegExp;
}): void;

/**
 * 提取 Vue 组件的 event
 * @param {obj} params 参数
 * @param {string} params.filePath 源文件地址
 * @param {string} [params.targetFilePath] 输出文件地址
 * @param {Regexp} [params.extractRegexp] 提取正则
 * @example
 *
 * ```ts
 * extractEvent({
 *   filePath: 'xxx.vue',
 * })
 * ```
 */
export declare function extractEvent({ filePath, targetFilePath, extractRegexp, }: {
    filePath: string;
    targetFilePath?: string;
    extractRegexp?: RegExp;
}): void;

/**
 * 提取 Vue 组件的 props
 * @param {obj} params 参数
 * @param {string} params.filePath 源文件地址
 * @param {string} [params.targetFilePath] 输出文件地址
 * @param {Regexp} [params.extractRegexp] 提取正则
 * @example
 *
 * ```ts
 * extractProps({
 *   filePath: 'xxx.vue',
 * })
 * ```
 */
export declare function extractProps({ filePath, targetFilePath, extractRegexp, }: {
    filePath: string;
    targetFilePath?: string;
    extractRegexp?: RegExp;
}): void;

declare type Fail = (err?: any) => void;

/**
 * 分页获取全部项目组列表（自动翻页）。
 *
 * 基于 {@link fetchGroups} 封装，自动遍历所有分页。
 * @example
 *
 * // 一次拿到当前 token 权限下的所有项目组
 * fetchAllGroups({
 *   privateToken: 'xxxxx',
 * }).then((groups) => {
 *   console.log(groups.length);
 * })
 */
export declare function fetchAllGroups({ privateToken, baseUrl, search, owned, minAccessLevel, createdByMe, excludeOrgGroup, }: {
    privateToken: string;
    baseUrl?: string;
    search?: string;
    owned?: boolean;
    minAccessLevel?: number;
    createdByMe?: boolean;
    excludeOrgGroup?: boolean;
}): Promise<IGroupInfo[]>;

/**
 * 获取某个组下所有项目（通过 `GET /api/v3/groups/:id` 接口，速度更快）。
 *
 * 当 `includeSubgroups` 为 true 时，会同时返回子组下的项目（`sub_projects`）。
 *
 * 兼容旧调用方式：返回值既是数组，又带有 `projects` 属性。
 * - 旧方式：`res.projects.map(item => ...)`
 * - 新方式：`res.map(item => ...)`
 * @example
 *
 * // 获取 pmd-mobile 组下（含子组）所有项目
 * fetchAllProjectsInGroup({
 *   groupName: 'pmd-mobile',
 *   privateToken: 'xxxxx',
 *   includeSubgroups: true,
 * }).then((res) => {
 *   res.forEach(p => console.log(p.path_with_namespace));
 * })
 */
export declare function fetchAllProjectsInGroup({ groupName, privateToken, baseUrl, includeSubgroups, }: {
    groupName: string;
    privateToken: string;
    baseUrl?: string;
    includeSubgroups?: boolean;
}): Promise<any>;

/**
 * 获取项目组的详细信息以及项目组下所有项目。
 *
 * 对应 API: `GET /api/v3/groups/:id`
 *
 * @see https://code.tencent.com/help/api/group#获取项目组的详细信息以及项目组下所有项目
 * @example
 *
 * fetchGroupDetail({
 *   groupId: 'pmd-mobile',
 *   privateToken: 'xxxxx',
 *   includeSubgroups: true,
 * }).then((detail) => {
 *   console.log(detail.projects);
 *   console.log(detail.sub_projects);
 * })
 */
export declare function fetchGroupDetail({ groupId, privateToken, baseUrl, includeSubgroups, }: {
    /** 项目组 ID 或 项目组全路径 namespace_full_path */
    groupId: string | number;
    privateToken: string;
    baseUrl?: string;
    /** 是否包含 subgroup 项目，默认 false */
    includeSubgroups?: boolean;
}): Promise<IGroupDetail>;

/**
 * 获取 / 搜索项目组列表。
 *
 * 对应 API: `GET /api/v3/groups`
 *
 * @see https://code.tencent.com/help/api/group#获取项目组列表
 * @example
 *
 * // 搜索名称包含 'pmd' 的项目组
 * fetchGroups({
 *   privateToken: 'xxxxx',
 *   search: 'pmd',
 *   page: 1,
 *   perPage: 20,
 * }).then((groups) => {
 *   console.log(groups.length);
 * })
 */
export declare function fetchGroups({ privateToken, baseUrl, search, owned, minAccessLevel, createdByMe, excludeOrgGroup, page, perPage, }: {
    privateToken: string;
    baseUrl?: string;
    /** 搜索关键字，按名称或路径匹配 */
    search?: string;
    /** 若为 true 则只返回 owner 为当前用户的 group */
    owned?: boolean;
    /** 指定最小访问级别 */
    minAccessLevel?: number;
    /** 仅当前用户创建 true / 仅非当前用户创建 false / 不传则不过滤 */
    createdByMe?: boolean;
    /** 排除组织架构授权 */
    excludeOrgGroup?: boolean;
    page?: number;
    perPage?: number;
}): Promise<IGroupInfo[]>;

export declare function fetchLatestOneRainbowData({ secretInfo, appName, key, valueType, fetchRainbowConfigOptions, }: {
    secretInfo: ISecretInfo_3;
    appName: string;
    key: string;
    valueType?: RainbowKeyValueType;
    fetchRainbowConfigOptions?: FetchRainbowConfigOptions;
}): Promise<{
    config: Array<IRemoteConfig>;
    originConfig: ILocalConfig;
    equal: boolean;
}>;

export declare function fetchLatestRainbowData({ secretInfo, appName, }: {
    secretInfo: ISecretInfo_3;
    appName: string;
}): Promise<{
    config: Array<IRemoteConfig>;
    originConfig: ILocalConfig;
    equal: boolean;
}>;

/**
 * 拉取七彩石配置
 * @param {String} key 七彩石的key
 * @param {object} secretInfo 密钥信息
 * @param {string} secretInfo.appId 项目Id
 * @param {string} secretInfo.envName 环境
 * @param {string} secretInfo.groupName 组名称
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 *
 * fetchRainbowConfig('test', {
 *   appId: 'xx',
 *   envName: 'prod',
 *   groupName: 'robot',
 * }).then((resp) => {
 *   console.log(resp)
 * });
 *
 */
export declare function fetchRainbowConfig(key: string, secretInfo: Partial<ISecretInfo_3>, options?: FetchRainbowConfigOptions): Promise<any>;

/**
 * 通过七彩石 SDK 拉取配置（适用于 Node.js 服务端）
 * 支持 v3Get 和 v3GetGroup 两种模式，内置内存缓存和文件缓存
 * @param {object} config 配置信息
 * @param {ISecretInfo} config.secretInfo 密钥信息，包含 appId、userId、secretKey、groupName、envName
 * @param {any} config.sdk 七彩石 SDK 实例（需包含 Rainbow、AccessType、AddrType）
 * @param {string} config.key 要获取的配置 key
 * @param {Record<string, any>} [config.initOptions] Rainbow 初始化额外选项
 * @param {boolean} [config.isFetchGroup=false] 是否使用 v3GetGroup 获取整组配置
 * @param {boolean} [config.tryJsonParse=true] 是否尝试 JSON.parse 解析返回值
 * @param {any} [config.rainbow] 外部传入的 Rainbow 实例（传入后不会自动 exit）
 * @returns {Promise<any>} 配置值
 * @example
 * ```ts
 * import * as sdk from 'rainbow-sdk';
 *
 * const config = await fetchRainbowConfigFromSdk({
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     groupName: 'default',
 *     envName: 'prod',
 *   },
 *   sdk,
 *   key: 'my_config_key',
 * });
 * ```
 */
export declare function fetchRainbowConfigFromSdk({ secretInfo, sdk, initOptions, key, isFetchGroup, tryJsonParse, rainbow, }: {
    secretInfo: ISecretInfo_3;
    sdk: any;
    key: string;
    initOptions?: Record<string, any>;
    isFetchGroup?: boolean;
    tryJsonParse?: boolean;
    rainbow?: any;
}): Promise<unknown>;

declare interface FetchRainbowConfigOptions {
    sdk: any;
    initOptions?: Record<string, any>;
    isFetchGroup?: boolean;
    tryJsonParse?: boolean;
}

/**
 * 发起 SSE 请求的核心函数，根据环境自动选择 H5 或 MP 实现
 * @param {RequestParams} params - 请求参数
 * @param {string} params.url - 请求地址
 * @param {Object} params.data - 请求数据
 * @param {Function} params.success - 成功回调
 * @param {Function} params.fail - 失败回调
 * @param {Function} params.complete - 完成回调
 * @returns {Promise} 返回一个 Promise，包含请求任务或响应对象
 * @example
 * ```ts
 * import { safeJsonParse } from 't-comm/es/json';
 *
 * import { fetchSSECore, type RequestParams } from 't-comm/es/sse';
 *
 * // 检查是否结束，业务自定义
 * function checkFinish(str) {
 *   const data: any = safeJsonParse(str);
 *   return data?.status === 3;
 * }
 *
 * // 业务二次封装，把自己的请求数据、自定义的处理数据的逻辑放进去
 * export function sendChatMessage({
 *   input,
 *   sessionId,
 *   extraInfo,
 *   expectedOp,
 *
 *   success,
 *   fail,
 *   complete,
 * }: {
 *   input: string;
 *   sessionId?: string;
 *   extraInfo?: string;
 *   expectedOp?: Record<string, any>;
 *
 *   success?: (data: any) => void;
 *   fail?: RequestParams['fail'];
 *   complete?: RequestParams['complete'];
 * }) {
 *   const origin = isTestEnv() ? 'https://xx.com' : 'https://xx.com';
 *   const url = `${origin}/xx.xx.xx.xx/xx?g_app_tk=${cookie.get('tip_token')}&tstamp=${Date.now()}`;
 *   const reqData = {
 *     input,
 *     session_id: sessionId,
 *     extra_info: extraInfo,
 *     expected_op: expectedOp,
 *   };
 *
 *   const parsedSuccess = (str, fullStr) => {
 *     const data: any = safeJsonParse(str);
 *     const fullData: any = safeJsonParse(fullStr);
 *
 *     if (checkFinish(str)) {
 *       complete?.(str);
 *       return;
 *     }
 *
 *     // 检查是否失败，业务自定义
 *     if (fullData?.err_msg) {
 *       fail?.(data);
 *       return;
 *     }
 *
 *     success?.(data);
 *   };
 *
 *   return fetchSSECore({
 *     url,
 *     data: reqData,
 *     success: parsedSuccess,
 *     fail,
 *     complete,
 *     isTestEnv,
 *   });
 * }
 *
 * ```
 */
export declare function fetchSSECore({ url, data, success, fail, complete, isTestEnv, }: RequestParams): Promise<unknown>;

/**
 * 在 H5 环境下发起 SSE 请求的核心函数
 * @param {Object} params - 参数对象
 * @param {string} params.url - 请求 URL
 * @param {any} params.data - 请求数据
 * @param {Function} params.success - 成功回调函数
 * @param {Function} params.fail - 失败回调函数
 * @param {Function} params.complete - 完成回调函数
 * @returns {Promise} 返回一个 Promise，包含响应对象
 * @example
 * ```ts
 * fetchSSECoreInH5({
 *   url: 'https://example.com/sse',
 *   data: { input: 'hello' },
 *   success: (chunk) => console.log(chunk),
 *   fail: ({ response }) => console.error('failed'),
 *   complete: () => console.log('done'),
 * });
 * ```
 */
export declare function fetchSSECoreInH5({ url, data, success, fail, complete, }: Pick<RequestParams, 'url' | 'data' | 'success' | 'fail' | 'complete'>): Promise<unknown>;

/**
 * 在 MP 环境下发起 SSE 请求的核心函数
 * @param {RequestParams} params - 请求参数
 * @returns {Promise} 返回一个 Promise，包含请求任务对象
 * @example
 * ```ts
 * fetchSSECoreInMP({
 *   url: 'https://example.com/sse',
 *   data: { input: 'hello' },
 *   success: (data) => console.log(data),
 *   fail: (err) => console.error(err),
 *   complete: () => console.log('done'),
 *   isTestEnv: () => false,
 * });
 * ```
 */
export declare function fetchSSECoreInMP({ url, data, success, fail, complete, isTestEnv, }: RequestParams): Promise<unknown>;

/**
 * 获取天气信息
 * @returns {Promise<Array>} 天气数据
 * @example
 *
 * fetchWeatherData().then(content => {
 *   console.log(content)
 * })
 */
export declare function fetchWeatherData<T extends Array<object>>(): Promise<T>;

export declare type FileMap = {
    [k: string]: {
        reg: RegExp;
        lintKeyword: string;
        outputFileName: string;
        outputFile?: string;
        isStyle?: boolean;
        isVue?: boolean;
        /** 全量模式下是否为多类型合并输出文件（需按扩展名过滤） */
        isMerged?: boolean;
        total?: number;
        errorFiles?: JSErrorFile[];
    };
};

export declare function filterCommit(commits?: Array<CommitInfo>): CommitInfo[];

export declare interface FilterParams {
    url: string;
    limit: number;
    keepKey: string[];
    forceHistoryMode?: boolean | undefined;
}

/**
 * 根据地址长度，进行过滤地址参数，允许指定保留特定参数
 * @param {object} [params={ limit: 1024 }] 参数
 * @param {number} params.url 待过滤地址，默认当前页面地址
 * @param {number} params.limit 参数长度限制
 * @param {array}  params.keepKey 指定保留的参数，比如业务参数、框架参数（登录态、统计上报等）
 * @example
 * // 未超过长度限制，原样返回
 * filterUrlParams({
 *   url: 'https://igame.qq.com/?name=mike#/?from=test',
 *   limit: 600,
 *   keepKey: ['name'],
 * });
 * // => 'https://igame.qq.com/?name=mike#/?from=test'
 * @example
 * // search 参数超长，仅保留 keepKey 指定参数
 * filterUrlParams({
 *   url: 'https://igame.qq.com/?name=mike&__lxsdk_params=...(超长)#/?from=test',
 *   limit: 600,
 *   keepKey: ['name'],
 * });
 * // => 'https://igame.qq.com/#/?name=mike'
 * @example
 * // search 参数超长 + 强制 history 模式返回
 * filterUrlParams({
 *   url: 'https://igame.qq.com/?name=mike&__lxsdk_params=...(超长)',
 *   limit: 600,
 *   keepKey: ['name'],
 *   forceHistoryMode: true,
 * });
 * // => 'https://igame.qq.com/?name=mike'
 * @example
 * // hash 参数超长
 * filterUrlParams({
 *   url: 'https://igame.qq.com/?name=mike#/?name=mike&__lxsdk_params=...(超长)',
 *   limit: 600,
 *   keepKey: ['name'],
 * });
 * // => 'https://igame.qq.com/#/?name=mike'
 * @example
 * // 参数超长，并且支持识别路径
 * filterUrlParams({
 *   url: 'https://igame.qq.com/?name=mike#/detail?name=mike&__lxsdk_params=...(超长)',
 *   limit: 600,
 *   keepKey: ['name'],
 * });
 * // => 'https://igame.qq.com/#/detail?name=mike'
 */
export declare function filterUrlParams(params?: FilterParams): string;

export declare function findCurrentStage<T extends {
    start_time: number;
    end_time: number;
}>(list: Array<T>, now: number): T | Partial<T>;

/**
 * 根据路由表，找到 path 对应的 路由名称
 * @param {string} path 路由路径
 * @param {array} routes 路由表
 * @returns {object} 匹配到的路由信息
 *
 * @example
 * ```ts
 * const { name, params, meta, path } = findRouteName(rawPath, ALL_ROUTES) || {};
 *
 * console.log('name', name);
 * ```
 */
export declare function findRouteName(path: string, routes: Array<IRoute>): {
    name: string | undefined;
    params: {
        [x: string]: any;
    };
    path: string | undefined;
    meta: IMeta;
} | undefined;

/**
 * 递归拉平数组
 * @param list 数组
 * @returns 数组
 *
 * @example
 *
 * flat([[[1, 2, 3], 4], 5])
 *
 * // [1, 2, 3, 4, 5]
 */
export declare function flat<T>(list: readonly T[]): T[];

/**
 * 拉平数组，不会递归处理
 * @param {Array<Object>} list - 对象数组
 * @param {string} key - 对象的key
 * @returns {object} 拉平后的对象
 *
 * @example
 *
 * const list = [{id: 1, name: 'a'}, {id: 2, name: 'b'}]
 *
 * flatten(list, 'id')
 *
 * // {1: {id: 1, name: 'a'}, 2: {id: 2, name: 'b'}}
 *
 */
export declare function flatten<T extends Record<string, unknown>, K extends keyof T>(list: T[], key: K): Record<string | number | symbol, T>;

/**
 * 拉平之前数据
 * @param {Array<Object>} preDataList 之前的数据，作为对照
 * @param {string} key 主键
 * @returns {Object} preDataMap
 *
 * @example
 * const data = [{
 *   ProjectName: { name: 'ProjectName', value: '研发平台' },
 *   PagePv: { name: 'PagePv', value: 152 },
 *   PageUv: { name: 'PageUv', value: 7 },
 *   Score: { name: 'Score', value: 93.92 },
 *   PageDuration: { name: 'PageDuration', value: 1281.58 },
 *   PageError: { name: 'PageError', value: 2 },
 * }];
 *
 * flattenPreData(data, 'ProjectName');
 *
 * // 输出
 * {
 *   研发平台: {
 *     ProjectName: '研发平台',
 *     PagePv: 152,
 *     PageUv: 7,
 *     Score: 93.92,
 *     PageDuration: 1281.58,
 *     PageError: 2,
 *   },
 * };
 */
export declare function flattenPreData(preDataList: Array<IPreData>, key: string): {
    [valueOfPrimaryKey: string]: {
        [key: string]: ValueType;
    };
};

export declare function flattenSubPackages(result: IUploadResult): Record<string, any>;

/**
 * 将嵌套的组件依赖关系打平为一维映射
 * 递归遍历组件依赖树，将每个页面/组件的所有直接和间接依赖打平为数组
 * @param {Record<string, any>} rawMap 原始组件依赖映射，key 为页面/组件名，value 为其直接依赖的组件映射
 * @returns {ComponentMapList} 打平后的组件列表映射，key 为页面/组件名，value 为所有依赖组件名数组
 * @example
 * ```ts
 * const rawMap = {
 *   'pages/index': { 'comp-a': true, 'comp-b': true },
 *   'comp-a': { 'comp-c': true },
 * };
 * const result = flattenUsingComponentMap(rawMap);
 * // { 'pages/index': ['comp-a', 'comp-b', 'comp-c'], 'comp-a': ['comp-c'] }
 * ```
 */
export declare function flattenUsingComponentMap(rawMap: Record<string, any>): ComponentMapList;

/**
 * 格式化 bite 单位，最多保留2位小数，最大单位为BB
 * @param size bite 单位
 * @param options 配置项（可选）
 * @returns 格式化的字符
 *
 * @example
 *
 * formatBite(1)
 * // 1B
 *
 * formatBite(100)
 * // 100B
 *
 * formatBite(1000)
 * // 1000B
 *
 * formatBite(10000)
 * // 9.77KB
 *
 * formatBite(10000, { space: true })
 * // '9.77 KB'
 *
 * formatBite(10000, { fixed: 1 })
 * // '9.8KB'
 *
 * formatBite(10000, { space: true, fixed: 1 })
 * // '9.8 KB'
 */
export declare function formatBite(size: number, options?: IFormatBiteOptions): string;

/**
 * 根据传入的参数，移除原来的所有参数，根据传入的 keepParamsObj 进行重新拼接地址，以 hash 模式返回
 * @param {string} url 地址
 * @param {object} keepParamsObj 参数对象
 * @returns 只有传入参数的地址
 * @example
 * // 地址是 hash 模式参数
 * formatUrlParams('http://www.test.com/#/detail?a=1&b=2&c=3', { d: 4 });
 * // => 'http://www.test.com/#/detail?d=4'
 * @example
 * // 地址 history 模式参数并存（默认仍以 hash 模式返回）
 * formatUrlParams('http://www.test.com?a=1&b=2&c=3', { d: 4 });
 * // => 'http://www.test.com/?d=4'
 * @example
 * // hash 模式和 history 模式参数并存
 * formatUrlParams('http://www.test.com?a=1&b=2&c=3#/detail?d=4', { e: 5 });
 * // => 'http://www.test.com/#/detail?e=5'
 * @example
 * // 地址是 hash 模式和 history 模式参数并存，且是多个参数
 * formatUrlParams('http://www.test.com?d=4&f=6#/detail?a=1&b=2&c=3', { e: 5, g: 7 });
 * // => 'http://www.test.com/#/detail?e=5&g=7'
 * @example
 * // 子工程是 history 模式（forceHistoryMode = true）
 * formatUrlParams('http://www.test.com?a=1&b=2&c=3', { d: 4 }, true);
 * // => 'http://www.test.com/?d=4'
 */
export declare function formatUrlParams(url?: string, keepParamsObj?: Record<string, string | number>, forceHistoryMode?: boolean): string;

/**
 * 蓝鲸 APIGW 鉴权配置
 * @ignore
 */
export declare interface GalileoAuth {
    /** 蓝鲸 APP code */
    bk_app_code: string;
    /** 蓝鲸 APP secret */
    bk_app_secret: string;
    /** 可选，用户态 access_token */
    access_token?: string;
}

/**
 * 单条日志记录，对应 proto LogRecord
 * @ignore
 */
export declare interface GalileoLogRecord {
    /** 时间戳（纳秒，字符串形式） */
    timestamp: string;
    trace_id: string;
    span_id: string;
    message: string;
    level: string;
    tags: Record<string, string>;
}

/**
 * 排序类型，对应 proto LogSortType
 * @ignore
 */
export declare enum GalileoLogSortType {
    DEFAULT = 0,
    ASC = 1,
    DESC = 2
}

/**
 * 单个 tag 过滤字段，对应 proto LogTagsFields
 * @ignore
 */
export declare interface GalileoLogTagsFields {
    /** tag 名称，如 "tags.qimei36" */
    name: string;
    /** tag 值列表；长度 1 时为 name=value，长度 >1 时为 name in [value] */
    values: string[];
}

/**
 * message 搜索的关键词组合逻辑，对应 proto MessageSearch.FilterType
 * @ignore
 */
export declare enum GalileoMessageFilterType {
    EMPTY = 0,
    OR = 1,
    AND = 2
}

/** message 关键字搜索，对应 proto MessageSearch */
export declare interface GalileoMessageSearch {
    keyword: string[];
    filter?: GalileoMessageFilterType;
    search?: GalileoMessageSearchType;
}

/**
 * message 搜索模式，对应 proto MessageSearch.SearchType
 * @ignore
 */
export declare enum GalileoMessageSearchType {
    DEFAULT = 0,
    CASEINS = 1,
    TOKEN = 2,
    SUBSTR = 3,
    REGULAR = 4
}

/** 命名空间，伽利略协议枚举 */
export declare type GalileoNamespace = 'Production' | 'Development';

/** tag 条件搜索，对应 proto TagSearch */
export declare interface GalileoTagSearch {
    trace_id?: string;
    level?: string[];
    other_tags?: GalileoLogTagsFields[];
}

/**
 * 获取自定义事件图片并发送
 * @param {object} options 配置信息
 * @returns {string} 图片url
 * @example
 *
 * const requestMultiImgDate = Date.now() - 1 * 24 * 60 * 60 * 1000;
 *
 * const tamGroupIdList = [1, 2, 3];
 *
 * const eventProjectMap = {
 *   62659: {
 *     name: 'aaaaa',
 *   },
 *   57706: {
 *     name: 'bbbbb',
 *     extraProjectId: 66379,
 *   },
 * };
 *
 * const eventMap = {
 *   WX_SUC: {
 *     // 总和
 *     type: 'SUMMARY',
 *     target: ['ENTER_GAME_WX_SUC', 'LAUNCH_GAME_SUC_WX'],
 *   },
 *   WX_FAIL: {
 *     // 总和
 *     type: 'SUMMARY',
 *     target: ['ENTER_GAME_WX_FAIL', 'LAUNCH_GAME_FAIL_WX'],
 *   },
 * };
 *
 * const eventTableHeaderMap = {
 *   ProjectName: {
 *     name: '项目名称',
 *     tableWidth: 95,
 *   },
 *   ALL_SUMMARY: {
 *     name: '拉起总数',
 *     tableWidth: 65,
 *   },
 * };
 *
 * genCustomEventImgAndSendRobot({
 *   date: requestLaunchGameDate,
 *   secretInfo: {
 *     getPwdCode,
 *     encrypt,
 *     apiKey: process.env.AEGIS_APP_KEY,
 *     loginName: 'lee',
 *   },
 *   projectIdMap: eventProjectMap,
 *   eventMap,
 *   tableHeaderMap: eventTableHeaderMap,
 *   webhookUrl: tamRobotWebhook,
 *   chatId: tamRobotChatId,
 * });
 *
 */
export declare function genCustomEventImgAndSendRobot({ date, projectIdMap, env, secretInfo, eventMap, tableHeaderMap, webhookUrl, chatId, }: {
    date: number;
    projectIdMap: Array<string>;
    env: string;
    secretInfo: SecretInfoType;
    eventMap: {};
    tableHeaderMap: {};
    webhookUrl: string;
    chatId: string;
}): Promise<void>;

/**
 * 生成 CSV 文件内容，可以用于 fs.writeFileSync 输出
 *
 * 第一行为表头
 * @param {Array<Array<string>>} dataList 二维数据列表
 * @returns 生成的字符串
 * @example
 *
 * ```ts
 * generateCSV([['a','b'], ['1', '2']]);
 * ```
 */
export declare function generateCSV(dataList: Array<Array<string>>): string;

/**
 * 生成 CSV 所需数据，可用于传递给 generateCSV 方法
 *
 * @param {Array<Record<string, string | number | boolean>>} list 数据列表
 * @param {Record<string, string>} headMap 数据项的 key 和表头标题的映射关系
 * @returns 二维数组，第一行是表头
 *
 * @example
 * ```ts
 * generateCSVData([
 *   {
 *     file: 'a.js',
 *     size: 88,
 *   },
 *  {
 *     file: 'b.js',
 *     size: 66,
 *   }
 * ], { file: '文件名称', size: '文件大小' })
 *
 *
 * // [['文件名称', '文件大小'], ['a.js', 88], ['b.js', 66]]
 * ```
 */
export declare function generateCSVData(list: Array<Record<string, string | number | boolean>>, headMap: Record<string, string>): any[][];

/**
 * 生成迭代式组件映射，将子组件的依赖合并到父组件中
 * 遍历组件映射，如果某个组件本身也在映射中，则将其依赖合并到引用它的父组件中
 * @param {IterativeComponentMap} usingComponentsMap 组件依赖映射，key 为页面/组件名，value 为其依赖的组件对象
 * @example
 * ```ts
 * const map = {
 *   'pages/index': { 'comp-a': {}, 'comp-b': {} },
 *   'comp-a': { 'comp-c': {} },
 * };
 * genIterativeComponentMap(map);
 * // map['pages/index']['comp-a'] 现在包含了 comp-c 的依赖
 * ```
 */
export declare function genIterativeComponentMap(usingComponentsMap: IterativeComponentMap): void;

/**
 * 生成多个图片并发送机器人
 * @param {object} options 配置
 *
 * @example
 *
 * const requestMultiImgDate = Date.now() - 1 * 24 * 60 * 60 * 1000;
 *
 * const tamGroupIdList = [1, 2, 3];
 *
 * const summaryScoreTableHeaderMap = {
 *   ProjectName: {
 *     name: '项目名称',
 *     tableWidth: 95,
 *   },
 *   PagePv: {
 *     name: 'PV',
 *     tableWidth: 65,
 *   },
 * };
 *
 * const eventProjectMap = {
 *   62659: {
 *     name: 'aaaaa',
 *   },
 *   57706: {
 *     name: 'bbbbb',
 *     extraProjectId: 66379,
 *   },
 * };
 *
 * const eventMap = {
 *   WX_SUC: {
 *     // 总和
 *     type: 'SUMMARY',
 *     target: ['ENTER_GAME_WX_SUC', 'LAUNCH_GAME_SUC_WX'],
 *   },
 *   WX_FAIL: {
 *     // 总和
 *     type: 'SUMMARY',
 *     target: ['ENTER_GAME_WX_FAIL', 'LAUNCH_GAME_FAIL_WX'],
 *   },
 * };
 *
 * const eventTableHeaderMap = {
 *   ProjectName: {
 *     name: '项目名称',
 *     tableWidth: 95,
 *   },
 *   ALL_SUMMARY: {
 *     name: '拉起总数',
 *     tableWidth: 65,
 *   },
 * };
 *
 * await genMultiImgAndSendRobot({
 *   date: requestMultiImgDate,
 *   secretInfo: {
 *     getPwdCode,
 *     encrypt,
 *     apiKey: process.env.AEGIS_APP_KEY,
 *     loginName: 'lee',
 *   },
 *   webhookUrl: tamRobotWebhook,
 *   chatId: tamRobotChatId,
 *
 *   groupIdList: tamGroupIdList,
 *   eventProjectIdMap: eventProjectMap,
 *   tableHeaderMap: summaryScoreTableHeaderMap,
 *
 *   eventMap,
 *   eventTableHeaderMap,
 * });
 *
 *
 */
export declare function genMultiImgAndSendRobot({ date, groupIdList, secretInfo, extraDataMap, ignoreProjectIdList, tableHeaderMap, webhookUrl, chatId, env, eventMap, eventProjectIdMap, eventTableHeaderMap, }: {
    date: number;
    groupIdList: Array<number>;
    secretInfo: SecretInfoType;
    extraDataMap?: Record<string, any>;
    ignoreProjectIdList?: Array<string | number>;
    tableHeaderMap?: Record<string, any>;
    webhookUrl: string;
    chatId: string;
    env?: string;
    eventMap: Record<string, any>;
    eventProjectIdMap: Record<string, any>;
    eventTableHeaderMap: Record<string, any>;
}): Promise<{
    data: ScoreInfoType[];
    projectIdList: number[];
} | undefined>;

/**
 * 将参数对象转换为 query 字符串（不进行 URL 编码）
 * @param {Record<string, string | number>} [query={}] 参数对象
 * @returns {string} 拼接后的 query 字符串
 * @example
 * genQueryToStr({ a: 1, b: 2 }); // => 'a=1&b=2'
 */
export declare function genQueryToStr(query?: Record<string, string | number>): string;

/**
 * 请求签名Header生成
 * @private
 * @param {object} signInfo 密钥信息
 * @example
 * ```ts
 * const headers = genRainbowHeaderSignature({
 *   appId: 'xxx',
 *   userId: 'yyy',
 *   secretKey: 'zzz',
 *   signMethod: 'sha1',
 * });
 * // {
 * //   rainbow_sgn_type: 'apisign',
 * //   rainbow_version: '2020',
 * //   rainbow_app_id: 'xxx',
 * //   rainbow_user_id: 'yyy',
 * //   rainbow_timestamp: '1700000000',
 * //   rainbow_nonce: '...',
 * //   rainbow_sgn_method: 'sha1',
 * //   rainbow_sgn_body: '',
 * //   rainbow_signature: '...',
 * // }
 * ```
 */
export declare function genRainbowHeaderSignature(signInfo: {
    appID?: string;
    appId?: string;
    userID?: string;
    userId?: string;
    secretKey: string;
    signMethod?: ISignMethod;
}): {
    rainbow_sgn_type?: undefined;
    rainbow_version?: undefined;
    rainbow_app_id?: undefined;
    rainbow_user_id?: undefined;
    rainbow_timestamp?: undefined;
    rainbow_nonce?: undefined;
    rainbow_sgn_method?: undefined;
    rainbow_sgn_body?: undefined;
    rainbow_signature?: undefined;
} | {
    rainbow_sgn_type: string;
    rainbow_version: string;
    rainbow_app_id: string | undefined;
    rainbow_user_id: string | undefined;
    rainbow_timestamp: string;
    rainbow_nonce: string;
    rainbow_sgn_method: ISignMethod;
    rainbow_sgn_body: string;
    rainbow_signature: any;
};

export declare function genRobotMessage(list: Array<string | Array<MessageType>>, separator?: string, labelSeparator?: string): string;

export declare function genRUMPerfImgAndSend({ secretId, secretKey, id, startTime, endTime, type, title, chatId, webhookUrl, }: {
    secretId: string;
    secretKey: string;
    id: string | number;
    startTime: number;
    endTime: number;
    type?: string;
    title?: string;
    chatId: string;
    webhookUrl: string;
}): Promise<void>;

/**
 * 获取jsAPI签名
 *
 * 校验地址：https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=jsapisign
 *
 * 文档地址：https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html
 * @param {string} ticket 票据
 * @param {string} url 当前url，不包括#之后的部分
 * @returns signature
 * @example
 * ```ts
 * const sig = genSignature('jsapi_ticket_xxx', 'https://example.com/page');
 * // {
 * //   timestamp: 1700000000,
 * //   nonceStr: 'random-12-bytes-hex',
 * //   signature: 'sha1-hex-string',
 * //   url: 'https://example.com/page',
 * // }
 * ```
 */
export declare function genSignature(ticket: string, url: string): {
    timestamp: number;
    nonceStr: string;
    signature: string;
    url: string;
};

/**
 * 生成TAM汇总数据并发送到机器人
 * @param {object} options 配置
 * @param {string} options.date 日期，yyyyMMdd格式
 * @param {Array<number>} options.groupIdList groupId列表
 *
 * @param {object} options.secretInfo 密钥信息
 * @param {string} options.secretInfo.apiKey apiKey
 * @param {string} options.secretInfo.loginName loginName
 * @param {Function} options.secretInfo.getPwdCode getPwdCode
 * @param {Function} options.secretInfo.encrypt encrypt
 *
 * @param {object} options.extraDataMap 额外数据Map
 * @param {object} options.ignoreProjectIdList 忽略的projectIdList
 * @param {object} options.tableHeaderMap 表格头部Map
 *
 * @param {object} options.webhookUrl 机器人回调地址
 * @param {object} options.chatId 会话Id
 *
 * @example
 * const requestSummaryScoreDate = Date.now() - 1 * 24 * 60 * 60 * 1000;
 *
 * const tamGroupIdList = [1, 2, 3];
 *
 * const summaryScoreTableHeaderMap = {
 *   ProjectName: {
 *     name: '项目名称',
 *     tableWidth: 95,
 *   },
 *   PagePv: {
 *     name: 'PV',
 *     tableWidth: 65,
 *   },
 * };
 *
 * await genSummaryDataAndSendRobot({
 *   date: requestSummaryScoreDate,
 *   groupIdList: tamGroupIdList,
 *   secretInfo: {
 *     getPwdCode,
 *     encrypt,
 *     apiKey: process.env.AEGIS_APP_KEY,
 *     loginName: 'lee',
 *   },
 *   webhookUrl: tamRobotWebhook,
 *   chatId: tamRobotChatId,
 *   tableHeaderMap: summaryScoreTableHeaderMap,
 * });
 */
export declare function genSummaryDataAndSendRobot({ date, groupIdList, secretInfo, extraDataMap, ignoreProjectIdList, tableHeaderMap, webhookUrl, chatId, rumSecretList, }: {
    date: number;
    groupIdList: Array<number>;
    secretInfo: SecretInfoType;
    extraDataMap?: {};
    ignoreProjectIdList?: Array<string>;
    tableHeaderMap?: {};
    webhookUrl: string;
    chatId: string;
    rumSecretList?: Array<IRumSecretItem>;
}): Promise<{
    data: ScoreInfoType[];
    projectIdList: number[];
} | undefined>;

/** 生成 6 位随机大写临时 ID（写到广播特征值里） */
export declare function genTempId(): string;

/**
 * 生成 v-console
 * 有几种情况：
 * 1. 不显示
 * 2. 立即显示
 * 3. 异步判断后，确定是否显示
 * @param params 参数
 * @example
 *
 * ```ts
 * genVConsole({
 *   immediateShow: isShowVConsole === 'true'
 *     || isTestEnv()
 *     || noDelay === V_CONSOLE_NO_DELAY.VALUE,
 *   hide: isShowVConsole === 'false' || !!UserInfo.tipUid(),
 *   asyncConfirmFunc: checkIsDevList,
 * });
 * ```
 */
export declare function genVConsole({ immediateShow, hide, vConsoleConfig, asyncConfirmFunc, }: {
    immediateShow?: boolean;
    hide?: boolean;
    vConsoleConfig?: Record<string, any>;
    asyncConfirmFunc?: Function;
}): void;

/**
 * 自动生成version，核心是利用 standard-version 命令
 * @param {object} config 配置信息
 * @param {string} config.root 项目根路径
 * @returns {boolean} 是否执行了 standard-version
 * @example
 *
 * genVersion({
 *   root: process.cwd()
 * })
 *
 */
export declare function genVersion({ root, forceGenVersion, }: {
    root: string;
    forceGenVersion?: boolean;
}): boolean;

/**
 * 运行standard-version，并且发送changelog到机器人
 * @param {object} options 配置
 * @param {object} config.appInfo package.json信息
 * @param {string} config.root 项目根路径
 * @param {string} config.changeLogFilePath changelog文件地址
 * @param {string} config.webhookUrl 机器人hook地址
 * @param {string} config.chatId 会话id
 * @example
 * ```ts
 * await genVersionAndSendChangeLog({
 *   root: process.cwd(),
 *   changeLogFilePath: `${process.cwd()}/CHANGELOG.md`,
 *   webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx',
 *   chatId: 'group-chat-id',
 * });
 * ```
 */
export declare function genVersionAndSendChangeLog({ root, changeLogFilePath, webhookUrl, chatId, forceGenVersion, pushRemote, }: {
    root?: string;
    changeLogFilePath?: string;
    webhookUrl: string;
    chatId?: string;
    forceGenVersion?: boolean;
    pushRemote?: boolean;
}): Promise<unknown>;

/**
 * 生成版本信息，可以用来发送到群聊中
 * @param {object} config 配置信息
 * @param {string} config.readmeFilePath changelog文件地址
 * @param {object} config.appInfo package.json信息
 * @param {boolean} [config.showNpmLink] 是否显示 npm 链接（默认走 npmjs.com，被 npmLink 覆盖时优先用 npmLink）
 * @param {string} [config.publisher] 发布者别名，传入后会在末尾 `@发布者`
 * @param {string} [config.npmLink] 自定义 npm 详情页地址（如腾讯内部镜像），优先级高于 showNpmLink
 * @param {string} [config.pipelineUrl] 流水线/构建地址，调用方自行解析（蓝盾 BK_CI_* env 等）
 * @param {object} [config.packageSize] 包体积信息，存在时会渲染「📦 包体积」区块
 * @returns {string} 版本信息
 * @example
 *
 * const appInfo = require(`${rootPath}/package.json`);
 * const readmeFilePath = `${rootPath}/CHANGELOG.md`;
 *
 * const content = genVersionTip({
 *   readmeFilePath,
 *   appInfo,
 *   npmLink: 'https://mirrors.tencent.com/...',
 *   pipelineUrl: 'https://devops.woa.com/...',
 *   packageSize: {
 *     oldSize: 1234567,
 *     newSize: 1230000,
 *     oldUnpacked: 4500000,
 *     newUnpacked: 4490000,
 *     fileCount: 256,
 *   },
 * });
 */
export declare function genVersionTip({ readmeFilePath, appInfo, showNpmLink, publisher, npmLink, pipelineUrl, packageSize, }: {
    showNpmLink?: boolean;
    readmeFilePath: string;
    appInfo: IAppInfo;
    publisher?: string;
    npmLink?: string;
    pipelineUrl?: string;
    packageSize?: PackageSizeInfo;
}): string;

export declare function get(source: Record<string, any>, path: string, defaultValue?: any): any;

/**
 * 获取累积宽度
 * @param {Array<number>} cellWidthList - 宽度列表
 * @param {number} idx - 当前idx
 * @returns {number} 累计宽度
 *
 * @example
 *
 * getAccCellWidth([20, 10, 20, 10], 1)
 *
 * // 30
 */
export declare function getAccCellWidth(cellWidthList: Array<number>, idx: number): number;

export declare function getAccessToken({ appId, appSecret, }: {
    appId: string;
    appSecret: string;
}): Promise<unknown>;

export declare function getAllDevopsTemplateInstances(reqParam: ITemplateReq & {
    page?: number | undefined;
    pageSize?: number | undefined;
}): Promise<IRemoteInstances>;

/**
 * 递归获取目录下所有匹配扩展名的文件
 * @example
 * ```ts
 * // 默认扫描 .vue/.js/.ts/.less/.css/.scss
 * const files = getAllFiles('/path/to/src');
 *
 * // 自定义扫描扩展名
 * const tsFiles = getAllFiles('/path/to/src', ['.ts', '.tsx']);
 * ```
 */
export declare function getAllFiles(dirPath: string, extensions?: Array<string>, fileList?: Array<string>): Array<string>;

/**
 * 获取所有 git 仓库
 *
 * @export
 * @param {string} root 根路径
 * @returns {array} 路径列表
 * @example
 * ```ts
 * getAllGitRepo('/root/yang');
 *
 * [
 *   {
 *     root: '/root',
 *     origin: 'git@git.address',
 *   }
 * ]
 * ```
 */
export declare function getAllGitRepo(root: string): {
    root: string;
    origin: string;
}[];

/**
 * 获取全部流水线列表
 * @param {object} params 配置信息
 * @param {string} params.projectId 项目ID
 * @param {object} params.secretInfo 密钥信息
 * @param {string} params.host 请求域名
 * @param {number} params.page 第几页
 * @param {number} params.pageSize 每页数据量
 * @param {Array} list 结果列表，可不传，用于迭代
 * @returns 流水线列表
 * @example
 * ```ts
 * const all = await getAllPipelineList({
 *   projectId: 'my-project',
 *   host: 'https://devops.woa.com',
 *   secretInfo: { appCode, appSecret, devopsUid },
 * });
 * console.log(all.length);
 * ```
 */
export declare function getAllPipelineList(args: Parameters<typeof getPipelineList>[0], list?: Array<any>): Promise<any>;

/**
 * 获取某个token名下所有项目
 * @param {string} privateToken 密钥
 * @param {string} search 搜索内容
 * @returns {Array<object>} 项目列表
 * @example
 *
 * const projects = await getAllProjects('xxxxx');
 *
 * console.log(projects)
 */
export declare function getAllProjects(privateToken: string, search?: string): Promise<Array<object>>;

export declare function getAPITicket(accessToken: string): Promise<unknown>;

/**
 * 根据省份城市转化为`id`数组
 * @param {string} provinceStr
 * @param {string} cityStr
 * @returns {Array} 包含省份、城市ID的数组
 *
 * @example
 * const res =  getAreaCode('山东', '德州');
 * // ['37', '14']
 */
export declare function getAreaCode(provinceStr?: string, cityStr?: string): any;

/**
 * 获取城市列表，默认不包含`全省`选项
 * @param {object} [data] 原始数据
 * @param {array} [areaArray = []] 结果列表
 * @param {boolean} [allProvFlag = false] 是否包含`全省`选项
 * @returns {Array} 城市列表
 * @example
 *
 * const res = getAreaData();
 * // [
 * //   {
 * //     text: '北京',
 * //     code: '11',
 * //     children: [{
 * //       text: '北京',
 * //       code: '0',
 * //     }],
 * //   },
 * //   {
 * //     text: '天津',
 * //     code: '12',
 * //     children: [{
 * //       text: '天津',
 * //       code: '0',
 * //     }],
 * //   },
 * //   {
 * //     text: '河北',
 * //     code: '13',
 * //     {
 * //       text: '石家庄',
 * //       code: '1',
 * //     },
 * //     {
 * //       text: '唐山',
 * //       code: '2',
 * //     },
 * //       // ...
 * //     ],
 * //   },
 * //   // ...
 * // ];
 *
 */
export declare function getAreaData(data?: {
    provData: {
        11: string;
        12: string;
        13: string;
        14: string;
        15: string;
        21: string;
        /**
         * 获取如下格式的城市列表，包含`全国`、`全省`选项
         * @returns {Array} 城市列表
         * @example
         *
         * const res = getAreaDataAll();
         * // [
         * //   {
         * //     text: '全国',
         * //     code: '0',
         * //     children: [{
         * //       text: '不限',
         * //       code: '0',
         * //     }],
         * //   },
         * //   {
         * //     text: '北京',
         * //     code: '11',
         * //     children: [{
         * //       text: '北京',
         * //       code: '0',
         * //     }],
         * //   },
         * //   {
         * //     text: '天津',
         * //     code: '12',
         * //     children: [{
         * //       text: '天津',
         * //       code: '0',
         * //     }],
         * //   },
         * //   {
         * //     text: '河北',
         * //     code: '13',
         * //     children: [{
         * //       text: '全省',
         * //       code: '0',
         * //     },
         * //     {
         * //       text: '石家庄',
         * //       code: '1',
         * //     },
         * //     {
         * //       text: '唐山',
         * //       code: '2',
         * //     },
         * //       // ...
         * //     ],
         * //   },
         * //   // ...
         * // ];
         *
         */
        22: string;
        23: string;
        31: string;
        32: string;
        33: string;
        34: string;
        35: string;
        36: string;
        37: string;
        41: string;
        42: string;
        43: string;
        44: string;
        45: string;
        46: string;
        50: string;
        51: string;
        52: string;
        53: string;
        54: string;
        61: string;
        62: string;
        63: string;
        64: string;
        65: string;
        71: string;
        81: string;
        82: string;
    };
    cityData: {
        11: string[];
        12: string[];
        13: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
        };
        14: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
        };
        15: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            22: string;
            25: string;
            29: string;
            30: string;
        };
        21: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
        };
        22: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            24: string;
            25: string;
        };
        23: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            27: string;
        };
        31: string[];
        32: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
        };
        33: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
        };
        34: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
            18: string;
        };
        35: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
        };
        36: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
        };
        37: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
        };
        41: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
            18: string;
            19: string;
        };
        42: {
            1: string;
            2: string;
            3: string;
            5: string; /**
            * 根据省份城市转化为`id`数组
            * @param {string} provinceStr
            * @param {string} cityStr
            * @returns {Array} 包含省份、城市ID的数组
            *
            * @example
            * const res =  getAreaCode('山东', '德州');
            * // ['37', '14']
            */
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            28: string;
            94: string;
            95: string;
            96: string;
            A21: string;
        };
        43: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            31: string;
        };
        44: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            12: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
            18: string;
            19: string;
            20: string;
            51: string;
            52: string;
            53: string;
        };
        45: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
        };
        46: {
            1: string;
            2: string;
            91: string;
            92: string;
            93: string;
            95: string;
            96: string;
            97: string;
            A25: string;
            A26: string;
            A27: string;
            A28: string;
            A30: string;
            A31: string;
            A33: string;
            A34: string;
            A35: string;
            A36: string;
            A37: string;
            A38: string;
            A39: string;
        };
        50: string[];
        51: {
            1: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
            18: string;
            19: string;
            20: string;
            32: string;
            33: string;
            34: string;
        };
        52: {
            1: string;
            2: string;
            3: string;
            4: string;
            22: string;
            /**
             * 根据`id`获取省份名字
             * @param {string | number} provinceId
             * @returns {string} 省份名字
             *
             * @example
             * const res =  getProvName(37)
             * // 山东
             *
             * const res2 =  getCityName(11)
             * // 北京
             */
            23: string;
            24: string;
            26: string;
            27: string;
            31: string;
            32: string;
            33: string;
            34: string;
            35: string;
            36: string;
            37: string;
        };
        53: {
            1: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            23: string;
            25: string;
            26: string;
            28: string;
            29: string;
            31: string;
            33: string;
            34: string;
        };
        54: {
            1: string;
            21: string;
            22: string;
            23: string;
            24: string;
            25: string;
            26: string;
        };
        61: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
        };
        62: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            29: string;
            30: string;
        };
        63: {
            1: string;
            21: string;
            22: string;
            23: string;
            25: string;
            26: string;
            27: string;
            28: string;
        };
        64: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
        };
        65: {
            1: string;
            2: string;
            21: string;
            22: string;
            23: string;
            27: string;
            28: string;
            29: string;
            30: string;
            31: string;
            32: string;
            40: string;
            42: string;
            43: string;
            91: string;
            92: string;
            93: string;
            94: string;
        };
        71: string[];
        81: string[];
        82: string[];
    };
}, areaArray?: Array<ProvType>, allProvFlag?: boolean): ProvType[];

/**
 * 获取如下格式的城市列表，包含`全国`、`全省`选项
 * @returns {Array} 城市列表
 * @example
 *
 * const res = getAreaDataAll();
 * // [
 * //   {
 * //     text: '全国',
 * //     code: '0',
 * //     children: [{
 * //       text: '不限',
 * //       code: '0',
 * //     }],
 * //   },
 * //   {
 * //     text: '北京',
 * //     code: '11',
 * //     children: [{
 * //       text: '北京',
 * //       code: '0',
 * //     }],
 * //   },
 * //   {
 * //     text: '天津',
 * //     code: '12',
 * //     children: [{
 * //       text: '天津',
 * //       code: '0',
 * //     }],
 * //   },
 * //   {
 * //     text: '河北',
 * //     code: '13',
 * //     children: [{
 * //       text: '全省',
 * //       code: '0',
 * //     },
 * //     {
 * //       text: '石家庄',
 * //       code: '1',
 * //     },
 * //     {
 * //       text: '唐山',
 * //       code: '2',
 * //     },
 * //       // ...
 * //     ],
 * //   },
 * //   // ...
 * // ];
 *
 */
export declare function getAreaDataAll(): ProvType[];

/**
 * 根据`id`将省份城市转化为字符串数组
 * @param {string | number} provinceId
 * @param {string | number} cityId
 * @returns {Array} 包含省份、城市名字的数组
 *
 * @example
 * const res =  getProvName(37, 14)
 * // ['山东', '德州']
 *
 * const res2 =  getCityName(11)
 * // ['北京', '北京']
 */
export declare function getAreaName(provinceId: string | number, cityId?: number): string[];

/**
 * 统一审核人获取方法，支持 rainbow / json / static 三种模式
 *
 * @example rainbow 模式 - 文件路径
 * ```ts
 * const { auditor, shouldAudit } = await getAuditor({
 *   type: 'rainbow',
 *   configSource: '/data/h5_publish_auditor.json',
 *   rainbowOptions: { projectName: 'pmd-mobile/match/gp', subProjectName: 'gp-hor', minimatch },
 * });
 * ```
 *
 * @example rainbow 模式 - 异步获取数据
 * ```ts
 * const { auditor, shouldAudit } = await getAuditor({
 *   type: 'rainbow',
 *   configSource: async () => fetchRainbowConfig(),
 *   rainbowOptions: { projectName: 'pmd-mobile/match/gp', subProjectName: 'gp-hor', minimatch },
 * });
 * ```
 *
 * @example json 模式（NPM/组件库发布）
 * ```ts
 * const { auditor, shouldAudit } = await getAuditor({
 *   type: 'json',
 *   configSource: '/data/library_publish_auditor.json',
 *   jsonOptions: { projectName: 'my-lib', key: 'patch' },
 * });
 * ```
 *
 * @example static 模式（灰度发布 / 回滚）
 * ```ts
 * const { auditor, shouldAudit } = await getAuditor({
 *   type: 'static',
 *   staticAuditorList: ['novlan1', 'lee'],
 * });
 * ```
 *
 * @example 跳过审核（如非生产环境）
 * ```ts
 * const { auditor, shouldAudit } = await getAuditor({
 *   type: 'static',
 *   skipAudit: !isProd,
 * });
 * ```
 */
export declare function getAuditor(options: IGetAuditorOptions): Promise<IGetAuditorResult>;

/**
 * 获取审核人
 * @param params 参数
 * @returns 审核人
 *
 * @example
 * ```ts
 * getAuditorFromRainbowConfig({
 *   rainbowConfig: { "pmd-mobile/match/*": "gg", "pmd-mobile/convert-cross": "gg" },
 *   checkKeyList: [ 'pmd-mobile/match/gp/gp-hor', 'pmd-mobile/match/gp' ],
 *   minimatch: require('minimatch'),
 *   minimatchKey: 'pmd-mobile/match/gp',
 * })
 * ```
 */
export declare function getAuditorFromRainbowConfig({ rainbowConfig, checkKeyList, minimatch, minimatchKey, }: {
    rainbowConfig: Record<string, string>;
    checkKeyList: string[];
    minimatch: Function;
    minimatchKey: string;
}): string;

export declare function getAuthOfTai({ paasToken, paasId, }: {
    paasToken: string;
    paasId: string;
}): {
    'Cache-Control': string;
    'Content-Type': string;
    'x-rio-nonce': string;
    'x-rio-signature': string;
    'x-rio-timestamp': string;
    'x-rio-paasid': string;
};

export declare function getAutoProtectedBranchRules({ projectName, baseUrl, privateToken, }: {
    projectName: string;
    baseUrl?: string;
    privateToken: string;
}): Promise<string>;

export declare function getAvailableDiskSize(options?: {
    mockLog: string;
}): number;

/**
 * 获取图片，并转 base64
 *
 * @param url 图片链接
 * @returns 获取结果
 * @example
 * ```ts
 * getBase64FromUrl(imgUrl).then(consoleImage);
 * ```
 */
export declare function getBase64FromUrl(url: string): Promise<unknown>;

/**
 * 获取仓库的分支列表
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称
 * @param {string} options.privateToken 密钥
 * @param {string} options.baseUrl baseUrl
 * @returns {Promise<Array<object>>} 请求Promise
 * @example
 *
 * getBranchesByProjectName({
 *   projectName: 't-comm',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function getBranchesByProjectName({ projectName, privateToken, baseUrl, }: {
    projectName: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<Array<object>>;

/**
 * 获取tGit上某分支生命周期
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称
 * @param {string} options.branchName 分支名称
 * @param {string} options.privateToken 密钥
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * getBranchLifeCycle({
 *   projectName: 't-comm',
 *   branchName: 'master',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function getBranchLifeCycle({ projectName, branchName, privateToken, baseUrl, }: {
    projectName: string;
    branchName: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<object>;

export declare function getBundleBuildDesc({ root, env, branch, author, message, }: {
    root: string;
    env?: string;
    branch?: string;
    author?: string;
    message?: string;
}): string;

export declare function getBundleVersion(root: string): any;

/**
 * 获取 canvas 库
 * canvas 是一个用于在 Node.js 中使用 Canvas API 的第三方库
 * @returns canvas 库
 * @example
 * ```ts
 * const { createCanvas } = getCanvas();
 * const canvas = createCanvas(200, 100);
 * ```
 */
export declare function getCanvas(): any;

/**
 * 获取 cdn 链接
 * @param {string} url 图片地址
 * @returns 新的地址
 * @example
 * ```ts
 * // cos 域名会被替换为 cdn 加速域名
 * getCdnUrl('https://igame-10037599.cos.ap-shanghai.myqcloud.com/a.jpg');
 * // 'https://igame-10037599.file.myqcloud.com/a.jpg'
 *
 * getCdnUrl('https://gamelife-1251917893.cos.ap-guangzhou.myqcloud.com/b.png');
 * // 'https://gamelife-1251917893.igcdn.cn/b.png'
 *
 * // 非映射表中的域名保持原样
 * getCdnUrl('https://other.com/x.jpg');
 * // 'https://other.com/x.jpg'
 *
 * // 空字符串
 * getCdnUrl(''); // ''
 * ```
 */
export declare function getCdnUrl(inUrl?: string): string;

/**
 * 获取 chalk 库
 * chalk 是一个用于在终端输出彩色文本的第三方库
 * @returns chalk 库
 * @example
 * ```ts
 * const chalk = getChalk();
 * console.log(chalk.red('error message'));
 * ```
 */
export declare function getChalk(): typeof Chalk;

/**
 * 获取 cheerio 库
 * cheerio 是一个用于在服务端解析 HTML 的第三方库
 * @returns cheerio 库
 * @example
 * ```ts
 * const cheerio = getCheerio();
 * const $ = cheerio.load('<h1>hello</h1>');
 * $('h1').text(); // 'hello'
 * ```
 */
export declare function getCheerio(): typeof Cheerio;

/**
 * 获取 Node.js child_process 模块（仅支持 Node.js 环境）
 * @returns child_process 模块
 * @throws {Error} 当在非 Node.js 环境中调用时抛出错误
 * @example
 * ```ts
 * const cp = getChildProcess();
 * cp.exec('ls -la', (error, stdout, stderr) => {
 *   console.log(stdout);
 * });
 * ```
 */
export declare function getChildProcess(): ChildProcess;

/**
 * 根据`id`获取城市名字
 * @param {string | number} provinceId
 * @param {string | number} cityId
 * @returns {string} 城市名字
 *
 * @example
 * const res =  getCityName(37, 14)
 * // 德州
 *
 * const res2 =  getCityName(11)
 * // 北京
 */
export declare function getCityName(provinceId: number | string, cityId?: number | string): string;

/**
 * 生成文件内容的三阶段替换规则（kebab-case + PascalCase + 类名）
 * @param {string[]} rawList - 组件名列表
 * @param {string[]} dirList - 目标文件 glob 列表
 * @param {Object} [options={}] - 可选配置
 * @param {string[]} [options.needClassReplaceList=[]] - 需要额外替换类名的组件列表
 * @returns {Array<{ list: Array, dirList: string[] }>}
 * @example
 * ```ts
 * const rules = getComponentContentReplaceRules(
 *   ['dialog', 'icon'],
 *   ['src/**\/*.{ts,vue,less}'],
 *   { needClassReplaceList: ['icon'] },
 * );
 * batchReplaceFileContent(rules);
 * ```
 */
export declare function getComponentContentReplaceRules(rawList: string[], dirList: string[], options?: {
    needClassReplaceList?: string[];
}): {
    list: [string | RegExp, string][];
    dirList: string[];
}[];

/**
 * 统计组件数目、wxml大小、wxss大小、js大小等
 * @param dist
 * @returns result
 *
 * @example
 * ```ts
 * getComponentInfo('./dist/dev/mp-weixin')
 * ```
 */
export declare function getComponentInfo(dist: string, config?: {
    wxmlPostfix: string;
    wxssPostfix: string;
    vendorNames: string[];
}): {
    componentTotal: number;
    wxsstTotal: number;
    jsTotal: number;
    wxmlSizeTotal: number;
    wxssSizeTotal: number;
    jsSizeTotal: number;
    vendorJsSize: number;
};

/**
 * 生成 PascalCase 匹配正则（前后必须是非单词字符）
 * @param {string} value - kebab-case 名称
 * @returns {RegExp}
 * @example
 * ```ts
 * const reg = getComponentPascalReg('press-icon');
 * 'use <PressIcon/>'.match(reg); // ['PressIcon']
 * ```
 */
export declare function getComponentPascalReg(value: string): RegExp;

/**
 * 处理并压缩图片 URL
 * @docgen
 * @function getCompressImgUrl
 *
 * @param {string|object} inUrl - 图片原始 URL，或包含 url/width/height 的对象
 * @param {number} [inImageWidth=0] - 图片裁剪后的宽度（可选，默认为 0，表示不裁剪）
 * @param {number} [inImageHeight=0] - 图片裁剪后的高度（可选，默认为 0，表示不裁剪）
 * @return {string} 返回处理后的图片 URL
 *
 * @description
 * 该函数用于处理腾讯云 COS 图片，实现按需加载和压缩。
 * - 自动将 http 转为 https
 * - 对腾讯云图片添加压缩参数
 * - 自动调整图片尺寸为 2 倍（避免图片模糊）
 * - 宽高按 10 取整（避免图片闪烁）
 *
 * @example
 *
 * // 基础用法
 * const url = 'https://image-xxx.file.myqcloud.com/test.jpg';
 * const compressed = getCompressImgUrl(url, 100, 100);
 *
 * // 使用对象参数
 * const compressed2 = getCompressImgUrl({
 *   url: 'https://image-xxx.file.myqcloud.com/test.jpg',
 *   width: 100,
 *   height: 100
 * });
 */
export declare function getCompressImgUrl(inUrl?: string | {
    width?: number;
    height?: number;
    url?: string;
    replace?: Function;
}, inImageWidth?: number, inImageHeight?: number): string;

/**
 * 获取config
 * @param {string} name
 * @return {*}  {*}
 *
 * @example
 * getConfig('login.loginType')
 * getConfig('game')
 */
export declare function getConfig(name?: string): any;

/**
 * 获取cookie
 * @param {string} key cookie键值
 * @returns {string} cookie值
 *
 * @example
 *
 * const res = getCookie('name')
 *
 * // => mike
 *
 */
export declare function getCookie(key: string): string;

/**
 * 获取腾讯云COS存储桶中的对象列表
 *
 * @param secretId - 腾讯云API密钥ID
 * @param secretKey - 腾讯云API密钥Key
 * @param bucket - COS存储桶名称
 * @param region - COS存储桶所在区域
 * @param prefix - 对象键前缀匹配，限定返回中只包含指定前缀的对象键（可选）
 * @param delimiter - 定界符，用于对对象键进行分组，一般是传/（可选）
 * @param maxKeys - 单次返回最大的条目数量，默认1000，最大为1000（可选）
 * @param marker - 起始对象键标记，列出从Marker开始MaxKeys条目（可选）
 * @param encodingType - 返回值的编码方式，可选值：url（可选）
 * @returns Promise对象，成功时返回存储桶内容数据，失败时返回错误信息
 * @throws 当参数不全时会抛出错误
 * @example
 * ```typescript
 * getCosBucket({
 *   secretId: 'your-secret-id',
 *   secretKey: 'your-secret-key',
 *   bucket: 'test-bucket',
 *   region: 'ap-beijing'
 * })
 * .then(data => console.log(data))
 * .catch(err => console.error(err));
 * ```
 */
export declare function getCosBucket({ secretId, secretKey, bucket, region, prefix, delimiter, maxKeys, marker, encodingType, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    prefix?: string;
    delimiter?: string;
    maxKeys?: number;
    marker?: string;
    encodingType?: string;
}): Promise<any>;

/**
 * 获取 COS 存储桶中的文件列表
 * @param {object} config 配置信息
 * @param {string} config.secretId COS secretId
 * @param {string} config.secretKey COS secretKey
 * @param {string} config.bucket COS bucket
 * @param {string} config.region COS region
 * @param {string} config.prefix 文件前缀过滤
 * @returns {Promise<Array<ICosMeta>>} 文件元信息列表
 * @example
 * ```ts
 * const list = await getCOSBucketList({
 *   secretId: 'xxx',
 *   secretKey: 'xxx',
 *   bucket: 'my-bucket-1250000000',
 *   region: 'ap-guangzhou',
 *   prefix: 'static/',
 * });
 * ```
 */
export declare function getCOSBucketList({ secretId, secretKey, bucket, region, prefix, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    prefix: string;
}): Promise<Array<ICosMeta>>;

/**
 * 获取腾讯云COS对象的元数据信息（不返回对象内容）
 *
 * @param secretId - 腾讯云API密钥ID
 * @param secretKey - 腾讯云API密钥Key
 * @param bucket - COS存储桶名称
 * @param region - COS存储桶所在区域
 * @param key - 对象键（Object Key），对象在存储桶中的唯一标识
 * @returns Promise对象，成功时返回对象的元数据信息（如大小、修改时间等），失败时返回错误信息
 * @throws 当参数不全时会抛出错误
 * @example
 * ```typescript
 * getCosHeadObject({
 *   secretId: 'your-secret-id',
 *   secretKey: 'your-secret-key',
 *   bucket: 'test-bucket',
 *   region: 'ap-beijing',
 *   key: 'path/to/file.txt'
 * })
 * .then(data => console.log(data))
 * .catch(err => console.error(err));
 * ```
 */
export declare function getCosHeadObject({ secretId, secretKey, bucket, region, key, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    key: string;
}): Promise<any>;

/**
 * 获取 cos-nodejs-sdk-v5 库
 * cos-nodejs-sdk-v5 是腾讯云对象存储 COS 的 Node.js SDK
 * @returns cos-nodejs-sdk-v5 库
 * @example
 * ```ts
 * const COS = getCosNodejsSdkV5();
 * const cos = new COS({ SecretId: '...', SecretKey: '...' });
 * ```
 */
export declare function getCosNodejsSdkV5(): typeof COS;

/**
 * 获取腾讯云 COS 存储桶中对象的访问 URL
 *
 * @param secretId - 腾讯云 API 密钥 ID
 * @param secretKey - 腾讯云 API 密钥 Key
 * @param bucket - COS 存储桶名称
 * @param region - COS 存储桶所在区域，例如 ap-beijing
 * @param key - 存储在桶里的对象键（例如 1.jpg、a/b/test.txt），支持中文
 * @param sign - 是否获取带签名的对象 URL，默认 true（可选）
 * @param expires - 签名 URL 的有效时长，单位秒，默认 900 秒（可选）
 * @param method - 请求方法，默认 GET（可选）
 * @param protocol - 请求协议，可选值：http:、https:（可选）
 * @param domain - 自定义域名（可选）
 * @param query - 请求中的 query 参数（可选）
 * @param headers - 请求中的 header 参数（可选）
 * @param forceDownload - 是否强制下载，传入下载后的文件名后将拼接 response-content-disposition 参数（可选）
 * @returns Promise 对象，成功时返回对象访问 URL 字符串，失败时返回错误信息
 * @throws 当参数不全时会抛出错误
 * @example
 * ```typescript
 * getCosObjectUrl({
 *   secretId: 'your-secret-id',
 *   secretKey: 'your-secret-key',
 *   bucket: 'examplebucket-1250000000',
 *   region: 'ap-beijing',
 *   key: '头像.jpg',
 *   sign: true,
 * })
 * .then(url => console.log(url))
 * .catch(err => console.error(err));
 * ```
 */
export declare function getCosObjectUrl({ secretId, secretKey, bucket, region, key, sign, expires, method, protocol, domain, query, headers, forceDownload, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    key: string;
    sign?: boolean;
    expires?: number;
    method?: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS';
    protocol?: string;
    domain?: string;
    query?: Record<string, string | number | boolean>;
    headers?: Record<string, string | number | boolean>;
    forceDownload?: string;
}): Promise<string>;

export declare function getCosUrlLink({ bucket, region, dir, fileName, }: {
    bucket: string;
    region: string;
    dir: string;
    fileName: string;
}): string;

/**
 * 倒计时（eg:距开赛1天）
 * @param {string} time  剩余时间
 * @param {SECOND | MINUTE | HOUR | DAY } [maxUnit]  最大单位
 * @returns {object} 剩余时间的描述对象
 * @example
 *
 * getCountDownObj(100)
 * // { day: 0, hour: 0, minute: 1, second: 40 }
 *
 * getCountDownObj(1*24*60*60+200)
 * // { day: 1, hour: 0, minute: 3, second: 20 }
 *
 * getCountDownObj(1 * 24 * 60 * 60 + 2 * 60 * 60 + 1 * 60 + 11, 'HOUR')
 * // 结果 =>
 * {
 *   fHour: '26',
 *   fMinute: '01',
 *   fSecond: '11',
 *   hour: 26,
 *   minute: 1,
 *   second: 11,
 * }
 */
export declare function getCountDownObj(time: number | string, maxUnit?: string): {
    day?: Number;
    hour?: Number;
    minute?: Number;
    second?: Number;
    fDay?: String;
    fHour?: String;
    fMinute?: String;
    fSecond?: String;
};

/**
 * 获取 cron-parser 库
 * cron-parser 是一个用于解析 cron 表达式的第三方库
 * @returns cron-parser 库
 * @example
 * ```ts
 * const cronParser = getCronParser();
 * const interval = cronParser.parseExpression('0 0 * * *');
 * interval.next().toString();
 * ```
 */
export declare function getCronParser(): typeof CronParser;

/**
 * 获取 Node.js 的 crypto 模块
 * 这样可以避免在浏览器环境中直接导入 crypto 模块导致的错误
 * @returns crypto 模块
 * @example
 * ```ts
 * const crypto = getCrypto();
 * const hash = crypto.createHash('md5').update('hello').digest('hex');
 * ```
 */
export declare function getCrypto(): typeof CryptoType;

/**
 * 获取当前项目使用的灰度配置
 * 根据子项目名称查找匹配的灰度发布配置
 * @param fullSubProjectName - 完整的子项目名称
 * @param globalGrayPublishConfig - 全局灰度发布配置
 * @returns 匹配的灰度配置列表
 * @example
 * ```ts
 * const grayList = getCurrentProjectUseGray(
 *   'my-project.sub-project',
 *   globalGrayPublishConfig
 * );
 * // [
 * //   {
 * //     fullSubProjectName: 'my-project.sub-project',
 * //     packageName: 'my-project.sub-project.dev',
 * //     parsedBranch: '.dev',
 * //     cookieId: 'xxx'
 * //   }
 * // ]
 * ```
 */
export declare function getCurrentProjectUseGray(fullSubProjectName: string, globalGrayPublishConfig: IGlobalGrayPublishConfig): {
    fullSubProjectName: string;
    packageName: string;
    parsedBranch: string;
    cookieId: string;
}[];

export declare function getCyclomaticComplexityReportAndSendToRobot({ reportJson, detailLinks, webhookUrl, chatId, repo, }: {
    repo: string;
    reportJson: Record<number, string>[];
    webhookUrl?: string;
    chatId?: string[];
    detailLinks?: Array<{
        label: string;
        value: string;
    }>;
}): Promise<{
    list: StrictComplexityMetrics[];
    info: ICyclomaticComplexityStatisticsInfo;
    msgList: string[];
    mdTable: string[];
}>;

/**
 * 获取几天前的终止时间戳
 * @param {boolean} n 几天前
 * @param {string} unit 返回时间戳的单位，默认是s(秒)
 * @param {string} endFlag 以什么单位作为结束时间，默认分钟，即 23时59劆0秒0毫秒
 * @returns {number} 时间戳
 * @example
 * ```ts
 * // 默认返回今日 23:59:00 的秒级时间戳
 * getDayEndTimeStamp(0);
 * // 返回毫秒级
 * getDayEndTimeStamp(0, 'ms');
 * // 以秒为结束单位，返回 23:59:59 毫秒级
 * getDayEndTimeStamp(0, 'MS', 's');
 * // 以毫秒为结束单位，返回 23:59:59.999
 * getDayEndTimeStamp(0, 'MS', 'ms');
 * // 以小时为结束单位，返回 23:00:00
 * getDayEndTimeStamp(0, 'MS', 'h');
 * ```
 */
export declare function getDayEndTimeStamp(n?: number, unit?: string, endFlag?: string): number;

/**
 * 获取几天前的起始时间戳
 * @param {boolean} n 几天前
 * @returns {number} 时间戳
 * @example
 * ```ts
 * // 默认返回秒级时间戳（今日 0 点 0 分 0 秒）
 * getDayStartTimestamp(0);
 * // 返回毫秒级时间戳
 * getDayStartTimestamp(0, 'ms');
 * // 获取三天前的起始时间戳（秒级）
 * getDayStartTimestamp(3);
 * ```
 */
export declare function getDayStartTimestamp(n?: number, unit?: string): number;

export declare function getDBYEndTimeStamp(unit?: string, endFlag?: string): number;

export declare function getDBYStartTimeStamp(unit?: string): number;

/**
 * 获取依赖列表
 * @param dir 目录
 * @returns dependenciesList
 * @example
 * ```ts
 * // 假设 ./package.json 中 dependencies 包含 axios、lodash
 * getDeps('./');
 * // ['axios', 'lodash']
 * ```
 */
export declare function getDeps(dir: string): string[];

export declare function getDevopsTemplateInstances({ projectId, templateId, host, secretInfo, page, pageSize, }: ITemplateReq & {
    page?: number;
    pageSize?: number;
}): Promise<any>;

/**
 * 获取 dotenv 库
 * dotenv 是一个用于加载环境变量的第三方库
 * @returns dotenv 库
 * @example
 * ```ts
 * const dotenv = getDotenv();
 * dotenv.config({ path: '.env.local' });
 * ```
 */
export declare function getDotenv(): typeof Dotenv;

/**
 * 获取 dotenv-expand 库
 * dotenv-expand 是一个用于扩展 dotenv 环境变量的第三方库
 * @returns dotenv-expand 库
 * @example
 * ```ts
 * const dotenvExpand = getDotenvExpand();
 * dotenvExpand.expand({ parsed: { FOO: 'bar', BAZ: '$FOO' } });
 * ```
 */
export declare function getDotenvExpand(): typeof DotenvExpand;

export declare function getE2ERobotChatId({ chatIdMap, start, isFailed, isSendAll, isOnlyMe, shouldSendSuccess, }: {
    chatIdMap: {
        ALL: Array<string>;
        ONLY_ME: Array<string>;
        FAIL: Array<string>;
        SUCCESS: Array<string>;
    };
    start: number;
    isFailed?: boolean;
    isSendAll?: boolean;
    isOnlyMe?: boolean;
    shouldSendSuccess?: (number: number) => boolean;
}): string[];

export declare function getE2ETestRobotMessage(data: {
    start: number | string | Date;
    duration: number;
    passes: number;
    tests: number;
    bkStartType: keyof typeof TRIGGER_MAP;
    projectLink?: string;
    checkUrl?: string;
    name?: string;
    comment?: string;
    fileList?: Array<{
        file: string;
        tests: number;
        passes: number;
        link: string;
        testList: ITestList;
    }>;
}, notificationList?: never[]): {
    message: string;
    start: string | number | Date;
    hasFailed: boolean;
};

/**
 * 获取useragent类型
 * @returns {object} useragent的map
 * @example
 *
 * getEnvUAType()
 *
 * // =>
 * {
 *   isWeixin: false,
 *   isWorkWeixin: false,
 *   isQQ: false,
 *   isPvpApp: false,
 *   isTipApp: false,
 *   isAndroid: false,
 *   isIos: true,
 *   isIOS: true,
 *   isMsdk: false,
 *   isMsdkV5: false,
 *   isSlugSdk: false,
 *   isInGame: false,
 *   isGHelper: false,
 *   isGHelper20004: false,
 *   isMiniProgram: false,
 *   isLolApp: false,
 *   isWindowsPhone: false,
 *   isSymbian: false,
 *   isPc: true,
 * };
 *
 */
export declare function getEnvUAType(): IEnv;

/**
 * 获取文件中所有环境变量的键值对映射
 * 支持解析 KEY=VALUE 格式的环境变量文件，忽略以 # 开头的注释行
 * @param {string} filepath 文件路径，如果文件不存在则将参数作为字符串直接解析
 * @returns {Record<string, any>} 环境变量的键值对映射
 * @example
 * ```ts
 * // 解析 .env 文件
 * const envMap = getEnvVariableMap('.env.local');
 * // { NODE_ENV: 'production', API_URL: 'https://api.example.com' }
 *
 * // 直接解析字符串
 * const envMap2 = getEnvVariableMap('KEY1=value1\nKEY2=value2');
 * // { KEY1: 'value1', KEY2: 'value2' }
 * ```
 */
export declare function getEnvVariableMap(filepath: string): Record<string, any>;

export declare function getESLintImportOrderRule(): {
    'import/order': (string | {
        groups: string[];
        'newlines-between': string;
        alphabetize: {
            order: string;
            caseInsensitive: boolean;
        };
        pathGroups: {
            pattern: string;
            group: string;
            position: string;
        }[];
        pathGroupsExcludedImportTypes: string[];
    })[];
};

export declare function getESLintImportSettings(options?: {
    aliasMap: Array<[string, string]>;
}): {
    'import/resolver': {
        node: {
            extensions: string[];
        };
        alias: {
            map: string[][];
            extensions: string[];
        };
    };
    'import/ignore': string[];
};

/**
 * 从 MIME 类型获取文件后缀
 * @param {string} mimeType - MIME 类型
 * @returns {string|null} 文件后缀或 null
 * @example
 * ```ts
 * getExtensionFromMime('image/png');                 // 'png'
 * getExtensionFromMime('application/pdf');           // 'pdf'
 * getExtensionFromMime('application/foo-unknown');   // null
 * ```
 */
export declare function getExtensionFromMime(mimeType: string): string | null;

/**
 * 获取仓库中指定文件的内容（自动 base64 解码）
 *
 * 对应工蜂 API：GET /api/v3/projects/:id/repository/files
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {string} options.filePath 文件路径（如 src/utils/helper.ts）
 * @param {string} [options.ref='master'] 分支名或 commit SHA
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<RepoFile>} 文件内容（已解码）
 * @example
 *
 * getFileContent({
 *   projectName: 'group/sub/repo',
 *   filePath: 'src/utils/helper.ts',
 *   ref: 'master',
 *   privateToken: 'xxxxx',
 * }).then(file => console.log(file.content));
 */
export declare function getFileContent({ projectName, filePath, ref, privateToken, baseUrl, }: {
    projectName: string | number;
    filePath: string;
    ref?: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<RepoFile>;

/**
 * 从文件路径中提取文件名（不含扩展名）
 * @param file - 文件路径
 * @returns 不含扩展名的文件名
 * @example
 * ```ts
 * const name = getFileName('/path/to/file.txt');
 * console.log(name); // 'file'
 * ```
 */
export declare function getFileName(file: string): string;

/**
 * 将嵌套的依赖关系打平为一维映射
 * 递归遍历依赖关系图，将每个节点的所有直接和间接依赖打平为数组，并去重
 * @param {Record<string, Array<string>>} deps 依赖关系映射，key 为节点名，value 为其直接依赖的节点数组
 * @returns {Record<string, Array<string>>} 打平后的依赖关系映射
 * @example
 * ```ts
 * const deps = {
 *   a: ['b', 'c'],
 *   b: ['d'],
 *   c: [],
 *   d: [],
 * };
 * const result = getFlattenedDeps(deps);
 * // { a: ['b', 'c', 'd'], b: ['d'], c: [], d: [] }
 * ```
 */
export declare function getFlattenedDeps(deps: IDeps): Record<string, any>;

/**
 * 获取 form-data 库
 * form-data 是一个用于创建表单数据的第三方库
 * @returns form-data 库
 * @example
 * ```ts
 * const FormData = getFormData();
 * const form = new FormData();
 * form.append('field', 'value');
 * ```
 */
export declare function getFormData(): typeof FormData_2;

/**
 * 获取 fs 模块
 * @returns fs 模块
 * @description 仅在 Node.js 环境中可用
 * @example
 * ```ts
 * import { getFs } from 't-comm';
 * const fs = getFs();
 * fs.readFileSync('path/to/file', 'utf-8');
 * ```
 */
export declare function getFs(): typeof fsModule;

/**
 * 获取 fs-extra 库
 * fs-extra 是一个扩展了 Node.js fs 模块的第三方库
 * @returns fs-extra 库
 * @example
 * ```ts
 * const fse = getFsExtra();
 * await fse.copy('src', 'dist');
 * ```
 */
export declare function getFsExtra(): typeof FsExtra;

/**
 * 获取组件全称
 * @param name 组件名称
 * @param prefix 前缀
 * @returns 全称
 * @example
 * ```ts
 * getFullCompName('swiper-item', 'press-')
 * getFullCompName('press-swiper-item', 'press-')
 *
 * // press-swiper-item
 * ```
 */
export declare function getFullCompName(name?: string, prefix?: string): string;

/**
 * 获取当前用户
 * @param isPriorGit - 是否优先使用git用户信息
 * @returns user
 * @example
 * ```ts
 * // 默认优先 process.env.VUE_APP_AUTHOR，其次 git config user.name
 * getGitAuthor();
 * // 'novlan1'
 *
 * // 优先使用 git 配置中的 user.name
 * getGitAuthor(true);
 * ```
 */
export declare function getGitAuthor(isPriorGit?: boolean, root?: string, useCache?: boolean): string;

export declare function getGitCodeLink({ domain, repo, branch, localFile, line, }: {
    domain: string;
    repo: string;
    branch: string;
    localFile: string;
    line: string;
}): string;

/**
 * 获取提交信息
 * @param {string} root 根路径
 * @param {boolean} mergeCommit 是否包含 merge 的提交
 * @param {boolean} splitMessage 是否去掉提交信息的前缀
 * @returns {Object} 提交对象
 *
 * @example
 * ```ts
 * getGitCommitInfo()
 * {
 *   author: 'novlan1',
 *   message: ' 优化一部分文档',
 *   hash: '0cb71f9',
 *   date: '2022-10-02 10:34:31 +0800',
 *   timeStamp: '1664678071',
 *   branch: 'master'
 * }
 * ```
 */
export declare function getGitCommitInfo(root?: string, mergeCommit?: boolean, splitMessage?: boolean, useCache?: boolean): IGitCommitInfo;

/**
 * 获取提交信息
 * @param {string} root 根路径
 * @param {boolean} mergeCommit 是否包含 merge 的提交
 * @param {boolean} splitMessage 是否去掉提交信息的前缀
 * @returns {string} 提交信息
 *
 * @example
 * ```ts
 * getGitCommitMessage()
 * // '优化一部分文档'
 * ```
 */
export declare function getGitCommitMessage(root?: string, mergeCommit?: boolean, splitMessage?: boolean, useCache?: boolean): string;

/**
 * 获取tag到head的提交数目
 * @param {string} tag git标签
 * @returns {string} tag至今的提交数目
 * @example
 * ```ts
 * getGitCommitsBeforeTag('v1.0.0');
 * // '12'
 *
 * // 指定仓库路径
 * getGitCommitsBeforeTag('v1.0.0', '/path/to/repo');
 * ```
 */
export declare function getGitCommitsBeforeTag(tag: string, root?: string): string;

/**
 * 获取当前分支
 * @returns {string} 分支名称
 *
 * @example
 *
 * getGitCurBranch()
 *
 * // => master
 */
export declare function getGitCurBranch(root?: string, useCache?: boolean): string;

/**
 * 一次性收集仓库的完整 git 信息（remote / 分支 / 最近一次提交作者 / 当前登录用户）。
 *
 * 与 `getGitCommitInfo` 的差异：
 * - 提供 **40 位 commitSha**（`getGitCommitInfo.hash` 是 short id）
 * - 提供 **authorEmail**
 * - 提供 **当前 git 登录用户**（`user.name` / `user.email`，**仓库级优先 → 全局 → 环境变量**）并标记来源 `userScope`
 * - 提供 **project** 字段（自动解析 remoteUrl 为 `group/sub/project`）
 *
 * 任意一项失败均不影响其它字段。
 *
 * @param root git 仓库根目录，默认 `process.cwd()`
 *
 * @example
 * ```ts
 * import { getGitFullInfo } from 't-comm';
 *
 * const info = getGitFullInfo();
 * // {
 * //   project: 'pmd-mobile/pixui/pubgm-official',
 * //   remoteUrl: 'git@git.woa.com:pmd-mobile/pixui/pubgm-official.git',
 * //   branch: 'develop',
 * //   commitSha: '33c75cb8e78a7388c357749234d46b731daead09',
 * //   authorName: 'mobilehelper',
 * //   authorEmail: 'mobilehelper@tencent.com',
 * //   userName: 'novlan1',
 * //   userEmail: 'novlan1@tencent.com',
 * //   userScope: 'global',
 * // }
 * ```
 */
export declare function getGitFullInfo(root?: string): IGitFullInfo;

/**
 * 获取最新tag
 * @returns {string} 最新tag
 * @example
 * ```ts
 * getGitLastTag();
 * // 'v1.2.3'
 *
 * // 指定仓库路径
 * getGitLastTag('/path/to/repo');
 * ```
 */
export declare function getGitLastTag(root?: string): string;

export declare function getGitMRLink({ domain, repo, id, }: {
    domain: string;
    repo: string;
    id?: string;
}): string;

/**
 * 获取打标签的时间
 * @private
 * @param {string} tag git标签
 * @returns {string} 标签时间
 * @example
 * ```ts
 * getGitTagTime('v1.0.0');
 * // '2023-09-12 10:30:45 +0800'
 * ```
 */
export declare function getGitTagTime(tag: string, root?: string): string;

/**
 * 获取 glob 库
 * glob 是一个用于文件匹配的第三方库
 * @returns glob 库
 * @example
 * ```ts
 * const { glob } = getGlob();
 * const files = await glob('src/** /*.ts');
 * ```
 */
export declare function getGlob(): any;

/**
 * 递归获取某个组（含所有子组）下的全部仓库列表，支持多种过滤条件。
 *
 * 通过 `GET /api/v3/groups/:id`（`include_subgroups=true`）一次性获取
 * 组及子组下所有项目，避免逐页遍历 `/projects` 接口，速度更快。
 *
 * @param {object} options 输入配置
 * @param {string} options.groupName 组名称或完整路径，如 'pmd-mobile'
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] 自定义 API 基础路径，如 https://git.woa.com
 * @param {IGroupProjectFilter} [options.filter] 过滤配置
 * @returns {Promise<Array<IGroupProject>>} 过滤后的仓库列表
 * @example
 *
 * // 获取 pmd-mobile 组下所有仓库，排除 test 子组、归档仓库，以及前一天没有活跃的仓库
 * const yesterday = new Date();
 * yesterday.setDate(yesterday.getDate() - 1);
 *
 * const projects = await getGroupProjectsRecursive({
 *   groupName: 'pmd-mobile',
 *   privateToken: 'xxxxx',
 *   baseUrl: 'https://git.woa.com',
 *   filter: {
 *     excludePathPrefixes: ['pmd-mobile/test/'],
 *     excludeArchived: true,
 *     lastActivityAfter: yesterday,
 *     filterFn: (project) => !project.name.startsWith('deprecated-'),
 *   },
 * });
 *
 * console.log(projects);
 */
export declare function getGroupProjectsRecursive({ groupName, privateToken, baseUrl, filter, }: {
    groupName: string;
    privateToken: string;
    baseUrl?: string;
    filter?: IGroupProjectFilter;
}): Promise<Array<IGroupProject>>;

/**
 * 小程序下，获取对应的 H5 路由信息
 * @param {Object} route 路由信息
 * @returns H5 Url
 * @example
 * ```ts
 * getH5CurrentUrl(this.$route);
 * ```
 */
export declare function getH5CurrentUrl(route: {
    name?: string;
    meta?: {
        rawPath?: Array<string>;
    };
    params: Record<string, string>;
}): string;

export declare function getHistoryModeConfigDiff({ secretInfo, appName, key, fetchRainbowConfigOptions, }: {
    secretInfo: ISecretInfo_3;
    appName: string;
    key: string;
    fetchRainbowConfigOptions?: FetchRainbowConfigOptions;
}): Promise<{
    equal: boolean;
    addedMap: IAddedMap;
    deletedMap: IAddedMap;
    parsed: Record<string, string[]>;
    originParsed: Record<string, string[]>;
}>;

export declare function getHistoryModeConfigDiffAndSendRobot({ secretInfo, appName, key, chatId, webhookUrl, mentions, fetchRainbowConfigOptions, heartbeat, }: {
    secretInfo: ISecretInfo_3;
    appName: string;
    key: string;
    chatId?: string | string[];
    webhookUrl?: string;
    mentions?: Array<string>;
    fetchRainbowConfigOptions?: FetchRainbowConfigOptions;
    heartbeat?: boolean;
}): Promise<{
    message: string;
    equal: boolean;
    addedMap: IAddedMap;
    deletedMap: IAddedMap;
}>;

/**
 * 获取项目的 Webhook 列表
 *
 * 对应工蜂 API：GET /api/v3/projects/:id/hooks
 * @example
 *
 * getHooks({
 *   projectName: 'group/sub/repo',
 *   privateToken: 'xxxxx',
 * }).then((list) => {
 *   list.forEach(h => console.log(h.id, h.url));
 * })
 */
export declare function getHooks({ projectName, privateToken, baseUrl, }: {
    projectName: string | number;
    privateToken: string;
    baseUrl?: string;
}): Promise<WebhookItem[]>;

/**
 * 获取 http 模块
 * @returns http 模块
 * @description 仅在 Node.js 环境中可用
 * @example
 * ```ts
 * import { getHttp } from 't-comm';
 * const http = getHttp();
 * http.request(options, callback);
 * ```
 */
export declare function getHttp(): typeof httpModule;

/**
 * 将图片地址由 http 替换为 https 协议
 * @param url 图片地址
 * @returns 新的地址
 * @example
 * ```ts
 * // 腾讯系图片域名才会被替换
 * getHttpsUrl('http://game.gtimg.cn/x.jpg');
 * // 'https://game.gtimg.cn/x.jpg'
 *
 * getHttpsUrl('http://wx.qlogo.cn/x.png');
 * // 'https://wx.qlogo.cn/x.png'
 *
 * // 非腾讯域名保持原样
 * getHttpsUrl('http://other.com/x.jpg');
 * // 'http://other.com/x.jpg'
 *
 * // 本身就是 https 不会变
 * getHttpsUrl('https://game.gtimg.cn/x.jpg');
 * // 'https://game.gtimg.cn/x.jpg'
 * ```
 */
export declare const getHttpsUrl: (inUrl: string) => string;

/**
 * 获取 i18n token
 *
 * @export
 * @param {string} appId appId
 * @param {string} appKey appKey
 * @returns {Promise<string>} token
 * @example
 * ```ts
 * getI18nToken('appId', 'appKey').then(token => {
 *   console.log('token', token)
 * })
 * ```
 */
export declare function getI18nToken(appId: string, appKey: string): Promise<unknown>;

export declare function getIdentityFromTOF(headers: Record<string, string>, key: string): Promise<{
    staffid: any;
    staffname: any;
}>;

/**
 * 获取镜像名称
 * 根据项目名、子项目名和分支生成镜像名称
 * @param projectName - 项目名称
 * @param subProjectName - 子项目名称
 * @param branch - 分支名称
 * @returns 镜像名称
 * @example
 * ```ts
 * const imageName = getImageName({
 *   projectName: 'my-project',
 *   subProjectName: 'sub-project',
 *   branch: 'release'
 * });
 * // 'my-project.sub-project'
 * ```
 */
export declare function getImageName({ projectName, subProjectName, branch, }: {
    projectName: string;
    subProjectName: string;
    branch: string;
}): string;

/**
 * 获取 image-size 库
 * image-size 是一个用于获取图片尺寸的第三方库
 * @returns image-size 库
 * @example
 * ```ts
 * const sizeOf = getImageSize();
 * const dimensions = sizeOf('test.png'); // { width, height, type }
 * ```
 */
export declare function getImageSize(): any;

/**
 * 获取图片md5
 * @param {object} options 配置信息
 * @param {string} options.savePath 本地图片地址，建议绝对路径
 * @returns {Promise<string>} 图片md5值
 *
 * @example
 * getImgMd5({
 *  savePath: '/test.png'
 * }).then(md5 => {
 *   console.log(md5)
 * })
 * ```
 */
export declare function getImgMd5({ savePath }: {
    savePath: string;
}): Promise<string>;

export declare function getInnerBundleBuildDesc({ env, branch, author, message, }: {
    env: string;
    branch: string;
    author: string;
    message: string;
}): string;

/**
 * 获取ip地址
 * @returns 字符串，形如 x.x.x.x
 *
 * @example
 * ```ts
 * getIPAddress() // 10.10.10.10
 * ```
 */
export declare function getIPAddress(): string;

/**
 *
 * 获取ip的字符串
 * @returns 字符串，形如 x_x_x_x
 *
 * @example
 * ```ts
 * getIPAddressStr() // 10_10_10_10
 * ```
 */
export declare function getIPAddressStr(): string;

/**
 * 获取 jose 库
 * jose 是一个用于 JSON Web Encryption (JWE) 和 JSON Web Signature (JWS) 的第三方库
 * @returns jose 库
 * @example
 * ```ts
 * const jose = getJose();
 * const { payload } = await jose.jwtVerify(token, secret);
 * ```
 */
export declare function getJose(): typeof JoseType;

/**
 * 从日志目录读取并解析 JSON 文件
 * 读取 ./log 目录下的 JSON 文件并解析为对象
 * @param file - 文件名（相对于 log 目录）
 * @returns 解析后的 JSON 对象，解析失败或文件不存在时返回空对象
 * @example
 * ```ts
 * const data = getJsonFromLog('config.json');
 * console.log(data);
 * ```
 */
export declare function getJsonFromLog(file: string): {};

export declare function getJsonFromSheet(dataPath: string): unknown[];

/**
 * 获取 JSON 日志目录的绝对路径
 * @returns 日志目录的绝对路径
 * @example
 * ```ts
 * const logDir = getJsonLogDir();
 * console.log(logDir); // /path/to/project/log
 * ```
 */
export declare function getJsonLogDir(): string;

/**
 * 获取对象的value列表，并输出大对象形式
 * @param {Array<any>} data
 * @returns {Object} 处理后的对象
 *
 * @example
 *
 * const data = [
 * {
 *   Project: 'x',
 *   Request: 1,
 *   Score: 'a'
 * },
 * {
 *   Project: 'y',
 *   Request: 2,
 *   Score: 'b'
 * }]
 *
 * getKeyValuesMap(data)
 *
 * // 结果为:
 * {
 *   Project: ['x', 'y'],
 *   Request: [1, 2],
 *   Score: ['a', 'b'],
 * }
 *
 * // 也支持参数为带value属性的对象数组，如：
 *
 * const data = [
 * {
 *   Project: {
 *     value: 'x'
 *   }
 * },{
 *   Project: {
 *     value: 'y'
 *   }
 * }]
 *
 * // 结果为：
 * {
 *   Project: ['x', 'y']
 * }
 */
export declare function getKeyValuesMap(data?: Array<{
    [k: string]: ValueType | {
        value: ValueType;
    };
}>): Record<string, Array<ValueType>>;

/**
 * 获取分支上的最新若干条 commit
 *
 * 对应工蜂 API：GET /api/v3/projects/:id/repository/commits
 *
 * 典型场景：通过 PUT files 接口更新文件后，该接口不返回 commit_id，
 * 可用本函数回查真实的 commit sha。
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {string} [options.refName] 分支名或 commit sha，默认由后端使用默认分支
 * @param {number} [options.perPage=1] 每页条数
 * @param {number} [options.page] 页码
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<Array<{ id: string; short_id: string; title?: string; message?: string; created_at?: string }>>} commit 列表
 * @example
 *
 * // 拉取 master 分支最近 5 条 commit
 * getLatestCommits({
 *   projectName: 'group/sub/repo',
 *   refName: 'master',
 *   perPage: 5,
 *   privateToken: 'xxxxx',
 * }).then((list) => {
 *   console.log(list[0].id); // commit sha
 * })
 */
export declare function getLatestCommits({ projectName, refName, perPage, page, privateToken, baseUrl, }: {
    projectName: string | number;
    refName?: string;
    perPage?: number;
    page?: number;
    privateToken: string;
    baseUrl?: string;
}): Promise<Array<{
    id: string;
    short_id: string;
    title?: string;
    message?: string;
    created_at?: string;
}>>;

/**
 * 计算本地文件的哈希值
 * @param {string} filePath 文件路径
 * @param {'md5' | 'sha1' | 'sha256'} [algorithm='md5'] 哈希算法
 * @returns {string | null} 哈希值（hex 字符串）；文件不存在或读取失败时返回 null
 * @example
 * ```ts
 * const md5 = getLocalFileHash('/path/to/file');
 * const sha256 = getLocalFileHash('/path/to/file', 'sha256');
 * ```
 */
export declare function getLocalFileHash(filePath: string, algorithm?: 'md5' | 'sha1' | 'sha256'): string | null;

/**
 * 计算本地文件的 MD5
 * @param {string} filePath 文件路径
 * @returns {string | null} MD5 值（hex 字符串）；文件不存在或读取失败时返回 null
 * @example
 * ```ts
 * const md5 = getLocalFileMd5('/path/to/file');
 * ```
 */
export declare function getLocalFileMd5(filePath: string): string | null;

/**
 * 获取本地文件大小（字节数）
 * @param {string} filePath 文件路径
 * @returns {number | null} 文件大小（字节）；文件不存在或读取失败时返回 null
 * @example
 * ```ts
 * const size = getLocalFileSize('/path/to/file');
 * ```
 */
export declare function getLocalFileSize(filePath: string): number | null;

/**
 * 读取本地数据，IDE中不生效，在真机上才生效
 * 数据以 app + roleId 为维度隔离存储,。存储的信息如15天不更新，会自动清除。
 * @param key 键
 * @example
 * ```ts
 * const token = await getLocalStorageInPixui('user-token');
 * console.log(token);
 * ```
 */
export declare const getLocalStorageInPixui: (key: string) => Promise<string>;

/**
 * 获取游戏定位信息,回调数据
 * {
 *   flag: LocationFlagInPixui,
 *   lat: number,
 *   lng: number,
 * }
 * @example
 * ```ts
 * const res = await getLocationInPixui(platformAPI);
 * if (res.flag === LocationFlagInPixui.LocationSuccess) {
 *   console.log('lat:', res.lat, 'lng:', res.lng);
 * } else if (res.flag === LocationFlagInPixui.LocationNoPermission) {
 *   console.log('未开启系统定位权限');
 * }
 * ```
 */
export declare const getLocationInPixui: (platformAPI: any) => Promise<unknown>;

export declare function getLoginUrlInPixui(baseUrl: string): string;

/**
 * 获取 log-symbols 库
 * log-symbols 是一个用于在终端显示彩色符号的第三方库
 * @returns log-symbols 库
 * @example
 * ```ts
 * const logSymbols = getLogSymbols();
 * console.log(logSymbols.success, 'done');
 * ```
 */
export declare function getLogSymbols(): any;

/**
 * 匹配正则，获取匹配到的列表
 * @param {string} content 输入内容
 * @param {RegExp} reg 正则
 * @returns 匹配列表
 *
 * @example
 * ```ts
 * getMatchListFromReg(content, /emit\('([^',]+)'/g);
 *
 * // ['start', 'end']
 * ```
 */
export declare function getMatchListFromReg(content: string, reg: RegExp): string[];

/**
 * 给对象数组的每一项，添加isMax、isMin、、isSecondMax、isSecondMin、idx、lastIdx等属性
 * @param {Array<object>} data 原始数据
 * @param {Array<string>} reverseScoreKeys - 逆序的key列表
 * @returns {Object} 处理后的数据
 *
 * @example
 * const data = [{
 *   ProjectName: { name: 'ProjectName', value: '麻将赛事' },
 *   PagePv: { name: 'PagePv', value: 2877 },
 * }, {
 *   ProjectName: { name: 'ProjectName', value: '斗地主赛事' },
 *   PagePv: { name: 'PagePv', value: 7 },
 * },
 * // ...
 * ];
 *
 * getMaxAndMinIdx(data, [])
 *
 * // =>
 *   [{
 *     ProjectName: { name: 'ProjectName', value: '麻将赛事' },
 *     PagePv: {
 *       name: 'PagePv',
 *       value: 2877,
 *       idx: 6,
 *       lastIdx: 6,
 *       isMax: false,
 *       isMin: false,
 *       isSecondMax: false,
 *       isSecondMin: false,
 *     },
 *   }];
 *
 */
export declare function getMaxAndMinIdx(data?: Array<Record<string, any>>, reverseScoreKeys?: Array<string>): any[];

/**
 * 获取 rtx 拼接的提及字符串
 * @param rawStr 原始字符串，比如 `foo,bar`
 * @returns 处理后的字符串，比如 <@foo><@bar>
 * @example
 * ```ts
 * getMentionRtx('foo,bar');   // '<@foo><@bar>'
 * getMentionRtx('foo;bar');   // '<@foo><@bar>'
 * getMentionRtx('foo');       // '<@foo>'
 * getMentionRtx('');          // ''
 * ```
 */
export declare function getMentionRtx(rawStr?: string): string;

/**
 * 生成 meta config（如 component-config.json）的 PascalCase 替换规则
 * @param {string[]} rawList - 组件名列表
 * @param {string[]} dirList - 目标文件 glob 列表
 * @returns {Array<{ list: Array, dirList: string[] }>}
 * @example
 * ```ts
 * const rules = getMetaConfigPascalReplaceRules(
 *   ['dialog', 'icon'],
 *   ['src/component-config.json'],
 * );
 * // rules 为三阶段替换规则数组，供 batchReplaceFileContent 使用
 * ```
 */
export declare function getMetaConfigPascalReplaceRules(rawList: string[], dirList: string[]): {
    list: [string, string][];
    dirList: string[];
}[];

/**
 * 获取 miniprogram-ci 库
 * miniprogram-ci 是微信小程序的命令行工具
 * @returns miniprogram-ci 库
 * @example
 * ```ts
 * const ci = getMiniprogramCi();
 * const project = new ci.Project({ appid: '...', type: 'miniProgram' });
 * ```
 */
export declare function getMiniprogramCi(): typeof MiniprogramCI;

/**
 * 获取一个月有多少天
 * 原理：new Date()第2个参数默认为1，就是每个月的1号，把它设置为0时，
 * new Date()会返回上一个月的最后一天，然后通过getDate()方法得到天数
 * @param {string} year 年份
 * @param {string} month 月份
 * @returns {number} 天数
 *
 * @example
 * getMonthDay(2022, 2) // 28
 *
 * getMonthDay(2022, 3) // 31
 *
 * getMonthDay(2022, 4) // 30
 */
export declare function getMonthDay(year: number, month: number): number;

/**
 * 获取一个月有多少天
 *
 * 原理：把每月的天数写在数组中，再判断时闰年还是平年确定2月分的天数
 * @param {string} year 年份
 * @param {string} month 月份
 * @returns {number} 天数
 *
 * @example
 * getMonthDay2(2022, 2)
 * // 28
 *
 * getMonthDay2(2022, 3)
 * // 31
 *
 * getMonthDay2(2022, 4)
 * // 30
 */
export declare function getMonthDay2(year: number, month: number): number;

/**
 * 摩斯密码的 Vue mixin，方便实用
 * @param {array} pwd 密钥
 * @param {Function} cb 回到函数
 * @returns 换入内容
 * @example
 * ```ts
 * getMorsePwdMixin([1, 1, 1, 1, 1], function () {
 *   if (isInIFrame()) return;
 *   this.onShowLaunchApp();
 * }),
 * ```
 */
export declare const getMorsePwdMixin: (pwd: number[], cb: Function) => any;

/**
 * 获取 MR 变更内容（含 diff）
 *
 * 对应工蜂 API：GET /api/v3/projects/:id/merge_request/:id/changes
 *
 * 工蜂 v3 API 返回的变更文件字段名为 `files`，本函数会额外映射一个 `changes` 字段
 * 方便调用方以统一的字段名访问（同时保留 files）。
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.mrIid MR 的项目内序号
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<MRChangesDetail>} MR 变更详情
 * @example
 *
 * getMRChanges({
 *   projectName: 'coecology/xd',
 *   mrIid: 169,
 *   privateToken: 'xxxxx',
 * }).then((res) => {
 *   res.changes.forEach(c => console.log(c.new_path));
 * })
 */
export declare function getMRChanges({ projectName, mrIid, privateToken, baseUrl, }: {
    projectName: string | number;
    mrIid: number | string;
    privateToken: string;
    baseUrl?: string;
}): Promise<MRChangesDetail>;

/**
 * 获取 MR 详情（参数为 iid，内部自动转全局 id）
 *
 * 对应工蜂 API：GET /api/v3/projects/:id/merge_request/:id
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.mrIid MR 的项目内序号
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<MRDetail>} MR 详情
 * @example
 *
 * getMRDetail({
 *   projectName: 'coecology/xd',
 *   mrIid: 169,
 *   privateToken: 'xxxxx',
 * }).then((mr) => {
 *   console.log(mr.title, mr.state);
 * })
 */
export declare function getMRDetail({ projectName, mrIid, privateToken, baseUrl, }: {
    projectName: string | number;
    mrIid: number | string;
    privateToken: string;
    baseUrl?: string;
}): Promise<MRDetail>;

/**
 * 通过 iid（项目内 MR 序号）获取 MR 的全局 id
 *
 * iid 与 id 的区别：
 * - iid：项目内的序号，从 1 开始递增，即 URL 和 Web 界面上看到的数字
 * - id：MR 在整个 TGit 系统中的全局唯一 ID
 *
 * 工蜂 v3 API 的 merge_request 详情接口使用全局 id，而非 iid。
 * 新建的 MR 在工蜂 API 侧可能有短暂同步延迟，本函数默认进行 3 次重试（3s 间隔）。
 *
 * 对应工蜂 API：GET /api/v3/projects/:id/merge_requests?iid=:iid
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.mrIid MR 的项目内序号
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @param {number} [options.maxRetries=3] 最大重试次数
 * @param {number} [options.retryDelay=3000] 重试间隔（毫秒）
 * @returns {Promise<number>} MR 的全局 id
 * @example
 *
 * getMRIdByIid({
 *   projectName: 'group/sub/repo',
 *   mrIid: 112,
 *   privateToken: 'xxxxx',
 * }).then((id) => {
 *   console.log(id); // 全局 id
 * })
 */
export declare function getMRIdByIid({ projectName, mrIid, privateToken, baseUrl, maxRetries, retryDelay, }: {
    projectName: string | number;
    mrIid: number | string;
    privateToken: string;
    baseUrl?: string;
    maxRetries?: number;
    retryDelay?: number;
}): Promise<number>;

/**
 * 获取MR列表
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称
 * @param {string} options.privateToken 密钥
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * getMrList({
 *   projectName: 't-comm',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function getMrList({ projectName, privateToken, baseUrl }: {
    projectName: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<object>;

/**
 * 获取 MR 的单条评论（Note）详情
 *
 * 对应工蜂 API：GET /api/v3/projects/:id/merge_requests/:id/notes/:noteId
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.mrIid MR 的项目内序号
 * @param {number | string} options.noteId 评论 ID
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<Record<string, unknown>>} 评论详情
 * @example
 *
 * getMRNoteById({
 *   projectName: 'coecology/xd',
 *   mrIid: 169,
 *   noteId: 123456,
 *   privateToken: 'xxxxx',
 * }).then((note) => {
 *   console.log(note.body);
 * })
 */
export declare function getMRNoteById({ projectName, mrIid, noteId, privateToken, baseUrl, }: {
    projectName: string | number;
    mrIid: number | string;
    noteId: number | string;
    privateToken: string;
    baseUrl?: string;
}): Promise<Record<string, unknown>>;

/**
 * 获取 MR 的所有评论（Notes）列表
 *
 * 对应工蜂 API：GET /api/v3/projects/:id/merge_requests/:id/notes
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.mrIid MR 的项目内序号
 * @param {string} options.privateToken 密钥
 * @param {number} [options.perPage=100] 每页数量
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<Array<Record<string, unknown>>>} 评论列表
 * @example
 *
 * getMRNotes({
 *   projectName: 'coecology/xd',
 *   mrIid: 169,
 *   privateToken: 'xxxxx',
 * }).then((notes) => {
 *   notes.forEach(n => console.log(n.id, n.body));
 * })
 */
export declare function getMRNotes({ projectName, mrIid, privateToken, perPage, baseUrl, }: {
    projectName: string | number;
    mrIid: number | string;
    privateToken: string;
    perPage?: number;
    baseUrl?: string;
}): Promise<Array<Record<string, unknown>>>;

/**
 * msdk 浏览器全屏方法，点击外链时可全屏，返回时退出全屏
 * @example
 * ```ts
 * mixins: [getMsdkFullScreen()],
 * ```
 */
export declare function getMsdkFullScreen(): {
    onShow(): void;
    methods: {
        callJsReSetFullScreen(): void;
    };
};

/**
 * 获取 Node.js 的 net 模块
 * 这样可以避免在浏览器环境中直接导入 net 模块导致的错误
 * @returns net 模块
 * @example
 * ```ts
 * const net = getNet();
 * const server = net.createServer((socket) => {
 *   socket.write('hello\n');
 *   socket.end();
 * });
 * server.listen(3000);
 * ```
 */
export declare function getNet(): typeof NetType;

/**
 * 通过 `npm pack --dry-run --json` 获取「即将发布」的新包体积。
 *
 * 注意事项：
 * - 必须在项目根目录或正确的 cwd 下执行，否则会发错包。
 * - 文件多时输出会撑爆默认 `maxBuffer`（1MB），这里设为 64MB。
 * - `--loglevel=error` 用于压住 npm 警告，进一步减少缓冲区占用。
 *
 * @param options.cwd 工作目录，默认 `process.cwd()`
 * @returns 新包体积。失败时返回全 0。
 */
export declare function getNewPackageSize(options?: {
    cwd?: string;
}): {
    tarballSize: number;
    unpackedSize: number;
    fileCount: number;
};

declare function getNewPage(browser: IBrowser, device: DEVICE_TYPE): Promise<any>;

/**
 * 根据 npm dist-tag 结果计算下一个版本号
 * @param packageName 包名
 * @param versionType 版本类型 alpha/beta/rc/patch/minor/major，或一个合法的 semver
 * @param optionsOrCwd 第三个参数：
 *   - 字符串：兼容旧用法，作为 cwd 使用
 *   - 对象：{ cwd, checkTagExists, maxBumpAttempts }；当 checkTagExists 返回 true 时会基于该版本继续 bump
 */
export declare function getNextVersion(packageName: string | undefined, versionType: VersionType, optionsOrCwd?: string | GetNextVersionOptions): string | null;

declare interface GetNextVersionOptions {
    /** 执行 npm dist-tag ls 时所在目录，默认 process.cwd() */
    cwd?: string;
    /**
     * 检测某个版本对应的 tag 是否已存在
     * 若返回 true，则会基于该版本继续往后 bump，直到找到一个不冲突的版本
     * （仅对 prerelease 类型 alpha/beta/rc 有循环 bump 能力，其他类型只会判断一次）
     */
    checkTagExists?: (version: string) => boolean;
    /** checkTagExists 循环次数上限，防御无限循环，默认 20 */
    maxBumpAttempts?: number;
}

export declare function getNowBySecond(): number;

/**
 * 获取分支详情
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称
 * @param {string} options.branchName 分支名称
 * @param {string} options.privateToken 密钥
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * getOneBranchDetail({
 *   projectName: 't-comm',
 *   branchName: 'master',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function getOneBranchDetail({ projectName, branchName, privateToken, baseUrl }: {
    projectName: string;
    branchName: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<object>;

/**
 * 获取commit详情
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称
 * @param {string} options.commitId 提交hash
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] 自定义 API 基础路径
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * getOneCommitDetail({
 *   projectName: 't-comm',
 *   commitId: 'aaaa',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function getOneCommitDetail({ projectName, commitId, privateToken, baseUrl }: {
    projectName: string;
    commitId: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<object>;

/**
 * 获取MR的一条评论
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称
 * @param {string} options.privateToken 密钥
 * @param {string} options.mrId 某次MR的Id
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * getOneMrComments({
 *   projectName: 't-comm',
 *   privateToken: 'xxxxx',
 *   mrId: '1'
 * }).then((resp) => {
 *
 * })
 */
export declare function getOneMrComments({ mrId, projectName, privateToken, baseUrl }: {
    projectName: string;
    mrId: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<object>;

/**
 * 通过搜索获取一个项目信息
 * @param {object} options 输入配置
 * @param {string} options.search 搜索内容
 * @param {string} options.page 起始页码
 * @param {string} options.privateToken 密钥
 * @returns {Promise<Array<object>>} 请求Promise
 * @example
 *
 * getOneProjectBySearch({
 *   search: 't-comm',
 *   page: 1,
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function getOneProjectBySearch({ search, privateToken, page, baseUrl, }: {
    search: string;
    privateToken: string;
    page?: number;
    baseUrl?: string;
}): Promise<Array<object>>;

/**
 * 获取仓库详情
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称
 * @param {string} options.privateToken 密钥
 * @returns {Promise<object>} 请求Promise
 * @example
 * getOneProjectDetail({
 *   projectName: 't-comm',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function getOneProjectDetail({ projectName, privateToken, baseUrl, }: {
    projectName: string | number;
    privateToken: string;
    baseUrl?: string;
}): Promise<unknown>;

export declare function getOpenLocationUrl({ lat, lng, name, address, }: Pick<OpenLocation, 'lat' | 'lng' | 'name' | 'address'>): string;

/**
 * 获取 os 模块
 * @returns os 模块
 * @description 仅在 Node.js 环境中可用
 * @example
 * ```ts
 * import { getOs } from 't-comm';
 * const os = getOs();
 * const tmpDir = os.tmpdir();
 * ```
 */
export declare function getOs(): typeof osModule;

/**
 * 通过 registry 接口拿指定版本的包体积。
 * 兼容字段：
 *   - 腾讯源 mirrors.tencent.com：`dist.packageSize`（tarball 字节，可能无 unpackedSize）
 *   - 公网 npm：`dist.size`（tarball） + `dist.unpackedSize`（解包大小） + `dist.fileCount`
 */
export declare function getPackageSizeByVersion(name: string, version: string, options?: {
    registry?: string;
    timeout?: number;
}): Promise<{
    tarballSize: number;
    unpackedSize: number;
    fileCount: number;
}>;

export declare function getPagesJsonCondition(componentConfig: Array<{
    list: Array<{
        name: string;
    }>;
}>): {
    current: number;
    list: {
        name: any;
        path: string;
    }[];
};

/**
 * 统计页面总数、分包数目等
 * @param dist
 * @returns result
 *
 * @example
 * ```ts
 * getPageTotal('./dist/dev/mp-weixin')
 * ```
 */
export declare function getPageTotal(dist: string): {
    pageTotal: number;
    subPackageTotal: number;
};

/**
 * 高度可配置的参数获取函数。
 * 它根据提供的参数名列表，智能地将分散参数或对象参数转换为一个标准化的对象。
 *
 * @template T - 期望返回的对象类型。
 * @param {string[]} paramNames - 参数名列表，用于映射分散的参数。
 * @param {any[]} args - 原始的函数参数 `arguments`。
 * @returns {T} - 一个标准化的对象。
 * @example
 * ```ts
 * // 1. 分散参数：按 paramNames 顺序映射
 * function foo(a: string, b: number, c: boolean) {
 *   return getParameters<{ a: string; b: number; c: boolean }>(
 *     ['a', 'b', 'c'],
 *     // eslint-disable-next-line prefer-rest-params
 *     [...arguments],
 *   );
 * }
 * foo('x', 1, true); // { a: 'x', b: 1, c: true }
 *
 * // 2. 对象参数：原样返回
 * function bar(opts: { a: string; b: number }) {
 *   return getParameters<{ a: string; b: number }>(
 *     ['a', 'b'],
 *     // eslint-disable-next-line prefer-rest-params
 *     [...arguments],
 *   );
 * }
 * bar({ a: 'x', b: 1 }); // { a: 'x', b: 1 }
 * ```
 */
export declare function getParameters<T>(paramNames: string[] | readonly string[], args?: any[]): T;

/**
 * 获取占比
 * @param {number} summary 总数据
 * @param {number} part 部分数据
 * @returns {number} 比例
 * @example
 * getRatio(0, 1)
 * // 0
 *
 * getRatio(1, 0)
 * // 0
 *
 * getRatio(1, 1)
 * // 100
 *
 * getRatio(1, .5)
 * // 50
 */
export declare function getPartRatio(summary: number, part: number): number;

/**
 * 获取 Node.js path 模块
 * 动态导入 path 模块，避免在浏览器环境中引起错误
 * @returns Node.js path 模块
 * @example
 * ```ts
 * const path = getPath();
 * const fullPath = path.resolve(__dirname, './file.txt');
 * const basename = path.basename('/path/to/file.txt'); // 'file.txt'
 * ```
 */
export declare function getPath(): typeof path;

/** GetPetByTempId 请求参数 */
export declare interface GetPeerByTempIdReq {
    temp_id: string;
    [key: string]: any;
}

/** GetPetByTempId 响应 */
export declare interface GetPeerByTempIdRsp {
    user_nick?: string;
    pet_id?: string;
    pet?: {
        nick?: string;
        [key: string]: any;
    };
    user_head?: string;
    [key: string]: any;
}

/**
 * 读取持久化存储
 * @param {string} key
 * @returns {string} key对应的值
 * @example
 * ```ts
 * savePersist('name', 'mike');
 * getPersist('name'); // 'mike'
 *
 * // 已过期或不存在返回 undefined
 * getPersist('not-exist'); // undefined
 * ```
 */
export declare function getPersist(key: string): any;

export declare function getPipelineBuildDetail({ projectId, pipelineId, buildId, archiveFlag, executeCount, secretInfo, host, }: {
    projectId: string;
    pipelineId: string;
    buildId: string;
    archiveFlag?: boolean;
    executeCount?: number | string;
    secretInfo: ISecretInfo;
    host: string;
}): Promise<any>;

/**
 * 获取流水线列表
 * @param {object} params 配置信息
 * @param {string} params.projectId 项目ID
 * @param {object} params.secretInfo 密钥信息
 * @param {string} params.host 请求域名
 * @param {number} params.page 第几页
 * @param {number} params.pageSize 每页数据量
 * @returns 流水线列表
 * @example
 * ```ts
 * const res = await getPipelineList({
 *   projectId: 'my-project',
 *   host: 'https://devops.woa.com',
 *   secretInfo: { appCode, appSecret, devopsUid },
 *   page: 1,
 *   pageSize: 20,
 * });
 * console.log(res.records);
 * ```
 */
export declare function getPipelineList({ projectId, secretInfo, host, page, pageSize, }: {
    projectId: string;
    secretInfo: ISecretInfo;
    host: string;
    page?: number;
    pageSize?: number;
}): Promise<any>;

export declare function getPipelineReviewElement(data?: any): any;

/**
 * 获取预发布版本标签，比如 alpha, beta
 * @param {string} version 版本号
 * @returns 标签
 * @example
 * ```ts
 * getPreReleaseTag('1.2.2-beta.0')
 * // beta
 * ```
 */
export declare function getPreReleaseTag(version: string): string;

/**
 * 生成 alpha、beta 等这些预发布的版本
 * @param key 关键词
 * @returns 生成的版本
 * @example
 * ```ts
 * // 假设 npm dist-tag 的 latest 是 1.0.0、alpha 是 1.0.0-alpha.1
 * getPreReleaseVersion('alpha'); // '1.0.0-alpha.2'
 *
 * // key 为空时返回 undefined
 * getPreReleaseVersion(''); // undefined
 *
 * // 拉不到 dist-tag 时使用默认 latest 0.1.0
 * getPreReleaseVersion('beta'); // '0.1.0-beta.1'
 * ```
 */
export declare function getPreReleaseVersion(key?: string, cwd?: string): string | undefined;

/**
 * 获取相对上次的比例，会给输入的对象数组的每一项增加 ratio、previousValue 属性
 * @param {Array<Object>} data - 输入数据
 * @param {Object} preDataMap - 上次数据的map
 * @param {string} uniqKey - 唯一键
 *
 * @example
 * const data = [{
 *   Project: { value: 'mj-match', name: 'Project' },
 *   Request: {
 *     value: 854,
 *     name: 'Request',
 *     idx: 19,
 *     lastIdx: 19,
 *     isMax: false,
 *     isMin: false,
 *     isSecondMax: false,
 *     isSecondMin: true,
 *   },
 * }];
 *
 * const preDataMap = {
 *   'mj-match': {
 *     Project: 'mj-match',
 *     Request: 4,
 *     Score: 91.81,
 *     FirstLoadTime: 178,
 *     WholePageTime: 1035,
 *     ParseDomTime: 484,
 *     DNSLinkTime: 0,
 *     DOMTime: 414,
 *     TCP: 0,
 *     HTTP: 275,
 *     BackEnd: 60,
 *     CGIFailNum: 0,
 *     ErrorLogNum: 0,
 *     CGIRequestNum: 83,
 *   },
 * };
 *
 * getPreviousRatio(data, preDataMap);
 *
 * // data会变成：
 * [{
 *   Project: { value: 'mj-match', name: 'Project' },
 *   Request: {
 *     value: 854,
 *     name: 'Request',
 *     idx: 19,
 *     lastIdx: 19,
 *     isMax: false,
 *     isMin: false,
 *     isSecondMax: false,
 *     isSecondMin: true,
 *
 *     previousValue: 4, // 新增属性
 *     ratio: "+999+%" // 新增属性
 *   },
 * }];
 */
export declare function getPreviousRatio(data?: Array<any>, preDataMap?: Record<string, any>, uniqKey?: string): void;

/**
 * 根据 groupId 获取项目列表
 * @ignore
 * @param {object} options 配置
 * @param {number} options.groupId 小组Id
 * @param {object} options.secretInfo 密钥信息
 * @param {string} options.secretInfo.apiKey apiKey
 * @param {string} options.secretInfo.loginName loginName
 * @param {Function} options.secretInfo.getPwdCode getPwdCode
 * @param {Function} options.secretInfo.encrypt encrypt
 * @returns {Promise<array<object>>} 项目列表
 * @example
 * getProjectByGroupId({
 *   groupId: 1,
 *   secretInfo: {
 *     apiKey: '',
 *     loginName: '',
 *     getPwdCode() {},
 *     encrypt() {},
 *   }
 * }).then(resp => {
 *   console.log(resp)
 * })
 * [
 *   {
 *     ID: 56564,
 *     ProjectName: 'name',
 *     ProjectDesc: 'desc',
 *     ProjectKey: 'xxx',
 *     ProjectType: 'web',
 *     GroupId: 123,
 *     GroupName: 'xxx',
 *     GroupKey: 'xxx',
 *     InstanceID: 'rum-xxx',
 *     Url: '*.qq.com',
 *     CodePath: '',
 *     Rate: '100',
 *     CreateUser: 'xxx',
 *     EnableUrlGroup: true,
 *     KafkaHost: '',
 *     KafkaTopic: '',
 *     KafkaVersion: '',
 *     SaslUserName: '',
 *     SaslPassword: '',
 *     SaslMechanism: '',
 *     IsFollow: false,
 *     CreateTime: '2021-10-01T11:34:32+08:00',
 *   },
 *   {
 *     ID: 12345,
 *     // ...
 *   },
 * ];
 *
 */
export declare function getProjectByGroupId({ groupId, secretInfo, }: {
    groupId: number;
    secretInfo: SecretInfoType;
}): Promise<any>;

/**
 * 根据项目路径或 URL 获取项目信息（含 id / name / path_with_namespace）
 *
 * 本函数是 `parseProjectPath` + `getOneProjectDetail` 的便捷封装，
 * 支持与 `parseProjectPath` 相同的输入格式：
 *   - 完整 URL：           https://git.woa.com/pmd-mobile/pmd-h5/press-next
 *   - 带 .git 后缀：       https://git.woa.com/pmd-mobile/pmd-h5/press-next.git
 *   - SSH 地址：           git@git.woa.com:pmd-mobile/pmd-h5/press-next.git
 *   - 纯路径：             pmd-mobile/pmd-h5/press-next
 *
 * @param {object} options 输入配置
 * @param {string} options.pathOrUrl 项目路径或 URL
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<TGitProjectInfo>} 项目信息
 * @example
 *
 * getProjectByPath({
 *   pathOrUrl: 'https://git.woa.com/pmd-mobile/pmd-h5/press-next',
 *   privateToken: 'xxxxx',
 * }).then((info) => {
 *   console.log(info.id, info.path_with_namespace);
 * })
 */
export declare function getProjectByPath({ pathOrUrl, privateToken, baseUrl, }: {
    pathOrUrl: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<TGitProjectInfo>;

/**
 * 获取默认分支
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称
 * @param {string} options.privateToken 密钥
 * @returns {Promise<string>} 请求Promise
 * @example
 *
 * getProjectDefaultBranch({
 *   projectName: 't-comm',
 *   privateToken: 'xxxxx',
 * }).then((branch) => {
 *  console.log('branch: ', branch)
 * })
 */
export declare function getProjectDefaultBranch({ projectName, privateToken, baseUrl, }: {
    projectName: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<string>;

export declare function getProtectedBranchRules({ projectName, baseUrl, privateToken, }: {
    projectName: string;
    baseUrl?: string;
    privateToken: string;
}): Promise<Array<{
    name: string;
    [k: string]: any;
}>>;

/**
 * 根据`id`获取省份名字
 * @param {string | number} provinceId
 * @returns {string} 省份名字
 *
 * @example
 * const res =  getProvName(37)
 * // 山东
 *
 * const res2 =  getCityName(11)
 * // 北京
 */
export declare function getProvName(provinceId: string | number): string;

export declare function getPublishBashPath(): string;

export declare function getPublishEnvValue(key: string): string;

export declare function getPublishModuleName(dir?: string): string;

export declare function getPublishRootDir(): string;

/**
 * 获取组件简称
 * @param name 组件名称
 * @param prefix 前缀
 * @returns 简称
 * @example
 * ```ts
 * getPureCompName('press-swiper-item', 'press-')
 * getPureCompName('swiper-item', 'press-') // swiper-item
 * ```
 */
export declare function getPureCompName(name?: string, prefix?: string): string;

/**
 * 从 App.onShow 的 options 中提取 QQ 登录票据
 *
 * @param options App.onShow 回调参数
 * @param qqMpAppId 腾讯 QQ 小程序 appId（默认 wx26da53d900421226）
 * @returns QQ 登录票据信息，未登录或失败时返回 undefined
 */
export declare function getQQTicketInfo(options: QQOnShowOptions | undefined | null, qqMpAppId?: string): QQTicketInfo | undefined;

/**
 * 获取插件实例（不重复初始化时使用）
 */
export declare function getQQWXMiniPlugin(): QQWXMiniPlugin | undefined;

/**
 * 获取 qs 库
 * qs 是一个用于解析和序列化查询字符串的第三方库
 * @returns qs 库
 * @example
 * ```ts
 * const qs = getQs();
 * qs.parse('a=1&b=2'); // { a: '1', b: '2' }
 * qs.stringify({ a: 1 }); // 'a=1'
 * ```
 */
export declare function getQs(): any;

/**
 * url参数变对象
 * @param {string} url 输入URL
 * @returns {Object} search对象
 * @example
 * // 完整 url
 * getQueryObj('https://igame.qq.com?name=mike&age=18&feel=cold&from=china');
 * // => { name: 'mike', age: '18', feel: 'cold', from: 'china' }
 * @example
 * // 仅传入 query 字符串（不含 ?）也能解析
 * getQueryObj('name=mike&age=18&feel=cold&from=china');
 * // => { name: 'mike', age: '18', feel: 'cold', from: 'china' }
 */
export declare function getQueryObj(url: string): Record<string, string>;

/**
 * 在区间内获取随机浮点数
 * @param min - 最小值
 * @param max - 最大值
 * @returns 随机浮点数
 * @example
 * ```ts
 * getRandomNumber(0, 10); // 3.456789
 * getRandomNumber(1.5, 5.5); // 2.789123
 * ```
 */
export declare function getRandomNumber(min: number, max: number): number;

/**
 * 获取随机字符串
 * @param {number} length 字符串长度，默认 32
 * @returns {string} 字符串
 * @example
 * ```ts
 * randomString()
 *
 * randomString(16)
 * ```
 */
export declare const getRandomString: typeof randomString;

/**
 * 通过 `npm view <name> time --json` 拿到所有版本的发布时间，
 * 按时间倒序返回最近的 N 个版本号（跳过 created/modified 两个非版本号 key）。
 *
 * 这样做的原因：
 *   - version-tip 是在「发布完成后」调用的，registry 上已经存在新版本；
 *   - `time` 字段记录每个版本的 ISO 发布时间，倒序就能依次拿到「新版本」「上一个版本」。
 *
 * @param {string} name 包名
 * @param {number} limit 取最近的几个版本，默认 2（新、旧各一个）
 * @returns {string[]} 版本号数组，按时间倒序；失败返回空数组
 */
export declare function getRecentVersions(name: string, limit?: number): string[];

/**
 * A引用B时，拿引用路径
 * @param pathA 路径A
 * @param pathB 路径B
 * @returns 相对路径
 * @example
 * ```ts
 * getRelativePath('a', 'b');
 *
 * // './b'
 * ```
 */
export declare function getRelativePath(pathA: string, pathB: string): string;

/**
 * 获取 request 库
 * request 是一个第三方 HTTP 客户端库
 * 注意：request 库已经被废弃，建议使用 axios 或 node-fetch 替代
 * @returns request 库
 * @example
 * ```ts
 * const request = getRequest();
 * request('https://example.com', (err, response, body) => {
 *   if (err) return console.error(err);
 *   console.log(body);
 * });
 * ```
 */
export declare function getRequest(): any;

/**
 * 从审核意见中提取真实审核人
 *
 * 当审核由 pmd-mcp 等自动化工具代为操作时，审核意见中会携带真实审核人信息，
 * 格式为 "by pmd-mcp, from novlan1)"，此函数提取其中的真实用户名。
 *
 * @param suggest - 审核意见字符串
 * @returns 提取到的审核人用户名，未匹配则返回空字符串
 *
 * @example
 * ```ts
 * getReviewerFromSuggest('by pmd-mcp, from novlan1)')  // => 'novlan1'
 * getReviewerFromSuggest('by pmd-mcp, from novlan1')   // => 'novlan1'
 * getReviewerFromSuggest('LGTM')                            // => ''
 * getReviewerFromSuggest('')                                 // => ''
 * ```
 */
export declare function getReviewerFromSuggest(suggest: string): string;

export declare function getRobotWebhookUrl(key: string): string;

/**
 * 路由离开前记住缓存，返回后不刷新页面
 *
 * 比如创建赛事页面，如果前往查看规则，返回后，希望保留之前的表单
 *
 * 注意，用了这个 mixin，就不要用 onShow 了，而是用 mounted，
 * 否则可能会重复触发刷新
 *
 * @param {string} config.refresh 刷新方法
 * @returns 返回对象，包含 beforeRouteLeave 和 activated 方法
 * @example
 * ```ts
 * // 在 Vue 组件中：
 * export default {
 *   mixins: [getRouteLeaveCache({ refresh: 'fetchData' })],
 *   methods: {
 *     fetchData() { ... },
 *     onClickRule() {
 *       this._jumpToCacheRoute();
 *       this.$router.push('/rule');
 *     },
 *   },
 * };
 * ```
 */
export declare function getRouteLeaveCache({ refresh, }: {
    refresh?: string;
}): {
    activated(): void;
    mounted(): void;
    methods: {
        _jumpToCacheRoute(): void;
    };
};

/**
 * 获取当前路由部分的 url
 * @return {string}
 * @example
 * ```ts
 * // 在当前页面中调用
 * getRoutePartUrl();
 * // 'pages/home/home?from=index'
 * ```
 */
export declare function getRoutePartUrl(): string;

/**
 * 根据路由跳转时的参数，提取 path 和其他参数
 * @param route $router.push 或者 $router.replace 的参数
 * @returns 解析结果
 * @example
 * ```ts
 * getRouterFuncPath('/foo/bar');
 * // { path: '/foo/bar', other: {} }
 *
 * getRouterFuncPath({ path: '/foo/bar', query: { a: 1 } });
 * // { path: '/foo/bar', other: { query: { a: 1 } } }
 *
 * getRouterFuncPath({ name: 'home' });
 * // { path: undefined, other: {} }
 * ```
 */
export declare function getRouterFuncPath(route: any): {
    path: any;
    other: any;
};

/**
 * 获取rtx信息
 * @private
 * @example
 * ```ts
 * getRtxInfo().then((info) => {
 *   console.log(info); // { rtx: 'xxx', ... }
 * });
 * ```
 */
export declare function getRtxInfo(): Promise<unknown>;

export declare function getRtxInfoV2(defaultRtx?: string): Promise<{
    rtx: string;
}>;

export declare function getRUMAllProject({ secretId, secretKey, }: {
    secretId: string;
    secretKey: string;
}): Promise<any>;

/**
 * 获取腾讯云 RUM（Real User Monitoring）性能数据
 * 用于查询前端性能监控数据，支持按时间范围和类型筛选
 * @param secretId - 腾讯云 SecretId
 * @param secretKey - 腾讯云 SecretKey
 * @param id - RUM 项目 ID
 * @param startTime - 开始时间（时间戳或字符串）
 * @param endTime - 结束时间（时间戳或字符串）
 * @param type - 性能数据类型
 * @returns {Promise<{data: Array<unknown>}>} - 返回性能数据数组
 * @example
 * ```ts
 * getRUMPerformance({
 *   secretId: 'your-secret-id',
 *   secretKey: 'your-secret-key',
 *   id: '123456',
 *   startTime: 1640000000,
 *   endTime: 1640086400,
 *   type: 'page'
 * }).then(result => {
 *   console.log('性能数据:', result.data);
 * });
 * ```
 */
export declare function getRUMPerformance({ secretId, secretKey, id, startTime, endTime, type, }: {
    secretId: string;
    secretKey: string;
    id: string | number;
    startTime: string | number;
    endTime: string | number;
    type: string;
}): Promise<any>;

export declare function getRUMScores({ secretId, secretKey, startTime, endTime, }: {
    secretId: string;
    secretKey: string;
    startTime: string;
    endTime: string;
}): Promise<Array<ScoreInfoType_2>>;

/**
 * 安全获取文件后缀名
 * @param {File} file - 文件对象
 * @returns {string} 文件后缀名（小写，不带点）
 * @example
 * ```ts
 * const f = new File([''], 'photo.PNG', { type: 'image/png' });
 * getSafeFileExtension(f); // 'png'
 *
 * // 没有 type 时会退化到用文件名后缀
 * const f2 = new File([''], 'doc.PDF');
 * getSafeFileExtension(f2); // 'pdf'
 * ```
 */
export declare function getSafeFileExtension(file: File): string;

export declare function getSomeDayEndTimeStamp(date: string | number | Date, unit?: string): number;

export declare function getSomeDayStartTimeStamp(date: string | number | Date, unit?: string): number;

export declare function getStylelintLinebreaksRules(value?: string): {
    linebreaks?: undefined;
} | {
    linebreaks: string;
};

export declare function getStylelintVendorPrefixRules(): {
    'selector-no-vendor-prefix': null;
    'value-no-vendor-prefix': null;
    'property-no-vendor-prefix': null;
    'at-rule-no-vendor-prefix': null;
    'media-feature-name-no-vendor-prefix': null;
};

export declare function getSubmodulePathList(file?: string): string[];

/**
 * 根据项目id获取分数信息
 * @ignore
 * @param {object} options 参数
 * @param {Array<number>} options.projectIdList 项目Id列表
 * @param {string} options.date 日期，yyyyMMdd格式
 * @param {object} options.secretInfo 密钥信息
 * @param {string} options.secretInfo.apiKey apiKey
 * @param {string} options.secretInfo.loginName loginName
 * @param {Function} options.secretInfo.getPwdCode getPwdCode
 * @param {Function} options.secretInfo.encrypt encrypt
 * @returns {Promise<Array<object>>} 分数信息
 * @example
 * getTAMScoreInfoByProjectId({
 *   projectId: 123123,
 *   date: 20210106
 *   secretInfo: {
 *     apiKey: '',
 *     loginName: '',
 *     getPwdCode() {},
 *     encrypt() {},
 *   }
 * }).then((data) => {
 *   console.log(data)
 * })
 *
 * [
 *   {
 *     ProjectName: '社区',
 *     PagePv: 99,
 *     PageError: 0,
 *     PageDuration: 1409.8333,
 *     StaticFail: 8,
 *     CreateTime: '',
 *     ProjectId: 123123,
 *     PageUv: 23,
 *     ApiNum: 521,
 *     ApiFail: 78,
 *     ApiDuration: 1813.3333,
 *     StaticNum: 1494,
 *     StaticDuration: 103.75,
 *     Score: 80.9167,
 *     CreateUser: 'lee',
 *     GroupName: 'aGroup',
 *   },
 * ]
 *
 */
export declare function getTAMScoreInfoByProjectId({ projectId, startDate, secretInfo, }: {
    projectId: number;
    startDate: string;
    secretInfo: SecretInfoType;
}): Promise<Array<any>>;

/**
 * 根据 groupIdList 获取汇总数据
 * @ignore
 * @param {object} options 配置
 * @param {string} options.date 日期，yyyyMMdd格式
 * @param {Array<number>} options.groupIdList groupId列表
 * @param {object} options.secretInfo 密钥信息
 * @param {string} options.secretInfo.apiKey apiKey
 * @param {string} options.secretInfo.loginName loginName
 * @param {Function} options.secretInfo.getPwdCode getPwdCode
 * @param {Function} options.secretInfo.encrypt encrypt
 * @returns {Promise<({ data: object, projectIdList: Array<number> })>} 汇总数据
 * @example
 * getTAMSummaryScoreByGroupIdList({
 *   groupIdList: [1,2,3],
 *   date: '20210106',
 *   secretInfo: {
 *     apiKey: '',
 *     loginName: '',
 *     getPwdCode() {},
 *     encrypt() {},
 *   }
 * }).then(resp => {
 *   console.log(resp)
 * })
 *
 * {
 *   data:
 *   [
 *     {
 *       ProjectName: '社区',
 *       PagePv: 99,
 *       PageError: 0,
 *       PageDuration: 1409.8333,
 *       StaticFail: 8,
 *       CreateTime: '',
 *       ProjectId: 123123,
 *       PageUv: 23,
 *       ApiNum: 521,
 *       ApiFail: 78,
 *       ApiDuration: 1813.3333,
 *       StaticNum: 1494,
 *       StaticDuration: 103.75,
 *       Score: 80.9167,
 *       CreateUser: 'lee',
 *       GroupName: 'aGroup',
 *     },
 *     {
 *       ProjectId: 123,
 *       // ...
 *     },
 *   ],
 *   projectIdList: [
 *     123123,
 *     123,
 *   ],
 * };
 *
 */
export declare function getTAMSummaryScoreByGroupIdList({ date, groupIdList, secretInfo, }: {
    date: string;
    groupIdList: Array<number>;
    secretInfo: SecretInfoType;
}): Promise<({
    data: Array<ScoreInfoType_2>;
    projectIdList: Array<number>;
})>;

/**
 * 获取 tar 库
 * tar 是一个用于处理 tar 压缩包的第三方库
 * @returns tar 库
 * @example
 * ```ts
 * const tar = getTar();
 * await tar.create({ file: 'out.tgz' }, ['src']);
 * ```
 */
export declare function getTar(): any;

/**
 * 用于获取用户信息，同时也可以用来校验 AccessToken 的有效性。
 * @example
 * ```ts
 * const info = await getTencentDocUserInfo({ accessToken: 'xxx' });
 * console.log(info);
 * // { ret: 0, msg: 'ok', data: { user_name: '...', avatar_url: '...' } }
 * ```
 */
export declare function getTencentDocUserInfo({ accessToken, }: {
    accessToken: string;
}): Promise<any>;

/**
 * 获取千分位分隔符
 * @param {string | number} value 输入数字
 * @returns {string} 处理后的数字
 *
 * @example
 *
 * getThousandSeparator('123123123')
 *
 * // => 123,123,123
 *
 * getThousandSeparator('12312312')
 *
 * // => 12,312,312
 */
export declare function getThousandSeparator(value: number | string): string;

/**
 * 获取千分位分隔符，处理数字之间有空格的情况
 * @param {string | number} value 输入数字
 * @returns {string} 处理后的数字
 *
 * @example
 * getThousandSeparator2('12345678 123456789')
 *
 * // => 12,345,678 123,456,789
 *
 */
export declare function getThousandSeparator2(value: number | string): string;

/**
 * 生成三阶段重命名配置（plus -> temp, key -> plus, temp -> key）
 * @param {string[]} rawList - 组件名列表，如 ['dialog', 'icon']
 * @param {string[]} [extraList=[]] - 额外需要重命名的组件名列表
 * @returns {{ renameConfig: Object, renameConfig2: Object, renameConfig3: Object }}
 * @example
 * ```ts
 * const { renameConfig, renameConfig2, renameConfig3 } = getThreeStageRenameConfig(['dialog', 'icon']);
 * // renameConfig:  { 'press-dialog-plus': '<random>', 'press-icon-plus': '<random>' }
 * // renameConfig2: { 'press-dialog': 'press-dialog-plus', 'press-icon': 'press-icon-plus' }
 * // renameConfig3: { '<random>': 'press-dialog', '<random>': 'press-icon' }
 * ```
 */
export declare function getThreeStageRenameConfig(rawList: string[], extraList?: string[]): {
    renameConfig: Record<string, string>;
    renameConfig2: Record<string, string>;
    renameConfig3: Record<string, string>;
};

/**
 * 获取某个时间戳距离今天的时间
 * @param {number} timestamp
 * @returns {string} 距离今天的时间描述
 * @example
 *
 * const date = new Date('2020-11-27 8:23:24').getTime();
 * getTimeAgo(date);
 * // 1个月前
 *
 * const date2 = new Date('2021-11-27 8:23:24').getTime();
 * getTimeAgo(date2);
 * // 10个月后
 */
export declare function getTimeAgo(timestamp: number): string;

/**
 * 功能：获取多久之前，若间隔超过一天，返回时刻描述
 * @param {number} timestamp 时间戳
 * @param {string} format 时间格式
 * @returns {string} 距离今天的时间描述或者时刻描述
 * @example
 *
 * getTimeAgoOrDate(Date.now() - 60 * 60 * 24 * 1 * 1000);
 * // 1天前
 *
 * const date = new Date('2018-07-13 17:54:01').getTime();
 * getTimeAgoOrDate(date);
 * // 7月13日17时54分
 */
export declare function getTimeAgoOrDate(time: string | number, format: string): string | null;

export declare function getTodayEndTimeStamp(unit?: string, endFlag?: string): number;

export declare function getTodayStartTimestamp(unit?: string): number;

export declare function getTSErrorFiles(options?: GetTSErrorFilesProps): TsErrorFile[];

declare type GetTSErrorFilesProps = {
    command?: string;
    root?: string;
};

export declare function getUniRouteName({ isNavigateBack, routerParams, }: {
    isNavigateBack?: boolean;
    routerParams?: Array<any>;
}): {
    from: string;
    to: string;
};

/**
 * 获取相对于过去数据的比例
 * @param {number} value 当前数据
 * @param {number} preValue 之前数据
 * @returns {string} 比例
 *
 * @example
 *
 * getUnitPreviousRatio(1, 0)
 * // +999+%
 */
export declare function getUnitPreviousRatio(value: number, preValue: number): string;

/**
 * 小程序中，获取页面对应的 url 链接
 * @param {string} baseLink 基础 URL
 * @return {string}
 * @example
 * ```ts
 * // 在当前页面中调用
 * getUrlInMP('https://example.com');
 * // 'https://example.com/pages/home/home?from=index'
 * ```
 */
export declare function getUrlInMP(baseLink: string): string;

/**
 * 获取 Url 参数
 * @param {string} paraName 参数 key
 * @param {string} search url search 部分
 * @returns paraValue
 * @example
 * getUrlPara('gender', '?gender=male&name=mike&feel=cold&age=18&from=test');
 * // => 'male'
 * @example
 * getUrlPara('from', '?gender=male&name=mike&feel=cold&age=18&from=test');
 * // => 'test'
 * @example
 * getUrlPara('age', '?gender=male&name=mike&feel=cold&age=18&from=test');
 * // => '18'
 * @example
 * // 不存在的 key 返回空字符串
 * getUrlPara('other', '?gender=male&name=mike&feel=cold&age=18&from=test');
 * // => ''
 * @example
 * // 未传 search 且环境不存在 location 时，返回空字符串
 * getUrlPara('other');
 * // => ''
 */
export declare function getUrlPara(paraName: string, search?: string): string;

/**
 * 根据用户 ID 获取工蜂用户信息
 *
 * 对应工蜂 API：GET /api/v3/users/:id
 *
 * 应用场景：Webhook payload 中 `author.username` 可能不是标准 RTX，
 * 此时可以通过 `author_id` 反查拿到准确的 username。
 *
 * @param {object} options 输入配置
 * @param {number | string} options.userId 用户 ID
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<TGitUser | null>} 用户信息，失败或缺字段返回 null
 * @example
 *
 * getUserById({
 *   userId: 12345,
 *   privateToken: 'xxxxx',
 * }).then((user) => {
 *   console.log(user?.username);
 * })
 */
export declare function getUserById({ userId, privateToken, baseUrl, }: {
    userId: number | string;
    privateToken: string;
    baseUrl?: string;
}): Promise<TGitUser | null>;

/**
 * 获取用户组件演示数据
 * 返回包含头像和昵称的用户信息对象，用于组件演示
 * @returns 用户信息对象
 * @returns {string} avatar - 用户头像 URL
 * @returns {string} nick - 用户昵称
 * @example
 * ```ts
 * const user = getUserComponentDemo();
 * console.log(user.avatar); // 'https://...'
 * console.log(user.nick); // '杨'
 * ```
 */
export declare function getUserComponentDemo(): {
    avatar: string;
    nick: string;
};

/**
 * 根据用户名（英文名 / RTX）获取工蜂用户信息
 *
 * 对应工蜂 API：GET /api/v3/users?search=:username
 * 搜索接口可能返回多条结果，本函数会精确匹配 `username`，不命中返回 null。
 *
 * @param {object} options 输入配置
 * @param {string} options.username 用户名
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<number | null>} 用户 ID
 * @example
 *
 * getUserIdByUsername({
 *   username: 'novlan1',
 *   privateToken: 'xxxxx',
 * }).then((userId) => {
 *   console.log(userId); // 未命中返回 null
 * })
 */
export declare function getUserIdByUsername({ username, privateToken, baseUrl, }: {
    username: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<number | null>;

/**
 * 获取 Node.js 的 util 模块
 * 这样可以避免在浏览器环境中直接导入 util 模块导致的错误
 * @returns util 模块
 * @example
 * ```ts
 * const util = getUtil();
 * console.log(util.format('%s + %s = %s', 1, 2, 3)); // '1 + 2 = 3'
 *
 * const promisify = util.promisify(fs.readFile);
 * const data = await promisify('./a.txt', 'utf-8');
 * ```
 */
export declare function getUtil(): typeof UtilType;

/**
 * 获取可用的端口号
 * 从指定端口开始检测，如果端口被占用则自动尝试下一个端口，直到找到可用端口
 * @param port - 起始端口号
 * @returns {Promise<number>} - 返回可用的端口号
 * @example
 * ```ts
 * // 从 3000 端口开始查找可用端口
 * getValidPort(3000).then(port => {
 *   console.log(`可用端口: ${port}`);
 * });
 * ```
 */
export declare function getValidPort(port: number): Promise<unknown>;

export declare const getVisibilityChangeMixin: (showCallback?: Function, hiddenCallback?: Function) => {
    mounted(): void;
    destroyed(): void;
    methods: {
        _watchVisibleChange(): void;
    };
};

/**
 * 获取 vue-lazyload 插件参数
 * @param options 选项
 * @returns 插件参数
 * @example
 * ```ts
 * import Vue from 'vue';
 * import VueLazyload from 'vue-lazyload';
 * import { getVLazyOptions } from 't-comm';
 *
 * Vue.use(VueLazyload, getVLazyOptions({
 *   loadingImg: '/loading.png',
 *   errorImg: '/error.png',
 * }));
 * ```
 */
export declare function getVLazyOptions(options?: {
    loadingImg?: string;
    errorImg?: string;
}): {
    preLoad: number;
    attempt: number;
    filter: {
        loading(listener: any): void;
        error(listener: any): void;
        https(listener: any): void;
        compress(listener: any): void;
        cdn(listener: any): void;
        stopBeforeLoad(listener: any): void;
    };
    adapter: {
        error(listener: any): void;
    };
};

/**
 * 获取 vue 库
 * vue 是一个用于构建用户界面的渐进式框架
 * @returns vue 库
 * @example
 * ```ts
 * const Vue = getVue();
 * const app = Vue.createApp({});
 * ```
 */
export declare function getVue(): any;

/**
 * 获取深圳天气信息，可用于通过机器人发送到群聊
 * @returns {object} 天气信息和是否有变化
 * @example
 *
 * getWeatherRobotContent().then(resp => {
 *   const { content, isSame } = resp
 *
 *   console.log(content)
 *   // ## 深圳当前正在生效的预警如下
 *   // ...
 *
 *   console.log(isSame)
 *   // false
 * })
 */
export declare function getWeatherRobotContent(): Promise<{
    content: string;
    isSame: boolean;
}>;

/**
 * @see [企业微信自助入群工具](https://iwiki.woa.com/p/541885852#%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E8%87%AA%E5%8A%A9%E5%85%A5%E7%BE%A4%E5%B7%A5%E5%85%B7)
 * https://nops.woa.com/pigeon/v1/tools/add_chat?chatId=群会话ID
 * @example
 * ```ts
 * getWxWorkAddChatLink('xxx-chat-id');
 * // 'https://nops.woa.com/pigeon/v1/tools/add_chat?chatId=xxx-chat-id'
 * ```
 */
export declare function getWxWorkAddChatLink(chatId: string): string;

/**
 * @example
 * ```ts
 * getWxWorkMessageLink('novlan1')
 * // => https://github.com/novlan1
 * ```
 */
export declare function getWxWorkMessageLink(rtx: string): string;

/**
 * 获取 xlsx 库
 * xlsx 是一个用于处理 Excel 文件的第三方库
 * @returns xlsx 库
 * @example
 * ```ts
 * const XLSX = getXlsx();
 * const workbook = XLSX.readFile('data.xlsx');
 * ```
 */
export declare function getXlsx(): typeof XLSX;

export declare function getYesterdayEndTimeStamp(unit?: string, endFlag?: string): number;

export declare function getYesterdayStartTimeStamp(unit?: string): number;

/**
 * 获取构建产物目录的 zip 压缩后体积，跨平台兜底。
 *
 * 估算策略：
 * 1) 优先调用系统 `zip` 命令打成真实 zip 包，删除后返回字节数（最准）
 * 2) 不可用时，降级为 `zlib.gzipSync` 逐文件累加（估算值，比真实 zip 略大，因为没有共享字典）
 * 3) 仍失败则返回 `{ zipSize: null, zipMethod: 'none' }`
 *
 * Windows 默认没有 `zip` 命令，会自动降级到 gzip-sum，无需额外配置。
 *
 * @example
 * ```ts
 * import { getZipSize } from 't-comm';
 *
 * const { zipSize, zipMethod } = getZipSize({ outputDir: '/path/to/dist' });
 * console.log(zipSize, zipMethod); // 1234567 'zip'
 * ```
 */
export declare function getZipSize(options: IGetZipSizeOptions): IZipSizeResult;

/**
 *
 * GID 映射表
 *
 * |  名称  |  游戏  |
 * |  ---  |  ---  |
 * |  GAME_LIFE  |  游戏人生  |
 * |  GAME_PVP  |  王者荣耀  |
 * |  GAME_GP  |  和平精英  |
 * |  GAME_HLDDZ  |  欢乐斗地主  |
 * |  GAME_MAJIANG  |  欢乐麻将  |
 * |  GAME_LOLM  |  英雄联盟手游  |
 * |  GAME_NBA  |  最强 NBA  |
 * |  GAME_SJJQ  |    神角技巧  |
 * |  GAME_LMJX  |  黎明觉醒  |
 * |  GAME_TY  |  天涯明月刀手游  |
 * |  GAME_TLBB  |  天龙八部手游  |
 * |  GAME_CF  |  穿越火线  |
 * |  GAME_LOL  |  英雄联盟  |
 * |  GAME_CFM  |  穿越火线-枪战王者  |
 * |  GAME_X5M  |  QQ炫舞手游  |
 * |  GAME_TXGD  |  腾讯掼蛋  |
 * |  GAME_SHANHAI  |  妄想山海  |
 * |  GAME_JCC  |  金铲铲之战  |
 * |  GAME_HYRZ  |  火影忍者手游  |
 *
 * @example
 * ```ts
 * import { GID_MAP } from 't-comm/es/constant/gid';
 *
 * console.log(GID_MAP.GAME_PVP);   // 331（王者荣耀）
 * console.log(GID_MAP.GAME_LOLM);  // 425（英雄联盟手游）
 * ```
 */
export declare const GID_MAP: {
    readonly GAME_LIFE: 100;
    readonly GAME_PVP: 331;
    readonly GAME_GP: 411;
    readonly GAME_HLDDZ: 323;
    readonly GAME_MAJIANG: 304;
    readonly GAME_LOLM: 425;
    readonly GAME_NBA: 406;
    readonly GAME_SJJQ: 460;
    readonly GAME_LMJX: 428;
    readonly GAME_TY: 281;
    readonly GAME_TLBB: 396;
    readonly GAME_CF: 2;
    readonly GAME_LOL: 26;
    readonly GAME_CFM: 333;
    readonly GAME_X5M: 507;
    readonly GAME_TXGD: 508;
    readonly GAME_SHANHAI: 429;
    readonly GAME_JCC: 461;
    readonly GAME_HYRZ: 334;
};

export declare namespace GitTypes {
    export {
        IGitCommitInfo
    }
}

/** 构建期注入的全局变量 key：项目通过 globalThis[__COCOS_BUILD_NETWORK_ENV__] 设置默认环境 */
export declare const GLOBAL_BUILD_ENV_KEY = "__COCOS_BUILD_NETWORK_ENV__";

export declare const globalEBus: EventBus;

export declare const GRAY_PUBLISH_OPERATION: {
    FIRST_GRAY_PUBLISH: string;
    UPDATE_GRAY_PERCENT: string;
    PUBLISH_ALL_GRAY: string;
    RECALL_ALL_GRAY: string;
};

export declare const GRAY_PUBLISH_TITLE_MAP: {
    [x: string]: string;
};

/**
 /**
 * 处理图片尺寸单位，将 px/rem 转换为纯数字
 * @docgen
 * @function handleImgUnit
 *
 * @param {number|string} size - 输入的尺寸值
 * @return {number} 返回处理后的数值（px）
 *
 * @description
 * 该函数用于处理图片尺寸，去除单位（px/rem）并转换为数字类型。
 * - 纯数字：直接返回
 * - px 单位：去除 'px' 后返回数字
 * - rem 单位：乘以根元素的 fontSize 转换为 px 值
 *
 * @example
 *
 * handleImgUnit(3);        // 3
 * handleImgUnit('10');     // 10
 * handleImgUnit('30px');   // 30
 *
 * // 假设 document.documentElement.style.fontSize = '50px'
 * handleImgUnit('5rem');   // 250
 *
 * // 假设 document.documentElement.style.fontSize = '10px'
 * handleImgUnit('5rem');   // 50
 */
export declare const handleImgUnit: (size: number | string) => string | number | undefined;

/**
 * 处理 QQ 登录返回：提取票据并写入 storage
 *
 * 通常在 App.onShow 中调用：
 * ```ts
 * onShow(options => {
 *   const ticket = handleQQLoginOnShow(options);
 *   if (ticket) {
 *     // 用 ticket 调 queryQQLoginUserInfo
 *   }
 * });
 * ```
 *
 * @param options App.onShow 回调参数
 * @param config 配置（QQ 小程序 appId / 自定义 storage / storage key）
 * @returns 提取到的票据信息，若非 QQ 登录回调或失败则返回 undefined
 */
export declare function handleQQLoginOnShow(options: QQOnShowOptions | undefined | null, config: HandleQQLoginOnShowOptions): QQTicketInfo | undefined;

/**
 * handleQQLoginOnShow 的入参
 */
export declare interface HandleQQLoginOnShowOptions {
    /** 腾讯 QQ 小程序 appId，默认 wx26da53d900421226 */
    qqMpAppId?: string;
    /** 自定义 storage，默认使用 wx.setStorageSync */
    storage?: QQStorageLike;
    /**
     * 票据写入的 storage key
     *
     * **重要**：必须与业务方的 loginInfo（cocos `loginMp` 写入的 logininfo）所用 key 区分开，
     * 否则票据会把已有的登录态覆盖掉。建议使用形如 `${loginInfoStorageKey}__qq_ticket` 的独立 key。
     */
    storageKey: string;
}

export declare const hsl2hsv: (hue: number, sat: number, light: number) => {
    h: number;
    s: number;
    v: number;
};

export declare const hsv2hsl: (hue: number, sat: number, val: number) => number[];

/**
 * Converts an HSV color value to RGB.
 * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100].
 * *Returns:* { r, g, b } in the set [0, 255]
 * @example
 * ```ts
 * hsv2rgb(0, 0, 0);
 * // { r: 0, g: 0, b: 0 }
 *
 * hsv2rgb(0, 0, 100);
 * // { r: 255, g: 255, b: 255 }
 *
 * hsv2rgb(83.75, 20.34, 92.55);
 * // { r: 217, g: 236, b: 188 }
 * ```
 */
export declare function hsv2rgb(h: number, s: number, v: number): {
    r: number;
    g: number;
    b: number;
};

/**
 * 驼峰命名转横线命名：拆分字符串，使用 - 相连，并且转换为小写
 * @param {string} str 输入字符串
 * @returns {string} 处理后的字符串
 *
 * @example
 *
 * hyphenate('abCd')
 *
 * // => ab-cd
 *
 */
export declare function hyphenate(str: string): string;

declare type IAddedMap = Record<string, Array<string>>;

/**
 * Aegis 上报专用：响应数据拦截器
 *
 * - 业务：在「响应拦截器链」里加本拦截器，把 request / response / 耗时 一次性上报
 * - 必须配合 `AegisStartTimeInterceptor`（请求打点）一起使用，否则 duration 始终为 0
 *
 * 上报字段（透传给业务注入的 report 回调）：
 *   - url        请求完整 URL（已拼 baseUrl）
 *   - method     HTTP method
 *   - status     HTTP 状态码
 *   - ret        业务返回码 r（已被 NormalizeResponseRetInterceptor 归一化）
 *   - requestBody   请求体（JSON.stringify + 截断）
 *   - responseData  响应 data（JSON.stringify + 截断）
 *   - responseHeader 响应头（完整对象，截断总长）
 *   - duration   耗时 ms
 *   - ok         是否 2xx
 *   - isAbort    是否被业务中断（链中其他拦截器 abort=true）
 *
 * 截断策略：
 *   - `truncateSize` 控制单项 JSON 序列化后最大字符数（默认 1000 字符），防 aegis 单条日志过大
 *   - `truncateSize <= 0` 表示不截断（业务方自己控制）
 *   - 截断发生在「序列化后」用 `slice(0, size) + '...(truncated)'` 标记，不破坏原始 data
 *
 * 异常处理：
 *   - 上报回调内部异常被 try/catch 吃掉，不影响主链路
 *   - aegis.reportEvent 失败不会影响业务响应
 *
 * 位置建议：
 *   - 放在 `NormalizeResponseRetInterceptor` 之后、`GetDataInterceptor` 之前
 *   - 这样 `r` / `msg` 已被归一化，data 还能继续走 GetData 拆包
 */
export declare interface IAegisReportInfo {
    /** 完整请求 URL（已拼 baseUrl） */
    url: string;
    /** HTTP method */
    method: string;
    /** HTTP 状态码（2xx / 4xx / 5xx） */
    status: number;
    /** 业务返回码 r（已被归一化） */
    ret: number | null;
    /** 请求体 */
    requestBody: Record<string, any>;
    /** 响应 data */
    responseData: Record<string, any>;
    /** 响应 header */
    responseHeader: Record<string, any>;
    /** 耗时 ms（基于 AegisStartTimeInterceptor 注入的 __aegisStartTime） */
    duration: number;
    /** 是否 2xx */
    ok: boolean;
    /** 是否被其他拦截器 abort（业务错误） */
    isAbort: boolean;
    /** 异常 msg（如果 data.msg 存在） */
    msg?: string;
}

/** aegisReport 选项：透传到 AegisReportInterceptor */
export declare interface IAegisReportOption {
    /**
     * 业务注入的上报回调。
     *
     * 形如：
     * ```ts
     * aegisReport: {
     *   report: (info) => aegis.infoAll({
     *     msg: `${info.method} ${info.url} ret=${info.ret} dur=${info.duration}ms`,
     *     ext1: info.requestBody,
     *     ext2: info.responseData,
     *     ext3: `${info.status} | ${info.responseHeader}`,
     *     duration: info.duration,
     *   }),
     *   truncateSize: 1000,
     * }
     * ```
     */
    report: (info: IAegisReportInfo) => void;
    /**
     * 单项 JSON 序列化后最大字符数，默认 1000。<=0 不截断。
     * 超过会在末尾追加 `...(truncated, total N)` 标记。
     */
    truncateSize?: number;
}

export declare interface IAegisReportOptions {
    /**
     * 业务注入的上报回调（必填）。
     *
     * 形如：
     * ```ts
     * aegisReport: (info) => {
     *   aegis.infoAll({
     *     msg: `${info.method} ${info.url} ret=${info.ret} dur=${info.duration}ms`,
     *     ext1: info.requestBody,
     *     ext2: info.responseData,
     *     ext3: `${info.status} | ${info.responseHeader}`,
     *     duration: info.duration,
     *   });
     * }
     * ```
     */
    report: (info: IAegisReportInfo) => void;
    /**
     * 单项序列化后最大字符数，默认 1000。<=0 不截断。
     */
    truncateSize?: number;
}

declare interface IAppInfo {
    name: string;
    version: string;
    homepage?: string;
    bugs?: {
        url: string;
    };
    repository?: {
        url: string;
    };
}

/**
 * checkAuditResult 的审核结果信息
 */
declare interface IAuditResultInfo {
    /** 审核状态：PROCESS 通过 / ABORT 驳回 */
    status: string;
    /** 审核人 */
    reviewer: string;
    /** 审核意见 */
    suggest: string;
    /** 构建链接 */
    bkBuildUrl: string;
}

declare type IBaseLaunchParams = {
    context?: any;
    qrCodeLib?: any;
    dialogHandler?: any;
    otherDialogParams?: Record<string, any>;
    launchParams?: Record<string, any>;
    wxJSLink?: string;
    env?: Record<string, boolean>;
};

declare type IBrowser = any;

/**
 * buildAuditContent 的参数
 */
declare interface IBuildAuditContentOptions {
    /** 审核标题，如 '【H5发布审核】' */
    title: string;
    /** 项目名，传空或不传时不展示项目行 */
    projectName?: string;
    /** 发起人 rtx */
    creator: string;
    /** 审核人原始字符串，逗号分隔 */
    auditor: string;
    /** 构建链接 */
    buildUrl: string;
    /** 差异化的额外行，如子工程、分支、灰度比例等 */
    extraLines?: string[];
}

declare interface ICanvas extends HTMLCanvasElement {
    dpi: number;
}

/**
 * checkAuditResult 的参数
 */
declare interface ICheckAuditResultOptions {
    /** 审核结果信息 */
    resultInfo: IAuditResultInfo;
    /** 通知标题，如 '【H5发布】' '【组件库发布】' */
    title: string;
    /** 差异化的通知内容行（项目名、子工程、分支等） */
    contentLines: string[];
    /** 发起人 rtx */
    creator: string;
    /** 审核描述 */
    auditDesc: string;
    /** 企微机器人 webhook key */
    webhookUrl: string;
}

/** 加密能力接口，业务方注入（通常基于 crypto-js 实现） */
export declare interface ICocosFangshuaCrypto {
    /** 计算 MD5，返回 hex 字符串 */
    md5: (data: string) => string;
    /**
     * AES-CBC 解密
     * @param key 密钥（MD5 hex 字符串）
     * @param encryptedHex 密文（hex 字符串）
     * @param iv 初始化向量（明文字符串）
     * @returns 解密后的明文字符串
     */
    aesDecrypt: (key: string, encryptedHex: string, iv: string) => string;
}

export declare interface ICocosFangshuaOptions {
    /** 登录态存储（与 CocosLoginInfoParamInterceptor 共用同一个 storage） */
    storage: ICocosLoginInfoStorage;
    /** 存储登录态的 key，默认 cocos_login_info */
    storageKey?: string;
    /** 获取防刷时间戳（后台 GetTs 接口返回的 ts） */
    getTs: () => string | undefined;
    /** 获取防刷加密数据（后台 GetTs 接口返回的 encryptData） */
    getEncryptData: () => string | undefined;
    /**
     * 加密能力注入（必填）
     *
     * 业务方基于 crypto-js 实现示例：
     * ```ts
     * import 'crypto-js/md5';
     * import 'crypto-js/aes';
     * import 'crypto-js/enc-utf8';
     * import 'crypto-js/enc-hex';
     * import 'crypto-js/enc-base64';
     * import 'crypto-js/pad-pkcs7';
     * import 'crypto-js/cipher-core';
     * import * as CryptoJS from 'crypto-js/core';
     *
     * const crypto: ICocosFangshuaCrypto = {
     *   md5: (data) => CryptoJS.MD5(data).toString(),
     *   aesDecrypt: (key, encryptedHex, iv) => {
     *     const hexStr = CryptoJS.enc.Hex.parse(encryptedHex);
     *     const srcs = CryptoJS.enc.Base64.stringify(hexStr);
     *     const decrypt = CryptoJS.AES.decrypt(srcs, CryptoJS.enc.Utf8.parse(key), {
     *       iv: CryptoJS.enc.Utf8.parse(iv),
     *       mode: CryptoJS.mode.CBC,
     *       padding: CryptoJS.pad.Pkcs7,
     *     });
     *     return decrypt.toString(CryptoJS.enc.Utf8);
     *   },
     * };
     * ```
     */
    crypto: ICocosFangshuaCrypto;
    /** 判断当前是否为测试环境（可选，用于 mock 检测） */
    isTestEnv?: () => boolean;
    /** 是否打印调试日志，默认 false */
    debug?: boolean;
}

/** 登录态存储接口（业务方注入，用 wx.getStorageSync 封装即可） */
export declare interface ICocosLoginInfoStorage {
    get: (key: string) => any;
    set: (key: string, value: any) => void;
    /** 删除指定 key（可选，业务方自定义 storage 未实现时回退到 set(key, null)） */
    removeItem?: (key: string) => void;
}

declare interface ICosInfo {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    dir: string;
}

declare interface ICosMeta {
    Key: string;
    LastModified: Date | string;
}

export declare interface ICyclomaticComplexityStatisticsInfo {
    fileTotal: number;
    funcTotal: number;
    cnnTotal: number;
    avgCNN: number;
    avgNLOC: number;
    avgToken: number;
    avgParameter: number;
    locTotal: number;
    nLocTotal: number;
    tokenTotal: number;
    parameterTotal: number;
    less5Length: number;
    between5And10Length: number;
    between10And15Length: number;
    between15And20Length: number;
    between20And25Length: number;
    between25And30Length: number;
    between30And35Length: number;
    greater35Length: number;
    parameterLadders: number[];
    nlocLadders: number[];
}

/**
 * 装饰器：包装整个 request Promise，用于做重试、限流、调度等横切逻辑
 * 需要自己决定调用 request() 的时机和次数
 */
declare type IDecorator = (request: () => Promise<any>, param: IRawRequest) => Promise<any>;

declare type IDeps = Record<string, Array<string>>;

declare type IEnv = {
    isWeixin: boolean;
    isWorkWeixin: boolean;
    isQQ: boolean;
    isPvpApp: boolean;
    isTipApp: boolean;
    isAndroid: boolean;
    isIos: boolean;
    isIOS: boolean;
    isMsdk: boolean;
    isMsdkX: boolean;
    isMsdkV5: boolean;
    isSlugSdk: boolean;
    isInGame: boolean;
    isGHelper: boolean;
    isGHelper20004: boolean;
    isMiniProgram: boolean;
    isLolApp: boolean;
    isWindowsPhone: boolean;
    isSymbian: boolean;
    isPc: boolean;
};

export declare interface IEnvSwitcher {
    /** 当前环境 */
    getEnv(): Env;
    /** 当前环境对应的域名（不带协议） */
    getDomain(): string;
    /** 当前环境对应的 baseUrl（含 https://） */
    getBaseUrl(): string;
    /**
     * 切换环境。autoRestart 不传时取构造时配置（默认 true）。
     * 非法 env 会被忽略并打 warn。
     */
    setEnv(env: Env, autoRestart?: boolean): void;
    isTestEnv(): boolean;
}

export declare interface IEnvSwitcherOptions {
    /** 各环境对应的服务端域名（不带协议、不带末尾斜杠） */
    svrdomain: EnvDomainMap;
    /** 持久化 key，默认 'pmd_api_cocos_env' */
    storageKey?: string;
    /** 自定义存储（默认 cocos sys.localStorage → 浏览器 localStorage → 内存） */
    storage?: ICocosLoginInfoStorage;
    /** 切换时是否自动重启（restartMiniProgram / location.reload），默认 true */
    autoRestart?: boolean;
    /**
     * 全局 setter 函数名，默认 '__pmdSetEnv__'。传 false 关闭挂载。
     * 会优先挂到 wx 上（如 wx.__pmdSetEnv__），没有 wx 时回退到 globalThis。
     */
    globalSetEnvName?: string | false;
    /**
     * 全局 getter 函数名，默认 '__pmdGetEnv__'。传 false 关闭挂载。
     * 会优先挂到 wx 上（如 wx.__pmdGetEnv__），没有 wx 时回退到 globalThis。
     */
    globalGetEnvName?: string | false;
    /** 切换成功后回调（持久化已完成、重启之前） */
    onChange?: (next: Env, prev: Env) => void;
}

/**
 * `formatBite` 入参（可选）
 */
declare interface IFormatBiteOptions {
    /** 数值与单位之间是否加空格，默认 false（原行为） */
    space?: boolean;
    /** 保留小数位数，默认 2 */
    fixed?: number;
}

/**
 * getAuditor 的参数
 */
declare interface IGetAuditorOptions {
    /** 审核类型：'rainbow' | 'json' | 'static' */
    type: 'rainbow' | 'json' | 'static';
    /**
     * 审核配置数据源（rainbow 和 json 模式需要）
     * - 传入 string：作为配置文件路径，同步读取
     * - 传入函数：异步获取配置数据
     * @type {string | Function}
     */
    configSource?: string | (() => Promise<Record<string, any>>);
    /** rainbow 模式的额外参数 */
    rainbowOptions?: IRainbowAuditorOptions;
    /** json 模式的额外参数 */
    jsonOptions?: IJsonAuditorOptions;
    /** 静态审核人列表（static 模式） */
    staticAuditorList?: string[];
    /** 是否跳过审核（例如非生产环境或由参数控制） */
    skipAudit?: boolean;
}

/**
 * getAuditor 的返回值
 */
declare interface IGetAuditorResult {
    /** 审核人，逗号分隔 */
    auditor: string;
    /** 是否需要审核 */
    shouldAudit: boolean;
}

export declare type IGetWxSignaturePromise = () => Promise<{
    wxappid?: string;
    timestamp?: string;
    noncestr?: string;
    signature?: string;
}>;

/**
 * `getZipSize` 入参
 */
export declare interface IGetZipSizeOptions {
    /** 产物目录绝对路径（必填） */
    outputDir: string;
    /**
     * 已采集到的产物文件相对路径列表（来自 `outputDir` 的相对路径）。
     * 仅在 `gzip-sum` 降级分支使用；不传时降级分支会自行递归 `outputDir`。
     */
    files?: Array<{
        name: string;
    }>;
    /** zip 模式下要排除的 glob 模式，默认 `['*.map']`（sourcemap） */
    excludeGlobs?: string[];
    /** gzip 兜底分支是否同样跳过 sourcemap，默认 `true` */
    excludeMapInGzip?: boolean;
    /** zip 命令所在路径，默认 `'zip'`（依赖 PATH） */
    zipBin?: string;
}

export declare type IGitCommitInfo = {
    author: string;
    message: string;
    hash: string;
    date: string;
    timeStamp: string;
    branch: string;
};

/**
 * 一站式 git 仓库信息（贴近 CI / 构建上报场景的完整字段）
 */
export declare interface IGitFullInfo {
    /** 项目标识，如 `pmd-mobile/pixui/pubgm-official`（remoteUrl 解析失败时为 null） */
    project: string | null;
    /** 原始 remote URL */
    remoteUrl: string | null;
    /** 当前分支 */
    branch: string | null;
    /** 最近一次提交 sha（40 位） */
    commitSha: string | null;
    /** 最近一次提交作者姓名 */
    authorName: string | null;
    /** 最近一次提交作者邮箱 */
    authorEmail: string | null;
    /** 当前 git 登录用户名（仓库级优先 → 全局） */
    userName: string | null;
    /** 当前 git 登录用户邮箱 */
    userEmail: string | null;
    /** user.name / user.email 来源 */
    userScope: 'local' | 'global' | 'none';
}

export declare type IGlobalGrayPublishConfig = Record<string, Record<string, string>>;

/** 项目组详情（含 projects / sub_projects） */
export declare interface IGroupDetail extends IGroupInfo {
    projects: IGroupProject[];
    sub_projects: IGroupProject[];
}

/** 项目组基本信息（列表接口返回） */
export declare interface IGroupInfo {
    id: number;
    name: string;
    path: string;
    description: string;
    avatar_url: string;
    full_name: string;
    full_path: string;
    web_url: string;
    parent_id: number | null;
    [k: string]: any;
}

export declare interface IGroupProject {
    id: number;
    name: string;
    path_with_namespace: string;
    archived: boolean;
    last_activity_at: string;
    [k: string]: any;
}

export declare interface IGroupProjectFilter {
    /** 自定义过滤函数，返回 true 表示保留 */
    filterFn?: (project: IGroupProject) => boolean;
    /** 需要排除的路径前缀列表，如 ['pmd-mobile/test/'] */
    excludePathPrefixes?: string[];
    /** 是否过滤已归档仓库，默认 true（过滤掉已归档的） */
    excludeArchived?: boolean;
    /** 最后活跃时间不早于此日期（ISO 字符串或 Date），早于此时间的仓库将被过滤 */
    lastActivityAfter?: string | Date;
}

declare type IHumpObject = Record<string, any> | Array<any>;

export declare type IImportItem = string | Array<string> | {
    sourceName?: string;
    sourceType?: IImportType;
    targetName?: string;
    targetType?: IImportType;
};

export declare enum IImportType {
    ImportSpecifier = "ImportSpecifier",
    ImportDefaultSpecifier = "ImportDefaultSpecifier",
    importNamespaceSpecifier = "ImportNamespaceSpecifier",
    FAKE = "FAKE"
}

export declare interface IInitCocosNetworkOptions {
    /**
     * 多环境域名配置（必填，breaking change）。
     *
     * 例：
     * ```ts
     * network: {
     *   svrdomain: {
     *     test: 'atest.igame.qq.com',
     *     prod: 'igame.qq.com',
     *   },
     * }
     * ```
     * 域名不要带协议，也不要带末尾斜杠。
     */
    network: {
        svrdomain: EnvDomainMap;
    };
    /**
     * 登录接口路径（必填，breaking change）。
     * 内部会拼接为 `https://{svrdomain[env]}{loginPath}`。
     * 例如 '/v2/login/code'。
     */
    loginPath?: string;
    /**
     * 登录接口路径
     * 优先级更高，防止 loginPath 的 domain 与 network.svrdomain 不一致
     * 如 https://atest.igame.qq.com/pmdtrpc.commcgi.user.user/QueryUserInfo
     */
    loginUrl?: string;
    /**
     * 环境持久化存储 key，默认 'pmd_api_cocos_env'。
     */
    envStorageKey?: string;
    /**
     * 切换环境后是否自动重启（restartMiniProgram / location.reload），默认 true。
     */
    envAutoRestart?: boolean;
    /**
     * 全局调试函数名（挂到 globalThis 上）。
     *   - 默认 '__pmdSetEnv__' / '__pmdGetEnv__'
     *   - 传 false 可关闭挂载
     */
    globalSetEnvName?: string | false;
    globalGetEnvName?: string | false;
    /** 小游戏 appid（必填） */
    appid: string;
    /** 登录平台类型，默认 3（微信小游戏） */
    platform?: number;
    /** 登录类型 _ltype，默认 tiploginwxproc */
    ltype?: string;
    /**
     * 登录态存储（可选）
     * 默认使用 Cocos 的 `sys.localStorage`（getItem/setItem/removeItem）封装，
     * 业务如需自定义（如真机用 wx.getStorageSync）可自行传入。
     */
    storage?: ICocosLoginInfoStorage;
    /** 存储 key，默认 cocos_login_info */
    storageKey?: string;
    /**
     * 无登录态时获取 wx.code 的方法（可选）
     * 默认使用 `wx.login`；在 `wx` 不存在的环境下返回空 code。
     */
    getLoginCode?: () => Promise<{
        code: string;
    }>;
    /** loginInfo 更新回调（可选，便于业务侧刷新 UI 或同步到 AuthService 等） */
    onLoginInfo?: (info: LoginInfo) => void;
    /**
     * 「访问被拒」回调（可选，强烈推荐注入）
     *
     * 触发时机：后端返回 `r=100006`（ACCESS_DENIED_RET）时由 `NormalizeResponseRetInterceptor` 调用。
     * 常见场景：测试环境白名单 / 黑名单 / 风控等。
     *
     * 框架层会同时把响应 `msg` 置空（避免兜底 toast 抢先弹），由业务方决定后续动作：
     *   - 打开 H5 申请页（推荐，通过 `wx.openUrl` / `wx.navigateTo` 等）
     *   - 弹 `wx.showModal` 告知用户
     *   - 直接 `wx.restartMiniProgram()` 重启小游戏
     *
     * 实现要求：
     *   - 可同步可异步；框架层不阻塞响应链
     *   - 内部异常由框架 try/catch 兜住，不会影响业务方后续业务流
     *   - **不要在这里再次 throw 出 ret=100006**，上层（AccountService / PlayerService 等）
     *     仍会按正常失败路径派发 `LoginFail` 等事件，由业务方在 `catch` 中识别
     *     `r === 100006` 后跳过对应的「切号失败 / 网络异常」toast
     */
    onAccessDenied?: (info: IResponseInterceptorParam) => void | Promise<void>;
    /**
     * 防刷配置（可选）
     * 传入后会在请求拦截器链末尾自动加上防刷签名拦截器。
     * 需要业务方提前调用 GetTs 接口获取加密参数。
     */
    fangshua?: {
        /** 获取防刷时间戳（后台 GetTs 接口返回的 ts） */
        getTs: () => string | undefined;
        /** 获取防刷加密数据（后台 GetTs 接口返回的 encryptData） */
        getEncryptData: () => string | undefined;
        /** 加密能力注入（MD5 + AES 解密），业务方基于 crypto-js 实现 */
        crypto: ICocosFangshuaCrypto;
    };
    /**
     * 接入 aegis（伽利略）监控：自动把每个请求的 url / method / 请求体 / 响应 data / 响应 header / 耗时
     * 上报到注入的回调。
     *
     * 接入后框架层会：
     *   1. 在请求拦截器链最前加 `AegisStartTimeInterceptor`（打点）
     *   2. 在响应拦截器链 NormalizeResponseRet 之后、GetData 之前加 `AegisReportInterceptor`
     *
     * 注意：
     *   - 上报是**附加**行为，不会影响主响应链；回调内部异常被框架吞掉
     *   - 响应 data / header 都会做 JSON 序列化 + 截断（默认 1000 字符），避免 aegis 单条日志过大
     *   - doRequest 网络层失败（wx.request fail）**不会**进响应拦截器，需要业务自己再补一层；
     *     本接口当前只覆盖 HTTP 拿到响应的情况
     *
     * @example
     * ```ts
     * aegisReport: {
     *   report: (info) => {
     *     aegis.infoAll({
     *       msg: `${info.method} ${info.url} ret=${info.ret} dur=${info.duration}ms`,
     *       ext1: info.requestBody,
     *       ext2: info.responseData,
     *       ext3: `${info.status} | ${info.responseHeader}`,
     *       duration: info.duration,
     *     });
     *   },
     * }
     * ```
     */
    aegisReport?: IAegisReportOption;
}

declare type IJSDocOptions = {
    docsPath?: string;
    author?: string;
    extraCss?: string;
    extraScript?: string;
    navHandler?: Function;
    isHandleNav?: boolean;
};

/**
 * json 模式的额外参数
 */
declare interface IJsonAuditorOptions {
    /** 项目名 */
    projectName: string;
    /** 配置 key（如 versionType） */
    key: string;
}

declare type ILocalConfig = Array<{
    key: string;
    value: string;
}>;

declare type IMeta = {
    rawPath?: Array<string>;
};

declare interface IMorsePwd {
    pwd: Array<number>;
    cb: Function;
    quiet?: boolean;
    holdTime?: number;
    envType: 'H5' | 'h5' | 'mp' | 'MP';
    selector?: keyof HTMLElementTagNameMap;
}

/**
 * 函数实现时的参数类型（联合类型）
 *
 * @example
 * ```ts
 * type ImplArgs = ImplementationArgs<ShowDialogParams, ['content', 'title']>;
 * // 结果: [ShowDialogParams] | [string, string?]
 * ```
 */
export declare type ImplementationArgs<T, K extends readonly (keyof T)[]> = [T] | ParamsToTuple<T, K>;

export declare function importI18nDict({ projectId, moduleCode, versionCode, accessToken, data, }: {
    projectId: string;
    moduleCode?: string;
    versionCode?: string;
    accessToken: string;
    data: object;
}): Promise<unknown>;

declare interface INetworkEngineOptions {
    requestInterceptors: IRequestInterceptor[];
    responseInterceptors: IResponseInterceptor[];
    decorator?: IDecorator;
}

/**
 * 推断"未手动设置过环境"时的默认 env：
 *   1. globalThis.__COCOS_BUILD_NETWORK_ENV__（构建期注入）
 *   2. 小程序正式版（release） → 'prod'
 *   3. 其他情况              → 'test'
 */
export declare function inferDefaultEnv(): Env;

declare interface InitAegisOptions {
    Aegis: any;
    aegisKey: string;
    setupPolyfills?: () => void;
    url?: string;
}

/**
 * 表单等数据变更时，提示用户是否确认离开当前页面
 * @param checkDataCallback 可选，用于检查是否有未保存的数据变更，返回 true 则提示用户，返回 false 则不提示
 * @returns 一个数组，第一个元素是移除事件监听的函数，第二个元素是事件处理函数
 *
 * @example
 * ```ts
 * const [removeBeforeUnload] = initBeforeUnload(() => {
 *   return form.isDirty; // 假设 form.isDirty 表示表单是否有未保存的更改
 * });
 *
 * // 在组件卸载或不再需要提示时调用
 * removeBeforeUnload();
 * ```
 */
export declare function initBeforeUnload(checkDataCallback?: () => boolean): [
() => void,
(event: BeforeUnloadEvent) => void
];

declare function initBrowser({ puppeteer, args, headless, devtools, }: {
    puppeteer: any;
    args?: Array<string>;
    headless?: boolean;
    devtools?: boolean;
}): Promise<any>;

/**
 * 一键初始化 Cocos 微信小游戏网络层
 *
 * 等价于 pmd-npm `business/src/network-v2/application/cocos/index-mp.ts`
 * 的 initNetworkManager，但适配到本包自带的 NetworkManager 和 wx.request。
 *
 * 调用一次后，所有通过 pmd-api-cocos 的 NetworkManager 发出的请求
 * 都会：
 *   - 自动拼 baseUrl + host
 *   - 无登录态时带 code → 触发后台换登录态
 *   - 有登录态时 body.login_info + cookie 透传
 *   - 响应 header logininfo 自动入库
 *   - ret=100000 自动清态重试一次
 *
 * 使用示例（见 README）：
 * ```ts
 * import { initCocosNetwork } from '@tencent/pmd-api-cocos/network';
 *
 * initCocosNetwork({
 *   network: {
 *     svrdomain: {
 *       test: 'atest.igame.qq.com',
 *       prod: 'igame.qq.com',
 *     },
 *   },
 *   loginPath: '/v2/login/code',
 *   appid: 'wx14f5bb5ae9a067f8',
 *   // storage / getLoginCode 可不传，默认走 sys.localStorage + wx.login
 *   onLoginInfo: (info) => {
 *     // 可选：同步到 AuthService / 刷新 UI 等
 *   },
 * });
 *
 * // 控制台可执行（微信小游戏 / 开发者工具）：
 *   wx.__pmdSetEnv__('prod')  // → 切到正式环境并自动重启
 *   wx.__pmdSetEnv__('test')  // → 切回测试环境
 *   wx.__pmdGetEnv__()        // → 查看当前环境
 * // （非微信环境会回退挂到 globalThis 上）
 * ```
 */
export declare function initCocosNetwork(options: IInitCocosNetworkOptions): NetworkEngine & {
    envSwitcher: IEnvSwitcher;
};

/**
 * 初始化config
 * @param {ConfigType} config
 * @example
 * ```ts
 * initConfig({
 *   login: { loginType: 'WXPC' },
 *   game: 'pvp',
 * });
 *
 * getConfig('login.loginType'); // 'WXPC'
 * ```
 */
export declare function initConfig(config: ConfigType): void;

export declare function initCustomDialog({ title, content, confirmText, cancelText, styleId, dialogId, }: {
    title: string;
    content: string;
    confirmText?: string;
    cancelText?: string;
    styleId?: string;
    dialogId?: string;
}): void;

export declare function initCustomDom({ styleId, styleContent, dialogId, dialogContent, }: {
    styleId: string;
    styleContent: string;
    dialogId: string;
    dialogContent: string;
}): void;

/**
 * 挂载唯一的eBus，不同实例用不同的
 * @param app Vue3 应用实例
 * @example
 * ```ts
 * import { createApp } from 'vue';
 * import App from './App.vue';
 *
 * const app = createApp(App);
 * const [_, eBus] = initDiffVue3EBus(app);
 * // 每个 app 实例拥有独立的 eBus
 * ```
 */
export declare const initDiffVue3EBus: (app: any) => any;

/**
 * 初始化环境信息
 * 获取当前运行环境的 UA 类型信息
 * @returns 环境信息对象
 * @example
 * ```ts
 * const env = initEnv();
 * console.log(env.isWeixin); // false
 * console.log(env.isIOS); // true
 * ```
 */
export declare function initEnv(): IEnv;

export declare const initEnvInPixui: () => {
    isPixui: boolean;
};

/**
 * 挂载统一的eBus，所有实例共用一个
 * @param app Vue3 应用实例
 * @example
 * ```ts
 * import { createApp } from 'vue';
 * import App from './App.vue';
 *
 * const app = createApp(App);
 * initGlobalVue3EBus(app);
 *
 * // 组件内：this.$ebus.emit('event-name', payload)
 * ```
 */
export declare const initGlobalVue3EBus: (app: any) => any;

/**
 * 加载并初始化 qq-wxmini-plugin
 *
 * 内部带缓存，重复调用安全。
 *
 * @returns 插件实例；非微信小程序环境或未安装插件时返回 undefined
 */
export declare function initQQMiniPlugin(): QQWXMiniPlugin | undefined;

/**
 * 同步最新版本的更新日志
 * @param {object} params 参数
 * @param {string} params.changelogPath 源 change-log路径
 * @param {string} params.docChangelogPath 文档 change-log 路径
 * @param {string} params.packageJsonPath package.json 路径
 *
 * @example
 * ```ts
 * const DOC_CHANGE_LOG_PATH = './docs/CHANGELOG.md';
 * const SOURCE_CHANGE_LOG_PATH = './CHANGELOG.md';
 *
 * insertDocChangeLog({
 *   changelogPath: SOURCE_CHANGE_LOG_PATH,
 *   docChangeLog: DOC_CHANGE_LOG_PATH,
 *   packageJsonPath: './package.json',
 * });
 * ```
 */
export declare function insertDocChangeLog({ changelogPath, docChangelogPath, packageJsonPath, }: {
    changelogPath: string;
    docChangelogPath: string;
    packageJsonPath: string;
}): void;

/**
 * 向页面 body 中插入隐藏的 HTML 元素
 * 如果已存在相同 id 的元素，会先移除再插入新的
 * @param options - 配置选项
 * @param options.id - div 元素的 id
 * @param options.content - HTML 内容
 * @example
 * ```ts
 * insertHtml({
 *   id: 'hidden-content',
 *   content: '<div>隐藏的内容</div>'
 * });
 * ```
 */
export declare function insertHtml({ id, content, }: {
    id: string;
    content: string;
}): void;

/**
 * 向页面 head 中插入 style 标签
 * 如果已存在相同 id 的 style 标签，会先移除再插入新的
 * @param options - 配置选项
 * @param options.id - style 标签的 id
 * @param options.content - CSS 样式内容
 * @example
 * ```ts
 * insertStyle({
 *   id: 'custom-style',
 *   content: '.my-class { color: red; }'
 * });
 * ```
 */
export declare function insertStyle({ id, content, }: {
    id: string;
    content: string;
}): void;

declare type IOptions = Record<keyof typeof TIP_MAP, string>;

declare type IPage = any;

export declare type IParsedConfigItem = {
    source: string;
    target: string;
    sourceName: string;
    sourceType: IImportType;
    targetName: string;
    targetType: IImportType;
};

declare type IPostFileOptions = {
    host: string;
    port: string;
    path: string;
    method?: string;
};

declare interface IPreData {
    [key: string]: {
        name: string;
        value: ValueType;
    };
}

declare type IPublishOptions = IPostFileOptions & {
    publishEnv?: string;
    publishTargetDir?: string;
    fileTar?: string;
    fileDir?: string;
};

declare type IPurgeMethod = 'invalidate' | 'delete';

declare type IPurgeType = 'purge_url' | 'purge_prefix' | 'purge_host' | 'purge_all' | 'purge_cache_tag';

/**
 * rainbow 模式的额外参数
 */
declare interface IRainbowAuditorOptions {
    /** 项目名 */
    projectName: string;
    /** 子工程名 */
    subProjectName: string;
    /** minimatch 方法 */
    minimatch: Function;
}

/**
 * Cocos Network 子模块 - 公共类型定义
 *
 * 不依赖 @tencent/pmd-network / pmd-network-v2，完全自持，
 * 便于 pmd-api-cocos 独立发布、独立编译。
 */
/** 底层请求参数（传给 doRequest 的入参，经过请求拦截器链处理后） */
declare interface IRawRequest {
    /** 最终请求 URL（已含 query） */
    url: string;
    /** HTTP method，默认 POST */
    method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS';
    /** 请求头 */
    header?: Record<string, string>;
    /** 请求体（通常是业务 reqData） */
    reqData?: any;
    /** 业务层传入的附加参数（会在拦截器链之间透传） */
    extra?: {
        withCredentials?: boolean;
        headers?: Record<string, string>;
        /** decorator 内部用，标记重试次数防死循环 */
        __cocosRetried?: boolean;
        [k: string]: any;
    };
    /** 记录原始 url（拦截器可能多次改写，需要这个做幂等重试） */
    __cocosOriginUrl?: string;
    [k: string]: any;
}

/** 底层响应（doRequest 的返回） */
declare interface IRawResponse {
    /** HTTP 状态码 */
    status: number;
    /** 2xx => true */
    ok: boolean;
    /** 响应 body（已做 JSON parse 尝试） */
    data: any;
    /** 原始状态文本或 errMsg */
    statusText: string;
    /** 大小写不敏感取 header */
    getHeader: (name: string) => string | null | undefined;
}

declare type IRemoteConfig = {
    key: string;
    value: string;
    valueType: RainbowKeyValueType;
};

declare type IRemoteInstances = Array<{
    templateId: string;
    versionName: string;
    version: number;
    pipelineId: string;
    pipelineName: string;
    updateTime: number;
    hasPermission: boolean;
    status: string;
}>;

export declare interface IReplaceAliasOptions {
    /** 项目根目录（绝对路径） */
    rootDir: string;
    /** alias 映射关系：alias => 对应的真实目录（相对于项目根目录） */
    aliasMap: Record<string, string>;
    /** 需要扫描的目录列表（相对于项目根目录） */
    scanDirs: Array<string>;
    /** 需要扫描的根目录文件（相对于项目根目录） */
    scanRootFiles?: Array<string>;
    /** 支持的文件扩展名，默认 ['.vue', '.js', '.ts', '.less', '.css', '.scss'] */
    supportedExtensions?: Array<string>;
}

export declare type IReplaceConfig = {
    importedList: Array<IImportItem>;
    source: string | Array<string>;
    target: string;
};

declare interface IReplaceResult {
    replaced: boolean;
    error: string | null;
}

declare type IReportArr = Array<{
    code_specification_score: number;
    code_security_score: number;
    codecc_url: string;
    project_name: string;
    owners: string;
}>;

declare interface IRequest {
    (): Promise<any>;
    resolve?: (...args: any) => any;
    reject?: (...args: any) => any;
}

declare interface IRequestInfo {
    bgName: string;
    centerName: string;
    groupName: string;
}

/**
 * 请求拦截器
 * 返回 [shouldAbort, param]
 *   - shouldAbort=true：中止链路，由上层处理
 *   - shouldAbort=false：继续下一个拦截器
 */
declare interface IRequestInterceptor {
    interceptor(param: IRawRequest): [
    boolean,
    IRawRequest
    ] | Promise<[boolean, IRawRequest]>;
}

declare interface IResponseInterceptor {
    interceptor(param: IResponseInterceptorParam): [
    boolean,
    IResponseInterceptorParam
    ] | Promise<[boolean, IResponseInterceptorParam]>;
}

/**
 * 响应拦截器
 * 入参包含 request + response，方便拦截器做路由判断
 */
declare interface IResponseInterceptorParam {
    /** 原始请求 */
    request: IRawRequest;
    /** 底层响应（含 getHeader） */
    response: IRawResponse;
    /** 业务数据（= response.data，由 GetDataInterceptor 提取出来） */
    data?: any;
}

declare type IRoute = {
    name?: string;
    path?: string;
    meta?: IMeta;
};

declare interface IRumSecretItem {
    rumSecretId: string;
    rumSecretKey: string;
}

/**
 * 判断是否数组
 * @param {Array} arg
 * @returns {Boolean}
 * @example
 * ```ts
 * isArray([] as any); // true
 * isArray([1, 2, 3] as any); // true
 * isArray('hello'); // false
 * isArray(123 as any); // false
 * ```
 */
export declare function isArray(arg: string): boolean;

/** 判断是否是普通浏览器
 * @example
 * ```ts
 * if (isBrowserInPixui()) {
 *   localStorage.setItem('foo', 'bar');
 * }
 * ```
 */
export declare function isBrowserInPixui(): boolean;

/**
 * 判断 COS 对象与本地文件是否一致（基于 size 与 ETag/MD5）
 *
 * 实现说明：
 * 1. 先比较文件大小（HEAD 返回的 Content-Length 与本地 stat().size）；不一致直接判定为不同。
 * 2. 大小一致时，再比较 MD5：
 *    - 优先使用 COS 的 `x-cos-meta-md5`（上传时显式设置的元数据，最可靠）；
 *    - 否则使用 ETag（仅当对象为简单上传，即 ETag 不含连字符 `-` 时才视为整体 MD5；分块上传 ETag 不可用于直接比较）。
 *
 * @param secretId  - 腾讯云 API 密钥 ID
 * @param secretKey - 腾讯云 API 密钥 Key
 * @param bucket    - COS 存储桶名称
 * @param region    - COS 存储桶所在区域
 * @param key       - 对象键
 * @param localFilePath - 本地文件路径
 * @returns {Promise<boolean>} 一致返回 true，否则 false（本地文件不存在或对象不存在也返回 false）
 *
 * @example
 * ```typescript
 * const same = await isCosObjectSameAsLocal({
 *   secretId, secretKey,
 *   bucket: 'test-bucket', region: 'ap-beijing',
 *   key: 'path/to/file.txt',
 *   localFilePath: './local/file.txt',
 * });
 * if (!same) {
 *   // 重新上传
 * }
 * ```
 */
export declare function isCosObjectSameAsLocal({ secretId, secretKey, bucket, region, key, localFilePath, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    key: string;
    localFilePath: string;
}): Promise<boolean>;

/**
 * 判断数据是不是时间对象
 * @param {any} value - 输入数据
 * @returns {boolean} 是否是时间对象
 *
 * @example
 *
 * isDate(1)
 *
 * // => false
 *
 * isDate(new Date())
 *
 * // => true
 */
export declare function isDate(value: any): boolean;

/**
 * 判断值是否已定义（不为 undefined 和 null）
 * @param value - 输入数据
 * @returns 是否已定义
 * @example
 * ```ts
 * isDef(0); // true
 * isDef(''); // true
 * isDef(null); // false
 * isDef(undefined); // false
 * ```
 */
export declare function isDef(value: any): boolean;

export declare function isDirectory(filePath?: string): boolean;

declare interface ISearchInfo {
    prefix: string;
}

declare interface ISecretInfo {
    appCode: string;
    appSecret: string;
    devopsUid: string;
}

declare interface ISecretInfo_2 {
    accessToken: string;
    clientId: string;
    openId: string;
}

declare interface ISecretInfo_3 {
    appID?: string;
    appId?: string;
    userID?: string;
    userId?: string;
    secretKey: string;
    envName: string;
    groupName: string;
}

declare interface ISecretInfo_4 {
    appID: string;
    userID: string;
    secretKey: string;
    groupName: string;
    envName: string;
}

/**
 * 判断是否合法的邮箱号码
 * @param {String} email 待检测的邮箱号码
 * @example
 * ```ts
 * isEmail('test@qq.com'); // true
 * isEmail('user.name@domain.com'); // true
 * isEmail('invalid'); // false
 * isEmail(''); // false
 * ```
 */
export declare function isEmail(email: string): boolean;

declare interface ISendReq {
    chatId: string | Array<string>;
    webhookUrl: string;
}

/**
 * 判断是否外部资源
 * @param {string} path
 * @returns {Boolean}
 * @example
 * ```ts
 * isExternal('http://baidu.com'); // true
 * isExternal('mailto:a@b.com'); // true
 * isExternal('tel:10086'); // true
 * isExternal('ttt'); // false
 * ```
 */
export declare function isExternal(path: string): boolean;

/**
 * 判断数据是不是函数
 * @param {any} value - 输入数据
 * @returns {boolean} 是否是函数
 *
 * @example
 *
 * isFunction(1)
 *
 * // => false
 *
 * isFunction(()=>{})
 *
 * // => true
 */
export declare function isFunction(value: any): boolean;

/**
 * 判断是否合法的身份证号
 * 除了基本的格式校验外，还检查了第18位是否合法，方法如下：
 * - 逆序排列，放到数组 list 中
 * - x/X 代表数字10
 * - 遍历 list，累加 `item * ((2 ** index) % 11)`，item 为list的每一位，index为下标值
 * - 将上一步的累加和余11，判断是否等于1
 *
 * @param {string} idCard 输入字符串
 * @example
 * isIdCard('123')
 * // false
 *
 * isIdCard('34052419800101001X')
 * // true
 */
export declare function isIdCard(idCard: string | number): boolean;

declare type ISignMethod = 'sha256' | 'sha1';

/**
 * 判断 URL 是否为图片地址
 * 根据文件扩展名判断（jpeg、jpg、gif、png、svg、webp、jfif、bmp、dpg）
 * @param url - URL 地址
 * @returns 是否为图片 URL
 * @example
 * ```ts
 * isImageUrl('https://example.com/image.jpg'); // true
 * isImageUrl('https://example.com/video.mp4'); // false
 * ```
 */
export declare function isImageUrl(url: any): boolean;

export declare function isInCronExpression(cronExpression: string): boolean;

/**
 * Checks if `value` is a valid array-like index.
 *
 * @param {*} value The value to check.
 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
 * @example
 * ```ts
 * isIndex(0); // true
 * isIndex(1); // true
 * isIndex(100); // true
 * isIndex('0'); // true
 * isIndex('999'); // true
 * isIndex(-1); // false
 * isIndex(1.5); // false
 * isIndex('abc'); // false
 * isIndex('01'); // false  // 前导 0
 * isIndex(5, 5); // false  // value 必须 < length
 * isIndex(4, 5); // true
 * isIndex(0, 0); // false  // length 为 0
 * isIndex(Symbol('test')); // false
 * isIndex(null); // false
 * isIndex(undefined); // false
 * ```
 */
export declare function isIndex(value: any, length?: number): boolean;

/**
 * 判断指定路径（默认 `process.cwd()`）是否在 git 仓库中。
 *
 * 实现方式：从给定目录起向上递归查找 `.git`（目录或文件，后者用于 worktree / submodule 场景）。
 * 不会执行任何 git 命令，**纯文件系统判断**，零副作用、不会刷屏报错。
 *
 * 结果会按绝对路径缓存，重复调用近乎零开销。
 *
 * @param root 起始目录，默认为 `process.cwd()`
 * @returns 是否在 git 仓库内
 *
 * @example
 * ```ts
 * if (isInGitRepo()) {
 *   const branch = getGitCurBranch();
 * }
 * ```
 */
export declare function isInGitRepo(root?: string): boolean;

export declare function isInTimeRange({ daysOfWeek, start, end, now, }: {
    daysOfWeek: Array<number>;
    start: string;
    end: string;
    now?: Date;
}): boolean;

/**
 * 判断数组是否全部相等
 * @param {Array<number | string>} list - 数组
 * @returns {Boolean} 是否全部相等
 *
 * @example
 * isListAllEqual([0, 0, 0])
 *
 * // true
 *
 * isListAllEqual([0, 0, 2])
 *
 * // false
 */
export declare function isListAllEqual(list?: Array<number | string>): boolean;

/**
 * 判断是否合法的手机号
 * @param {String} phone 待检测的手机号
 * @example
 * ```ts
 * isMobile('13800138000'); // true
 * isMobile('19912345678'); // true
 * isMobile('12345678901'); // false  // 不是 1[3-9] 开头
 * isMobile('1380013800'); // false  // 位数不够
 * isMobile('abc'); // false
 * ```
 */
export declare function isMobile(phone: string): boolean;

/**
 * 判断字符串是否为数字格式
 * 支持整数和小数
 * @param value - 输入值
 * @returns 是否为数字格式
 * @example
 * ```ts
 * isNumber('123'); // true
 * isNumber('123.45'); // true
 * isNumber('abc'); // false
 * ```
 */
export declare function isNumber(value: any): boolean;

/**
 * 判断是否为对象或函数
 * @param x - 输入数据
 * @returns 是否为对象或函数
 * @example
 * ```ts
 * isObj({}); // true
 * isObj(() => {}); // true
 * isObj(null); // false
 * ```
 */
export declare function isObj(x: any): boolean;

/**
 * 判断是否为对象类型
 * @param val - 输入数据
 * @returns 是否为对象
 * @example
 * ```ts
 * isObject({}); // true
 * isObject([]); // true
 * isObject(null); // false
 * ```
 */
export declare function isObject(val: any): boolean;

export declare const isObjectEqual: (obj1: unknown, obj2: unknown) => boolean;

/** 判断是否是 PixUI
 * @example
 * ```ts
 * if (isPixUI()) {
 *   console.log('当前是 PixUI 环境');
 * }
 * ```
 */
export declare function isPixUI(): boolean;

/**
 * 判断数据是否为普通对象
 * 排除 null 和数组，只返回纯对象
 * @param val - 输入数据
 * @returns 是否为普通对象
 * @example
 * ```ts
 * isPlainObject({}); // true
 * isPlainObject([]); // false
 * isPlainObject(null); // false
 * ```
 */
export declare function isPlainObject(val: any): boolean;

/**
 * 判断数据是否为 Promise 对象
 * 检查对象是否有 then 和 catch 方法
 * @param val - 输入数据
 * @returns 是否为 Promise 对象
 * @example
 * ```ts
 * isPromise(Promise.resolve()); // true
 * isPromise({}); // false
 * ```
 */
export declare function isPromise(val: any): boolean;

/**
 * 判断是否合法的QQ号码
 * @param {String} qq 待检测的qq号
 * @example
 * ```ts
 * isQQNumber(777777); // true
 * isQQNumber('ddd'); // false
 * isQQNumber('1234'); // false  // 少于 5 位
 * isQQNumber('12345678901'); // false  // 超过 10 位
 * isQQNumber('01234567'); // false  // 0 开头
 * ```
 */
export declare function isQQNumber(qq: any): boolean;

/**
 * 判断数据是不是正则对象
 * @param {any} value - 输入数据
 * @returns {boolean} 是否是正则对象
 *
 * @example
 *
 * isRegExp(1)
 *
 * // => false
 *
 * isRegExp(/\d/)
 *
 * // => true
 */
export declare function isRegExp(value: any): boolean;

/**
 * 判断是否是同一天
 * @param {number} date1 时间戳
 * @param {number} date2 时间戳
 * @returns 是否相同
 * @example
 * ```ts
 * isSameDay(1702613769418, 1702613769419) // true
 * ```
 */
export declare function isSameDay(date1: number, date2: number): boolean;

/**
 * 判断两个日期是否属于同一周
 *
 * 原理：把两个日期均转换到周一，比较转换后的两日期是否相同。
 *
 * @param {number} date1 第1个时间戳
 * @param {number} date2 第2个时间戳
 * @returns {boolean} 是否是同一周
 * @example
 *
 * isSameWeek(1601308800000, 1601395200000)
 *
 * // true
 *
 * isSameWeek(1601308800000, 1601913600000)
 *
 * // false
 */
export declare function isSameWeek(date1: number, date2: number): boolean;

/** 判断是否是模拟器
 * @example
 * ```ts
 * if (isSimulatorInPixui()) {
 *   console.log('当前是 PixUI 模拟器环境');
 * }
 * ```
 */
export declare function isSimulatorInPixui(): boolean;

/**
 * 判断是否字符串
 * @param {string} str
 * @returns {Boolean}
 * @example
 * ```ts
 * isString('hello'); // true
 * isString(''); // true
 * isString(123); // false
 * isString(null); // false
 * isString(undefined); // false
 * isString([]); // false
 * ```
 */
export declare function isString(str: any): boolean;

/**
 * 判断当前浏览器是否支持 webp
 * @returns {Promise<boolean> }是否支持
 * @example
 * ```ts
 * const checkWebp = isSupportedWebp();
 * const supported = await checkWebp();
 * if (supported) {
 *   console.log('当前浏览器支持 webp');
 * }
 *
 * // 连续调用会复用上次检测结果（memo 缓存）
 * await checkWebp(); // 不会重复创建 Image
 * ```
 */
export declare const isSupportedWebp: () => () => any;

/**
 * 判断是否合法的电话号码
 * @param {String} tel 待检测的电话号码
 * @example
 * ```ts
 * isTel('0755-1234567'); // true
 * isTel('12345678'); // true
 * isTel('123'); // false
 * isTel('abc'); // false
 * ```
 */
export declare function isTel(tel: string): boolean;

/**
 * 判断是否为腾讯文档链接
 * @param url 待判断的链接
 *
 * @example
 * ```ts
 * isTencentDocLink('https://docs.qq.com/doc/xxx'); // true
 * isTencentDocLink('https://example.com'); // false
 * ```
 */
export declare function isTencentDocLink(url?: string): boolean;

/**
 * 判断包是否是腾讯内网包（@tencent 开头）
 * @param name 包名
 * @returns 是否是 @tencent/xxx 风格的内网包
 */
export declare function isTencentInternalPackage(name: string): boolean;

export declare function isTestEnv(storageKey?: string, storage?: ICocosLoginInfoStorage): boolean;

export declare const isTestEnvInPixui: () => boolean;

/**
 * 判断 URL 是否为视频地址
 * 根据文件扩展名判断（mp4、mpg、mpeg、dat、asf、avi、rm、rmvb、mov、wmv、flv、mkv）
 * @param url - URL 地址
 * @returns 是否为视频 URL
 * @example
 * ```ts
 * isVideoUrl('https://example.com/video.mp4'); // true
 * isVideoUrl('https://example.com/image.jpg'); // false
 * ```
 */
export declare function isVideoUrl(url: any): boolean;

/**
 * 判断当前操作系统是否为 Windows
 * @returns 如果是 Windows 系统返回 true，否则返回 false
 * @example
 * ```ts
 * if (isWindows()) {
 *   console.log('当前运行在 Windows 系统上');
 * }
 * ```
 */
export declare function isWindows(): boolean;

declare interface ITemplateReq {
    projectId: string;
    templateId: string;
    host: string;
    secretInfo: ISecretInfo;
}

export declare type IterativeComponentMap = Record<string, Record<string, any>>;

declare type ITestList = Array<{
    fail: number;
    title: string;
    err: {
        estack?: string;
    };
}>;

export declare type IUploaderOptions = {
    requestHashUrl?: string | Function;
    uploadFileKey?: string;
    uploadUrlPrefix?: string;
};

declare interface IUploadResult {
    subPackageInfo: Array<{
        name: string;
        size: number;
    }>;
}

/**
 * `getZipSize` 的返回结果
 */
export declare interface IZipSizeResult {
    /** zip 压缩后字节数。无法估算时为 null */
    zipSize: number | null;
    /**
     * 体积来源：
     * - `zip`     : 系统 zip 命令打成真实 zip 包，最准
     * - `gzip-sum`: zlib.gzipSync 逐文件累加，估算值，比真实 zip 略大（无共享字典）
     * - `none`    : 两种方式都失败
     */
    zipMethod: 'zip' | 'gzip-sum' | 'none';
}

export declare class JsDocHandler {
    /**
     * 初始化并运行
     * @static
     * @param {object} options 配置
     * @param {string} [options.docsPath] 文档所在目录位置，默认为`./docs`
     * @param {string} [options.author] 作者，默认为空
     * @param {string} [options.extraCss] 额外插入的css，默认为`.nav-separator`的一些样式
     * @param {string} [options.navHandler] 处理API所在文件的方法
     * @param {boolean} [options.isHandleNav] 是否处理导航栏，即插入文件名进行分隔，默认为false
     * @returns {object} JsDocHandler实例
     * @example
     *
     * JsDocHandler.init({
     *   author: 'novlan1',
     *   docsPath: './docs',
     *   extraCss: '.some-class{}',
     *   navHandler(nav) {
     *
     *   }
     * })
     *
     */
    static init(options: IJSDocOptions): JsDocHandler;
    extraCss: string;
    extraScript: string;
    author: string;
    docsPath: string;
    navHandler: Function;
    isHandleNav: boolean;
    fs: fs;
    path: PlatformPath;
    /**
     * 处理jsdoc的脚本
     * 1. 增加导航栏的分隔符
     * 2. 增加css
     * 3. 处理footer
     * @constructor
     * @param {object} options 配置
     * @param {string} [options.docsPath] 文档所在目录位置，默认为`./docs`
     * @param {string} [options.author] 作者，默认为空
     * @param {string} [options.extraCss] 额外插入的css，默认为`.nav-separator`的一些样式
     * @param {string} [options.extraScript] 额外插入的script
     * @param {Function} [options.navHandler] 处理API所在文件的方法
     * @param {boolean} [options.isHandleNav] 是否处理导航栏，即插入文件名进行分隔，默认为false
     */
    constructor(options?: IJSDocOptions);
    run(): void;
    getFs(): fs;
    getGlobalSourceMap(): Record<string, string>;
    /**
     * 获取sourceMap，形如：
     * ```ts
     * {
     *   NUMBER_CHI_MAP: 'base/number/number.ts',
     *   parseFunction: 'base/function/function.ts',
     *   flatten: 'base/list/list.ts',
     * }
     * ```
     * @private
     * @param {string} content
     * @returns {object} sourceMap
     */
    getSourceMap(file: string): Record<string, string>;
    handleEveryHtml(sourceMap: Record<string, string>, author: string): void;
    parseSourceMap(sourceMap: Record<string, any>): Record<string, string>;
    getParsedHtml(content: string, sourceMap: Record<string, string>, author: string): string;
    appendCSS(extra: string): void;
    finished(): void;
}

export declare type JSErrorFile = Record<string, any>;

export declare function jsonpRequest({ url, callback, errorCallback, timeout, }: {
    url: string;
    callback: (data: any) => void;
    errorCallback?: (error: string) => void;
    timeout?: number;
}): () => void;

/**
 * json 转 excel
 * @param {object} params 参数
 * @example { workbook, worksheet }
 *
 * const jsonData = [
 *   { id: 1, name: '2', age: '3' },
 *   { id: 1, name: '2', age: '3' },
 * ];
 *
 * jsonToExcel({
 *   jsonData,
 *   outputPath: CONFIG.outputFilePath,
 *   options: {
 *     header: ['id', 'name', 'age'],  // 可选：自定义表头顺序
 *     skipHeader: false,              // 可选：是否跳过表头行
 *   },
 *   sheetName: 'addedData',
 * });
 */
export declare function jsonToExcel({ jsonData, outputPath, options, sheetName, overwrite, }: {
    jsonData: Array<Record<string, string>>;
    outputPath: string;
    options?: Record<string, any>;
    sheetName?: string;
    overwrite?: boolean;
}): {
    workbook: WorkBook;
    worksheet: WorkSheet;
};

/**
 * 除保留参数外，一律移除
 * @param {string} url 地址
 * @param {string} removeKeyArr 待保留的参数名集合
 * @returns 重新拼接的地址
 * @example
 * // 地址是 hash 模式参数
 * keepUrlParams('http://www.test.com/#/detail?a=1&b=2&c=3', ['a', 'b']);
 * // => 'http://www.test.com/#/detail?a=1&b=2'
 * @example
 * // 地址 history 模式参数并存
 * keepUrlParams('http://www.test.com?a=1&b=2&c=3', ['a', 'b']);
 * // => 'http://www.test.com/?a=1&b=2'
 * @example
 * // 地址 history 模式参数并存 + 强制 history 模式返回
 * keepUrlParams('http://www.test.com?a=1&b=2&c=3', ['a', 'b'], true);
 * // => 'http://www.test.com/?a=1&b=2'
 * @example
 * // hash 模式和 history 模式参数并存
 * keepUrlParams('http://www.test.com?a=1&b=2&c=3#/detail?d=4', ['a', 'd']);
 * // => 'http://www.test.com/#/detail?a=1&d=4'
 * @example
 * // 地址是 hash 模式和 history 模式参数并存，且是多个参数
 * keepUrlParams('http://www.test.com?d=4&f=6#/detail?a=1&b=2&c=3', ['a', 'd']);
 * // => 'http://www.test.com/#/detail?d=4&a=1'
 */
export declare function keepUrlParams(url: string | undefined, keepKeyArr: string[], forceHistoryMode?: boolean): string;

declare const LANG_NAME_TO_TI18N_KEY: Record<string, Ti18nKey>;
export { LANG_NAME_TO_TI18N_KEY as DEFAULT_LANG_NAME_TO_TI18N_KEY }
export { LANG_NAME_TO_TI18N_KEY }

/**
 * 拉起 DDZ
 * @param {object} params 拉起参数
 * @param {string} params.seriesId series id
 * @param {string} params.gameId game id
 * @param {string} params.uin uin
 * @param {object} [params.context] 上下文，可传入组件实例 this
 * @param {object} [params.qrCodeLib] qrcode
 * @param {object} [params.dialogHandler] 弹窗 handler
 * @param {object} [params.otherDialogParams] 弹窗的其他参数
 * @param {string} [params.wxJSLink] wx js link
 * @param {object} [params.env] 环境对象
 * @returns Promise<boolean | number>
 *
 * @example
 * ```ts
 * launchDDZGameRoom({
 *   seriesId: '12',
 *   gameId: '123',
 *   uin: '222',
 * })
 * ```
 */
export declare const launchDDZGameRoom: ({ seriesId, gameId, uin, context, qrCodeLib, dialogHandler, otherDialogParams, wxJSLink, env, }: {
    gameId: string;
    seriesId: string;
    uin: string;
} & IBaseLaunchParams) => Promise<unknown>;

/**
 * 拉起 GN
 * @param {object} params 拉起参数
 * @param {string} params.roomId 房间 Id
 * @param {string} params.roomPwd 房间 Pwd
 * @param {object} [params.context] 上下文，可传入组件实例 this
 * @param {object} [params.qrCodeLib] qrcode
 * @param {object} [params.dialogHandler] 弹窗 handler
 * @param {object} [params.otherDialogParams] 弹窗的其他参数
 * @param {string} [params.wxJSLink] wx js link
 * @param {object} [params.env] 环境对象
 * @returns Promise<boolean | number>
 *
 * @example
 * ```ts
 * launchGNGameRoom({
 *   roomId: '12',
 *   roomPwd: '123'
 * })
 * ```
 */
export declare function launchGNGameRoom({ roomId, roomPwd, context, qrCodeLib, dialogHandler, otherDialogParams, wxJSLink, env, }: IBaseLaunchParams & {
    roomId: string;
    roomPwd: string;
}): Promise<unknown>;

/**
 * 拉起 GP
 * @param {object} params 拉起参数
 * @param {string} params.roomId 房间 Id
 * @param {string} params.roomPwd 房间 Pwd
 * @param {string} params.source 来源
 * @param {string} [params.wxJSLink] wx js link
 * @param {object} [params.env] 环境对象
 * @param {object} [params.useGPHelperSchemePrefix] 是否使用特殊 scheme
 * @param {object} [params.justLaunchGame] 是否仅拉起 app，不进入房间
 * @returns Promise<boolean | number>
 *
 * @example
 * ```ts
 * launchGPGameRoom({
 *   roomId: '12',
 *   roomPwd: '123'
 * })
 * ```
 */
export declare function launchGPGameRoom({ roomId, roomPwd, source, wxJSLink, env, useGPHelperSchemePrefix, useTrialSchemePrefix, justLaunchGame, }: {
    roomId: string;
    roomPwd: string;
    source?: string | number;
    wxJSLink?: string;
    env?: Record<string, boolean>;
    useGPHelperSchemePrefix?: boolean;
    useTrialSchemePrefix?: boolean;
    justLaunchGame?: boolean;
}): Promise<unknown>;

export declare function launchMiniProgramInGame({ appId, path, type, isWxMp, }: {
    appId?: string | undefined;
    path?: string | undefined;
    type?: number | undefined;
    isWxMp?: boolean | undefined;
}): void;

/**
 * 拉起 MJ
 * @param {object} params 拉起参数
 * @param {string} params.seriesId series id
 * @param {string} params.gameId game id
 * @param {string} params.uin uin
 * @param {object} [params.context] 上下文，可传入组件实例 this
 * @param {object} [params.qrCodeLib] qrcode
 * @param {object} [params.dialogHandler] 弹窗 handler
 * @param {object} [params.otherDialogParams] 弹窗的其他参数
 * @param {string} [params.wxJSLink] wx js link
 * @param {object} [params.env] 环境对象
 * @returns Promise<boolean | number>
 *
 * @example
 * ```ts
 * launchMJGameRoom({
 *   seriesId: '12',
 *   gameId: '123',
 *   uin: '222',
 * })
 * ```
 */
export declare function launchMJGameRoom({ seriesId, gameId, uin, context, qrCodeLib, dialogHandler, otherDialogParams, wxJSLink, env, }: IBaseLaunchParams & {
    gameId: string;
    seriesId: string;
    uin: string;
}): Promise<unknown>;

/**
 * 跳转腾讯 QQ 小程序进行 QQ 登录
 *
 * 调用后 QQ 小程序登录完成，会通过 wx.navigateBackMiniProgram 返回，
 * 在本小程序的 App.onShow 中通过 referrerInfo.extraData 拿到票据。
 *
 * @param options 必填 qqAppId（QQ 互联 AppId）
 */
export declare function launchQQMP(options: LaunchQQMPOptions): Promise<any>;

/**
 * launchQQMP 的入参
 */
export declare interface LaunchQQMPOptions {
    /** QQ 互联 appid（必填） */
    qqAppId: string | number;
    /** 腾讯 QQ 小程序 appId，默认 wx26da53d900421226 */
    qqMpAppId?: string;
    /** QQ 登录页路径，默认 pagesLogin/pages/login/login */
    loginPath?: string;
    /** 是否强制输入密码（不允许快速登录），默认 false */
    forcePwd?: boolean;
    /** 后台异常状态码列表，会透传给 QQ 小程序 */
    retcodes?: number[];
    /** 体验版：'release' | 'trial' | 'develop'，默认不传 */
    envVersion?: 'release' | 'trial' | 'develop';
}

/**
 * 统计代码库变更情况。分析多个项目的 Git 提交记录，生成统计数据并可选上传到 COS
 * @param analyzeList - 要分析的项目列表
 * @param saveDataDir - 保存统计数据的本地目录
 * @param cosInfo - COS 上传配置信息（可选）
 * @param cosInfo.secretId - 腾讯云 SecretId
 * @param cosInfo.secretKey - 腾讯云 SecretKey
 * @param cosInfo.bucket - COS 存储桶名称
 * @param cosInfo.region - COS 区域
 * @param cosInfo.dir - COS 目录路径
 * @param analyzeBlackList - 需要排除的目录黑名单（可选）
 * @returns {Promise<Array>} - 返回每个项目的统计结果数组
 * @example
 * ```ts
 * libraryChangeStatistics({
 *   analyzeList: [
 *     { root: '/path/to/repo', project: 'my-project', git: 'https://...' }
 *   ],
 *   saveDataDir: '/tmp/stats',
 *   cosInfo: {
 *     secretId: 'xxx',
 *     secretKey: 'xxx',
 *     bucket: 'my-bucket',
 *     region: 'ap-guangzhou',
 *     dir: 'stats'
 *   },
 *   analyzeBlackList: ['node_modules', 'dist']
 * }).then(result => {
 *   console.log('统计完成:', result);
 * });
 * ```
 */
export declare function libraryChangeStatistics({ analyzeList, saveDataDir, cosInfo, analyzeBlackList, }: {
    analyzeList: Array<AnalyzeItem>;
    saveDataDir: string;
    cosInfo?: {
        secretId: string;
        secretKey: string;
        bucket: string;
        region: string;
        dir: string;
    };
    analyzeBlackList?: string[];
}): Promise<{
    data: Array<ProjectInfo>;
    project: (typeof analyzeList)[number];
    cdnLink: string;
}[]>;

/**
 * 动态加载CSS
 * @param {string} url CSS链接
 * @example
 *
 * loadCSS('xxx.css')
 */
export declare function loadCSS(url: string): void;

/**
 * 加载样式代码块，会将样式代码包裹在 style 标签内，并加载到当前页面中
 * @param {string} code 样式代码
 * @param {string} className 类名
 *
 * @example
 *
 * ```ts
 * loadCssCode(
 *   '.press__cover { color: red; }',
 *   'load-css-code'
 * );
 * ```
 */
export declare function loadCssCode(code: string, className: string): void;

/**
 * 用 dotenv-expand 加载环境变量
 * @param file 文件路径，默认 .env.local
 * @param param 参数
 *
 * @example
 * ```ts
 * loadEnv();
 *
 * loadEnv('.env');
 *
 * loadEnv('.env.local', {
 *   debug: false, // 是否打印日志，默认 true
 * });
 * ```
 */
export declare function loadDotenv(file?: string, options?: {
    debug?: boolean;
}): void;

/**
 * 以 Callback 的方式加载 js 文件
 * @param {String}          src  js文件路径
 * @param {Function|Object} callback  加载回调
 * @param {String}          charset  指定js的字符集
 * @param {Object}          context Callback context
 * @example
 * ```ts
 * loader('https://example.com/lib.js', (err) => {
 *   if (err) return console.error(err);
 *   console.log('loaded');
 * });
 *
 * // 传递 setup 回调以修改 script 标签
 * loader('https://example.com/lib.js', {
 *   callback: (err) => {},
 *   setup: (script) => script.setAttribute('data-foo', '1'),
 * });
 * ```
 */
export declare const loader: (src: string, callback: any, charset?: string, context?: null) => void;

/**
 * 以 Promise 或者 Callback 的方式加载 js 文件，取决于是否传递 Callback
 * @param {string}  url  js文件路径
 * @param {function}  [cb]  回调
 * @returns {Promise<number>} promise
 * @example
 * ```ts
 * // 1. Promise 方式
 * await loaderUnity('https://example.com/lib.js');
 *
 * // 2. Callback 方式
 * loaderUnity('https://example.com/lib.js', (err) => {
 *   if (err) return console.error(err);
 *   console.log('loaded');
 * });
 * ```
 */
export declare const loaderUnity: (source: string, cb?: Function, ...args: Array<any>) => void | Promise<unknown>;

/**
 * 以 Promise 的方式加载 js 文件
 * @param {string}  url  js文件路径
 * @returns {Promise<number>} promise
 * @example
 * ```ts
 * await loadJS('https://example.com/lib.js');
 * console.log('loaded');
 * ```
 */
export declare function loadJS(url: string): Promise<unknown>;

/**
 * 加载多个样式文件，并在加载前移除具有相同类名的文件
 * @param {array} urls 外链地址列表
 * @param {string} urlClass 外链类名
 *
 * @example
 *
 * ```ts
 * loadStyles(['https://a.com/b.css'], 'load-style');
 * ```
 */
export declare function loadStyles(urls: Array<string>, urlClass: string): void;

/**
 * 加载 vConsole
 * @param {Object} [options = {}] vConsole 选项
 * @param {Array<string>} [plugins = []] 插件列表
 * @returns {Promise<Object>} vConsole 实例
 *
 * @example
 * ```ts
 * loadVConsole()
 * ```
 */
export declare function loadVConsole(options?: Record<string, any>, plugins?: Array<Function>): Promise<unknown>;

/**
 * 本地发布模块到测试/生产环境
 * 读取环境变量配置，打包并发布静态资源到指定路径
 * @param {IPublishOptions} options 发布配置选项
 * @param {string} [options.publishEnv='test'] 发布环境，'test' 或 'prod'
 * @param {string} [options.fileTar] 自定义 tar 文件路径
 * @param {string} [options.fileDir] 自定义文件目录路径
 * @returns {Promise<void>}
 * @example
 * ```ts
 * await localPublish({
 *   publishEnv: 'test',
 * });
 * ```
 */
export declare function localPublish(options: IPublishOptions): Promise<void>;

export declare enum LocationFlagInPixui {
    LocationSuccess = 1,
    LocationNoPermission = 2,
    LocationFailed = 3
}

/**
 * 输出日志信息
 * 带有信息图标的日志输出
 * @param content - 日志内容
 * @param args - 额外参数
 * @example
 * ```ts
 * log('正在处理...', 'file.ts');
 * ```
 */
export declare function log(content: string, ...args: string[]): void;

/**
 * 通过 intl 登录
 * @param {Options} options 参数
 * @example
 *
 * ```ts
 * function loginIntl() {
 *   const checkLoginAPI = res => new Promise((resolve, reject) => {
 *     getScheList({
 *       query: {
 *         ...INTL_CONFIG.extraQueryObject,
 *         appid: INTL_CONFIG.gameID,
 *         channelid: res.channel_info?.channelId,
 *       },
 *     }).then((res) => {
 *       resolve(res);
 *     })
 *       .catch((err) => {
 *         reject(err);
 *       });
 *   });
 *
 *   return loginByIntl({
 *     cookieDomain: COOKIE_DOMAIN,
 *     env: INTL_CONFIG.env,
 *     gameID: INTL_CONFIG.gameID,
 *     appID: INTL_CONFIG.appID,
 *     webID: INTL_CONFIG.webID,
 *     checkLoginAPI,
 *   });
 * }
 *
 * ```
 */
export declare function loginByIntl(options: Options): Promise<unknown>;

/** 登录态（后台下发的 logininfo 字段，本模块不解释具体字段含义，原样透传） */
export declare type LoginInfo = Record<string, any>;

/**
 * 用户登录（初始化游戏accToken等字段）
 * @example
 * ```ts
 * import { loginInPixui, getLoginUrlInPixui } from 't-comm/es/pixui';
 *
 * await loginInPixui();
 *
 * // 拼接登录态参数
 * const url = getLoginUrlInPixui('https://api.example.com/foo');
 * // => https://api.example.com/foo?appid=xxx&openid=xxx&access_token=xxx&acctype=wx
 * ```
 */
export declare const loginInPixui: () => Promise<void>;

/**
 * 通过 code 换取小程序登录态。
 *
 * code 来源优先级（高 → 低）：
 *   1. 直接传入的 `code` 参数（如 QQ App 下 `plugin.login()` 拿到的 QQ code）
 *   2. 自定义 `getCode` 函数（业务可注入任意 code 提供者）
 *   3. 默认调用 `wx.login()` 拿微信 code
 *
 * 配合 `_ltype` 即可同时支持微信登录（`tiploginwxproc`）和 QQ 登录（`tiploginqqproc`）。
 *
 * @example 微信登录（默认行为，向后兼容）
 * loginMp({ url, appid });
 *
 * @example QQ App 下用 plugin.login() 拿到的 code 走 QQ 登录
 * import { qqPluginLogin } from 't-comm/es/qq-mp';
 * const { code } = await qqPluginLogin();
 * loginMp({ url, appid, _ltype: 'tiploginqqproc', code });
 *
 * @example 注入自定义 code 提供者
 * loginMp({ url, appid, _ltype: 'tiploginqqproc', getCode: qqPluginLogin });
 */
export declare function loginMp({ url, method, header, body, appid, _ltype, storageKey, onLoginInfo, storage, code, getCode, qqTicketInfo, }: {
    url: string;
    appid?: string;
    method?: 'POST' | 'GET' | 'PUT' | 'DELETE';
    header?: any;
    body?: Record<string, any>;
    _ltype?: 'tiploginwxproc' | 'tiploginqqproc';
    onLoginInfo?: (loginInfo: Record<string, any>) => void;
    storage?: any;
    storageKey?: string;
    /**
     * 外部已经拿到的 code（如 `plugin.login()` 拿到的 QQ code、`wx.login()` 拿到的微信 code）。
     * 传了就跳过内部的 `wx.login()` 调用。优先级高于 `getCode`。
     */
    code?: string;
    /**
     * 自定义 code 提供者。未传 `code` 时使用，未传 `getCode` 时回退到默认的 `wx.login()`。
     * 例如 QQ App 下可传入 `qqPluginLogin`。
     */
    getCode?: () => Promise<{
        code: string;
    }>;
    qqTicketInfo?: QQTicketInfo;
}): Promise<void>;

/**
 * 登录成功回调的触发原因
 *
 *  - `switch`：从另一平台切换到当前平台（有实际登录动作）
 *  - `already`：调用切号入口时已经是目标平台（幂等分支，仅 bootstrap 拉最新数据）
 */
declare type LoginSuccessReason = 'switch' | 'already';

/**
 * 首字母小写
 * @param {string} str 输入字符串
 * @returns {string} 输出字符串
 * @example
 *
 * lowerInitial('GroupId')
 *
 * // groupId
 */
export declare function lowerInitial(str: string): string;

/**
 * 将语言名称映射为 ti18n key
 * @param name Excel 首行的语言名称
 * @param langNameMapping 语言名称到 ti18n key 的映射表，默认使用 LANG_NAME_TO_TI18N_KEY
 * @returns 对应的 ti18n key，无法识别返回 null
 * @example
 * ```ts
 * mapLangNameToKey('中文');     // 'zh'
 * mapLangNameToKey('English');  // 'en'
 * mapLangNameToKey('未知');     // null
 *
 * // 自定义映射
 * mapLangNameToKey('日语', { '日语': 'ja' }); // 'ja'
 * ```
 */
export declare function mapLangNameToKey(name: string | null | undefined, langNameMapping?: Record<string, Ti18nKey>): Ti18nKey | null;

/**
 * 判断扫到的设备是否携带我们的 service
 *
 * iOS 上 startBluetoothDevicesDiscovery 不传 services 时收到的设备都需要手动过滤。
 * 依次检查：advertisServiceUUIDs / serviceData / advertisData / 设备名前缀（BUMP_）。
 *
 * ⚠️ iOS↔iOS 时前 3 项几乎都拿不到，必须靠设备名前缀做最终兜底。
 */
export declare function matchesService(dev: BluetoothDeviceInfo, serviceUuid: string): boolean;

export declare function matchParams(rawPath?: string, params?: Record<string, string>): string;

export declare const merge: (object: any, ...sources: any) => any;

/**
 * 合并分支：将分支或者 commit 合并到指定分支
 *
 * 对应工蜂 API：PUT /api/v3/projects/:id/repository/branches/merge
 *
 * @param {object} options 输入配置
 * @param {number | string} options.id 项目 ID 或 项目全路径 project_full_path
 * @param {string} options.sourceObjectId 源分支名或者 commit
 * @param {string} options.targetBranch 目标分支名
 * @param {number} [options.sourceProjectId] 源项目 ID，默认为 id 的值
 * @param {'merge' | 'rebase' | 'squash'} [options.mergeType] 合并方式，默认为普通合并 merge
 * @param {string} [options.commitMessage] 合并点提交信息（mergeType=rebase 时必填）
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<unknown>} 请求 Promise
 * @example
 *
 * mergeBranches({
 *   id: 12345,
 *   sourceObjectId: 'feature/xxx',
 *   targetBranch: 'master',
 *   mergeType: 'merge',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function mergeBranches({ id, sourceObjectId, targetBranch, sourceProjectId, mergeType, commitMessage, privateToken, baseUrl, }: {
    id: number | string;
    sourceObjectId: string;
    targetBranch: string;
    sourceProjectId?: number;
    mergeType?: 'merge' | 'rebase' | 'squash';
    commitMessage?: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<unknown>;

/**
 * 绘制多张图
 * @param {object} config 输入参数
 * @param {Array<string>} config.imgs base64图片列表
 * @returns {string} 图片url
 *
 * @example
 *
 * mergeMultiCanvasPic({
 *   imgs: [img, img2, img3],
 * })
 */
export declare function mergeMultiCanvasPic({ imgs, }: {
    imgs: Array<string>;
}): Promise<string>;

/**
 * 88.合并两个有序数组
 *
 * https://leetcode.cn/problems/merge-sorted-array/description/?envType=study-plan-v2&envId=top-interview-150
 *
 * 双指针解法
 * - 将两个数组看成队列，每次从数组头部取出较小数字放到结果中
 *
 * - 时间复杂度 O(m + n)
 * - 空间复杂度 O(m + n)
 *
 * @example
 * ```ts
 * const nums1 = [1, 3, 9, 0, 0, 0, 0];
 * const nums2 = [2, 4, 5, 9];
 * mergeTwoSortedArrayV1(nums1, nums2, 3, 4);
 * // [1, 2, 3, 4, 5, 9, 9]
 *
 * const a = [1, 2, 3, 0, 0, 0];
 * const b = [2, 5, 6];
 * mergeTwoSortedArrayV1(a, b, 3, 3);
 * // [1, 2, 2, 3, 5, 6]
 * ```
 */
export declare function mergeTwoSortedArrayV1(nums1?: number[], nums2?: number[], m?: number, n?: number): number[];

/**
 * 88.合并两个有序数组
 *
 * https://leetcode.cn/problems/merge-sorted-array/description/?envType=study-plan-v2&envId=top-interview-150
 *
 * 逆向双指针解法
 * - 指针初始位置在尾部，每次向前移动
 * - 不用临时数组 temp，因为不用担心前面的被覆盖
 *
 * - 时间复杂度 O(m + n)
 * - 空间复杂度 O(1)
 *
 * @example
 * ```ts
 * const nums1 = [1, 3, 9, 0, 0, 0, 0];
 * const nums2 = [2, 4, 5, 9];
 * mergeTwoSortedArrayV2(nums1, nums2, 3, 4);
 * // [1, 2, 3, 4, 5, 9, 9]
 *
 * const a = [1, 2, 3, 0, 0, 0];
 * const b = [2, 5, 6];
 * mergeTwoSortedArrayV2(a, b, 3, 3);
 * // [1, 2, 2, 3, 5, 6]
 * ```
 */
export declare function mergeTwoSortedArrayV2(nums1?: number[], nums2?: number[], m?: number, n?: number): number[];

declare type MessageType = string | {
    content: string;
    link?: string;
    label?: string;
    isTitle?: boolean;
};

/**
 * 递归创建目录（同步方法）
 * 如果目录已存在则直接返回，否则递归创建父目录
 * @param dirname - 要创建的目录路径
 * @returns 创建成功返回 true
 * @example
 * ```ts
 * mkDirsSync('/path/to/new/directory');
 * ```
 */
export declare function mkDirsSync(dirname: string): boolean;

export declare function modifyAutoProtectedBranchRules({ projectName, baseUrl, privateToken, rules, shouldUpdateExistingBranches, }: {
    projectName: string;
    baseUrl?: string;
    privateToken: string;
    rules: string;
    shouldUpdateExistingBranches?: boolean;
}): Promise<unknown>;

declare interface ModifyConfigParam {
    keyValue: {
        key: string;
        value: string;
    };
    valueType: ValueType_2;
    secretInfo: ISecretInfo_3;
}

export declare function modifyProtectedBranchRule({ projectName, privateToken, baseUrl, ruleId, form, }: {
    projectName: string;
    privateToken: string;
    baseUrl?: string;
    ruleId: number;
    form: ProtectedRuleForm;
}): Promise<Array<object>>;

export declare class MorsePwd {
    /**
     * 初始化
     * @static
     * @param {Object} options 选项
     * @param {Array<number>} options.pwd 密码
     * @param {Function} options.cb 成功回调
     * @param {Boolean} options.quiet 是否安静模式（不打印日志）
     * @param {number} options.holdTime 等待多久后就恢复原位
     * @param {'H5' | 'h5' | 'mp' | 'MP'} options.envType 环境类型
     * @param {String} options.selector h5模式下的选择器
     *
     * @example <caption>小程序环境</caption>
     * <template>
     *   <div
     *     class="tip-match-header"
     *     /@longpress="onLongPressWrap"
     *     /@click.stop="onClickWrap"
     *   >
     * </template>
     *
     * <script>
     * export default {
     *   data() {
     *     return {
     *       morsePwd: null,
     *     };
     *   },
     *   mounted() {
     *     this.morsePwd = MorsePwd.init({
     *       pwd: [1, 1, 1, 2, 2, 2, 1, 1, 1],
     *       cb: () => {
     *         this.showToast('hhh');
     *       },
     *       envType: 'MP',
     *     });
     *   },
     *   beforeDestroy() {
     *     this.morsePwd.clear();
     *   },
     *   methods: {
     *     onLongPressWrap() {
     *       this.morsePwd.longPress();
     *     },
     *     onClickWrap() {
     *       this.morsePwd.click();
     *     },
     *   }
     * }
     * </script>
     * @example <caption>H5环境</caption>
     * <script>
     * export default {
     *   data() {
     *     return {
     *       morsePwd: null,
     *     };
     *   },
     *   mounted() {
     *     this.morsePwd = MorsePwd.init({
     *       pwd: [1, 1, 1, 2, 2, 2, 1, 1, 1],
     *       cb: () => {
     *         this.showToast('xxx');
     *       },
     *       selector: '#app',
     *       envType: 'H5',
     *     });
     *   },
     *   beforeDestroy() {
     *     this.morsePwd.clear();
     *   },
     * }
     * </script>
     *
     * @returns {Object} MorsePwd实例
     */
    static init(options: IMorsePwd): MorsePwd;
    pwd: Array<number>;
    cb: Function;
    holdTime: number;
    quiet: Boolean;
    selector?: keyof HTMLElementTagNameMap;
    envType?: 'H5' | 'h5' | 'mp' | 'MP';
    clickCode: number;
    longPressCode: number;
    curIdx: number;
    holdTimer: any;
    h5Dom: any;
    longPressTimer: any;
    isLongTouch: Boolean;
    /**
     * 摩斯密码初始化
     * @constructor
     * @param {Object} options 选项
     * @param {Array<number>} options.pwd 密码
     * @param {Function} options.cb 成功回调
     * @param {Boolean} options.quiet 是否安静模式（不打印日志）
     * @param {number} options.holdTime 等待多久后就恢复原位
     * @param {'H5' | 'h5' | 'mp' | 'MP'} options.envType 环境类型
     * @param {String} options.selector h5模式下的选择器
     */
    constructor(options: IMorsePwd);
    bindEvent(): void;
    onTouchStart(): void;
    onTouchEnd(): void;
    onTouchMove(): void;
    /**
     * 清除监听事件
     * @example
     * beforeDestroy() {
     *   this.morsePwd.clear();
     * }
     */
    clear(): void;
    operation(type: number): void;
    reset(): void;
    click(): void;
    suc(): void;
    longPress(): void;
    log(...args: Array<unknown>): void;
}

export declare const morsePwdMixin: (pwd: number[], cb: Function) => any;

export declare class MpCI {
    ciLib: any;
    options: OptionsType;
    projectCI: any;
    savePreviewPath: any;
    appId: string;
    appName: string;
    type: string;
    root: string;
    ignores: Array<string>;
    pkgFile: string;
    env: string;
    robotNumber: number;
    webhookUrl?: string;
    chatId?: string;
    buildSetting: any;
    projectPath: string;
    privateKeyPath: string;
    cosInfo: any;
    commitInfo: any;
    buildDesc: string;
    buildTime?: string;
    version: string;
    previewResult: IUploadResult;
    errorLink?: string;
    pagePath?: string;
    searchQuery?: string;
    tryTimesMap: {
        UPLOAD: number;
        PREVIEW: number;
    };
    /**
     * 小程序自动化构建工具
     * @param {object} options 选项
     *
     * @example
     *
     * const { MpCI, fetchRainbowConfig } = require('t-comm');
     *
     * const env = "${env}"
     * const branch = "${branch}"
     *
     * const root = "${WORKSPACE}";
     *
     * async function getCIConfig() {
     *   let res = {};
     *   const str = await fetchRainbowConfig('mp_ci', {
     *     appId: '',
     *     envName: 'x',
     *     groupName: 'x',
     *   });
     *   try {
     *     res = JSON.parse(str);
     *   } catch (err) {}
     *   return res;
     * }
     *
     * function getRobot(config = {}) {
     *   return config?.robotMap?.[branch]?.[env] || 1;
     * }
     *
     * async function main() {
     *   const config = await getCIConfig();
     *   console.log('config: \n', config, typeof config);
     *   const {
     *     appName,
     *     appId,
     *     webhookUrl,
     *     chatId,
     *     cosInfo,
     *   } = config;
     *
     *   const ci = new MpCI({
     *     appName,
     *     appId,
     *     root,
     *     env,
     *     robotNumber: getRobot(config),
     *
     *     webhookUrl,
     *     chatId,
     *
     *     cosInfo,
     *   });
     *
     *   await ci.upload();
     *   await ci.preview();
     *   await ci.sendRobotMsg();
     * }
     *
     * main();
     */
    constructor(options: OptionsType);
    validateOptions(): void;
    initBaseInfo(): void;
    init(): void;
    getBuildTime(): void;
    /**
     * 上传
     */
    upload(): Promise<void>;
    tryUpload(): Promise<void>;
    preview(): Promise<void>;
    /**
     * 预览
     */
    tryPreview(): Promise<void>;
    /**
     * 上传预览图片到COS
     */
    uploadPreviewImg(previewResult: IUploadResult): Promise<void>;
    getCosKey(): string;
    getCOSFilePath(): string;
    /**
     * 发送机器人消息
     */
    sendRobotMsg(hasImg?: boolean): Promise<void>;
    uploadAndPreview(): Promise<void>;
    uploadFiles(files: Array<{
        key: string;
        path: string;
    }>): Promise<void>;
}

export declare function mpUploadAndReport({ branch, env, root, rainbowConfigKey, rainbowAppId, rainbowEnvName, rainbowGroupName, rdHost, bkStartType, bkBuildUrl, bkStartUserName, bkPipelineId, commitInfo, version, buildDesc, }: Record<string, any>): Promise<void>;

export declare function mpUploadAndReportByOptions(options: Record<string, any>): Promise<void>;

/** MR 变更文件信息 */
export declare interface MRChange {
    /** 旧文件路径 */
    old_path: string;
    /** 新文件路径 */
    new_path: string;
    /** 是否新增文件 */
    new_file: boolean;
    /** 是否重命名 */
    renamed_file: boolean;
    /** 是否删除 */
    deleted_file: boolean;
    /** diff 内容 */
    diff: string;
}

/** MR 变更详情（含 diff），统一使用 changes 字段名 */
export declare interface MRChangesDetail extends MRDetail {
    changes: MRChange[];
}

/** MR 详情 */
export declare interface MRDetail {
    id: number;
    iid: number;
    title: string;
    description: string;
    state: string;
    source_branch: string;
    target_branch: string;
    author: {
        username: string;
        name: string;
    };
    web_url: string;
    source_project_id: number;
    target_project_id: number;
    [k: string]: unknown;
}

/** 附近设备缓存项 */
export declare interface NearbyPeer {
    /** 对端 tempId（BLE payload 解析得到） */
    peerTempId: string;
    /** 对端设备 ID（BLE 物理层稳定标识） */
    deviceId: string;
    /** 最后发现时间戳 */
    lastSeenAt: number;
    /** 首次发现时间戳 */
    firstSeenAt: number;
    /** 信号强度 */
    rssi: number;
    /** 对端用户昵称（通过 getPeerByTempId 获取） */
    nick?: string;
    /** 对端头像 */
    userHead?: string;
    /** 对端 petId（用于去重） */
    petId?: string;
}

/**
 * 网络调度引擎
 *
 * 职责：把"请求拦截器 → doRequest → 响应拦截器 → decorator"串起来，
 * 对外暴露一个符合 `NetworkManager.setRequestImpl` 签名的函数。
 *
 * 调度链：
 *   1. 顺序跑 requestInterceptors（任一返回 abort=true 即中止）
 *   2. 调 doRequest（wx.request / fetch）
 *   3. 顺序跑 responseInterceptors（任一返回 abort=true 即走失败）
 *   4. 成功：resolve param.data（通常由 GetDataInterceptor 填好）
 *      失败：reject param.data（同上）
 *   5. decorator 包裹整个 Promise，做 r=100000 重试等横切逻辑
 */
declare class NetworkEngine {
    options: INetworkEngineOptions;
    constructor(options: INetworkEngineOptions);
    /** 对外暴露的请求函数：一次完整的 request 调用 */
    request: (cfg: IRawRequest) => Promise<any>;
    /** 不含 decorator 的单次请求主链（供 decorator 重试时调用） */
    runCore: (cfg: IRawRequest) => Promise<any>;
}

export declare function networkHookInPixui(): void;

export declare class NetworkManager {
    private static _instance;
    private _impl;
    static get instance(): NetworkManager;
    /** 业务侧注入自定义网络实现 */
    setRequestImpl(impl: RequestImpl): void;
    request(cfg: RequestConfig): Promise<any>;
}

/**
 * 延迟执行函数，等待下一个渲染帧
 * 使用 setTimeout 延迟 33ms（约一帧的时间），返回 Promise
 * @returns {Promise<number>} - 返回 Promise，resolve 值为 1
 * @example
 * ```ts
 * // 等待下一帧执行
 * await nextTick();
 * console.log('下一帧执行');
 *
 * // 或使用 then
 * nextTick().then(() => {
 *   console.log('下一帧执行');
 * });
 * ```
 */
export declare const nextTick: () => Promise<unknown>;

/**
 * 获取 Promise 化的 HTTP GET 请求方法
 * 将 request.get 方法转换为返回 Promise 的异步函数
 * @returns Promise 化的 GET 请求函数
 * @example
 * ```ts
 * const get = nodeGet();
 * const response = await get('https://api.example.com/data');
 * ```
 */
export declare function nodeGet(): Function;

/**
 * 获取 Promise 化的 HTTP POST 请求方法
 * 将 request.post 方法转换为返回 Promise 的异步函数
 * @returns Promise 化的 POST 请求函数
 * @example
 * ```ts
 * const post = nodePost();
 * const response = await post({
 *   url: 'https://api.example.com/data',
 *   json: { key: 'value' }
 * });
 * ```
 */
export declare function nodePost(): Function;

/**
 * 获取 Promise 化的 HTTP PUT 请求方法
 * 将 request.put 方法转换为返回 Promise 的异步函数
 * @returns Promise 化的 PUT 请求函数
 * @example
 * ```ts
 * const put = nodePut();
 * const response = await put({
 *   url: 'https://api.example.com/data/123',
 *   json: { key: 'updated value' }
 * });
 * ```
 */
export declare function nodePut(): Function;

/**
 * 格式化路径
 * @param path 文件路径，或目录路径
 * @returns 格式化后的路径
 * @example
 * ```ts
 * normalizePath('xxx/xxx/xxx');
 *
 * normalizePath('xxx\\xxx\\xxx');
 * ```
 */
export declare const normalizePath: (path: string) => string;

export declare function npmInstallTip({ packageName, packageLink, packagePostfix, packagePostfixEn, feedbackList, }: {
    packageName: string;
    packageLink: string;
    packagePostfix: string;
    packagePostfixEn: string;
    feedbackList: Array<string>;
}): void;

/**
 *
 * 阿拉伯数字和中文数字映射表，0 - 32
 * @type {object}
 * @example
 *
 * console.log(NUMBER_CHI_MAP[1]);
 * // '一'
 *
 * console.log(NUMBER_CHI_MAP[2]);
 * // '二'
 */
export declare const NUMBER_CHI_MAP: {
    0: string;
    1: string;
    2: string;
    3: string;
    4: string;
    5: string;
    6: string;
    7: string;
    8: string;
    9: string;
    10: string;
    11: string;
    12: string;
    13: string;
    14: string;
    15: string;
    16: string;
    17: string;
    18: string;
    19: string;
    20: string;
    21: string;
    22: string;
    23: string;
    24: string;
    25: string;
    26: string;
    27: string;
    28: string;
    29: string;
    30: string;
    31: string;
    32: string;
};

/**
 * 去掉对象中的某些属性
 * @param {any} obj 对象
 * @param {Array<string>} fields 要去除的属性列表
 * @returns 处理后的对象
 * @example
 * ```ts
 * omit({ a: 1, b: 2, c: 3 }, ['a'])
 * // { b: 2, c: 3 }
 * ```
 */
export declare function omit<T extends object, K extends keyof T>(obj: T, fields: K[] | readonly K[]): Omit<T, K>;

export declare function OneClickReleaseRainbowTask({ secretInfo, versionName, creator, updators, approvers, type, description, }: {
    secretInfo: ISecretInfo_3;
    versionName: string;
    creator: string;
    updators: string;
    approvers: string;
    type?: number;
    description?: string;
}): Promise<object>;

/**
 * 微信蓝牙 API 薄封装
 *
 * 把所有对 wx.* 的直接调用集中在这一层，外部只看到 Promise / 回调注册接口。
 * 这样：
 *   1. 主流程类 BluetoothBump 不直接依赖 wx，可注入 mock adapter 做单测
 *   2. 这里的实现也能单独被测：mock 一个 (global as any).wx 就够了
 */
export declare interface OpenAdapterResult {
    /** iOS 上 peripheral 模式失败时为 true，需降级为只扫描 */
    skipAdvertising: boolean;
}

export declare interface OpenLocation {
    lat?: string;
    lng?: string;
    name?: string;
    address?: string;
    scale?: number;
    context?: any;
    route?: string;
}

/**
 * 打开地图，查看位置
 * @param param 参数
 * @returns 查看Promise
 * @example
 * ```ts
 * openLocationInH5({
 *   lat,
 *   lng,
 *   name,
 *   address,
 *
 *   context: this,
 *   route: '/map'
 * });
 * ```
 */
export declare function openLocationInH5({ lat, lng, name, address, route, context, }: OpenLocation): Promise<number>;

/**
 * 打开地图，查看位置
 * @param param 参数
 * @returns 查看Promise
 * @example
 * ```ts
 * openLocationInMp({
 *   lat,
 *   lng,
 *   name,
 *   address,
 * });
 * ```
 */
export declare function openLocationInMp({ lat, lng, name, address, scale, }: OpenLocation): Promise<unknown>;

declare function openOrFindPage(browser: any, href: string, device: DEVICE_TYPE): Promise<any>;

/**
 * 打开腾讯文档链接
 *
 * - H5 环境下：直接 `window.location.href` 跳转
 * - 小程序环境下：跳转到腾讯文档小程序详情页
 *
 * @param jumpUrl 腾讯文档链接（必须以 `https://docs.qq.com/doc` 开头）
 * @returns 是否为腾讯文档链接（仅当链接合法时执行跳转并返回 true）
 *
 * @example
 * ```ts
 * openTencentDocLink('https://docs.qq.com/doc/xxx');
 * ```
 */
export declare function openTencentDocLink(jumpUrl?: string): boolean;

export declare function optimizeRobotContent({ content, maxLen, concatFn, }: {
    content?: string | undefined;
    maxLen?: number | undefined;
    concatFn?: ((more: number | string) => string) | undefined;
}): string;

declare interface Options {
    env: string;
    gameID: number;
    appID: string;
    webID: string;
    cookieDomain: string;
    checkLoginAPI: (userInfo: UserInfo) => Promise<any>;
    loginDomSelector?: string;
    [k: string]: any;
}

declare type OptionsType = {
    ci?: any;
    appId: string;
    appName?: string;
    robotNumber?: number;
    projectPath?: string;
    privateKeyPath?: string;
    ignores?: Array<string>;
    type?: string;
    root?: string;
    env?: string;
    buildSetting?: object;
    buildDesc?: string;
    version?: string;
    commitInfo?: Partial<IGitCommitInfo>;
    webhookUrl?: string;
    chatId?: string;
    cosInfo?: object;
    errorLink?: string;
    pagePath?: string;
    searchQuery?: string;
};

/**
 * 创建支持对象参数和分散参数的函数重载类型
 *
 * @example
 * ```ts
 * interface ShowDialogParams {
 *   content: string;
 *   title?: string;
 * }
 *
 * type ShowDialogFn = OverloadedFn<ShowDialogParams, ['content', 'title']>;
 * // 等价于:
 * // {
 * //   (params: ShowDialogParams): void;
 * //   (content: string, title?: string): void;
 * // }
 * ```
 */
export declare type OverloadedFn<T, K extends readonly (keyof T)[], R = void> = {
    (params: T): R;
    (...args: ParamsToTuple<T, K>): R;
};

/**
 * 包体积信息（用于在版本通知中展示发布前后的体积变化）
 *
 * 字段单位均为「字节」。所有字段都允许缺省，缺省项不会出现在最终消息中。
 */
declare interface PackageSizeInfo {
    /** 旧包 tarball 体积（字节）。0 或未传时，不展示新旧对比 */
    oldSize?: number;
    /** 新包 tarball 体积（字节）。必传，否则 packageSize 区块不会显示 */
    newSize: number;
    /** 旧包解包后体积（字节，可选） */
    oldUnpacked?: number;
    /** 新包解包后体积（字节，可选） */
    newUnpacked?: number;
    /** 新包文件数（可选） */
    fileCount?: number;
}

/**
 * 数字左侧加 0，直到满足长度要求
 * @param {string | number} num 当前数字
 * @param {number} [targetLength=2] 目标长度
 * @returns {string} 新的字符串
 * @example
 * ```ts
 * padZero(1, 3); // 001
 * ```
 */
export declare function padZero(num: number | string, targetLength?: number): string;

declare namespace page {
    export {
        initBrowser,
        getNewPage,
        openOrFindPage,
        setUserAgent,
        setSessionStorage,
        setRoute,
        DEVICE_TYPE
    }
}

/**
 * 将对象类型转换为元组类型（分散参数）
 *
 * @example
 * ```ts
 * interface MyParams {
 *   name: string;
 *   age?: number;
 *   city?: string;
 * }
 *
 * // 手动指定顺序
 * type MyArgs = ParamsToTuple<MyParams, ['name', 'age', 'city']>;
 * // 结果: [string, number?, string?]
 * ```
 */
export declare type ParamsToTuple<T, K extends readonly (keyof T)[]> = K extends readonly [infer First, ...infer Rest] ? First extends keyof T ? Rest extends readonly (keyof T)[] ? undefined extends T[First] ? [T[First]?, ...ParamsToTuple<T, Rest>] : [T[First], ...ParamsToTuple<T, Rest>] : [] : [] : [];

/**
 * 解析设备名形如 `BUMP_ABC123_XYZ789` → { myTempId, seenPeerId }。
 * 仅需 myTempId 时（旧格式 `BUMP_ABC123`）也兼容，seenPeerId 返回空串。
 */
export declare function parseBumpName(name: string | undefined | null): BluetoothBumpPayload | null;

export declare function parseChangeLog({ changelogStr, targetVersion, }: {
    changelogStr: string;
    targetVersion: string;
}): string;

export declare function parseColorToHSV(value: string): {
    h: number;
    s: number;
    v: number;
    alpha: number;
};

/**
 * 解析带注释的 json 文件
 * @param content 原始文件内容
 * @returns json数据
 * @example
 * ```ts
 * const text = `{
 *   // 这是一个注释
 *   "name": "foo",
 *   "version": "1.0.0" // 末尾注释
 * }`;
 * parseCommentJson(text); // { name: 'foo', version: '1.0.0' }
 * ```
 */
export declare function parseCommentJson(content: string): Record<string, any>;

export declare function parseComponentPath(filePath: string, relativePath: string): string;

/**
 * 解析 `git config --show-origin --get key` 的输出，
 * 格式：`file:<配置文件路径>\t<值>`
 *
 * 通过配置文件路径判断来源：
 * - 含 `.git/` 或 `config.worktree` → `'local'`
 * - 其它（~/.gitconfig、/etc/gitconfig 等） → `'global'`
 */
export declare function parseConfigWithOrigin(output: string): {
    value: string;
    scope: 'local' | 'global';
} | null;

export declare function parseCyclomaticComplexity(report?: Record<number, string>[]): StrictComplexityMetrics[];

export declare function parseEslintAndSendRobot({ mrId, mrUrl, lintReportFile, repoConfig, robotInfo, }: {
    mrId: string | number;
    mrUrl: string;
    lintReportFile: string;
    repoConfig: RepoConfigType;
    robotInfo: {
        webhookUrl: string;
        chatId: string;
    };
}): Promise<any> | undefined;

/**
 * 将字符串转为函数
 * @param {string} func 字符串
 * @returns {Function} 字符串对应的函数
 *
 * @example
 *
 * parseFunction('()=>console.log(1)')
 *
 * // ()=>console.log(1)
 */
export declare function parseFunction(func: unknown): ((...args: any[]) => any) | string;

/**
 * 将 git remote URL 解析成 `group/subgroup/project` 形式。
 *
 * 支持以下格式：
 * - `git@git.woa.com:pmd-mobile/pixui/pubgm-official.git`
 * - `ssh://git@git.woa.com:22/pmd-mobile/pixui/pubgm-official.git`
 * - `https://git.woa.com/pmd-mobile/pixui/pubgm-official.git`
 * - `http://git.woa.com/pmd-mobile/pixui/pubgm-official`
 *
 * @example
 * ```ts
 * parseGitProject('git@git.woa.com:pmd-mobile/pixui/pubgm-official.git');
 * // => 'pmd-mobile/pixui/pubgm-official'
 * ```
 */
export declare function parseGitProject(remoteUrl?: string | null): string | null;

/**
 * 解析灰度发布配置
 * 将嵌套的配置对象转换为平面的映射表
 * @param config - 原始配置对象
 * @returns 解析后的全局灰度发布配置
 * @example
 * ```ts
 * const config = {
 *   'project1': {
 *     'sub1': {
 *       'release': { grayVersion: '1.0.0', grayPercent: '50', cookieId: 'xxx' }
 *     }
 *   }
 * };
 * const parsed = parseGrayPublishConfig(config);
 * // { 'project1.sub1': { grayVersion: '1.0.0', ... } }
 * ```
 */
export declare function parseGrayPublishConfig(config?: Record<string, Record<string, Record<string, Record<string, string>>>>): IGlobalGrayPublishConfig;

export declare const parseHexChannel: (hex: any) => number;

export declare function parseHSLString(value: string): {
    h: number;
    s: number;
    v: number;
    alpha: number;
};

export declare function parseHSVString(value: string): {
    h: number;
    s: number;
    v: number;
    alpha: number;
};

/**
 * 通用 LLM 输出 JSON 容错解析
 *
 * 用于解析大语言模型（AI Agent）输出的 JSON：通常 LLM 输出的内容有以下几种 "脏" 情况：
 *   1. 直接就是合法 JSON
 *   2. JSON 被自然语言包围（"好的，下面是 JSON: { ... } 谢谢"）
 *   3. JSON 被 markdown 代码块包裹（```json { ... } ```）
 *   4. 因 token 上限被截断（缺少闭合的 ] 和 }）
 *
 * 本函数依次使用 5 层策略尽力解析：
 *   策略 1: 直接 JSON.parse
 *   策略 2: 提取第一个 `{` 到最后一个 `}` 之间的内容
 *   策略 3: 贪婪匹配最外层 markdown 代码块
 *   策略 4: 按括号平衡从第一个 `{` 开始匹配（应对尾部自然语言夹带）
 *   策略 5: token 截断时尝试补齐闭合符号（"、]、}）
 *
 * @param content LLM 返回的原始字符串
 * @param logTag  策略 5 触发时的日志前缀（默认 [AI]），便于上层区分调用方
 *
 * @example
 * ```ts
 * const result = parseLooseJson<{ name: string }>(aiResponseText);
 * if (result) console.log(result.name);
 * ```
 */
export declare function parseLooseJson<T>(content: string, logTag?: string): T | null;

export declare function parseMochaAwesomeResult(report: {
    results: Array<{
        suites: Array<{
            tests: Array<{
                duration: number;
                pass: number;
                fail: number;
                pending: number;
            }>;
        }>;
        file: string;
    }>;
}): {
    [k: string]: {
        duration: number;
        passes: number;
        failures: number;
        pending: number;
        tests: number;
        files: {
            [k: string]: {
                duration: number;
                passes: number;
                failures: number;
                pending: number;
                tests: number;
                testList: Array<{}>;
            };
        };
    };
};

/**
 * 从 TGit MR 的 URL 中解析出项目名称和 MR ID
 *
 * iid 与 id 的区别：
 * - iid：项目内的序号，从 1 开始递增，即 URL 和 Web 界面上看到的数字（如 /merge_requests/112 中的 112）
 * - id：MR 在整个 TGit 系统中的全局唯一 ID，不同项目间不重复
 *
 * 本函数从 URL 中解析出的数字是 iid（项目内序号），不是全局 id。
 * 如需获取全局 id，可使用 queryMRByIId 通过 iid 查询 MR 详情后获取。
 *
 * @param {string} url TGit MR 的 URL，如 https://git.woa.com/group/project/-/merge_requests/112
 * @returns {{ projectName: string, mrIid: string } | null} 解析结果（mrIid 为 URL 中的 iid），解析失败返回 null
 * @example
 *
 * // URL 中的 112 是 iid（项目内序号）
 * parseMRUrl('https://git.woa.com/pmd-mobile/ai-tool/rd-ai-common/-/merge_requests/112/notes')
 * // => { projectName: 'pmd-mobile/ai-tool/rd-ai-common', mrIid: '112' }
 *
 * parseMRUrl('https://git.woa.com/coecology/xd/-/merge_requests/169')
 * // => { projectName: 'coecology/xd', mrIid: '169' }
 */
export declare function parseMRUrl(url: string): {
    projectName: string;
    mrIid: string;
} | null;

export declare function parseOpenSourceReport({ reportArr, date, formattedDate, searchInfo, requestInfo, maxShowLinkNum, whiteList, filterOrgPath, }: {
    reportArr: IReportArr;
    date: string;
    formattedDate: string;
    searchInfo: ISearchInfo;
    requestInfo: IRequestInfo;
    maxShowLinkNum?: number;
    whiteList?: Array<string>;
    filterOrgPath?: string;
}): string;

/**
 * 从扫描到的设备里提取 mutual 协议 payload。
 *
 * 解析顺序（按"iOS 上能拿到的可能性"由高到低）：
 *   1. 设备名 / localName 前缀 `BUMP_` —— iOS↔iOS 唯一可靠通道
 *   2. serviceData[serviceUuid] —— Android 标准方案
 *   3. advertisData 整段 —— 部分机型把 payload 塞这里
 *   4. 设备名按旧格式 `myTempId|seenPeerId` 解析（向后兼容）
 */
export declare function parsePayload(dev: BluetoothDeviceInfo, serviceUuid: string): BluetoothBumpPayload | null;

/**
 * 解析广播 payload 字符串 → { myTempId, seenPeerId }
 * 解析失败返回 null（payload 不是本协议）。
 *
 * seenPeerId 为占位符 '------' 时返回空字符串，方便上层 `if (seenPeerId)` 判断。
 */
export declare function parsePayloadString(raw: string | undefined | null): BluetoothBumpPayload | null;

/**
 * 解析工蜂项目的路径或完整 URL，提取出标准的 `group/sub/repo` 形式路径
 *
 * 支持的输入格式：
 *   - 完整 URL：           https://git.woa.com/pmd-mobile/pmd-h5/press-next
 *   - 带 .git 后缀：       https://git.woa.com/pmd-mobile/pmd-h5/press-next.git
 *   - SSH 地址：           git@git.woa.com:pmd-mobile/pmd-h5/press-next.git
 *   - 纯路径：             pmd-mobile/pmd-h5/press-next
 *   - 带首尾斜杠的路径：    /pmd-mobile/pmd-h5/press-next/
 *
 * @param {string} pathOrUrl 项目路径或 URL
 * @returns {string} 标准化后的项目路径（如 pmd-mobile/pmd-h5/press-next）
 * @example
 *
 * parseProjectPath('https://git.woa.com/pmd-mobile/pmd-h5/press-next.git')
 * // => 'pmd-mobile/pmd-h5/press-next'
 */
export declare function parseProjectPath(pathOrUrl: string): string;

/**
 * 解析替换配置
 *
 * @param {Array<IReplaceConfig>} configList 配置列表
 * @returns {array} 处理后的配置列表
 *
 * @example
 * ```ts
 * parseReplaceConfig([{
 *   source: '',
 *   target: '',
 * }])
 * ```
 */
export declare function parseReplaceConfig(configList: Array<IReplaceConfig>): {
    source: string;
    target: string;
    sourceName: string;
    sourceType: IImportType;
    targetName: string;
    targetType: IImportType;
}[];

export declare function parseRGBBracket(value: string): {
    h: number;
    s: number;
    v: number;
    alpha: number;
};

export declare function parseRGBHex(value: any): {
    r: number;
    g: number;
    b: number;
    alpha: number;
};

export declare function parseRobotMessage(info: MessageType, labelSeparator?: string): string;

/**
 * 解析 H5 环境下的 SSE 数据流
 * @param {Object} params - 参数对象
 * @param {Function} params.success - 成功回调函数
 * @param {Function} params.fail - 失败回调函数
 * @param {Function} params.complete - 完成回调函数
 * @param {Response} params.response - 响应对象
 * @returns {Promise} 返回一个 Promise，处理 SSE 数据流
 * @example
 * ```ts
 * const response = await fetch('/api/sse', { method: 'POST' });
 * await parseSSEChunkInH5({
 *   response,
 *   success: (chunk, line) => console.log(chunk),
 *   fail: ({ response }) => console.error(response.status),
 *   complete: () => console.log('finish'),
 * });
 * ```
 */
export declare const parseSSEChunkInH5: ({ success, fail, complete, response, }: {
    success: RequestParams['success'];
    fail: RequestParams['fail'];
    complete: RequestParams['complete'];
    response: Response;
}) => Promise<void>;

/**
 * 解析 MP 环境下的 SSE 数据块
 * @param {Object} params - 参数对象
 * @param {string} params.chunk - 数据块
 * @param {Fail} [params.fail] - 失败回调函数
 * @param {Success} [params.success] - 成功回调函数
 * @example
 * ```ts
 * parseSSEChunkInMP({
 *   chunk: 'data: hello\ndata: world\n',
 *   success: (data, line) => console.log(data),
 *   fail: () => console.error('parse error'),
 * });
 * ```
 */
export declare const parseSSEChunkInMP: ({ chunk, fail, success, }: {
    chunk: string;
    fail?: Fail | undefined;
    success?: Success | undefined;
}) => void;

/**
 * 功能和上面的dateFormat/timeStampFormat类型，只是参数time可以接收多种类型，且参数cFormat用的是{y}形式
 * @param {(Object|string|number)} time 输入日期
 * @param {string} cFormat 时间格式
 * @returns {string | null} 格式化后的日期字符串
 * @example
 *
 * const date = new Date('2020-11-27 8:23:24');
 *
 * const res = parseTime(date, 'yyyy-MM-dd hh:mm:ss')
 *
 * // 2020-11-27 08:23:24
 */
export declare function parseTime(time: Date | number, cFormat: string): string | null;

/**
 * 用大驼峰，即 PascalCase 格式，来格式化字符串
 * @param str 字符串
 * @returns PascalCase 的字符串
 *
 * @example
 * ```ts
 * pascalCase('ab-cd')
 * // AbCd
 *
 * pascalCase('ab_cd')
 * // AbCd
 * ```
 */
export declare function pascalCase(str?: string): string;

declare type Path = (string | number | symbol)[];

/**
 * Normalize the given path string, returning a regular expression.
 *
 * An empty array can be passed in for the keys, which will hold the
 * placeholder key descriptions. For example, using `/user/:id`, `keys` will
 * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
 * @ignore
 * @param  {(string|RegExp|Array)} path
 * @param  {Array=}                keys
 * @param  {Object=}               options
 * @returns {!RegExp}
 */
export declare function pathToRegexp(path: string | RegExp | Array<any>, keys?: Array<any>, options?: any): any;

export declare namespace pathToRegexp {
    var parse: parse;
    var compile: compile;
    var tokensToFunction: tokensToFunction;
    var tokensToRegExp: tokensToRegExp;
}

/** mutual 模式：广播 payload 分隔符 */
export declare const PAYLOAD_SEPARATOR = "|";

/** 候选 peer 的内存记录 */
export declare interface PeerRecord {
    peerTempId: string;
    /** 对方广播里携带的"它看到的对方 ID"（用于判断是否是双向互认） */
    seenPeerId: string;
    rssi: number;
    /** 最近一次见到的时间戳 */
    lastSeen: number;
    /** 对应的原始设备，便于回传给业务方 */
    dev: BluetoothDeviceInfo;
}

/** 从候选池里挑选"信号最强且在 TTL 内"的 peer（用于决定广播里要"点名"谁） */
export declare function pickBestPeer(peers: Map<string, PeerRecord>, now: number, ttlMs: number, rssiThreshold: number): PeerRecord | null;

export declare class PollingRequest {
    maxRequest: number;
    maxPollingTime: number;
    timeInterval: number;
    timer: any;
    /**
     * 轮询
     * @constructor
     * @param {number} [maxPollingTime=10] 最大轮询次数
     * @param {number} [timeInterval=2000] 轮询间隔
     * @example
     *
     * ```ts
     * const polling = new PollingRequest(10);
     * const cb = () => {
     *   this.onGetTeamList(true);
     * };
     * polling.polling(cb);
     * ```
     */
    constructor(maxPollingTime?: number, timeInterval?: number);
    /**
     * 重置，即取消轮询
     */
    reset(): void;
    /**
     * 开始轮询
     * @param {function} func 轮询方法
     */
    polling(func: Function): void;
}

export declare function post(cfg: RequestConfig): Promise<any>;

/**
 * 处理彩虹配置发布任务
 * @param {object} config 配置信息
 * @param {string} config.taskId 任务ID
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @param {string} config.versionName 版本名称
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 * processRainbowReleaseTask({
 *   taskId: 'taskId',
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   },
 *   versionName: 'version'
 * }).then(() => {
 *
 * })
 */
export declare function processRainbowReleaseTask({ taskId, secretInfo, versionName, }: {
    taskId: string;
    secretInfo: ISecretInfo_3;
    versionName: string;
}): Promise<{
    success: boolean;
    taskId: string;
}>;

declare interface ProjectInfo {
    project: string;
    commits: Array<CommitInfo>;
    commitsLength: number;
    analyzeDir: string;
    git: string;
}

declare interface ProtectedRuleForm {
    name?: string;
    description?: string;
    push_access_level?: number;
    merge_access_level?: number;
    commit_force?: boolean;
    commit_reset?: boolean;
    commit_reset_rule?: number;
    review_check?: boolean;
    commit_check?: boolean;
    creator_can_approve?: boolean;
    push_create_review?: boolean;
    rule_modify?: boolean;
    note_label?: boolean;
    resolved_check?: boolean;
    auto_create_review_pre_push?: boolean;
    approver_rule?: number;
    necessary_approver_rule?: number;
    suggestion_reviewer?: string;
    necessary_reviewer?: string;
    path_reviewer?: string;
    mr_template?: string;
    merge_request_must_link_tapd_tickets?: boolean;
    allow_merge_commits?: boolean;
    allow_squash_merging?: boolean;
    allow_rebase_merging?: boolean;
    default_merge_method?: number;
    owners_review_enabled?: boolean;
    initial_owners_min_count?: number;
    forbidden_add_necessary_reviewer?: boolean;
}

declare type ProvType = {
    text?: String;
    code?: String | Number;
    children?: Array<ProvTypeChild>;
};

declare type ProvTypeChild = {
    text: String;
    code: String | Number;
};

/** 清理候选池里过期的 peer（就地修改） */
export declare function pruneExpiredPeers(peers: Map<string, PeerRecord>, now: number, ttlMs: number): void;

export declare const PUBLISH_ENV_MAP: {
    readonly PROD: "prod";
    readonly TEST: "test";
    readonly DEV_CLOUD: "devcloud";
};

/**
 * 发布任务
 *
 * @param {object} config 配置信息
 * @param {string} config.taskId 任务Id
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 * publishRainbowTask({
 *   taskId: 'taskId',
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   }
 * }).then(() => {
 *
 * })
 */
export declare function publishRainbowTask({ taskId, secretInfo, }: {
    taskId: string;
    secretInfo: ISecretInfo_3;
}): Promise<object>;

export declare function purgePathCache({ secretId, secretKey, area, flushType, paths, }: {
    secretId: string;
    secretKey: string;
    area?: (typeof AREA_MAP)[keyof typeof AREA_MAP];
    flushType: 'flush' | 'delete';
    paths: string[];
}): Promise<any>;

/**
 * 刷新腾讯云 CDN URL 缓存
 * 提交 URL 刷新请求，使 CDN 节点上的缓存内容失效
 * @param {object} config 配置信息
 * @param {string} config.secretId 腾讯云 secretId
 * @param {string} config.secretKey 腾讯云 secretKey
 * @param {string} [config.area='mainland'] 刷新区域，默认为中国大陆
 * @param {Array<string>} config.urls 需要刷新的 URL 列表
 * @returns {Promise<any>} 刷新结果
 * @example
 * ```ts
 * await purgeUrlCache({
 *   secretId: 'xxx',
 *   secretKey: 'xxx',
 *   urls: ['https://cdn.example.com/file1.js', 'https://cdn.example.com/file2.css'],
 * });
 * ```
 */
export declare function purgeUrlCache({ secretId, secretKey, area, urls, }: {
    secretId: string;
    secretKey: string;
    area?: (typeof AREA_MAP)[keyof typeof AREA_MAP];
    urls: Array<string>;
}): Promise<any>;

export declare function pushCopyFilesInSyncCos({ fileList, cos, workspace, }: {
    fileList: Array<{
        key: string;
        path: string;
        relativePath: string;
        url: string;
    }>;
    cos: {
        domainDir: string;
        cdnPrefix: string;
        copyList: Array<{
            source: string;
            copyTargetPrefix?: string;
        }>;
    };
    workspace: string;
}): void;

export declare function pushMainlandCosFilesInSyncCos({ fileList, cos, mainLandCdnInfo, toPushMainlandFiles, }: {
    fileList: Array<{
        key: string;
        path: string;
        relativePath: string;
    }>;
    cos: {
        domainDir: string;
    };
    mainLandCdnInfo: {
        cdnPrefix: string;
        domainDir: string;
    };
    toPushMainlandFiles: Array<{
        key: string;
        path: string;
        relativePath: string;
        url: string;
    }>;
}): void;

export declare function pushUrlCache({ secretId, secretKey, area, urls, }: {
    secretId: string;
    secretKey: string;
    area?: (typeof AREA_MAP_WITH_GLOBAL)[keyof typeof AREA_MAP_WITH_GLOBAL];
    urls: Array<string>;
}): Promise<any>;

/**
 * App.onShow 回调参数（最小可用子集）
 */
export declare interface QQOnShowOptions {
    referrerInfo?: QQReferrerInfo;
    query?: Record<string, any>;
    scene?: number;
    path?: string;
    [key: string]: any;
}

/**
 * QQ 环境下直接通过 qq-wxmini-plugin 拿 QQ 登录 code
 *
 * 适用场景：用户已在 QQ App 中（即 `checkIsQQEnv() === true`），
 * 此时无需 `wx.navigateToMiniProgram` 跳腾讯 QQ 小程序，
 * 可直接调用插件的 `plugin.login()` 同步拿到 QQ code，
 * 再交给业务后台用 `_ltype=tiploginqqproc` 换登录态。
 *
 * @returns code 字符串；插件不可用或登录失败时 reject
 */
export declare function qqPluginLogin(): Promise<{
    code: string;
}>;

/**
 * 通用 post 请求函数签名
 *
 * 与 @tencent/pmd-network、t-comm/cocos/manager 兼容
 */
export declare type QQPostFn = <T = any>(args: {
    url: string;
    reqData?: Record<string, any>;
    [key: string]: any;
}) => Promise<T>;

/**
 * QueryUserInfo 接口的最小响应结构（业务可自行扩展具体类型）
 */
export declare interface QQQueryUserInfoRsp {
    user_info?: {
        uid?: string;
        nick?: string;
        header?: string;
        utype?: number;
        [key: string]: any;
    };
    [key: string]: any;
}

/**
 * 微信小程序/小游戏中 QQ 登录相关类型定义
 *
 * 数据来源：腾讯 QQ 小程序登录后通过 wx.navigateToMiniProgram 的回调
 * 在 App.onShow 的 options.referrerInfo.extraData 中携带票据信息
 *
 * 字段以现网真实数据为准。
 */
/**
 * 单条票据原始结构（来自 referrerInfo.extraData.tickets[i]）
 */
export declare interface QQRawTicket {
    /** 票据名称，目前固定为 access_token，不区分大小写 */
    name: 'access_token' | string;
    /** 票据值（access_token 实际值） */
    ticket: string;
    /** QQ 互联 appid（请求时由 launchQQMP 的 extraData.tickets[i].appid 决定） */
    appid: string | number;
    /** QQ 用户 openid */
    openid: string;
    /** 刷新 token，用于过期后续期 */
    refresh_token: string;
    /** 票据有效期（单位：秒），可选 */
    expires_in?: number;
    /** 是否为新用户，可选 */
    is_new?: boolean;
    /** 后端透传字段 */
    [key: string]: any;
}

/**
 * referrerInfo.extraData 原始结构
 */
export declare interface QQReferrerExtraData {
    /** 状态码：0 表示成功 */
    retcode: number;
    /** 票据列表 */
    tickets: QQRawTicket[];
    /** QQ 小程序透传字段 */
    [key: string]: any;
}

/**
 * referrerInfo 原始结构
 */
export declare interface QQReferrerInfo {
    /** 来源小程序的 appId（应等于腾讯 QQ 小程序 appId） */
    appId: string;
    /** QQ 小程序透传的数据 */
    extraData?: QQReferrerExtraData;
    /** 其他字段 */
    [key: string]: any;
}

/**
 * 简易 storage 接口（兼容 wx.setStorageSync / oops.storage 等）
 */
export declare interface QQStorageLike {
    set(key: string, value: any): void;
    get<T = any>(key: string): T | undefined;
    remove?(key: string): void;
}

/**
 * 提取后的 QQ 登录票据信息（供业务侧使用）
 */
export declare interface QQTicketInfo {
    /** QQ 用户 openid */
    qqOpenid: string;
    /** access_token 票据值 */
    qqAccessToken: string;
    /** 刷新 token */
    qqRefreshToken: string;
    /** QQ 互联 appid */
    qqAppid: string | number;
    /** 票据有效期（秒），可选 */
    qqExpiresIn?: number;
    /** 是否为新用户，可选 */
    qqIsNew?: boolean;
}

/**
 * qq-wxmini-plugin 微信小程序插件封装
 *
 * 背景：QQ 用户无法直接打开微信小程序，但微信提供了 qq-wxmini-plugin 插件，
 * 让 QQ 用户能够以 QQ 身份访问微信小程序。本文件封装插件初始化与环境检测。
 *
 * 使用前置条件：
 * 1. 在微信公众平台后台添加 qq-wxmini-plugin 插件授权
 * 2. 在 manifest.json / app.json 的 plugins 节点声明：
 *    {
 *      "qq-wxmini-plugin": {
 *        "version": "1.0.7",
 *        "provider": "wx41f6784ad4052201"
 *      }
 *    }
 */
/**
 * QQ 插件接口（最小可用子集）
 */
export declare interface QQWXMiniPlugin {
    /** 初始化插件（必须先调用） */
    initPlugin(wx: any): void;
    /** 判断当前是否为 QQ 环境（QQ 用户通过插件访问微信小程序） */
    isQQEnv(): boolean;
    /**
     * QQ 环境下直接拿 QQ 登录 code（无需跳腾讯 QQ 小程序）
     *
     * 文档：https://doc.weixin.qq.com/doc/w3_ANAAAgaEACcCN60gP1LZiRDujSMor
     */
    login?(): Promise<{
        code: string;
    }>;
    [key: string]: any;
}

/**
 * 查询伽利略日志（调用蓝鲸网关 /prod/log/query）
 *
 * 参考文档：https://iwiki.woa.com/p/4007673553
 *
 * 调用前需要在「伽利略 API 权限申请表」中申请 bk_app_code/bk_app_secret，以及对应 target 的查询权限。
 *
 * @example
 * ```ts
 * import { queryGalileoLog, GalileoLogSortType } from 't-comm/lib/galileo-api';
 *
 * const now = Date.now();
 * const res = await queryGalileoLog(
 *   {
 *     target: 'PCG-123.galileo.apiserver',
 *     namespace: 'Production',
 *     start: now - 30 * 60 * 1000,
 *     end: now,
 *     limit: 100,
 *     query: 'message:target and level:error',
 *     sort_type: GalileoLogSortType.ASC,
 *   },
 *   {
 *     auth: {
 *       bk_app_code: 'tip-tool',
 *       bk_app_secret: 'xxx',
 *     },
 *   },
 * );
 * console.log(res.logs, res.has_next_page, res.cursor);
 * ```
 */
export declare function queryGalileoLog(req: QueryGalileoLogReq, options: QueryGalileoLogOptions): Promise<QueryGalileoLogRsp>;

/**
 * 通过游标不断翻页，直到满足 limit 条数或 has_next_page=false。
 *
 * 伽利略后端分片查询时，稀疏数据可能单次只返回少量条目，需要借助 cursor 继续翻页。
 * 该方法会自动循环翻页直到累计条数 >= req.limit 或没有下一页。
 *
 * @param req 查询参数，limit 为期望累计的总条数
 * @param options 鉴权及请求配置
 * @param extra 可选项：最大翻页次数、每页大小
 *
 * @example
 * ```ts
 * const res = await queryGalileoLogAll(
 *   {
 *     target: 'PCG-123.galileo.apiserver',
 *     namespace: 'Production',
 *     start: Date.now() - 3600 * 1000,
 *     end: Date.now(),
 *     limit: 500,
 *     query: 'level:error',
 *   },
 *   { auth: { bk_app_code: 'xxx', bk_app_secret: 'xxx' } },
 * );
 * ```
 */
export declare function queryGalileoLogAll(req: QueryGalileoLogReq, options: QueryGalileoLogOptions, extra?: {
    /** 最大翻页次数，默认 20，防止死循环 */
    maxPage?: number;
    /** 每次翻页传给后端的 limit，默认 100（伽利略上限） */
    pageSize?: number;
}): Promise<QueryGalileoLogRsp>;

/** 查询日志接口的额外配置 */
export declare interface QueryGalileoLogOptions {
    /** 蓝鲸 APIGW 鉴权 */
    auth: GalileoAuth;
    /** 自定义请求地址，默认 https://galileo-api.apigw.o.woa.com/prod/log/query */
    url?: string;
    /** 请求超时（毫秒），默认 15000 */
    timeout?: number;
}

/**
 * 查询日志请求参数，对应 proto QueryLogReq
 * @ignore
 */
export declare interface QueryGalileoLogReq {
    /** 观测对象，必填，如 "PCG-123.galileo.apiserver" */
    target: string;
    /** 命名空间，必填 */
    namespace: GalileoNamespace;
    /** 查询开始时间（毫秒） */
    start: number;
    /** 查询结束时间（毫秒） */
    end: number;
    /** 单次最大查询 100 条，取值 (0, 100] */
    limit: number;
    /** tag 条件搜索 */
    tag_where?: GalileoTagSearch;
    /**
     * message 关键字搜索，多关键字之间关系为"且"。
     * @deprecated 建议使用 include / exclude
     */
    message_keyword?: string[];
    /** 游标翻页查询，下一页传入上一次响应的 cursor */
    cursor?: string;
    /** message 包含搜索 */
    include?: GalileoMessageSearch;
    /** message 排除搜索 */
    exclude?: GalileoMessageSearch;
    /**
     * 伽利略查询语句。有查询语句时优先使用，没有再使用 tag_where、message_keyword、include、exclude。
     * 例如 "message:target and level:error"
     */
    query?: string;
    /** 排序 */
    sort_type?: GalileoLogSortType;
}

/** 查询日志响应，对应 proto QueryLogRsp */
export declare interface QueryGalileoLogRsp {
    /** 0 为成功，其他为错误 */
    code: number;
    msg: string;
    /** 当前实际查询所得条数 */
    total: number;
    logs: GalileoLogRecord[];
    /** 游标翻页查询 */
    cursor: string;
    /** 是否有下一页 */
    has_next_page: boolean;
}

/**
 * 查询分组配置
 * @param {object} config 配置信息
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @returns {Promise<Array<object>>} 分组配置
 *
 * @example
 * queryGroupInfo({
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   }
 * }).then(() => {
 *
 * })
 */
export declare function queryGroupInfo({ secretInfo }: {
    secretInfo: ISecretInfo_3;
}): Promise<Array<{
    key: string;
    value: string;
    value_type: RainbowKeyValueType;
}>>;

/**
 * 根据 iid（项目内序号）查询 MR 评审信息
 *
 * iid 与 id 的区别：
 * - iid：项目内的序号，从 1 开始递增，即 URL 和 Web 界面上看到的数字（如 /merge_requests/112 中的 112）
 * - id：MR 在整个 TGit 系统中的全局唯一 ID，不同项目间不重复
 *
 * 对应 API：GET /api/v3/projects/:id/merge_request/iid/:merge_request_iid/review
 *
 * @param {object} options 输入配置
 * @param {string} options.projectName 项目名称或项目全路径
 * @param {string} options.privateToken 密钥
 * @param {string} options.mrIid 合并请求在项目中的编号 iid（即 URL 中看到的数字）
 * @param {string} [options.baseUrl] 自定义 API 基础路径
 * @returns {Promise<object>} MR 评审信息，包含 id（评审记录全局 ID）、reviewable_id（reviewer/summary 接口需要的 ID）、iid、title、description、author 等字段
 * @example
 *
 * queryMRByIId({
 *   projectName: 'coecology/xd',
 *   privateToken: 'xxxxx',
 *   mrIid: '169',
 * }).then((resp) => {
 *   console.log(resp.id);    // 全局 id
 *   console.log(resp.title); // MR 标题
 * })
 */
export declare function queryMRByIId({ projectName, privateToken, mrIid, baseUrl }: {
    projectName: string;
    mrIid: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<object>;

/**
 * 使用 QQ 票据请求后台 QueryUserInfo 接口换取登录态
 *
 * 接口域名、post 方法均由调用方注入，组件不耦合任何业务包。
 *
 * @param options 必填 host / post / ticketInfo
 * @returns 后台返回的用户信息；票据无效或失败时返回 undefined
 */
export declare function queryQQLoginUserInfo<T = QQQueryUserInfoRsp>(options: QueryQQLoginUserInfoOptions): Promise<T | undefined>;

/**
 * queryQQLoginUserInfo 的入参
 */
export declare interface QueryQQLoginUserInfoOptions {
    /** 接口完整 host（含协议，无末尾斜杠），如 https://a.igame.qq.com */
    host: string | (() => string);
    /** post 请求方法（必填） */
    post: QQPostFn;
    /** QQ 票据信息（必填） */
    ticketInfo: QQTicketInfo;
    /** 接口路径，默认 pmdtrpc.commcgi.user.user/QueryUserInfo */
    apiPath?: string;
    /** 兜底 QQ 互联 appid（票据中无 appid 时使用） */
    fallbackQQAppId?: string | number;
    /** 额外 query 参数 */
    extraQuery?: Record<string, string | number>;
    /** 额外 reqData */
    extraReqData?: Record<string, any>;
}

export declare function queryString(options: Record<string, string | number>, needEncode?: boolean): string;

declare const RAINBOW_VALUE_TYPE_MAP: {
    1: {
        type: string;
        ext: string;
    };
    2: {
        type: string;
        ext: string;
    };
    3: {
        type: string;
        ext: string;
    };
    4: {
        type: string;
        ext: string;
    };
    5: {
        type: string;
        ext: string;
    };
    18: {
        type: string;
        ext: string;
    };
    20: {
        type: string;
        ext: string;
    };
};

declare type RainbowKeyValueType = keyof typeof RAINBOW_VALUE_TYPE_MAP;

/**
 * 在区间内获取随机整数
 * @param {number} min 最小值
 * @param {number} max 最大值
 * @returns 随机数
 *
 * @example
 * ```ts
 * random(0, 19) // 1
 * ```
 */
export declare function random(min: number, max: number): number;

/**
 * 获取随机字符串
 * @param {number} length 字符串长度，默认 32
 * @returns {string} 字符串
 * @example
 * ```ts
 * randomString()
 *
 * randomString(16)
 * ```
 */
export declare function randomString(e?: number): string;

/**
 * 根据边界值修正数字
 * @param {number} num 待处理的数字
 * @param {number} min 边界最小值
 * @param {number} max 边界最大值
 * @returns {number} 处理结果
 * @example
 * ```ts
 * range(12, 1, 2); // 2
 * ```
 */
export declare function range(num: number, min: number, max: number): number;

export declare const RAW_CITY_DATA: {
    provData: {
        11: string;
        12: string;
        13: string;
        14: string;
        15: string;
        21: string;
        22: string;
        23: string;
        31: string;
        32: string;
        33: string;
        34: string;
        35: string;
        36: string;
        37: string;
        41: string;
        42: string;
        43: string;
        44: string;
        45: string;
        46: string;
        50: string;
        51: string;
        52: string;
        53: string;
        54: string;
        61: string;
        62: string;
        63: string;
        64: string;
        65: string;
        71: string;
        81: string;
        82: string;
    };
    cityData: {
        11: string[];
        12: string[];
        13: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
        };
        14: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
        };
        15: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            22: string;
            25: string;
            29: string;
            30: string;
        };
        21: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
        };
        22: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            24: string;
            25: string;
        };
        23: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            27: string;
        };
        31: string[];
        32: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
        };
        33: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
        };
        34: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
            18: string;
        };
        35: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
        };
        36: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
        };
        37: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
        };
        41: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
            18: string;
            19: string;
        };
        42: {
            1: string;
            2: string;
            3: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            28: string;
            94: string;
            95: string;
            96: string;
            A21: string;
        };
        43: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            31: string;
        };
        44: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            12: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
            18: string;
            19: string;
            20: string;
            51: string;
            52: string;
            53: string;
        };
        45: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            13: string;
            14: string;
        };
        46: {
            1: string;
            2: string;
            91: string;
            92: string;
            93: string;
            95: string;
            96: string;
            97: string;
            A25: string;
            A26: string;
            A27: string;
            A28: string;
            A30: string;
            A31: string;
            A33: string;
            A34: string;
            A35: string;
            A36: string;
            A37: string;
            A38: string;
            A39: string;
        };
        50: string[];
        51: {
            1: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            13: string;
            14: string;
            15: string;
            16: string;
            17: string;
            18: string;
            19: string;
            20: string;
            32: string;
            33: string;
            34: string;
        };
        52: {
            1: string;
            2: string;
            3: string;
            4: string;
            22: string;
            23: string;
            24: string;
            26: string;
            27: string;
            31: string;
            32: string;
            33: string;
            34: string;
            35: string;
            36: string;
            37: string;
        };
        53: {
            1: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            23: string;
            25: string;
            26: string;
            28: string;
            29: string;
            31: string;
            33: string;
            34: string;
        };
        54: {
            1: string;
            21: string;
            22: string;
            23: string;
            24: string;
            25: string;
            26: string;
        };
        61: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
        };
        62: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
            6: string;
            7: string;
            8: string;
            9: string;
            10: string;
            11: string;
            12: string;
            29: string;
            30: string;
        };
        63: {
            1: string;
            21: string;
            22: string;
            23: string;
            25: string;
            26: string;
            27: string;
            28: string;
        };
        64: {
            1: string;
            2: string;
            3: string;
            4: string;
            5: string;
        };
        65: {
            1: string;
            2: string;
            21: string;
            22: string;
            23: string;
            27: string;
            28: string;
            29: string;
            30: string;
            31: string;
            32: string;
            40: string;
            42: string;
            43: string;
            91: string;
            92: string;
            93: string;
            94: string;
        };
        71: string[];
        81: string[];
        82: string[];
    };
};

/**
 * 获取带注释的 json 文件内容
 * @param file 文件路径
 * @returns json数据
 * @example
 * ```ts
 * // tsconfig.json 中可能含有 // 注释
 * const config = readCommentJson('./tsconfig.json');
 * console.log(config.compilerOptions);
 * ```
 */
export declare function readCommentJson(file: string): Record<string, any>;

/**
 * 读取文件中环境变量的值，支持：
 * - NPM_TOKEN=xxx
 * - NPM_TOKEN = xxx
 * @param {string} key 环境变量的key
 * @param {string} filepath 保存环境变量的文件路径
 * @returns {string} 环境变量的值
 * @example
 * ```ts
 * const token = readEnvVariable('NPM_TOKEN', '.env.local');
 * console.log(token); // 'npm_xxxxxxxxxxxxxxxx'
 * ```
 */
export declare function readEnvVariable(key: string, filepath: string): string;

/**
 * 读取文件
 * @param {string} file 文件地址
 * @param {boolean} [isJson] 是否需要 json 反序列化
 * @returns {any} 文件内容
 * @example
 * ```ts
 * readFileSync('b.txt', false);
 *
 * readFileSync('b.json', true);
 * ```
 */
export declare function readFileSync(file: string, isJson?: boolean): any;

/**
 * 解析 JSON 字符串为对象
 * 安全地解析 JSON 字符串，解析失败时输出错误信息并返回空对象
 * @param content - JSON 字符串内容
 * @param file - 文件路径（用于错误日志）
 * @returns 解析后的对象，解析失败时返回空对象
 * @example
 * ```ts
 * const data = readJson('{"name":"test"}', 'config.json');
 * console.log(data); // { name: 'test' }
 * ```
 */
export declare function readJson(content: string, file: string): Record<string, any>;

/**
 * 从日志目录读取 JSON 文件
 * 读取 ./log 目录下的 JSON 文件内容
 * @param file - 文件名（相对于 log 目录）
 * @param defaultContent - 文件不存在时返回的默认内容，默认为 '{}'
 * @returns JSON 文件内容字符串
 * @example
 * ```ts
 * const content = readJsonLog('data.json', '[]');
 * ```
 */
export declare function readJsonLog(file: string, defaultContent?: string): any;

/**
 * 从 storage 读取已保存的 QQ 登录票据
 */
export declare function readQQTicketInfo(config: {
    storage?: QQStorageLike;
    storageKey: string;
}): QQTicketInfo | undefined;

export declare function refreshTencentDocToken({ clientId, clientSecret, refreshToken, }: {
    clientId: string;
    clientSecret: string;
    refreshToken: string;
}): Promise<any>;

/**
 * 移除CSS
 *
 * @param {string} href - CSS链接
 *
 * @example
 *
 * removeCss('https://xxx.css')
 */
export declare function removeCss(href: string): void;

/**
 *
 * 27.移除元素
 *
 * https://leetcode.cn/problems/remove-element/description/?envType=study-plan-v2&envId=top-interview-150
 *
 * 双指针。
 * - 右指针 right 指向当前将要处理的元素，左指针 left 指向下一个将要赋值的位置。
 * - 如果右指针不等于 val，就将右指针指向的值赋值给左指针位置，左指针右移一位。
 *
 *
 * - 时间复杂度：O(n)，其中 n 为序列的长度。我们只需要遍历该序列至多两次。
 * - 空间复杂度：O(1)。我们只需要常数的空间保存若干变量
 *
 * @example
 * ```ts
 * removeElementInArrayV1([3, 2, 2, 3], 3); // 2
 * removeElementInArrayV1([0, 1, 2, 2, 3, 0, 4, 2], 2); // 5
 * ```
 */
export declare function removeElementInArrayV1(nums: number[], val: number): number;

/**
 *
 * 27.移除元素
 *
 * https://leetcode.cn/problems/remove-element/description/?envType=study-plan-v2&envId=top-interview-150
 *
 * 对撞指针。
 * - 两个指针初始时分别位于数组的首尾，向中间移动遍历该序列。
 * - 如果左指针 left 指向的元素等于 val，此时将右指针 right 指向的元素复制到左指针 left 的位置，然后右指针 right 左移一位。否则左指针 left 右移一位。
 *
 * - 时间复杂度：O(n)，其中 n 为序列的长度。我们只需要遍历该序列至多一次。
 * - 空间复杂度：O(1)。我们只需要常数的空间保存若干变量
 *
 * 第一种是快慢指针，第二种是对撞指针，同样是双指针，前者同向出发，因此用一个 for 循环实现遍历；后者前后出发，因此用 while 循环判断指针对撞时退出循环
 *
 * @example
 * ```ts
 * removeElementInArrayV2([3, 2, 2, 3], 3); // 2
 * removeElementInArrayV2([0, 1, 2, 2, 3, 0, 4, 2], 2); // 5
 * ```
 */
export declare function removeElementInArrayV2(nums: number[], val: number): number;

/**
 *移除第一个和最后一个反斜杠
 *
 * @export
 * @param {string} [str=''] 输入字符串
 * @returns {string} 字符串
 *
 * @example
 * ```ts
 * removeFirstAndLastSlash('/abc/')
 *
 * 'abc'
 * ```
 */
export declare function removeFirstAndLastSlash(str?: string): string;

/**
 * 移除第一个反斜杠
 *
 * @export
 * @param {string} [str=''] 输入字符串
 * @returns {string} 字符串
 * @example
 * ```ts
 * removeFirstSlash('/abc/ddd/')
 *
 * 'abc/ddd/'
 * ```
 */
export declare function removeFirstSlash(str?: string): string;

/**
 * 移除最后一个反斜杠
 *
 * @export
 * @param {string} [str=''] 输入字符串
 * @returns {string} 字符串
 *
 * @example
 * ```ts
 * removeLastSlash('/abc/')
 *
 * '/abc'
 * ```
 */
export declare function removeLastSlash(str?: string): string;

/**
 * 移除 MSDK 原生回调监听器
 * 取消监听原生层发送给 Web 层的消息
 * @param callback - 要移除的回调函数
 * @example
 * ```ts
 * const callback = (data) => console.log(data);
 * addMsdkNativeCallbackListener(callback);
 * // 稍后移除
 * removeMsdkNativeCallbackListener(callback);
 * ```
 */
export declare function removeMsdkNativeCallbackListener(callback: Function): void;

/**
 * @export removeUrlParams
 * @description 移除参数
 * @param {string} url 地址
 * @param {string} removeKeyArr 待移除的参数名集合
 * @returns 重新拼接的地址
 * @example
 * // 地址是 hash 模式参数
 * removeUrlParams('http://www.test.com/#/detail?a=1&b=2&c=3', ['a', 'b']);
 * // => 'http://www.test.com/#/detail?c=3'
 * @example
 * // 地址 history 模式参数并存
 * removeUrlParams('http://www.test.com?a=1&b=2&c=3', ['a', 'b']);
 * // => 'http://www.test.com?c=3'
 * @example
 * // 地址 history 模式参数并存 + 强制 history 模式返回
 * removeUrlParams('http://www.test.com?a=1&b=2&c=3', ['a', 'b'], true);
 * // => 'http://www.test.com?c=3'
 * @example
 * // 全部参数移除完，返回不带 query 的地址
 * removeUrlParams('http://www.test.com?a=1&b=2&c=3', ['a', 'c', 'b'], true);
 * // => 'http://www.test.com'
 * @example
 * // hash 模式下 query 全部移除，会保留末尾的 ?
 * removeUrlParams('http://www.test.com?a=1&b=2&c=3#/detail?d=4', ['a', 'b', 'c', 'd']);
 * // => 'http://www.test.com/#/detail?'
 * @example
 * // hash 模式和 history 模式参数并存
 * removeUrlParams('http://www.test.com?a=1&b=2&c=3#/detail?d=4', ['a', 'd']);
 * // => 'http://www.test.com/#/detail?b=2&c=3'
 * @example
 * // 地址是 hash 模式和 history 模式参数并存，且是多个参数
 * removeUrlParams('http://www.test.com?d=4&f=6#/detail?a=1&b=2&c=3', ['a', 'd']);
 * // => 'http://www.test.com/#/detail?f=6&b=2&c=3'
 */
export declare function removeUrlParams(url: string | undefined, removeKeyArr: string[], forceHistoryMode?: boolean): string;

/**
 * 替换文件的 rem 单位，转为 px
 * @param {string} filePath 文件路径
 * @example
 * ```ts
 * remToPxInFile('xxx.vue');
 * ```
 */
export declare function remToPxInFile(filePath: string): void;

/**
 * 执行 alias 路径替换
 * @param options - 替换配置
 * @returns 替换统计信息
 * @example
 * ```ts
 * const { replacedCount, errorCount } = replaceAlias({
 *   rootDir: '/proj',
 *   aliasMap: {
 *     src: 'src',
 *     '@': 'src',
 *   },
 *   scanDirs: ['src'],
 *   scanRootFiles: ['vite.config.ts', 'tsconfig.json'],
 *   supportedExtensions: ['.ts', '.vue', '.scss'],
 * });
 * console.log(`替换了 ${replacedCount} 个文件，${errorCount} 个出错`);
 * ```
 */
export declare function replaceAlias(options: IReplaceAliasOptions): {
    replacedCount: number;
    errorCount: number;
};

/**
 * 替换单个文件中的 alias 引入为相对路径
 * @example
 * ```ts
 * // 假设文件内原本写的是 `from 'src/components/Btn.vue'`
 * // 调用后会被改写为 `from '../../components/Btn.vue'`
 * const result = replaceAliasInFile(
 *   '/proj/src/views/Home/index.vue',
 *   '/proj',
 *   { src: 'src' },
 * );
 * // { replaced: true, error: null }
 * ```
 */
export declare function replaceAliasInFile(filePath: string, rootDir: string, aliasMap: Record<string, string>): IReplaceResult;

/**
 * polyfill for replaceAll
 *
 * @export
 *
 * @example
 *
 * replaceAllPolyfill()
 */
export declare function replaceAllPolyfill(): void;

/**
 * 替换文件内容
 * 批量替换目标项目中指定文件的内容
 * @param replaceList - 替换配置列表
 * @param targetProject - 目标项目路径
 * @example
 * ```ts
 * replaceContent({
 *   replaceList: [
 *     {
 *       dirList: ['src/*.ts'],
 *       from: 'old-text',
 *       to: 'new-text'
 *     }
 *   ],
 *   targetProject: '/path/to/project'
 * });
 * ```
 */
export declare function replaceContent({ replaceList, targetProject, }: {
    replaceList: ReplaceContentOption[];
    targetProject: string;
}): void;

export declare type ReplaceContentOption = {
    list?: Array<[string, string]>;
    from?: string;
    to?: string;
    dirList: string | string[];
};

export declare function replaceContentSimple({ replaceList, }: {
    replaceList: ReplaceContentSimpleOption[];
}): void;

export declare type ReplaceContentSimpleOption = {
    list?: Array<[string | RegExp, string]>;
    from?: string | RegExp;
    to?: string;
    dirList: string | string[];
};

/**
 * 替换引用
 *
 * @param {string} content 输入内容
 * @param {Array<IParsedConfigItem>} parsedConfigList 替换配置
 * @param {string} keyword 提前返回关键词
 * @returns {string} 处理后的内容
 *
 * @example
 * ```ts
 * replaceDependencies('', [], '@tx/pmd-vue')
 * ```
 */
export declare function replaceDependencies(content: string, parsedConfigList: Array<IParsedConfigItem>, keyword: string): any;

declare type RepoConfigType = {
    domain: string;
    repo: string;
    branch: string;
};

/** 仓库文件内容 */
export declare interface RepoFile {
    /** 文件内容（已 base64 解码为 utf-8 字符串） */
    content: string;
    /** 工蜂返回的原始 encoding（通常为 base64） */
    encoding: string;
    /** blob_id，作为 sha 使用 */
    sha: string;
}

export declare function reportCoreInfoInPixUI(): Promise<void>;

declare type ReportOptions = string | {
    msg: string;
    [k: string]: string;
};

declare enum ReportPlatform {
    NOT_KNOWN = 0,
    H5 = 1,
    MP = 2
}

/**
 * 上报数据到研发平台
 * @param {object} param 参数
 * @param {object} param.data 上报数据
 * @param {string} param.host 请求域名
 * @param {ReportType} param.type 上报类型
 * @param {ReportPlatform} param.platform 上报平台
 * @returns 上报结果
 * @example
 * ```ts
 * await reportToRdPlatform({
 *   data: { metric: 'fcp', value: 1234 },
 *   host: 'https://your-host.example.com',
 *   type: 1, // PERFORMANCE
 *   platform: 1, // H5
 * });
 * ```
 */
export declare function reportToRdPlatform({ data, host, type, platform, }: {
    data: any;
    host: any;
    type?: ReportType;
    platform?: ReportPlatform;
}): Promise<any>;

declare enum ReportType {
    PERFORMANCE = 1,
    BUNDLE = 2,
    AUTO_TEST = 3,
    BUNDLE_MP = 4
}

declare interface ReqParam {
    url: string;
    data: object;
    secretInfo: ISecretInfo_3;
}

/**
 * pmd-network 的 Cocos 兼容实现（搬迁自原 src/_shim/pmd-network.ts）
 *
 * - 仅运行于微信小游戏环境
 * - 业务方在启动时必须调用 `initCocosNetwork(...)`（推荐）或
 *   `NetworkManager.instance.setRequestImpl(impl)` 注入网络实现
 *
 * 与原 @tencent/pmd-network 保持以下两个公共 API 兼容：
 *   - NetworkManager.instance.request(cfg)
 *   - post(cfg)
 *
 * 仓库内通过 tsconfig paths 把 '@tencent/pmd-network' 别名映射到本文件，
 * 这样上游 sync 下来的 src/api.ts 中的 import 路径无需改动即可编译。
 */
export declare interface RequestConfig {
    url: string;
    reqData?: any;
    extra?: {
        withCredentials?: boolean;
        headers?: Record<string, string>;
        [k: string]: any;
    };
    alwaysResolve?: boolean;
    [k: string]: any;
}

export declare type RequestImpl = (cfg: RequestConfig) => Promise<any>;

export declare interface RequestParams {
    url: string;
    data?: Record<string, any>;
    success?: Success;
    fail?: Fail;
    complete?: Complete;
    isTestEnv?: () => boolean;
}

/**
 * 从 package.json 中解析需要打包的文件列表
 * @param {object} options 配置
 * @param {string} [options.root] 项目根目录，默认为 process.cwd()
 * @returns {Array<string>} 文件列表
 * @example
 * ```ts
 * // 使用当前工作目录的 package.json
 * const files = resolveFiles();
 * // ['dist', 'README.md', '.env.local']
 *
 * // 指定项目根目录
 * const files2 = resolveFiles({ root: '/path/to/project' });
 * ```
 */
export declare function resolveFiles({ root, }?: {
    root?: string;
}): any;

/**
 * 解析 npm 包详情页地址。
 * - `@tencent/xxx`：腾讯内网镜像 detail 页（mirrors.tencent.com 私有 npm，repo_id=537）
 * - 其他：npmjs.com 公网详情页
 *
 * @param name 包名
 * @returns 完整 URL
 * @example
 *
 * resolveNpmLink('t-comm')
 * // 'https://mirrors.tencent.com/#/private/npm/detail?repo_id=537&project_name=%40tencent%2Ft-comm'
 *
 * resolveNpmLink('lodash')
 * // 'https://npmjs.com/package/lodash'
 */
export declare function resolveNpmLink(name: string): string;

/**
 * 提取链接参数，兼容hash模式和history模式，以及拼接异常情况
 * @param {string} [url=''] 地址
 * @param {string} [key=''] 可选，若不为空，则提取返回该key对应的参数值
 * @returns 地址参数对象，或者是指定参数值
 * @example
 * // 地址使用 search 参数
 * resolveUrlParams('https://igame.qq.com?name=mike&age=18');
 * // => { name: 'mike', age: '18' }
 * @example
 * // 地址使用 hash 参数
 * resolveUrlParams('https://igame.qq.com#/?from=china&home=china');
 * // => { from: 'china', home: 'china' }
 * @example
 * // 地址同时使用 search 和 hash 参数
 * resolveUrlParams('https://igame.qq.com?name=mike&age=18#/index?from=china&home=china');
 * // => { from: 'china', home: 'china', name: 'mike', age: '18' }
 * @example
 * // 通过 key 直接取值
 * resolveUrlParams('https://igame.qq.com?name=mike&age=18', 'age');
 * // => '18'
 * @example
 * // 空 url 时：未传 key 返回 {}，传 key 返回 undefined
 * resolveUrlParams('');         // => {}
 * resolveUrlParams('', 'age');  // => undefined
 * @example
 * // 兼容真实业务地址中带 %3F、&amp; 等异常拼接情况
 * resolveUrlParams('https://igame.qq.com/x.html#/index?brandid=b1662364289&amp%3BmultiCfgId=b16623642891663309541');
 * // => { brandid: 'b1662364289' }
 */
export declare function resolveUrlParams(url?: string, key?: string): string | Record<string, string> | undefined;

/**
 * 批量将用户名列表转换为用户 ID 列表（跳过找不到的）
 *
 * @param {object} options 输入配置
 * @param {string[]} options.usernames 用户名数组
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<string[]>} 用户 ID 字符串数组（顺序与输入保持一致，跳过缺失项）
 * @example
 *
 * resolveUserIds({
 *   usernames: ['novlan1', 'someone'],
 *   privateToken: 'xxxxx',
 * }).then((ids) => {
 *   console.log(ids); // [ '1234', '5678' ]
 * })
 */
export declare function resolveUserIds({ usernames, privateToken, baseUrl, }: {
    usernames: string[];
    privateToken: string;
    baseUrl?: string;
}): Promise<string[]>;

/** 反转十六进制字符串的字节序（小端 ↔ 大端） */
export declare function reverseHexBytes(hex: string): string;

/**
 * 发表评审意见（同意/拒绝/评论/要求修改）
 * @param {object} options 输入配置
 * @param {string} [options.projectName] 项目名称（与 url 二选一）
 * @param {string} options.privateToken 密钥
 * @param {string} [options.reviewableId] 合并请求的 reviewable_id（与 url 二选一）。注意 reviewer/summary API 需要的既不是全局 id 也不是 iid，而是 reviewable_id，可通过 queryMRByIId 获取
 * @param {string} [options.url] TGit MR 的 URL，传入后自动解析 projectName 和 mrIid，并自动调用 queryMRByIId 获取 reviewable_id
 * @param {string} options.reviewerEvent 评审人事件，可选：comment | approve | require_change | deny
 * @param {string} [options.summary] 评审信息摘要
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * // 方式一：直接传入 projectName 和 reviewableId
 * reviewMR({
 *   projectName: 't-comm',
 *   privateToken: 'xxxxx',
 *   reviewableId: '1',
 *   reviewerEvent: 'approve',
 *   summary: 'LGTM',
 * }).then((resp) => {
 *
 * })
 *
 * // 方式二：传入 URL 自动解析
 * reviewMR({
 *   url: 'https://git.woa.com/coecology/xd/-/merge_requests/169',
 *   privateToken: 'xxxxx',
 *   reviewerEvent: 'approve',
 * }).then((resp) => {
 *
 * })
 */
export declare function reviewMR({ baseUrl, reviewableId, projectName, privateToken, reviewerEvent, summary, url, }: {
    projectName?: string;
    reviewableId?: string;
    privateToken: string;
    reviewerEvent: 'comment' | 'approve' | 'require_change' | 'deny';
    summary?: string;
    url?: string;
    baseUrl?: string;
}): Promise<object>;

export declare function reviewPipeline({ host, projectId, buildId, pipelineId, stepId, elementId, reviewUsers, status, suggest, params, accessToken, }: {
    host: string;
    projectId: string;
    buildId: string;
    pipelineId?: string;
    elementId?: string;
    stepId?: string;
    reviewUsers?: string[] | string;
    status?: 'PROCESS' | 'ABORT';
    suggest?: string;
    params?: Array<{
        chineseName?: string;
        desc?: string;
        key: string;
        required: boolean;
        value?: string;
        valueType: any;
    }>;
    accessToken?: string;
}): Promise<unknown>;

/**
 * Converts an RGB color value to HSV
 * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1].
 * *Returns:* { h, s, v } in [0,1]
 * @example
 * ```ts
 * rgb2hsv(0, 0, 0);
 * // { h: 0, s: 0, v: 0 }
 *
 * rgb2hsv(255, 255, 255);
 * // { h: 0, s: 0, v: 100 }
 *
 * rgb2hsv(217, 236, 188);
 * // { h: 83.75, s: 20.34, v: 92.55 }
 * ```
 */
export declare function rgb2hsv(r: number, g: number, b: number): {
    h: number;
    s: number;
    v: number;
};

export declare const rgbToHex: ({ r, g, b }: {
    r: number;
    g: number;
    b: number;
}) => string;

/**
 * 递归删除空目录
 * 从指定路径开始，递归删除所有空目录（不删除包含文件的目录）
 * @param tPath - 要检查和删除的目录路径
 * @param level - 当前递归层级，默认为 0（根层级不会被删除）
 * @example
 * ```ts
 * rmEmptyDir('/path/to/check');
 * ```
 */
export declare function rmEmptyDir(tPath: string, level?: number): void;

export declare const rmFirstAndLastSlash: typeof removeFirstAndLastSlash;

/**
 * PostCSS 插件：将 rpx 单位转换为 px
 *
 * 基于 750 设计稿，1rpx = 0.5px。
 * 内置平台判断，默认仅在 h5 平台执行。
 *
 * @param {object} options - 配置选项
 * @param {number} options.ratio - rpx 到 px 的转换比例，默认 0.5
 * @param {string[]} options.platform - 在哪些平台执行，默认 ['h5']
 *
 * @example
 *
 * ```js
 * // postcss.config.js
 * const { rpxToPxPlugin } = require('t-comm');
 *
 * module.exports = {
 *   plugins: [
 *     // 默认仅在 h5 平台执行，无需外部判断
 *     rpxToPxPlugin(),
 *     // 自定义比例和平台
 *     rpxToPxPlugin({ ratio: 1, platform: ['h5', 'mp-weixin'] }),
 *   ],
 * };
 * ```
 */
export declare const rpxToPxPlugin: {
    (options?: RpxToPxPluginOptions): {
        postcssPlugin: string;
        Declaration(decl: any): void;
    };
    postcss: boolean;
};

declare interface RpxToPxPluginOptions {
    /** rpx 到 px 的转换比例，默认 0.5（基于 750 设计稿） */
    ratio?: number;
    /** 在哪些平台执行，默认 ['h5']。通过 process.env.UNI_PLATFORM 判断 */
    platform?: string[];
}

/**
 * 加了 try-catch 的 JSON.parse
 * @param data 传入数据
 * @param defaultValue 默认值，不传则为 空对象
 * @returns 解析后的数据
 *
 * @example
 *
 * ```ts
 * safeJsonParse(data)
 *
 * safeJsonParse(data, {})
 *
 * safeJsonParse(data, [])
 * ```
 */
export declare function safeJsonParse<T = Record<string, any>>(data: unknown, defaultValue?: T): T;

/**
 * node环境下，保存base64图片到文件
 * @param {object} config 输入配置
 * @param {string} config.imgUrl base64图片Url
 * @param {string} config.savePath 保存路径，最好是绝对路径
 * @returns {Promise<string>} 去掉前缀的base64图片地址
 *
 * @example
 *
 * saveBase64ImgToFile({
 *   imgUrl: 'xx',
 *   savePath: '/test.png'
 * }).then((base64Data) => {
 *   console.log(base64Data)
 * })
 *
 */
export declare function saveBase64ImgToFile({ imgUrl, savePath }: {
    imgUrl: string;
    savePath: string;
}): Promise<string>;

/**
 * 将 JSON 对象保存到日志文件
 * 将对象序列化为 JSON 并保存到 ./log 目录下
 * @param content - 要保存的对象内容
 * @param file - 文件名（相对于 log 目录）
 * @param needLog - 是否需要保存日志，默认为 true
 * @example
 * ```ts
 * saveJsonToLog({ status: 'success', data: [1, 2, 3] }, 'result.json');
 * ```
 */
export declare function saveJsonToLog(content: object, file: string, needLog?: boolean): void;

/**
 * 将内容追加保存到日志文件（支持保留历史记录）
 * 以数组形式保存多条日志记录，每条记录包含时间戳和数据，支持限制最大记录数
 * @param content - 要保存的内容
 * @param file - 文件名（相对于 log 目录）
 * @param options - 配置选项
 * @param options.needLog - 是否需要保存日志，默认为 true
 * @param options.max - 最大保留记录数，默认为 10
 * @example
 * ```ts
 * saveJsonToLogMore({ action: 'upload', status: 'success' }, 'history.json', {
 *   needLog: true,
 *   max: 20
 * });
 * ```
 */
export declare function saveJsonToLogMore(content: any, file: string, options?: {
    needLog?: boolean;
    max?: number;
}): void;

/**
 * 小程序下保存图片
 * @param {string} url 图片地址
 * @param {object} options 提示选项
 * @example
 * ```ts
 * saveMpImage('https://xxx.png');
 * ```
 */
export declare function saveMpImage(url: string, options?: Partial<IOptions>): void;

/**
 * 写入持久化存储localStorage。仅用于浏览器端，value里不能有循环引用
 * @param {string} key 键
 * @param {string} value 值
 * @param {number} expireMsec 过期时间，单位毫秒
 * @returns {boolean} 是否存储成功
 *
 * @example
 * const res = savePersist('name', 'mike', 30 * 86400 * 1000); // true
 * const name = getPersist('name'); // mike
 *
 * clearPersist('name'); // true
 * const name2 = getPersist('name'); // undefined
 */
export declare function savePersist(key: string, value: string, expireMsec?: number): boolean;

/**
 * node环境下，保存网络图片到本地
 * @param {object} config 输入配置
 * @param {string} config.imgUrl 网络图片地址
 * @param {string} config.savePath 本地图片保存路径，建议绝对路径
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 *
 * saveRemoteImgToLocal({
 *   imgUrl: 'xx',
 *   savePath: './test.png'
 * }).then(() => {
 *
 * })
 */
export declare function saveRemoteImgToLocal({ imgUrl, savePath }: {
    imgUrl: string;
    savePath: string;
}): Promise<object>;

export declare class Scheduler {
    pendingState: Array<IRequest>;
    doingJobs: number;
    maxConcurrency: number;
    /**
     * 异步任务调度器，同一时间只能执行 n 个任务
     * @param {number} [maxConcurrency] 最多同时执行的任务数目，默认为 2
     *
     * @example
     * ```ts
     * let scheduler;
     *
     * export async function login({
     *   userId,
     *   userSig,
     *   tim,
     * }: {
     *   userId: string;
     *   userSig: string;
     *   tim: IChatSDK;
     * }) {
     *   if (!scheduler) {
     *     scheduler = new Scheduler(1);
     *   }
     *
     *   return await scheduler.add(innerLogin.bind(null, {
     *     userId,
     *     userSig,
     *     tim,
     *   }));
     * }
     * ```
     */
    constructor(maxConcurrency?: number);
    add(promiseCreator: IRequest): Promise<any>;
    unshift(promiseCreator: IRequest): Promise<any>;
    doJob: () => void;
}

declare type ScoreInfoType_2 = {
    ProjectId: number;
    ProjectName: string;
    PagePv: number;
    PageUv: number;
    PageDuration: number;
    PageError: number;
    ApiNum: number;
    ApiFail: number;
    ApiDuration: number;
    StaticNum: number;
    StaticFail: number;
    StaticDuration: number;
    Score: number;
    GroupName: string;
    CreateUser: string;
    CreateTime: string;
    [k: string]: string | number;
};

export declare type SCSSErrorFile = Record<string, any>;

declare interface SearchReplaceResult {
    content: string;
    applied: boolean;
    matchLevel: 'exact' | 'trimEnd' | 'indentNormalize' | 'none';
}

declare type SecretInfoType = {
    apiKey: string;
    loginName: string;
    rumSecretId: string;
    rumSecretKey: string;
    getPwdCode: Function;
    encrypt: Function;
};

export declare function sendEmailByTai({ prefix, paasId, paasToken, from, to, title, content, cc, bcc, emailType, bodyFormat, priority, }: {
    prefix: string;
    paasId: string;
    paasToken: string;
    from: string;
    to: string;
    title: string;
    content: string;
    cc?: string;
    bcc?: string;
    emailType?: number;
    bodyFormat?: number;
    priority?: number;
}): Promise<unknown>;

/**
 * 请求开源治理数据并发送
 * @param options 配置信息
 * @example
 * ```ts
 * await sendOpenSourceReport({
 *   date: '2024-01-01',
 *   chatId: 'xxx',
 *   webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx',
 *   requestInfo: { ... },
 *   searchInfo: { ... },
 *   maxShowLinkNum: 12,
 *   whiteList: ['some-repo'],
 *   filterOrgPath: 'group/sub-group',
 * });
 * ```
 */
export declare function sendOpenSourceReport({ date, chatId, webhookUrl, requestInfo, searchInfo, maxShowLinkNum, whiteList, filterOrgPath, }: {
    date: string | number | Date;
    chatId: string;
    webhookUrl: string;
    requestInfo: IRequestInfo;
    searchInfo: ISearchInfo;
    maxShowLinkNum?: number;
    whiteList?: Array<string>;
    filterOrgPath?: string;
}): Promise<void>;

/**
 * 获取超时的流水线列表，并发送机器人消息
 * @param {object} params 参数
 * @param {object} params.params 获取流水线列表参数
 * @param {string} params.pipelineHost 流水线 host 地址
 * @param {string} params.webhookUrl 回调地址
 * @param {string} params.chatId 会话id
 * @example
 * ```ts
 * await sendOverTimePipelineMessage({
 *   params: {
 *     projectId: 'my-project',
 *     host: 'https://devops.woa.com',
 *     secretInfo: { appCode, appSecret, devopsUid },
 *   },
 *   pipelineHost: 'https://devops.woa.com',
 *   webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx',
 *   chatId: ['chat-id-1'],
 *   mentionList: ['novlan1'],
 * });
 * ```
 */
export declare function sendOverTimePipelineMessage({ params, pipelineHost, webhookUrl, chatId, overTimeConfigList, mentionList, }: {
    params: any;
    pipelineHost: string;
    webhookUrl: string;
    chatId: Array<string>;
    overTimeConfigList?: Array<{
        label: string;
        value: number;
    }>;
    mentionList: string[];
}): Promise<any[] | undefined>;

/**
 * MSDK 浏览器中，向原生发送数据
 * @param {string} data 发送的数据
 * @example
 * ```ts
 * sendToMsdkNative('123');
 * sendToMsdkNative(JSON.stringify({ method: 'foo', data: 'bar' }));
 * ```
 */
export declare function sendToMsdkNative(data?: string): void;

declare const SendToRobotTypeMap: {
    readonly NO_SEND: 0;
    readonly SEND_CHANGE: 1;
    readonly SEND_ALL: 2;
};

/**
 * 获取天气信息并发送
 * @param {object} options 配置
 * @param {string} options.webhookUrl 机器人hook地址
 * @param {string} [options.chatId] 会话Id
 * @param {string} [options.force] 是否在和之前获取数据相同时，也发送
 * @returns {Promise<Object>} 请求Promise
 * @example
 * ```ts
 * await sendWeatherRobotMsg({
 *   webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx',
 *   chatId: ['chat-id-1', 'chat-id-2'],
 *   force: false, // 默认 false：和上次数据一致时不发送
 * });
 * ```
 */
export declare function sendWeatherRobotMsg({ webhookUrl, chatId, force, }: {
    webhookUrl: string;
    chatId: string | string[];
    force?: boolean;
}): Promise<any>;

export declare function sendWxMpCIMessageAfterPlugin({ appName, webhookUrl, previewCodeBase64Path, bundleResult, subPackageInfo, robot, root, env, branch, compressOptions, dryRun, }: {
    appName: string;
    webhookUrl: string;
    previewCodeBase64Path: string;
    bundleResult: string;
    subPackageInfo: string;
    robot: number;
    root: string;
    env: string;
    branch: string;
    compressOptions?: CompressOptions;
    dryRun?: boolean;
}): Promise<{
    content: string;
    descList: string[];
} | undefined>;

/**
 * 发送企业微信机器人base64图片，其实就是先保存到本地，然后生成md5，最后发送
 * @param {object} config 配置信息
 * @param {string} config.img base64图片
 * @param {string} config.chatId 会话Id
 * @param {string} config.webhookUrl webhook地址
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * sendWxRobotBase64Img({
 *   img: 'xxx',
 *   chatId: 'xxx',
 *   webhookUrl: 'xxx',
 * }).then(() => {
 *
 * })
 *
 */
export declare function sendWxRobotBase64Img({ img, chatId, webhookUrl, }: {
    img: string;
    chatId: string;
    webhookUrl: string;
}): Promise<object>;

/**
 * 给机器人发送图片
 * @param {Object} config 配置参数
 * @param {string} config.webhookUrl 钩子链接
 * @param {string} config.chatId 会话id
 * @param {string} config.content 内容
 * @param {string} config.md5Val md5内容
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 *
 * sendWxRobotImg({
 *   webhookUrl: 'xxx',
 *   chatId: 'xxx',
 *   content: 'xxx',
 *   md5Val: 'xxx'
 * }).then(() => {
 *
 * })
 */
export declare function sendWxRobotImg({ webhookUrl, chatId, content, md5Val }: {
    webhookUrl: string;
    content: string;
    md5Val: string;
    chatId?: string;
}): Promise<object>;

/**
 * 给机器人发送Markdown消息
 * @param {Object} config 配置内容
 * @param {string} config.webhookUrl - 钩子链接
 * @param {string} config.chatId - 会话id
 * @param {string} config.content - 内容
 * @param {Array<object>} config.attachments - 附加内容
 * @returns {Promise<object>} 请求Promise
 * @example
 *
 * sendWxRobotMarkdown({
 *   webhookUrl: 'xxx',
 *   chatId: 'xxx',
 *   content: 'xxx',
 *   attachments: []
 * }).then(() => {
 *
 * })
 */
export declare function sendWxRobotMarkdown({ webhookUrl, chatId, content, attachments, isV2, }: {
    webhookUrl: string;
    content: string;
    chatId?: string;
    attachments?: Array<object>;
    isV2?: boolean;
}): Promise<object>;

/**
 * 给机器人发送普通消息
 * @param {Object} config 配置内容
 * @param {string} config.webhookUrl - 钩子链接
 * @param {string} config.chatId - 会话id
 * @param {string} config.alias - 别名
 * @param {string} config.content - 内容
 * @returns {Promise<object>} Promise
 *
 * @example
 *
 * sendWxRobotMsg({
 *   webhookUrl: 'xxx',
 *   chatId: 'xxx',
 *   content: 'xxx',
 *   alias: 'xxx',
 * }).then(() => {
 *
 * })
 */
export declare function sendWxRobotMsg({ webhookUrl, chatId, alias, content }: {
    webhookUrl: string;
    content: string;
    chatId?: string;
    alias?: string | Array<string>;
}): Promise<object>;

export declare function set<Entity = any, Output = Entity, Value = any>(entity: Entity, paths: Path, value: Value, removeIfUndefined?: boolean): Output;

/**
 * 设置config
 *
 * @param {string} name
 * @param {*} value
 *
 * @example
 * setConfig('login.loginType','WXPC')
 */
export declare function setConfig(name: string, value: unknown): void;

/**
 * 设置cookie
 * @param {string} key cookie键值
 * @param {string} value cookie值
 * @param {number} [hours] 过期时间，单位小时
 *
 * @example
 *
 * setCookie('name', 'mike')
 */
export declare function setCookie(name: string, value: string, Hours?: number): void;

/**
 * 设置 HTML 根元素的响应式字体大小
 * 基于屏幕宽度自动调整根元素的 font-size，实现移动端响应式布局
 * 以 750px 为基准，根元素 font-size = 100 * (屏幕宽度 / 750)
 * @example
 * ```ts
 * // 在应用启动时调用
 * setHtmlResponsiveFontsize();
 * // 屏幕宽度为 375px 时，根元素 font-size = 50px
 * // 屏幕宽度为 750px 时，根元素 font-size = 100px
 * ```
 */
export declare function setHtmlResponsiveFontsize(): void;

/**
 * 设置本地数据，IDE中不生效，在真机上才生效
 * 数据以 app + roleId 为维度隔离存储,。存储的信息如15天不更新，会自动清除。
 * @param key 键
 * @param value 值
 * @example
 * ```ts
 * await setLocalStorageInPixui('user-token', 'abc123');
 * ```
 */
export declare const setLocalStorageInPixui: (key: string, value: string) => Promise<void>;

declare function setRoute(page: IPage, route?: string): Promise<void>;

declare function setSessionStorage(key: string, value: string, page: IPage): Promise<void>;

/**
 * 在屏幕右上角注册一个隐藏触摸热区，连点 5 次（3 秒内）弹出环境切换菜单。
 * 触发区域：屏幕宽度 80%~100%、高度 0%~15% 的矩形区域。
 */
export declare function setupEnvSwitchHotspot(envSwitcher: {
    getEnv: () => string;
    setEnv: (env: string) => void;
}): void;

declare function setUserAgent(useragent: string, page: IPage): Promise<void>;

/**
 * 设置对象深层属性的值（类似 Lodash 的 _.set）
 * @param obj 目标对象
 * @param path 属性路径（字符串或数组，如 'a.b.c' 或 ['a', 'b', 'c']）
 * @param value 要设置的值
 * @returns 修改后的对象
 * @example
 * ```ts
 * // 字符串路径
 * setWithString({}, 'a.b.c', 1);
 * // { a: { b: { c: 1 } } }
 *
 * // 数组路径
 * setWithString({}, ['a', 'b', 'c'], 'x');
 * // { a: { b: { c: 'x' } } }
 *
 * // 数组下标语法 'a[0].b'
 * setWithString({}, 'a[0].b', 'y');
 * // { a: [{ b: 'y' }] }
 *
 * // 已有对象上覆盖/扩展
 * setWithString({ a: { b: 1 } }, 'a.c', 2);
 * // { a: { b: 1, c: 2 } }
 * ```
 */
export declare function setWithString<T extends object>(obj: T, path: string | Array<string | number>, value: any): T;

/**
 * 是否应该执行 standard-version
 * 返回0，不执行
 * 返回1，执行--first-release
 * 返回2，执行--release-as patch
 * @private
 * @param {string} [] 命令执行目录
 * @returns {number} 是否应该执行 standard-version
 * @example
 * ```ts
 * const code = shouldGenVersion(process.cwd());
 * // 0 = 不执行；1 = --first-release；2 = --release-as patch
 *
 * // 强制生成
 * shouldGenVersion(process.cwd(), true);
 * ```
 */
export declare function shouldGenVersion(root?: string, forceGenVersion?: boolean): number;

export declare function shouldInclude(branch?: string, reg?: RegExp): boolean;

/**
 * 判断这次扫描结果是否应该触发"碰一碰"
 *
 * 条件：
 *   1. RSSI 不低于阈值（够近）
 *   2. 距离上次同设备触发已超过冷却时间（避免重复）
 *
 * 抽成纯函数后，边界条件可以一行测一个。
 */
export declare function shouldTriggerBump(params: ShouldTriggerBumpParams): boolean;

/** 触发碰一碰的判定参数（纯函数 shouldTriggerBump 使用） */
export declare interface ShouldTriggerBumpParams {
    rssi: number;
    threshold: number;
    lastBumpTime: number;
    now: number;
    cooldownMs: number;
}

/**
 * 函数式调用组件
 * @param {Object} vueInstance 页面Vue实例（一般为页面this）
 * @param {Object} dialogComponent 弹窗组件，支持静态导入import Dialog from '..'和动态导入const Dialog = () => import('...')两种形式
 * @param {Object} dialogOptions 弹窗参数Object
 * @returns Promise 回调组件实例
 *
 * @example
 * ```ts
 * function showDateTimePicker(this: any, {
 *   onConfirm,
 *   currentDate,
 * }) {
 *   showFunctionalComponent(
 *     this, () => import('src/local-component/ui/gp-match-horz/date-picker'),
 *     {
 *       currentDate,
 *       minDate: new Date(new Date().getTime() + 30 * 60 * 1000),
 *       onClickConfirm: (date) => {
 *         const dateNumber =  Math.floor(date.getTime());
 *         onConfirm(date, dateNumber);
 *       },
 *     },
 *   );
 * }
 * ```
 */
export declare function showFunctionalComponent(vueInstance: any, dialogComponent: any, dialogOptions: Record<string, any>): Promise<unknown>;

/**
 * @description 根据弹窗队列（dialogList）依次弹出
 * @param {object} context Vue 页面 Vue实例上下文（一般为页面this、window.app、new Vue() 等）
 * @param {array} dialogList 弹窗列表
 * @param {Object} dialogComponent 弹窗组件，支持静态导入 import Dialog from '..' 和动态导入 const Dialog = () => import('...') 两种形式
 * @example
 * ```ts
 * // 在页面中按顺序依次弹出多个弹窗
 * showFunctionalComponentQueue(this, [
 *   { id: 'sign-in' },
 *   { id: 'subscribe' },
 *   { id: 'reward' },
 * ], () => import('src/local-component/ui/common-dialog'));
 * ```
 */
export declare function showFunctionalComponentQueue(context: any, dialogList: Array<any>, dialogComponent: any): void;

/**
 * 展示 vConsole
 * @example
 * ```ts
 * showVConsole()
 * ```
 */
export declare function showVConsole(): void;

/**
 * 打乱数组顺序
 *
 * @param {Array<any>} array - 数组
 * @returns {Array<any>} 乱序后的数组
 *
 * @example
 *
 * shuffle([1, 2, 3, 4, 5])
 *
 * // [3, 2, 1, 4, 5]
 *
 */
export declare function shuffle<T>(array: Array<T>): Array<T>;

/**
 * 简单的摩斯密码，只有点击
 * @param param {object} 参数
 *
 * @example
 * ```ts
 * simpleMorse({
 *   target: 5, // 目标值
 *   callback: () => console.log('test'),
 *   timeout: 300, // 超时取消
 *   debug: false,
 * })
 * ```
 */
export declare function simpleMorse({ target, callback, timeout, debug, }: {
    callback?: Function;
    target?: number;
    timeout?: number;
    debug?: boolean;
}): void;

/**
 * 等待一段时间
 * @func
 * @param {number} ms 毫秒
 * @returns Promise
 * @example
 *
 * async function main() {
 *   await sleep(2000)
 *
 *   // 等待2秒后才会打印
 *   console.log('hello')
 * }
 *
 * main()
 */
export declare const sleep: (ms: number) => Promise<unknown>;

export declare function sliceObject<T>(info: Record<string, T>, max: number): Record<string, T>;

export declare function sortByStr(list: Array<string | Record<string, string>>, key?: string, reverse?: boolean): void;

export declare function sortObjectByKey<T extends string | number, F>(obj: Record<T, F>): Record<T, F>;

export declare function splitLongList(list: Array<string>, threshold?: number, max?: number): string[][];

export declare interface StartAdvertisingParams {
    serviceUuid: string;
    characteristicUuid: string;
    tempId: string;
    /**
     * 可选：广播 payload 字符串（mutual 模式用）。
     * 为空时回退为广播 tempId（向后兼容 simple 模式）。
     */
    payload?: string;
}

/**
 * 启动流水线
 * @param {object} params 配置信息
 * @param {string} params.projectId 项目ID
 * @param {string} params.pipelineId 流水线ID
 * @param {object} params.secretInfo 密钥信息
 * @param {string} params.host 请求域名
 * @param {object} params.data 请求数据
 * @example
 * ```ts
 * await startDevopsPipeline({
 *   projectId: 'my-project',
 *   pipelineId: 'p-xxxx',
 *   host: 'https://devops.woa.com',
 *   secretInfo: {
 *     appCode: 'xxx',
 *     appSecret: 'xxx',
 *     devopsUid: 'novlan1',
 *   },
 *   data: { buildNo: 1 },
 * });
 * ```
 */
export declare function startDevopsPipeline({ projectId, pipelineId, secretInfo, host, data, }: {
    projectId: string;
    pipelineId: string;
    secretInfo: ISecretInfo;
    host: string;
    data: Object;
}): Promise<any>;

export declare interface StartDiscoveryParams {
    platform: string;
    serviceUuid: string;
}

/**
 * 启动流水线
 *
 * @param {object} config 配置信息
 * @param {string} config.buildId 流水线构建Id
 * @param {object} config.data 携带的数据
 * @returns Promise
 *
 * @example
 *
 * ```ts
 * startPipeline({
 *   buildId,
 *   data: {}
 * }).then(() => {
 *
 * })
 * ```
 */
export declare function startPipeline({ buildId, data, }: {
    buildId: string;
    data: Record<string, any>;
}): Promise<unknown>;

/**
 * 启动 uni-app 项目
 * @param options 参数
 *
 * @example
 * ```ts
 * startUniProject();
 *
 * startUniProject({
 *   debug: false, // 默认为 true，会打印参数
 * })
 * ```
 */
export declare function startUniProject(options?: {
    debug?: boolean;
}): void;

/**
 * 统计组件个数
 * @example
 * statisticsComponent('dist/build/mp-weixin');
 */
export declare function statisticsComponent(dir: string): number;

/**
 * 统计页面个数
 * @example
 * statisticsPages('dist/build/mp-weixin/app.json')
 */
export declare function statisticsPages(pagesJsonPath: string): any;

/** 把字符串编码为 ArrayBuffer，用于写入特征值 */
export declare function str2ArrayBuffer(str: string): ArrayBuffer;

declare type StrictComplexityMetrics = {
    readonly [K in ComplexityKey]: string;
};

/**
 *  String format template
 *  - Inspired:
 *    https://github.com/Matt-Esch/string-template/index.js
 * @param {string} string 字符串
 * @param {any} args 填充选项
 * @example
 * ```ts
 * stringFormat('{{likes}} people have liked this', {
 *   likes: 123,
 * });
 * ```
 */
export declare function stringFormat(string: string, ...args: any): string;

declare type Success = (slicedStr: string, fullStr: string) => void;

/**
 * 支持预发布环境切换。
 *
 * 检测当前页面 URL 中的 `tip_debug_cgi_env` 参数，自动将环境标识写入 `sessionStorage`：
 * - 当 URL 包含 `tip_debug_cgi_env=prod` 时，将环境设置为正式环境（写入 sessionStorage）。
 * - 当 URL 包含 `tip_debug_cgi_env=test` 时，移除环境标识（回退到测试环境）。
 *
 * > 仅在浏览器环境下生效，SSR / Node 环境中会直接跳过。
 *
 * @example
 * ```ts
 * // 在应用入口处调用
 * supportPrePublish();
 * ```
 */
export declare function supportPrePublish(): void;

/** 临时 ID 长度（genTempId 生成 6 位） */
export declare const TEMP_ID_LENGTH = 6;

/**
 * 腾讯文档小程序 AppId
 */
export declare const TENCENT_DOC_MP_APP_ID = "wxd45c635d754dbf59";

/**
 * 腾讯文档小程序详情页路径
 */
export declare const TENCENT_DOC_MP_DETAIL_PATH = "pages/detail/detail";

/**
 * 腾讯文档链接前缀
 */
export declare const TENCENT_DOC_URL_PREFIX = "https://docs.qq.com/doc";

/** AI 评审需要响应的严重等级（intelligent_review_block_severity_level） */
export declare type TGitAiReviewBlockSeverityLevel = 0 | 1 | 2;

/** AI 评审豁免方向规则项 */
export declare interface TGitAiReviewExemptionDirection {
    sourceBranchRegex: string;
    targetBranchRegex: string;
}

/** AI 评审挑剔模式（ai_review_mode） */
export declare type TGitAiReviewMode = 0 | 1 | 2 | number;

/** 仓库保密配置 */
export declare interface TGitConfigConfidential {
    level: number;
    allow_ai_coding_tool: boolean;
    [k: string]: unknown;
}

/** 仓库存储配置 */
export declare interface TGitConfigStorage {
    limit_lfs_file_size: number;
    limit_size: number;
    limit_file_size: number;
    limit_lfs_size: number;
    [k: string]: unknown;
}

/** 命名空间信息 */
export declare interface TGitNamespace {
    id: number;
    name: string;
    path: string;
    owner_id: number;
    description: string | null;
    created_at: string;
    updated_at: string;
    [k: string]: unknown;
}

/**
 * 项目详情信息（对应工蜂 GET /api/v3/projects/:id 返回）
 *
 * 字段参考工蜂 OpenAPI 文档：
 * - 基础信息：id / name / path / path_with_namespace / default_branch / description ...
 * - 仓库地址：ssh_url_to_repo / http_url_to_repo / https_url_to_repo / web_url
 * - 可见性：public / public_visibility / visibility_level / archived
 * - 关联对象：namespace / owner / suggestion_reviewers / necessary_reviewers
 * - 评审配置：approver_rule / necessary_approver_rule / can_approve_by_creator ...
 * - 功能开关：issues_enabled / merge_requests_enabled / wiki_enabled / review_enabled ...
 * - 存储与统计：config_storage / statistics
 *
 * 同时保留索引签名 `[k: string]: unknown`，兼容工蜂未来扩展的字段。
 */
export declare interface TGitProjectInfo {
    /** 项目 ID */
    id: number;
    /** 项目描述 */
    description: string | null;
    /** 是否为公开项目 */
    public: boolean;
    /** 是否已归档 */
    archived: boolean;
    /** 可见性级别（0 私有 / 10 内部 / 20 公开） */
    visibility_level: number;
    /** 公开可见性细分 */
    public_visibility: number;
    /** 命名空间 */
    namespace: TGitNamespace;
    /** 项目所有者 */
    owner: TGitUserBrief;
    /** 项目名称（如 test-01） */
    name: string;
    /** 带命名空间的项目名称（如 git_user1/test-01） */
    name_with_namespace: string;
    /** 项目路径（如 test-01） */
    path: string;
    /** 带命名空间的项目路径（如 git_user1/test-01） */
    path_with_namespace: string;
    /** 默认分支名 */
    default_branch: string;
    /** 仓库 SSH 克隆地址 */
    ssh_url_to_repo: string;
    /** 仓库 HTTP 克隆地址 */
    http_url_to_repo: string;
    /** 仓库 HTTPS 克隆地址 */
    https_url_to_repo: string;
    /** 项目 Web 访问地址 */
    web_url: string;
    /** Tag 列表 */
    tag_list: string[];
    /** 是否启用 Issues */
    issues_enabled: boolean;
    /** 是否启用 Merge Requests */
    merge_requests_enabled: boolean;
    /** 是否启用 Wiki */
    wiki_enabled: boolean;
    /** 是否启用 Snippets */
    snippets_enabled: boolean;
    /** 是否启用代码评审 */
    review_enabled: boolean;
    /** 是否允许 Fork */
    fork_enabled: boolean;
    /** Tag 名称正则约束 */
    tag_name_regex: string | null;
    /** 创建/推送 Tag 所需权限级别 */
    tag_create_push_level: number;
    /** 创建时间 */
    created_at: string;
    /** 最后活跃时间 */
    last_activity_at: string;
    /** 创建者 ID */
    creator_id: number;
    /** 项目头像地址 */
    avatar_url: string | null;
    /** 关注数 */
    watchs_count: number;
    /** 收藏数 */
    stars_count: number;
    /** Fork 数 */
    forks_count: number;
    /** 存储配置 */
    config_storage: TGitConfigStorage;
    /** 保密配置 */
    config_confidential: TGitConfigConfidential;
    /** Fork 来源（未 Fork 时为字符串提示） */
    forked_from_project: TGitProjectInfo | string | null;
    /** 仓库统计 */
    statistics: TGitProjectStatistics;
    /** 模板创建来源 ID */
    created_from_id: number | null;
    /** 是否为模板仓库 */
    template_repository: boolean;
    /** 建议评审人列表 */
    suggestion_reviewers: TGitUserBrief[];
    /** 必要评审人列表 */
    necessary_reviewers: TGitUserBrief[];
    /** 路径评审规则原始字符串 */
    path_reviewer_rules: string;
    /** 评审通过规则（1=单人，>=2=多人，-1=全部） */
    approver_rule: number;
    /** 必要评审通过规则 */
    necessary_approver_rule: number;
    /** 是否开启 commit MR 检查 */
    commit_mr_check: boolean;
    /** 是否开启评审检查 */
    review_check: boolean;
    /** 创建者是否可以通过评审 */
    can_approve_by_creator: boolean;
    /** 推送后是否自动创建评审 */
    auto_create_review_after_push: boolean;
    /** 是否禁止修改规则 */
    forbidden_modify_rule: boolean;
    /** 是否在评论中强制添加标签 */
    force_add_labels_in_note: boolean;
    /** 是否开启已解决检查 */
    resolved_check: boolean;
    /** 是否开启 push reset */
    push_reset_enabled: boolean;
    /** MR 模板内容 */
    merge_request_template: string | null;
    /** 文件 owner 路径规则 */
    file_owner_path_rules: string;
    /** 是否允许跳过评审人 */
    allow_skip_reviewer: boolean;
    /** 是否允许跳过 owner */
    allow_skip_owner: boolean;
    /** 是否允许跳过 MR 检查 */
    allow_skip_mr_check: boolean;
    /** 兼容工蜂未来扩展字段 */
    [k: string]: unknown;
}

/** 仓库统计信息 */
export declare interface TGitProjectStatistics {
    commit_count: number;
    repository_size: number;
    lfs_repository_size: number;
    [k: string]: unknown;
}

/** 工蜂用户信息 */
export declare interface TGitUser {
    id: number;
    username: string;
    name?: string;
    [k: string]: unknown;
}

/** 用户简要信息（owner / suggestion_reviewers / necessary_reviewers 等） */
export declare interface TGitUserBrief {
    id: number;
    username: string;
    name: string;
    state: string;
    web_url: string;
    avatar_url: string | null;
    [k: string]: unknown;
}

/**
 * 节流
 *
 * 连续触发事件但是在 n 秒中只执行一次函数
 * @param {Function} fn 主函数
 * @param {number} time 间隔时间，单位 `ms`
 * @returns 闭包函数
 *
 * @example
 *
 * ```ts
 * function count() {
 *  console.log('xxxxx')
 * }
 * window.onscroll = throttle(count, 500)
 * ```
 */
export declare function throttle(fn: Function, time: number): (...args: Array<any>) => void;

/**
 * i18n 国际化配置
 */
declare const TI18N_KEYS: readonly ["en", "ru", "pt-BR", "th", "vi", "zh", "zh-HK", "zh-TW", "de", "id", "fr", "es", "tr", "ar", "ms", "uz", "ur"];
export { TI18N_KEYS as DEFAULT_TI18N_KEYS }
export { TI18N_KEYS }

export declare type Ti18nKey = typeof TI18N_KEYS[number];

export declare interface TimeData {
    days: number;
    hours: number;
    minutes: number;
    seconds: number;
    milliseconds: number;
}

export declare interface TimeItem {
    digit: string;
    unit: string;
    match: string;
}

/**
 * 将时间戳格式化
 * @param {number} timestamp
 * @param {string} fmt
 * @param {string} [defaultVal]
 * @returns {string} 格式化后的日期字符串
 * @example
 *
 * const stamp = new Date('2020-11-27 8:23:24').getTime();
 *
 * const res = timeStampFormat(stamp, 'yyyy-MM-dd hh:mm:ss')
 *
 * // 2020-11-27 08:23:24
 */
export declare function timeStampFormat(timestamp: number, fmt: string, defaultVal?: string, whitePrefix?: string): string;

/**
 * 处理图片 URL（换 CDN 域名 + 裁剪压缩）
 * @docgen
 * @function tinyImage
 *
 * @param {string} inUrl - 图片原始 URL
 * @param {number} [width=0] - 图片裁剪后的宽度（可选，默认为 0，表示不裁剪）
 * @param {number} [height=0] - 图片裁剪后的高度（可选，默认为 0，表示不裁剪）
 * @return {string} 返回处理后的图片 URL
 *
 * @description
 * 该函数是图片处理的综合方法，依次执行：
 * 1. 将 http 转为 https
 * 2. 替换为 CDN 域名
 * 3. 添加压缩和裁剪参数
 *
 * @example
 *
 * const url = 'http://igame-10037599.cos.ap-shanghai.myqcloud.com/test.jpg';
 * const optimized = tinyImage(url, 200, 200);
 * // 结果：https 域名 + CDN + 压缩参数
 */
export declare const tinyImage: (inUrl: string, imageWidth?: number, imageHeight?: number) => string;

declare const TIP_MAP: {
    saveImage: string;
    saveImageSuccess: string;
    saveImageFail: string;
    saveImageFailOfAuth: string;
    authConfirmContent: string;
    authConfirmFailToast: string;
};

/**
 * 将每个单词的首字母转换为大写
 * @param {string} str 输入字符串
 * @returns {string} 处理后的字符串
 *
 * @example
 *
 * titleize('my name is yang')
 *
 * // My Name Is Yang
 *
 * titleize('foo-bar')
 *
 * // Foo-Bar
 */
export declare function titleize(str: string): string;

export declare const toCamel: typeof camelize;

/**
 * 切换展示 vConsole
 * @returns 是否展示
 * @example
 * ```ts
 * toggleVConsole()
 * ```
 */
export declare function toggleVConsole(): boolean;

/**
 * 将对象中的key由下划线专为驼峰
 *
 * @param {object} obj - 对象
 * @returns {object} 转化后的对象
 *
 * @example
 * const obj = {
 *   a_a: 'a',
 *   b_b: [
 *     {
 *       bb_b: 'b',
 *     },
 *   ],
 *   c: {
 *     dd_d: 'd',
 *     e: {
 *       ee_e: 'e',
 *     },
 *   },
 * };
 *
 * toHumpObj(obj);
 * // { aA: 'a', bB: [ { bbB: 'b' } ], c: { ddD: 'd', e: { eeE: 'e' } } }
 */
export declare function toHumpObj(obj: IHumpObject, cache?: WeakMap<object, any>): object;

export declare const toKebab: typeof hyphenate;

export declare const toPascal: typeof pascalCase;

/**
 * 将函数转成 Promise
 * @param {function} promiseLike 任意函数，可以为 Promise
 * @returns Promise 函数
 * @example
 * ```
 * const bar = () => 1;
 * toPromise(bar()).then(res => console.log(res)); // 1

 * function foo() {
 *   return new Promise(resolve => setTimeout(() => resolve(2), 1000));
 * }
 * toPromise(foo()).then(res => console.log(res)); // 2
 *
 * ```
 */
export declare function toPromise(promiseLike: any): any;

/**
 * 将 alias 路径转换为相对路径
 * @example
 * ```ts
 * toRelativePath(
 *   '/proj/src/views/Home/index.vue',
 *   'src',
 *   'components/Button/index.vue',
 *   '/proj',
 *   { src: 'src' },
 * );
 * // '../../components/Button/index.vue'
 * ```
 */
export declare function toRelativePath(filePath: string, alias: string, subPath: string, rootDir: string, aliasMap: Record<string, string>): string;

/**
 * 获取字符串的 unicode
 *
 * @param {string} str - 字符串
 * @returns {string} data
 *
 * @example
 *
 * toUnicode('ABC')
 *
 * // -> '\\u0041\\u0042\\u0043'
 *
 *
 */
export declare function toUnicode(str: string): unknown;

/**
 * 获取字符串指定下标的 unicode
 *
 * @param {string} str - 字符串
 * @param {number} index - unicode 的下标
 * @returns {string} data
 *
 * @example
 *
 * unicodeAt('ABC', 1)
 *
 * // -> '\\u0042'
 *
 */
export declare function toUnicodeAt(str: string, index?: number): string;

export declare function transformGitToSSH(link?: string): string;

/**
 * 转化 rem 单位
 * @param {string} content 输入内容
 * @param {number} factor 转化比例，默认 100
 * @param {string} unit 转化单位，默认 rpx
 * @returns {string} 转化后的结果
 *
 * @example
 * ```ts
 * transFormRem('1.22rem')
 * // 122rpx
 *
 * transFormRem('1.22rem', 50, 'px')
 * // 61px
 *
 * transFormRem('.21rem', 50, 'px')
 * // 10.50px
 * ```
 */
export declare function transFormRem(content: string, factor?: number, unit?: string): string;

/**
 * 将毫秒数time转化为倒计时
 * @param time 倒计时时间，毫秒单位
 * @param format 倒计时格式化字符串，例如：dd天hh小时mm分ss秒SSS毫秒，hh:mm:ss.SSS，hh:mm:ss
 * @example
 * ```ts
 * transformTime(1000, 'hh:mm:ss')
 * ```
 */
export declare function transformTime(time: number, format: string): {
    timeText: string;
    timeList: TimeItem[];
    timeData: TimeData;
};

/**
 * 递归遍历文件夹，并对每个文件执行回调函数
 * 遍历目录树，对每个文件（非目录）执行指定的回调函数
 * @param cb - 回调函数，接收文件路径作为参数
 * @param tPath - 要遍历的文件夹或文件路径
 * @example
 * ```ts
 * traverseFolder((filePath) => {
 *   console.log('处理文件:', filePath);
 * }, '/path/to/folder');
 * ```
 */
export declare function traverseFolder(cb: Function, tPath: string): void;

export declare function traverseResp(data: Record<string, any>, cb?: typeof updateChildId): void;

export declare const TRIGGER_MAP: {
    MANUAL: string;
    TIME_TRIGGER: string;
    WEB_HOOK: string;
    SERVICE: string;
    PIPELINE: string;
    REMOTE: string;
};

declare type TsErrorFile = {
    file: string;
    line: number;
    column: number;
    code: string;
    message: string;
};

/**
 * node环境下，本地图片转为base64
 * @param {string} savePath 本地图片保存路径
 * @returns {string} base64图片地址
 *
 * @example
 *
 * const base64str = turnLocalImg2Base64('/temp.png')
 *
 */
export declare function turnLocalImg2Base64(imgPath: string): string;

/**
 * 解除腾讯云 COS 图片封禁
 * - 当图片因内容审核被封禁后，可调用此方法解除封禁
 * - 底层通过 putObjectCopy 设置 `x-cos-forbid-state: 0` 来解除封禁状态
 *
 * @param {object} config 配置信息
 * @param {string} config.secretId 腾讯云 SecretId
 * @param {string} config.secretKey 腾讯云 SecretKey
 * @param {string} config.bucket COS 存储桶名称（如 'my-bucket-1250000000'）
 * @param {string} config.region COS 存储桶所在区域（如 'ap-guangzhou'）
 * @param {string} config.key 被封禁的对象键（Object Key），即图片在存储桶中的路径
 * @returns {Promise<object>} 解封结果
 * @throws 当参数不全时会抛出错误
 * @example
 * ```ts
 * // 解除单张图片的封禁
 * await unfreezeCosImage({
 *   secretId: 'your-secret-id',
 *   secretKey: 'your-secret-key',
 *   bucket: 'my-bucket-1250000000',
 *   region: 'ap-guangzhou',
 *   key: 'images/photo.jpg',
 * });
 * ```
 */
export declare function unfreezeCosImage({ secretId, secretKey, bucket, region, key, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    key: string;
}): Promise<any>;

/**
 * 拦截路由
 *
 * @example
 * ```ts
 * uniHookRouter({
 *   navigateToHooks: [
 *     () => console.log('1')
 *   ],
 *    navigateBackHooks: [
 *      () => console.log('2')
 *    ],
 *    redirectToHooks: [
 *      () => console.log('3')
 *    ],
 *    debug: true,
 * })
 * ```
 */
export declare function uniHookRouter({ navigateToHooks, navigateBackHooks, redirectToHooks, tryUniInterCeptor, debug, }: {
    navigateToHooks?: Array<Function>;
    navigateBackHooks?: Array<Function>;
    redirectToHooks?: Array<Function>;
    tryUniInterCeptor?: boolean;
    debug?: boolean;
}): void;

/**
 * 创建唯一 ID 生成器工厂函数
 * 返回一个函数，每次调用时生成递增的唯一 ID
 * @param compName - 组件名称，用于生成 ID 的一部分
 * @param prefix - ID 前缀，默认为 't'
 * @returns 返回一个生成唯一 ID 的函数
 * @example
 * ```ts
 * const getUniqueId = uniqueFactory('button', 'my');
 * getUniqueId(); // 'my_button_0'
 * getUniqueId(); // 'my_button_1'
 * getUniqueId(); // 'my_button_2'
 * ```
 */
export declare const uniqueFactory: (compName: string, prefix?: string) => () => string;

declare function updateChildId(data: {
    child_id_new?: number | string;
    child_id?: number | string;
}): void;

export declare function updateDevopsMpCIPipeline({ isWxCI, forceUpdate, onlyCollectNoUsedPipeline, devopsConfig, templateIdMap, rainbowGroupSecretInfo, }: Record<string, any>): Promise<void>;

export declare function updateDevopsTemplateInstances({ projectId, templateId, pipelineId, host, pipelineName, pipelineParam, useTemplateSettings, secretInfo, }: ITemplateReq & {
    pipelineId: string;
    pipelineName: string;
    pipelineParam: Object;
    useTemplateSettings?: boolean;
}): Promise<any>;

/**
 * 更新仓库中的文件（通过 API 提交，不需要 clone）
 *
 * 对应工蜂 API：PUT /api/v3/projects/:id/repository/files
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {string} options.filePath 文件路径
 * @param {string} options.content 新的文件内容（纯文本）
 * @param {string} options.commitMessage 提交消息
 * @param {string} options.branch 目标分支
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<{ file_path: string; branch_name: string } & Record<string, unknown>>}
 * @example
 *
 * updateFile({
 *   projectName: 'group/sub/repo',
 *   filePath: 'src/utils/helper.ts',
 *   content: 'export const x = 1;\n',
 *   commitMessage: 'chore: update helper',
 *   branch: 'master',
 *   privateToken: 'xxxxx',
 * }).then((resp) => {
 *
 * })
 */
export declare function updateFile({ projectName, filePath, content, commitMessage, branch, privateToken, baseUrl, }: {
    projectName: string | number;
    filePath: string;
    content: string;
    commitMessage: string;
    branch: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<{
    file_path: string;
    branch_name: string;
} & Record<string, unknown>>;

/**
 * 更新 iwiki 文档内容
 * 使用 POST /v2/doc/save 接口，通过 force: true 强制保存
 * @example
 * ```ts
 * await updateIwikiDoc({
 *   prefix: 'https://api.iwiki.woa.com',
 *   id: 12345,
 *   spacekey: 'my-space',
 *   title: '我的文档',
 *   body: '# Hello\n\n更新内容',
 *   contenttype: 'MD',
 *   paasId: 'xxx',
 *   paasToken: 'yyy',
 * });
 * ```
 */
export declare function updateIwikiDoc({ prefix, id, spacekey, title, body, contenttype, otherData, paasId, paasToken, force, }: {
    prefix: string;
    id: number | string;
    spacekey: string;
    title?: string;
    body?: string;
    contenttype?: string;
    otherData?: any;
    paasId: string;
    paasToken: string;
    force?: boolean;
}): Promise<{
    code: string;
    msg: string;
    data: any;
    request_id: string;
}>;

export declare function updateManager(): void;

export declare function updateManifestCore({ path, value, manifest, }: {
    path: string;
    value: string;
    manifest: string;
}): string;

export declare function updateMpCIRainbowConfig({ rainbowConfig, branch, originBranch, testRobot, releaseRobot, robot, env, useMpQQ, }: {
    rainbowConfig: Record<string, any>;
    branch: string;
    originBranch?: string;
    testRobot?: number;
    releaseRobot?: number;
    robot?: number;
    env?: string;
    useMpQQ?: boolean;
    errorMap?: typeof ERROR_MAP;
}): {
    error: string;
} | {
    newRainbowConfig: Record<string, any>;
    rainbowKey: string;
};

/**
 * 更新 MR 上的已有评论
 *
 * 对应工蜂 API：PUT /api/v3/projects/:id/merge_requests/:id/notes/:noteId
 *
 * @param {object} options 输入配置
 * @param {string | number} options.projectName 项目名称或项目 ID
 * @param {number | string} options.mrIid MR 的项目内序号
 * @param {number | string} options.noteId 要更新的评论 ID
 * @param {string} options.body 新的评论内容
 * @param {string} options.privateToken 密钥
 * @param {string} [options.baseUrl] baseUrl
 * @returns {Promise<{ id: number }>} 更新后的评论
 * @example
 *
 * updateMRNote({
 *   projectName: 'coecology/xd',
 *   mrIid: 169,
 *   noteId: 123456,
 *   body: '更新后的评论内容',
 *   privateToken: 'xxxxx',
 * }).then((res) => console.log(res.id));
 */
export declare function updateMRNote({ projectName, mrIid, noteId, body, privateToken, baseUrl, }: {
    projectName: string | number;
    mrIid: number | string;
    noteId: number | string;
    body: string;
    privateToken: string;
    baseUrl?: string;
}): Promise<{
    id: number;
}>;

export declare function updateQQMpResultToSheet({ result, accessToken, clientId, openId, bookId, sheetId, startRow, startColumn, }: ISecretInfo_2 & {
    result: Record<string, any>;
    bookId: string;
    sheetId: string;
    startRow: number;
    startColumn?: number;
}): Promise<any>;

export declare function updateQQMpResultToSheetV0({ accessToken, clientId, openId, bookId, sheetId, startRow, qqMpQRCodePath, result, }: ISecretInfo_2 & {
    bookId: string;
    sheetId: string;
    startRow: number;
    startColumn?: number;
    qqMpQRCodePath: string;
    result: Record<string, any>;
}): Promise<any>;

/**
 * 更新彩虹配置并创建发布任务
 * @param {object} config 配置信息
 * @param {string} config.key 配置key
 * @param {string} config.value 配置value
 * @param {number} config.valueType 配置类型，1: NUMBER, 2: STRING, 3: TEXT, 4: JSON, 5: XML, 18: 日期, 20: yaml
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @param {string} config.creator 创建者
 * @param {string} config.approvers 审批者
 * @returns {Promise<{taskRes: any, versionName: string}>} 发布任务结果和版本名称
 *
 * @example
 * updateRainbowConfigAndCreateTask({
 *   key: 'configKey',
 *   value: 'configValue',
 *   valueType: 2,
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   },
 *   creator: 'creatorName',
 *   approvers: 'approverName'
 * }).then(({ taskRes, versionName }) => {
 *   console.log('任务创建成功:', taskRes);
 *   console.log('版本名称:', versionName);
 * })
 */
export declare function updateRainbowConfigAndCreateTask({ key, value, valueType, secretInfo, creator, approvers, }: {
    key: string;
    value: string;
    valueType: RainbowKeyValueType;
    secretInfo: ISecretInfo_3;
    creator: string;
    approvers: string;
}): Promise<{
    taskRes: any;
    versionName: string;
}>;

/**
 * 修改配置
 * @param {object} config 配置信息
 * @param {object} config.keyValue 配置对象
 * @param {string} config.keyValue.key 配置的key
 * @param {string} config.keyValue.value 配置的value
 * @param {number} config.valueType 配置类型，1: NUMBER, 2: STRING, 3: TEXT, 4: JSON, 5: XML, 18: 日期, 20: yaml
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 * updateRainbowKV({
 *   keyValue: {
 *     key: 'theKey',
 *     value: 'theValue',
 *   },
 *   valueType: 2,
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   }
 * }).then(() => {
 *
 * })
 */
export declare function updateRainbowKV({ keyValue, valueType, secretInfo, }: ModifyConfigParam): Promise<object>;

/**
 * 更新或新增值并发布
 * @param {object} config 配置信息
 * @param {string} config.key 配置key
 * @param {string} config.value 配置value
 * @param {number} config.valueType 配置类型，1: NUMBER, 2: STRING, 3: TEXT, 4: JSON, 5: XML, 18: 日期, 20: yaml
 * @param {object} config.secretInfo 密钥信息
 * @param {string} config.secretInfo.appId 项目Id
 * @param {string} config.secretInfo.userId 用户Id
 * @param {string} config.secretInfo.secretKey 密钥
 * @param {string} config.secretInfo.envName 配置环境
 * @param {string} config.secretInfo.groupName 配置组
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 * updateRainbowKVAndPublish({
 *   key: 'key',
 *   value: 'value',
 *   valueType: 2,
 *   secretInfo: {
 *     appId: 'xxx',
 *     userId: 'xxx',
 *     secretKey: 'xxx',
 *     envName: 'prod',
 *     groupName: 'xxx',
 *   }
 * }).then(() => {
 *
 * })
 */
export declare function updateRainbowKVAndPublish({ key, value, valueType, secretInfo, creator, approvers, }: {
    key: string;
    value: string;
    valueType: RainbowKeyValueType;
    secretInfo: ISecretInfo_3;
    creator: string;
    approvers: string;
}): Promise<any>;

export declare function updateTencentSheet({ accessToken, clientId, openId, bookId, range, values, }: ISecretInfo_2 & {
    bookId: string;
    range: string;
    values: Array<{}>;
}): Promise<any>;

export declare function updateTencentSheetImage({ accessToken, clientId, openId, bookId, insertImages, }: ISecretInfo_2 & {
    bookId: string;
    insertImages: any;
}): Promise<any>;

export declare function upload({ root, bundleName, hostName, hostPwd, hostTargetDir, wrapHostPwd, outputDir, }: {
    root: string;
    bundleName: string;
    hostName: string;
    hostPwd: string;
    hostTargetDir?: string;
    wrapHostPwd?: boolean;
    outputDir?: string;
}): void;

/**
 * COS上传
 * @param {object} config 配置信息
 * @param {Array<object>} config.files 文件列表
 * @param {string} config.files.key 文件key
 * @param {string} config.files.path 文件路径
 * @param {string} [config.files.ContentType] 文件 MIME 类型（如 image/svg+xml），不传则由 COS 根据扩展名推断
 * @param {string} config.secretId COS secretId
 * @param {string} config.secretKey COS secretKey
 * @param {string} config.bucket COS bucket
 * @param {string} config.region COS region
 * @returns {Promise<object>} 请求Promise
 *
 * @example
 *
 * uploadCOSFile({
 *   files: [{
 *     key: 'key1',
 *     path: 'path1',
 *   }, {
 *     key: 'key2',
 *     path: 'path2',
 *   }],
 *   secretId: 'xxx',
 *   secretKey: 'xxx',
 *   bucket: 'xxx',
 *   region: 'xxx',
 * })
 */
export declare function uploadCOSFile({ files, secretId, secretKey, bucket, region, }: {
    files: Array<{
        key: string;
        path: string;
        ContentType?: string;
    }>;
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
}): Promise<any>;

/**
 * 上传文件到 COS 并刷新 CDN 缓存（一体化操作）
 * 先上传文件到 COS，然后自动刷新对应的 CDN URL 缓存，支持 CDN 和 EdgeOne 两种刷新方式
 * @param {object} config 配置信息
 * @param {string} config.secretId 腾讯云 secretId
 * @param {string} config.secretKey 腾讯云 secretKey
 * @param {string} config.bucket COS bucket
 * @param {string} config.region COS region
 * @param {Array<object>} config.files 文件列表，每项包含 key、path、url
 * @param {string} [config.area='mainland'] CDN 刷新区域
 * @param {boolean} [config.useEO] 是否使用 EdgeOne 刷新（默认使用 CDN）
 * @param {object} [config.eoOptions] EdgeOne 刷新配置
 * @returns {Promise<{uploadResult: any, purgeResult: any, code: 1|2}>} code=2 表示上传和刷新均成功，code=1 表示上传成功但刷新失败
 * @example
 * ```ts
 * const result = await uploadCOSFileAndPurgeUrlCache({
 *   secretId: 'xxx',
 *   secretKey: 'xxx',
 *   bucket: 'my-bucket-1250000000',
 *   region: 'ap-guangzhou',
 *   files: [{
 *     key: 'static/app.js',
 *     path: '/dist/app.js',
 *     url: 'https://cdn.example.com/static/app.js',
 *   }],
 * });
 * ```
 */
export declare function uploadCOSFileAndPurgeUrlCache({ secretId, secretKey, bucket, region, files, area, useEO, eoOptions, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    files: Array<{
        key: string;
        path: string;
        url: string;
    }>;
    area?: (typeof AREA_MAP)[keyof typeof AREA_MAP];
    useEO?: boolean;
    eoOptions?: {
        zoneId: string;
        type?: IPurgeType;
        method?: IPurgeMethod;
    };
}): Promise<{
    uploadResult: any;
    purgeResult: any;
    code: 1 | 2;
}>;

/**
 * 以流式方式上传文件到腾讯云 COS（使用 putObject 简单上传）
 * 支持通过文件路径或 Buffer 上传，适用于大文件或流式场景
 * 注意：单次上传大小限制为 5GB，超大文件请使用 uploadCOSStreamFileV2
 * @param {object} config 配置信息
 * @param {object} config.file 文件信息
 * @param {string} [config.file.path] 文件路径（与 buffer 二选一）
 * @param {number} config.file.size 文件大小（字节）
 * @param {Buffer} [config.file.buffer] 文件 Buffer（与 path 二选一）
 * @param {string} config.key COS 对象键（如 'images/test.png'）
 * @param {string} config.secretId COS secretId
 * @param {string} config.secretKey COS secretKey
 * @param {string} config.bucket COS bucket
 * @param {string} config.region COS region
 * @returns {Promise<any>} 上传结果
 * @example
 * ```ts
 * await uploadCOSStreamFile({
 *   file: { path: '/tmp/test.png', size: 1024 },
 *   key: 'images/test.png',
 *   secretId: 'xxx',
 *   secretKey: 'xxx',
 *   bucket: 'my-bucket-1250000000',
 *   region: 'ap-guangzhou',
 * });
 * ```
 */
export declare function uploadCOSStreamFile({ file, key, secretId, secretKey, bucket, region, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    file: {
        path?: string;
        size: number;
        buffer?: Buffer;
    };
    key: string;
}): Promise<unknown>;

/**
 * 以高级上传方式上传文件到腾讯云 COS（使用 uploadFile，SDK 自动决定分块或简单上传）
 * 适用于大文件上传，支持自动分块和断点续传
 * @param {object} config 配置信息
 * @param {object} config.file 文件信息
 * @param {string} config.file.path 文件路径（必填）
 * @param {number} config.file.size 文件大小（字节）
 * @param {string} config.key COS 对象键（如 'images/test.png'）
 * @param {string} config.secretId COS secretId
 * @param {string} config.secretKey COS secretKey
 * @param {string} config.bucket COS bucket
 * @param {string} config.region COS region
 * @param {number} [config.sliceSize=5242880] 分块大小，默认 5MB
 * @returns {Promise<any>} 上传结果
 * @example
 * ```ts
 * await uploadCOSStreamFileV2({
 *   file: { path: '/tmp/large-file.zip', size: 104857600 },
 *   key: 'files/large-file.zip',
 *   secretId: 'xxx',
 *   secretKey: 'xxx',
 *   bucket: 'my-bucket-1250000000',
 *   region: 'ap-guangzhou',
 *   sliceSize: 1024 * 1024 * 10, // 10MB
 * });
 * ```
 */
export declare function uploadCOSStreamFileV2({ file, key, secretId, secretKey, bucket, region, sliceSize, }: {
    secretId: string;
    secretKey: string;
    bucket: string;
    region: string;
    file: {
        path?: string;
        size: number;
    };
    key: string;
    sliceSize?: number;
}): Promise<unknown>;

/**
 * 上传文件
 *
 * 上传的本质：
 *
 * 1. 小程序上传文件是先用 chooseFile 获取一个文件，可以得到
 * 一个临时路径，然后用 uploadFile 上传该临时路径
 *
 * 2. H5 是 input 获取文件，然后用 FormData 上传 File 对象
 * @param {File} file 文件
 * @returns {Promise<{url: string}>} 上传结果
 *
 * @example
 * ```ts
 * import { uploadFile, UploadManager } from 't-comm/lib/uploader'
 *
 * uploadFile(file).then(() => {})
 *
 * // 可以通过 UploadManager 设置上传参数
 * UploadManager.setConfig({
 *   requestHashUrl: `https://${location.hostname}/pvp/share/getsharecfg.php`,
 *   uploadFileKey: 'upload_pic_input',
 *   uploadUrlPrefix: 'https://igame.qq.com/external/uploadpic.php?_hash=',
 * })
 *
 * // 可以通过 UploadManager.getInstance().updateHashCode 主动更新 hashCode
 * UploadManager.getInstance().updateHashCode();
 * ```
 */
export declare function uploadFile(file: File): Promise<unknown>;

/**
 * 文件上传管理器
 * 单例模式，管理文件上传的 hash 码和上传请求
 * @example
 * ```ts
 * // 设置上传配置
 * UploadManager.setConfig({
 *   requestHashUrl: 'https://example.com/api/hash',
 *   uploadFileKey: 'file',
 *   uploadUrlPrefix: 'https://example.com/upload?hash='
 * });
 *
 * // 获取实例并上传文件
 * const manager = UploadManager.getInstance();
 * manager.requestUpload(file).then(res => {
 *   console.log('上传成功:', res.url);
 * });
 * ```
 */
export declare class UploadManager {
    static uploadManager: UploadManager;
    /**
     * 获取 UploadManager 单例实例
     * @returns UploadManager 实例
     */
    static getInstance(): UploadManager;
    /**
     * 设置上传配置
     * @param options - 上传配置选项
     * @param options.requestHashUrl - 请求 hash 码的 URL 或函数
     * @param options.uploadFileKey - 上传文件的表单字段名
     * @param options.uploadUrlPrefix - 上传文件的 URL 前缀
     */
    static setConfig(options: IUploaderOptions): void;
    hash: string;
    timestamp: number;
    isRequesting: boolean;
    options: IUploaderOptions;
    constructor();
    /**
     * 更新 hash 码
     * 从服务器获取新的 hash 码用于文件上传
     * @returns Promise，resolve 时返回新的 hash 码
     */
    updateHashCode(): Promise<unknown>;
    /**
     * 请求上传文件
     * 自动管理 hash 码的更新，确保 hash 码有效
     * @param file - 要上传的文件对象
     * @returns Promise，resolve 时返回包含文件 URL 的对象
     */
    requestUpload(file: File): Promise<{
        url: string;
    }>;
}

export declare function uploadTencentDocImage({ accessToken, clientId, openId, image, }: ISecretInfo_2 & {
    image: string;
}): Promise<any>;

/**
 * 解决图片跨域问题，将网络图片URL转为base64 URL。
 * @param {string} src 网络图片URL
 * @returns {Promise} Promise对象返回base64 URL
 *
 * @example
 * Dom2Image.urlToBase64("http://test.com/image.png").then(url=>{});
 */
export declare function urlToBase64(src: string): Promise<string>;

declare interface UserInfo {
    openid: string;
    token: string;
    channel_info?: {
        channelId: number;
    };
}

/**
 * vConsole 当前展示状态
 * @example
 * ```ts
 * import { V_CONSOLE_STATE, toggleVConsole } from 't-comm';
 *
 * console.log(V_CONSOLE_STATE.show); // false
 * toggleVConsole();
 * console.log(V_CONSOLE_STATE.show); // true
 * ```
 */
export declare const V_CONSOLE_STATE: {
    show: boolean;
};

/**
 * 判断是否字母字符串
 * @param {string} str
 * @returns {Boolean}
 * @example
 * ```ts
 * validAlphabets('abcABC'); // true
 * validAlphabets('abc123'); // false
 * validAlphabets('abc def'); // false
 * ```
 */
export declare function validAlphabets(str: string): boolean;

/**
 * 验证身份证号第18位校验码是否合法
 * 使用加权求和算法验证身份证号的最后一位校验码
 * @param str - 身份证号字符串
 * @returns 校验码是否合法
 * @private
 * @example
 * ```ts
 * validateMoreIdCard('34052419800101001X'); // true
 * validateMoreIdCard('34052419800101001Y'); // false
 * ```
 */
export declare function validateMoreIdCard(str: string): boolean;

/**
 * 判断是否合法邮箱地址
 * @param {string} email
 * @returns {Boolean}
 * @example
 * ```ts
 * validEmail('test@example.com'); // true
 * validEmail('user.name@domain.co'); // true
 * validEmail('test'); // false
 * validEmail('@example.com'); // false
 * validEmail('test@'); // false
 * ```
 */
export declare function validEmail(email: string): boolean;

/**
 * 判断是否小写
 * @param {string} str
 * @returns {Boolean}
 * @example
 * ```ts
 * validLowerCase('abc'); // true
 * validLowerCase('aBc'); // false
 * validLowerCase('abc123'); // false
 * validLowerCase(''); // false
 * ```
 */
export declare function validLowerCase(str: string): boolean;

/**
 * 判断是否大写
 * @param {string} str
 * @returns {Boolean}
 * @example
 * ```ts
 * validUpperCase('ABC'); // true
 * validUpperCase('ABc'); // false
 * validUpperCase(''); // false
 * ```
 */
export declare function validUpperCase(str: string): boolean;

/**
 * 判断是否URL
 * @param {string} url
 * @returns {Boolean}
 * @example
 * ```ts
 * validURL('http://baidu.com'); // true
 * validURL('https://www.google.com'); // true
 * validURL('ftp://192.168.1.1'); // true
 * validURL('baidu.com'); // false
 * validURL('htp://test.com'); // false
 * validURL(''); // false
 * ```
 */
export declare function validURL(url: string): boolean;

declare type ValueType = string | number;

declare enum ValueType_2 {
    NUMBER = 1,
    STRING = 2,
    TEXT = 3,
    JSON = 4,
    XML = 5,
    DATE = 18,
    YAML = 20
}

export declare const vClickoutside: {
    beforeMount(el: ClickOutsideElement, binding: any): void;
    update(): void;
    unmounted(el: ClickOutsideElement): void;
};

export declare const version: any;

declare type VersionType = keyof typeof versionTypeMap | string;

declare const versionTypeMap: {
    alpha: string;
    beta: string;
    rc: string;
    patch: string;
    minor: string;
    major: string;
};

/**
 * 监听rainbow，同步到cos，并发送到机器人
 * @param {object} options 配置
 * @param {object} options.rainbowSecretInfo 七彩石密钥信息
 * @param {object} options.cosInfo 腾讯云信息
 * @param {string} options.appName 七彩石项目名称
 *
 * @param {string} options.webhookUrl 机器人回调
 * @param {string} options.chatId 会话id
 * @param {0|1|2} options.sendToRobotType 发送机器人类型，0 不发送，1 发送变化的部分，2 全部发送
 *
 * @example
 *
 * await watchRainbowToCosAndSendRobot({
 *   rainbowSecretInfo: {
 *     appID: RAINBOW_OPEN_APP_ID,
 *     userID: RAINBOW_OPEN_YGW_USER_ID,
 *     secretKey: RAINBOW_OPEN_YGW_SECRET_KEY,
 *     envName: 'Default',
 *     groupName: 'group',
 *   },
 *   appName: 'configApp',
 *   cosInfo: {
 *     secretId,
 *     secretKey,
 *     bucket: 'bucket',
 *     region: 'ap-guangzhou',
 *     dir: 'rb',
 *   },
 *   webhookUrl: 'xxx',
 *   chatId: 'xxx',
 *   sendToRobotType: 1,
 * });
 *
 */
export declare function watchRainbowToCosAndSendRobot({ rainbowSecretInfo: secretInfo, cosInfo, appName, webhookUrl, chatId, sendToRobotType, }: {
    rainbowSecretInfo: ISecretInfo_4;
    cosInfo: ICosInfo;
    appName: string;
    webhookUrl: string;
    chatId: string;
    sendToRobotType?: (typeof SendToRobotTypeMap)[keyof typeof SendToRobotTypeMap];
}): Promise<void>;

/** Webhook 条目 */
export declare interface WebhookItem {
    id: number;
    url: string;
    [k: string]: unknown;
}

export declare function writeEnvAndPrivateKey({ branch, env, root, rainbowConfigKey, rainbowAppId, rainbowEnvName, rainbowGroupName, }: Record<'branch' | 'env' | 'rainbowConfigKey' | 'rainbowAppId' | 'rainbowEnvName' | 'rainbowGroupName' | 'root', string>): Promise<void>;

export declare function writeEnvAndPrivateKeyByOptions(options: any): Promise<void>;

export declare function writeEnvFromRainbow({ envPath, rainbowAppId, rainbowUserId, rainbowSecretKey, rainbowKey, envName, groupName, sdk, }: {
    envPath: string;
    rainbowAppId: string;
    rainbowUserId?: string;
    rainbowSecretKey?: string;
    rainbowKey: string;
    envName: string;
    groupName: string;
    sdk: any;
}): Promise<boolean>;

/**
 * 将 .env.local 中 NPM_TOKEN 的值写入到 .npmrc 中
 * @example
 * ```ts
 * // 在发版脚本中使用：
 * // 先在项目根目录的 .env.local 写入 NPM_TOKEN=xxx
 * // 然后调用此方法生成 .npmrc，便于 npm publish 进行授权
 * writeEnvTokenToNpmRC();
 * ```
 */
export declare function writeEnvTokenToNpmRC(): void;

/**
 * 写入文件
 * @param {string} file 文件地址
 * @param {any} data 文件数据
 * @param {boolean} [isJson] 是否需要 json 序列化
 * @example
 * ```ts
 * writeFileSync('a', 'b.txt', false);
 *
 * writeFileSync({ a: 1 }, 'b.json', true);
 * ```
 */
export declare function writeFileSync(file: string, data: any, isJson?: boolean): void;

/** 微信蓝牙能力适配器接口（用于依赖注入，便于测试） */
export declare interface WxBluetoothAdapter {
    /** 当前环境是否具备最低限度的蓝牙 API */
    isAvailable(): boolean;
    /** 检测平台（ios / android / devtools / unknown ...） */
    detectPlatform(): string;
    /** 触发隐私授权弹窗并等待用户同意（不支持时直接 resolve） */
    ensurePrivacyAuthorized(privacyContent: string, log: (m: string) => void): Promise<void>;
    /** 打开蓝牙适配器；iOS 上分别打开 central + peripheral，并返回是否需跳过广播 */
    openAdapter(platform: string, log: (m: string) => void): Promise<OpenAdapterResult>;
    /** 创建外围设备并开始广播 */
    startAdvertising(params: StartAdvertisingParams): Promise<{
        server: any;
    }>;
    /**
     * 更新正在广播的 payload（mutual 模式用）。
     * 实现：stopAdvertising → 重新 addService（新 value）→ startAdvertising。
     * 失败时 reject，调用方需要自己决定是否回退。
     */
    updateAdvertisedValue(server: any, params: StartAdvertisingParams): Promise<void>;
    /** 开始扫描：iOS 不传 services（系统重新包装广播包后会扫不到） */
    startDiscovery(params: StartDiscoveryParams): Promise<void>;
    /** 注册扫描回调 */
    onDeviceFound(cb: (res: any) => void): void;
    offDeviceFound(cb: (res: any) => void): void;
    /** 注册适配器状态变化回调 */
    onAdapterStateChange(cb: (res: any) => void): void;
    offAdapterStateChange(cb: (res: any) => void): void;
    /** iOS 兜底轮询用 */
    getDevices(): Promise<{
        devices: any[];
    }>;
    /** 停止扫描 / 停止广播 / 关闭适配器（任一失败都安全吞掉） */
    stopDiscovery(): void;
    stopAdvertising(server: any): void;
    closeAdapter(): void;
}

export declare const wxBluetoothAdapter: WxBluetoothAdapter;

/**
 * 通过 wx.login 拿微信登录 code
 *
 * 适用场景：微信宿主下走微信登录，或 QQ App 下用户主动选择「微信账号登录」时。
 * 拿到 code 后由业务后台用 `_ltype=tiploginwxproc` 换登录态。
 *
 * @returns code 字符串；wx.login 不可用或失败时 reject
 */
export declare function wxLogin(): Promise<{
    code: string;
}>;

export { }
