siyuan 0.8.2 → 0.8.3
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.
- package/CHANGELOG.md +5 -1
- package/package.json +1 -1
- package/siyuan.d.ts +24 -4
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/siyuan.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ interface IModel {
|
|
|
51
51
|
app: App;
|
|
52
52
|
reqId: number;
|
|
53
53
|
parent: ITab | any;
|
|
54
|
+
|
|
54
55
|
send(cmd: string, param: Record<string, unknown>, process?: boolean): void;
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -59,10 +60,15 @@ interface ICustomModel extends IModel {
|
|
|
59
60
|
data: any;
|
|
60
61
|
type: string;
|
|
61
62
|
element: HTMLElement;
|
|
63
|
+
|
|
62
64
|
init(): void;
|
|
65
|
+
|
|
63
66
|
update?(): void;
|
|
67
|
+
|
|
64
68
|
resize?(): void;
|
|
69
|
+
|
|
65
70
|
beforeDestroy?(): void;
|
|
71
|
+
|
|
66
72
|
destroy?(): void;
|
|
67
73
|
}
|
|
68
74
|
|
|
@@ -166,10 +172,11 @@ interface ICommandOption {
|
|
|
166
172
|
*/
|
|
167
173
|
hotkey: string,
|
|
168
174
|
customHotkey?: string,
|
|
169
|
-
callback?: () => void
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
175
|
+
callback?: () => void // 其余回调存在时将不会触
|
|
176
|
+
globalCallback?: () => void // 焦点不在应用内时执行的回调
|
|
177
|
+
fileTreeCallback?: (file: any) => void // 焦点在文档树上时执行的回调
|
|
178
|
+
editorCallback?: (protyle: any) => void // 焦点在编辑器上时执行的回调
|
|
179
|
+
dockCallback?: (element: HTMLElement) => void // 焦点在 dock 上时执行的回调
|
|
173
180
|
}
|
|
174
181
|
|
|
175
182
|
interface IProtyleOption {
|
|
@@ -207,6 +214,19 @@ export function fetchSyncPost(url: string, data?: any): Promise<IWebSocketData>;
|
|
|
207
214
|
|
|
208
215
|
export function fetchGet(url: string, callback: (response: IWebSocketData) => void): void;
|
|
209
216
|
|
|
217
|
+
export function openWindow(options: {
|
|
218
|
+
position?: {
|
|
219
|
+
x: number,
|
|
220
|
+
y: number,
|
|
221
|
+
},
|
|
222
|
+
height?: number,
|
|
223
|
+
width?: number,
|
|
224
|
+
tab?: ITab,
|
|
225
|
+
doc?: {
|
|
226
|
+
id: string, // 块 id
|
|
227
|
+
},
|
|
228
|
+
}): void;
|
|
229
|
+
|
|
210
230
|
export function openTab(options: {
|
|
211
231
|
app: App,
|
|
212
232
|
doc?: {
|