import { AxiosResponse } from 'axios'; import { Context } from 'koishi'; /** * Git 平台类型 */ export declare enum GitPlatform { GITCODE = "gitcode" } /** * 操作结果类型 */ interface OperationResult { success: boolean; data?: AxiosResponse; error?: string; } /** * 文件上传参数 */ interface FileUploadParams { owner: string; repo: string; path: string; content: string; message: string; token: string; branch?: string; } /** * 上传或更新 GitCode 仓库中的文本文件 * @param ctx - Koishi 上下文 * @param owner - 仓库所有者用户名 * @param repo - 仓库名称 * @param path - 文件路径(例如 'docs/update.txt') * @param content - 文件内容(纯文本字符串,会自动 Base64 编码) * @param message - Commit 消息 * @param token - GitCode Personal Access Token * @param branch - 分支名(默认 'master') * @returns Promise */ export declare function upsertFileToGitCode(ctx: Context, owner: string, repo: string, path: string, content: string, message: string, token: string, branch?: string): Promise; /** * 通用上传函数(可指定平台) * @param ctx - Koishi 上下文 * @param platform - Git 平台类型 * @param params - 上传参数 * @returns Promise */ export declare function upsertFileToGit(ctx: Context, platform: GitPlatform, params: FileUploadParams): Promise; export {};