koishi-plugin-yunzai
Version:
a yunzai adapter for koishi
29 lines (28 loc) • 950 B
TypeScript
import { Region } from "../utils/Region";
type APIRequestMethod = 'GET' | 'POST';
type APIType = keyof APIRegionOption;
export type APIParameTyper = StringConstructor | NumberConstructor | BooleanConstructor | ObjectConstructor;
/**
* 基本 API 请求列表。
*/
export type APIStencil = {
readonly [K in string]: APIStencilOption;
};
export type APIRegion = {
readonly [K in string]: APIRegionOption;
};
export type ActID = Record<Region, string>;
export interface APIStencilOption {
readonly availableFor: readonly Region[];
readonly hostBy?: APIType | Record<Region, APIType | undefined>;
readonly method: APIRequestMethod;
readonly url: string | Record<Region, string>;
readonly parameters: readonly (readonly [string, APIParameTyper, boolean?])[];
readonly cookie: boolean;
}
export interface APIRegionOption {
readonly takumi: string;
readonly hk4e: string;
readonly record: string;
}
export {};