behavior-eden-coco-plugin/@types/extension.d.ts

67 lines
1.8 KiB
TypeScript
Raw Permalink Normal View History

2023-09-20 17:32:11 +00:00
declare namespace Editor {
namespace Interface {
// ---- Package ---- start
interface PackageInfo {
debug: boolean;
enable: boolean;
// TODO 更名为 packageJSON 更合适
info: PackageJson;
invalid: boolean;
name: string;
path: string;
version: string;
}
interface PackageJson {
name: string;
version: string;
title?: string;
author?: string;
debug?: boolean;
description?: string;
main?: string;
editor?: string;
panel?: any;
migrations?: {
version: string;
profile?: string;
custom?: string;
}[];
contributions?: {
[key: string]: any;
builder?: string; // 构建插件注册脚本
};
}
// ---- Package ---- end
// ---- UI ---- start
interface PanelInfo {
template?: string;
style?: string;
listeners?: { [key: string]: () => {} };
methods?: { [key: string]: Function };
$?: { [key: string]: string };
ready?(): void;
update?(...args: any[]): void;
beforeClose?(): void;
close?(): void;
}
namespace UIKit {
interface UIPanelInfo extends PanelInfo {
// 向上触发事件
dispath(eventName: string, ...arg: any): void;
}
interface EditorElementBase extends HTMLElement {
value: any;
dispath: (name: string, event: any) => void;
}
}
// ---- UI ---- end
}
}