An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve plugin lifecycle callback types https://github.com/siyuan-note/petal/issues/59
Vanessaec8c7660b702
diff --git a/app/src/layout/dock/Custom.ts b/app/src/layout/dock/Custom.tsindex 18a581bed9..a76aea4196 100644--- a/app/src/layout/dock/Custom.ts+++ b/app/src/layout/dock/Custom.ts@@ -8,11 +8,11 @@ export class Custom extends Model {public tab: Tab;public data: any;public type: string;- public init: (custom: Custom) => void;- public destroy: () => void;- public beforeDestroy: () => void;- public resize: () => void;- public update: () => void;+ public init: (this: Custom, custom: Custom) => void;+ public destroy: (this: Custom) => void;+ public beforeDestroy: (this: Custom) => void;+ public resize: (this: Custom) => void;+ public update: (this: Custom) => void;public editors: Protyle[] = [];constructor(options: {@@ -20,11 +20,11 @@ export class Custom extends Model {type: string,tab: Tab,data: any,- destroy?: () => void,- beforeDestroy?: () => void,- resize?: () => void,- update?: () => void,- init: (custom: Custom) => void+ destroy?: (this: Custom) => void,+ beforeDestroy?: (this: Custom) => void,+ resize?: (this: Custom) => void,+ update?: (this: Custom) => void,+ init: (this: Custom, custom: Custom) => void}) {super({app: options.app});if (window.siyuan.config.fileTree.openFilesUseCurrentTab) {diff --git a/app/src/mobile/dock/MobileCustom.ts b/app/src/mobile/dock/MobileCustom.tsindex e34bd6a0f5..dc09255c05 100644--- a/app/src/mobile/dock/MobileCustom.ts+++ b/app/src/mobile/dock/MobileCustom.ts@@ -2,17 +2,17 @@ export class MobileCustom {public element: Element;public data: any;public type: string;- public init: (custom: MobileCustom) => void;- public destroy: () => void;- public update: () => void;+ public init: (this: MobileCustom, custom: MobileCustom) => void;+ public destroy: (this: MobileCustom) => void;+ public update: (this: MobileCustom) => void;constructor(options: {element: Element,type: string,data: any,- destroy?: () => void,- update?: () => void,- init: (custom: MobileCustom) => void+ destroy?: (this: MobileCustom) => void,+ update?: (this: MobileCustom) => void,+ init: (this: MobileCustom, custom: MobileCustom) => void}) {this.element = options.element;this.data = options.data;diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.tsindex e20f217495..b105cd2a7a 100644--- a/app/src/plugin/index.ts+++ b/app/src/plugin/index.ts@@ -472,11 +472,11 @@ export class Plugin {public addTab(options: {type: string,- destroy?: () => void,- beforeDestroy?: () => void,- resize?: () => void,- update?: () => void,- init: () => void+ destroy?: (this: Custom) => void,+ beforeDestroy?: (this: Custom) => void,+ resize?: (this: Custom) => void,+ update?: (this: Custom) => void,+ init: (this: Custom, custom: Custom) => void}) {if (isPluginDisposed(this)) {return;@@ -572,10 +572,10 @@ export class Plugin {config: IPluginDockTab,data: any,type: string,- destroy?: () => void,- resize?: () => void,- update?: () => void,- init: () => void+ destroy?: (this: Custom | MobileCustom) => void,+ resize?: (this: Custom) => void,+ update?: (this: Custom | MobileCustom) => void,+ init: (this: Custom | MobileCustom, custom: Custom | MobileCustom) => void}) {if (isPluginDisposed(this)) {return;