extension.d.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. declare namespace Editor {
  2. namespace Interface {
  3. // ---- Package ---- start
  4. interface PackageInfo {
  5. debug: boolean;
  6. enable: boolean;
  7. info: PackageJson;
  8. invalid: boolean;
  9. name: string;
  10. path: string;
  11. version: string;
  12. }
  13. interface PackageJson {
  14. name: string;
  15. version: string;
  16. title?: string;
  17. author?: string;
  18. debug?: boolean;
  19. description?: string;
  20. main?: string;
  21. editor?: string;
  22. panel?: any;
  23. contributions?: { [key: string]: any };
  24. }
  25. // ---- Package ---- end
  26. // ---- UI ---- start
  27. interface PanelInfo {
  28. template?: string;
  29. style?: string;
  30. listeners?: { [key: string]: () => {} };
  31. methods?: { [key: string]: Function };
  32. $?: { [key: string]: string };
  33. ready?(): void;
  34. update?(...args: any[]): void;
  35. beforeClose?(): void;
  36. close?(): void;
  37. }
  38. namespace UIKit {
  39. interface UIPanelInfo extends PanelInfo {
  40. // 向上触发事件
  41. dispath(eventName: string, ...arg: any): void;
  42. }
  43. interface EditorElementBase extends HTMLElement {
  44. value: any;
  45. dispath: (name: string, event: any) => void;
  46. }
  47. }
  48. // ---- UI ---- end
  49. }
  50. }