siyuan 0.3.12 → 0.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/siyuan.d.ts +30 -1
package/package.json CHANGED
@@ -2,5 +2,6 @@
2
2
  "name": "siyuan",
3
3
  "author": "zuoez02",
4
4
  "types": "siyuan.d.ts",
5
- "version": "0.3.12"
5
+ "version": "0.3.18",
6
+ "repository": "https://github.com/zuoez02/siyuan-package"
6
7
  }
package/siyuan.d.ts CHANGED
@@ -76,6 +76,7 @@ declare module 'siyuan/api/client-api' {
76
76
  export function addToolbarLeft(el: Element): void;
77
77
  export function addToolbarRight(el: Element): void;
78
78
  export function addSettingTab(settingTab: ISettingTab): void;
79
+ export const createLogger: (name: string) => import("zhi-log").DefaultLogger;
79
80
  }
80
81
 
81
82
  declare module 'siyuan/internal/classes/menu' {
@@ -140,6 +141,8 @@ declare module 'siyuan/api/plugin' {
140
141
  onload(): void;
141
142
  onunload(): void;
142
143
  registerCommand(command: IPluginCommand): void;
144
+ loadStorage(filename: string): Promise<any>;
145
+ writeStorage(filename: string, content: any): Promise<void>;
143
146
  }
144
147
  }
145
148
 
@@ -147,13 +150,28 @@ declare module 'siyuan/types' {
147
150
  export interface IPlugin {
148
151
  onload(): void;
149
152
  onunload(): void;
153
+ registerCommand(command: IPluginCommand): any;
154
+ loadStorage(filename: string): Promise<Response>;
155
+ writeStorage(filename: string, content: any): Promise<void>;
150
156
  }
151
157
  export interface PluginConstructor {
152
158
  new (): IPlugin;
153
159
  }
160
+ export interface StorePluginManifest {
161
+ key: string;
162
+ name: string;
163
+ description: string;
164
+ author: string;
165
+ version: string;
166
+ }
167
+ export interface StorePluginStatus extends StorePluginManifest {
168
+ isExist: boolean;
169
+ needUpgrade: boolean;
170
+ }
154
171
  export interface PluginManifest {
155
172
  key: string;
156
173
  name: string;
174
+ version: string;
157
175
  script?: string;
158
176
  enabled?: boolean;
159
177
  hidden?: boolean;
@@ -161,7 +179,7 @@ declare module 'siyuan/types' {
161
179
  plugin?: new (...args: any) => IPlugin;
162
180
  }
163
181
  export interface IStorageManager {
164
- get(key: string): any;
182
+ get(key: keyof PluginConfig): any;
165
183
  set(key: string, val: any): Promise<void>;
166
184
  initStorage(): Promise<IStorageManager>;
167
185
  getPlugins(): PluginManifest[];
@@ -171,6 +189,8 @@ declare module 'siyuan/types' {
171
189
  setPluginEnabled(key: string, enabled: boolean): Promise<void>;
172
190
  savePluginsEnabled(): Promise<void>;
173
191
  setSafeModeEnabled(enabled: boolean): Promise<void>;
192
+ setPluginStorage(pluginKey: string, filename: string, content: any): Promise<void>;
193
+ getPluginStorage(pluginKey: string, filename: string): Promise<Response>;
174
194
  }
175
195
  export interface ISystemManager {
176
196
  saveToLocal(p: string, content: string): Promise<void>;
@@ -231,6 +251,7 @@ declare module 'siyuan/types' {
231
251
  PLUGIN_SYSTEM_AUTO_UPDATE: boolean;
232
252
  PLUGIN_SYSTEM_PLUGIN: Array<PluginEnableConfig>;
233
253
  PLUGIN_SYSTEM_THIRD_PARTY_PLUGIN: Array<PluginEnableConfig>;
254
+ PLUGIN_STORE_URL: string;
234
255
  }
235
256
  export type Listener = (...args: any) => void;
236
257
  export interface IEventBus {
@@ -265,5 +286,13 @@ declare module 'siyuan/types' {
265
286
  registerKeyboardEventFromPlugin(command: Command): any;
266
287
  unregisterKeyboardEventFromPlugin(command: Command): any;
267
288
  }
289
+ export interface INotification {
290
+ show(): void;
291
+ }
292
+ export interface INoticationOption {
293
+ type: 'error' | 'info';
294
+ message: string;
295
+ timeout?: number;
296
+ }
268
297
  }
269
298