HumanBreak/src/types/plugin.d.ts
2022-11-13 18:02:05 +08:00

25 lines
766 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 这里包含所有插件导出的函数及变量声明声明的函数会在类型标注中标注到core上
interface PluginDeclaration {
/**
* 添加函数 例添加弹出文字像这个就可以使用core.addPop或core.plugin.addPop调用
* @param px 弹出的横坐标
* @param py 弹出的纵坐标
* @param value 弹出的文字
*/
addPop(px: number, py: number, value: string): void;
/** 添加变量 例所有的正在弹出的文字像这个就可以使用core.plugin.pop获取 */
pop: any[];
}
type Forward<T> = {
[K in keyof T as T[K] extends Function
? K extends `_${string}`
? never
: K
: never]: T[K];
};
type ForwardKeys<T> = keyof Forward<T>;