import { APIRegion, APIStencil, ActID } from "./interface/basicAPI.interface"; import { GetRegion, RegionType } from "./utils/Region"; export declare namespace BBSApi { /** * hostBy所指API地址 */ export const region: APIRegion; /** * act_id */ export const actId: ActID; /** * 请求所用的API模板 */ export const stencil: APIStencil; type ApiList = keyof typeof stencil; type AvailableRegions = keyof typeof region; type AvailableUnion = typeof stencil[K]['availableFor'][number]; export type For = { [K in ApiList as R extends AvailableUnion ? K : never]: typeof stencil[K]; }; /** * 获取该地区支持的API */ export type Keys = keyof For>; /** * 获取API请求参数条件 */ export type Params> = { [K in For>[A]['parameters'][number][0]]: ReturnType>[A]['parameters'][number][1]>; }; export type RequestTyper = Keys> = K extends 'bbsSign' ? Sign : K extends 'bbsSignHome' ? SignHome : K extends 'bbsSignInfo' ? SignInfo : K extends 'dailyNote' ? DailyNote : K extends 'abyss' ? Abyss : K extends 'character' ? Character : any; export {}; }