siyuan 0.3.12 → 0.3.17

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 +1 -1
  2. package/siyuan.d.ts +29 -1
package/package.json CHANGED
@@ -2,5 +2,5 @@
2
2
  "name": "siyuan",
3
3
  "author": "zuoez02",
4
4
  "types": "siyuan.d.ts",
5
- "version": "0.3.12"
5
+ "version": "0.3.17"
6
6
  }
package/siyuan.d.ts CHANGED
@@ -140,6 +140,8 @@ declare module 'siyuan/api/plugin' {
140
140
  onload(): void;
141
141
  onunload(): void;
142
142
  registerCommand(command: IPluginCommand): void;
143
+ loadStorage(filename: string): Promise<any>;
144
+ writeStorage(filename: string, content: any): Promise<void>;
143
145
  }
144
146
  }
145
147
 
@@ -147,13 +149,28 @@ declare module 'siyuan/types' {
147
149
  export interface IPlugin {
148
150
  onload(): void;
149
151
  onunload(): void;
152
+ registerCommand(command: IPluginCommand): any;
153
+ loadStorage(filename: string): Promise<Response>;
154
+ writeStorage(filename: string, content: any): Promise<void>;
150
155
  }
151
156
  export interface PluginConstructor {
152
157
  new (): IPlugin;
153
158
  }
159
+ export interface StorePluginManifest {
160
+ key: string;
161
+ name: string;
162
+ description: string;
163
+ author: string;
164
+ version: string;
165
+ }
166
+ export interface StorePluginStatus extends StorePluginManifest {
167
+ isExist: boolean;
168
+ needUpgrade: boolean;
169
+ }
154
170
  export interface PluginManifest {
155
171
  key: string;
156
172
  name: string;
173
+ version: string;
157
174
  script?: string;
158
175
  enabled?: boolean;
159
176
  hidden?: boolean;
@@ -161,7 +178,7 @@ declare module 'siyuan/types' {
161
178
  plugin?: new (...args: any) => IPlugin;
162
179
  }
163
180
  export interface IStorageManager {
164
- get(key: string): any;
181
+ get(key: keyof PluginConfig): any;
165
182
  set(key: string, val: any): Promise<void>;
166
183
  initStorage(): Promise<IStorageManager>;
167
184
  getPlugins(): PluginManifest[];
@@ -171,6 +188,8 @@ declare module 'siyuan/types' {
171
188
  setPluginEnabled(key: string, enabled: boolean): Promise<void>;
172
189
  savePluginsEnabled(): Promise<void>;
173
190
  setSafeModeEnabled(enabled: boolean): Promise<void>;
191
+ setPluginStorage(pluginKey: string, filename: string, content: any): Promise<void>;
192
+ getPluginStorage(pluginKey: string, filename: string): Promise<Response>;
174
193
  }
175
194
  export interface ISystemManager {
176
195
  saveToLocal(p: string, content: string): Promise<void>;
@@ -231,6 +250,7 @@ declare module 'siyuan/types' {
231
250
  PLUGIN_SYSTEM_AUTO_UPDATE: boolean;
232
251
  PLUGIN_SYSTEM_PLUGIN: Array<PluginEnableConfig>;
233
252
  PLUGIN_SYSTEM_THIRD_PARTY_PLUGIN: Array<PluginEnableConfig>;
253
+ PLUGIN_STORE_URL: string;
234
254
  }
235
255
  export type Listener = (...args: any) => void;
236
256
  export interface IEventBus {
@@ -265,5 +285,13 @@ declare module 'siyuan/types' {
265
285
  registerKeyboardEventFromPlugin(command: Command): any;
266
286
  unregisterKeyboardEventFromPlugin(command: Command): any;
267
287
  }
288
+ export interface INotification {
289
+ show(): void;
290
+ }
291
+ export interface INoticationOption {
292
+ type: 'error' | 'info';
293
+ message: string;
294
+ timeout?: number;
295
+ }
268
296
  }
269
297