UNPKG

koishi-plugin-mc-tools

Version:

我的世界(Minecraft)。可查询 MC 版本、服务器信息、玩家皮肤信息以及四大平台资源;支持管理服务器,功能梭哈

366 lines (365 loc) 9.91 kB
import { getModrinthProject } from './modrinth'; import { getMcwikiPage } from './mcwiki'; /** * 支持的平台配置,包含各平台的搜索、详情获取和数据转换方法 * @type {Object} */ export declare const PLATFORMS: { modrinth: { name: string; /** * 搜索Modrinth项目 * @param {Context} ctx - Koishi上下文 * @param {string} keyword - 搜索关键词 * @param {Config} config - 配置对象 * @param {Object} options - 搜索选项 * @returns {Promise<Array>} 搜索结果列表 */ search: (ctx: any, keyword: any, config: any, options?: {}) => Promise<any>; /** * 获取Modrinth项目详情 * @type {Function} */ getDetail: typeof getModrinthProject; /** * 转换Modrinth项目数据为统一格式 * @param {Object} p - 项目数据 * @returns {Object} 统一格式的项目数据 */ transform: (p: any) => { platform: string; name: any; description: any; url: string; extra: { id: any; type: any; author: any; downloads: any; }; }; /** * 检查配置是否启用该平台 * @param {Config} config - 配置对象 * @returns {boolean} 是否启用 */ checkConfig: (config: any) => any; }; curseforge: { name: string; /** * 搜索CurseForge项目 * @param {Context} ctx - Koishi上下文 * @param {string} keyword - 搜索关键词 * @param {Config} config - 配置对象 * @param {Object} options - 搜索选项 * @returns {Promise<Object>} 包含结果和分页信息的对象 */ search: (ctx: any, keyword: any, config: any, options?: {}) => Promise<{ results: any; pagination: any; }>; /** * 获取CurseForge项目详情 * @param {Context} ctx - Koishi上下文 * @param {string} id - 项目ID * @param {Config} config - 配置对象 * @returns {Promise<Object>} 项目详情 */ getDetail: (ctx: any, id: any, config: any) => Promise<{ content: (string | import("koishi").Element)[]; url: any; }>; /** * 转换CurseForge项目数据为统一格式 * @param {Object} p - 项目数据 * @returns {Object} 统一格式的项目数据 */ transform: (p: any) => { platform: string; name: any; description: any; url: any; extra: { id: any; author: any; downloads: any; type: any; }; }; /** * 检查配置是否启用该平台 * @param {Config} config - 配置对象 * @returns {boolean} 是否启用 */ checkConfig: (config: any) => any; }; mcmod: { name: string; /** * 搜索MCMOD项目 * @param {Context} ctx - Koishi上下文 * @param {string} keyword - 搜索关键词 * @param {Config} config - 配置对象 * @param {Object} options - 搜索选项 * @returns {Promise<Object>} 包含结果和分页信息的对象 */ search: (ctx: any, keyword: any, config: any, options?: {}) => Promise<{ results: any; pagination: { page: any; total: any; totalResults: any; pageSize: number; offset: number; }; }>; /** * 获取MCMOD项目详情 * @param {Context} ctx - Koishi上下文 * @param {string} id - 项目ID * @param {Config} config - 配置对象 * @returns {Promise<Object>} 项目详情 */ getDetail: (ctx: any, project: any, config: any) => Promise<{ content: (string | import("koishi").Element)[]; url: any; icon: any; }>; /** * 转换MCMOD项目数据为统一格式 * @param {Object} p - 项目数据 * @returns {Object} 统一格式的项目数据 */ transform: (p: any) => { platform: string; name: any; description: any; url: any; extra: { id: any; type: any; category: any; }; }; /** * 检查配置是否启用该平台 * @param {Config} config - 配置对象 * @returns {boolean} 是否启用 */ checkConfig: (config: any) => boolean; }; mcwiki: { name: string; /** * 搜索Minecraft Wiki页面 * @param {Context} ctx - Koishi上下文 * @param {string} keyword - 搜索关键词 * @param {Config} config - 配置对象 * @param {Object} options - 搜索选项 * @returns {Promise<Array>} 搜索结果列表 */ search: (ctx: any, keyword: any, config: any, options?: {}) => Promise<{ results: any; pagination: { totalResults: any; offset: number; nextOffset: number; exhausted: boolean; }; } | { results: any[]; pagination: { totalResults: number; offset: number; exhausted: boolean; nextOffset?: undefined; }; }>; /** * 获取Minecraft Wiki页面详情 * @param {Context} ctx - Koishi上下文 * @param {string} id - 页面ID * @param {Config} config - 配置对象 * @returns {Promise<Object>} 页面详情 */ getDetail: typeof getMcwikiPage; /** * 转换Minecraft Wiki页面数据为统一格式 * @param {Object} p - 页面数据 * @returns {Object} 统一格式的页面数据 */ transform: (p: any) => { platform: string; name: any; description: any; url: string; extra: { id: any; }; }; /** * 检查配置是否启用该平台 * @param {Config} config - 配置对象 * @returns {boolean} 是否启用 */ checkConfig: (config: any) => any; }; }; /** * CurseForge相关映射表 * @type {Object} */ export declare const CF_MAPS: { /** 资源类型映射 */ TYPE: { mod: number; resourcepack: number; world: number; plugin: number; modpack: number; addon: number; customization: number; shader: number; datapack: number; }; /** 加载器类型映射 */ LOADER: { any: number; forge: number; cauldron: number; liteloader: number; fabric: number; quilt: number; neoforge: number; }; /** 发布类型映射 */ RELEASE: { 1: string; 2: string; 3: string; }; /** 依赖关系映射 */ RELATION: { 1: string; 2: string; 3: string; 4: string; 5: string; }; }; /** * 状态映射表 * @type {Object} */ export declare const STATUS_MAP: { compatibility: { required: string; optional: string; unsupported: string; }; type: { mod: string; modpack: string; resourcepack: string; shader: string; }; }; /** * MCMOD相关映射表 * @type {Object} */ export declare const MCMOD_MAPS: { /** 搜索过滤器映射 */ FILTER: { mod: number; modpack: number; item: number; post: number; author: number; user: number; community: number; }; /** 资源类型映射 */ RESOURCE_TYPE: { '1': string; '2': string; '3': string; '4': string; '5': string; '6': string; '7': string; '8': string; '9': string; '10': string; '11': string; '12': string; '191': string; }; /** 整合包分类映射 */ CATEGORY: { '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; }; /** 模组分类映射 */ MOD_CATEGORY: { '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; '33': string; '34': string; '35': string; }; /** 资源类型映射 */ TYPE: { class: string; modpack: string; item: string; post: string; author: string; user: string; community: string; }; };