mn-rails-core 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Temsys-Shen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,679 @@
1
+ import * as marginnote from 'marginnote';
2
+ import { MbModelTool, MbBookNote, MbTopic, MbBook, DictObj } from 'marginnote';
3
+ export { DictObj, MbBook, MbBookNote, MbTopic, NoteComment } from 'marginnote';
4
+
5
+ /**
6
+ * 笔记数据库操作类
7
+ * 基于 marginnote 的 MbModelTool 封装,提供 getAllNotes、createNote 等便捷 API
8
+ */
9
+
10
+ declare class NoteDatabase {
11
+ private db;
12
+ constructor(db?: MbModelTool);
13
+ getNoteById(noteId: string): MbBookNote | null;
14
+ getNotebookById(notebookId: string): MbTopic | null;
15
+ getDocumentById(md5: string): MbBook | null;
16
+ getMediaByHash(hash: string): {
17
+ base64Encoding(): string;
18
+ } | null;
19
+ /**
20
+ * 获取所有笔记。若提供 notebookId 则返回该笔记本的笔记,否则聚合所有笔记本的笔记。
21
+ */
22
+ getAllNotes(notebookId?: string): MbBookNote[];
23
+ createNote(title: string, notebookId: string, docMd5?: string): MbBookNote | null;
24
+ updateNote(noteId: string, updates: Partial<MbBookNote>): boolean;
25
+ deleteNote(noteId: string): boolean;
26
+ }
27
+
28
+ declare const MN: Omit<{
29
+ readonly app: marginnote.Application;
30
+ readonly db: marginnote.MbModelTool;
31
+ get studyController(): marginnote.StudyController;
32
+ get notebookController(): marginnote.NotebookController;
33
+ get currentDocumentController(): marginnote.DocumentController;
34
+ get currentWindow(): any;
35
+ get currentThemeColor(): marginnote.UIColor;
36
+ get currentAddon(): {
37
+ key: string;
38
+ title: string;
39
+ };
40
+ get currnetNotebookId(): string | undefined;
41
+ get currentDocmd5(): string | undefined;
42
+ readonly isZH: boolean;
43
+ readonly version: string;
44
+ readonly isMNE: boolean;
45
+ readonly isMac: boolean;
46
+ readonly isMacMNE: boolean;
47
+ readonly isMacMN3: boolean;
48
+ readonly themeColor: {
49
+ Gray: marginnote.UIColor;
50
+ Default: marginnote.UIColor;
51
+ Dark: marginnote.UIColor;
52
+ Green: marginnote.UIColor;
53
+ Sepia: marginnote.UIColor;
54
+ };
55
+ log(obj: any, suffix?: string, ...args: any[]): void;
56
+ error(obj: any, suffix?: string, ...args: any[]): void;
57
+ }, "db"> & {
58
+ readonly db: NoteDatabase;
59
+ readonly currentNotebookId: string | undefined;
60
+ };
61
+
62
+ interface LinkedNote {
63
+ summary: boolean;
64
+ noteid: string;
65
+ linktext: string;
66
+ }
67
+ interface PluginLifecycle {
68
+ onLaunch?(): void;
69
+ onExit?(): void;
70
+ onProfileChanged?(profileId: string): void;
71
+ onNotebookChanged?(notebookId: string): void;
72
+ onNotebookClosing?(notebookId: string): void;
73
+ onDocumentOpened?(docMd5: string): void;
74
+ onDocumentClosing?(docMd5: string): void;
75
+ onNoteSelected?(note: MbBookNote): void;
76
+ }
77
+ interface ControllerLifecycle {
78
+ onInit?(): void;
79
+ onDestroy?(): void;
80
+ }
81
+ type Actions = Record<string, (...args: any[]) => any>;
82
+ interface StateDefinition {
83
+ [key: string]: any;
84
+ }
85
+ interface WebViewConfig {
86
+ component: string;
87
+ props?: marginnote.DictObj;
88
+ }
89
+ interface ButtonConfig {
90
+ title: string;
91
+ action: () => void;
92
+ style?: 'default' | 'primary' | 'danger';
93
+ }
94
+
95
+ /**
96
+ * 生命周期管理器
97
+ * 将 App 生命周期映射到 MarginNote 的 defineLifecycleHandlers(由 marginnote 提供)
98
+ */
99
+
100
+ /**
101
+ * 生命周期管理器
102
+ * 将 App 类的生命周期方法映射到 MarginNote 的原生生命周期钩子
103
+ */
104
+ declare class LifecycleManager {
105
+ private app;
106
+ constructor(app: PluginLifecycle);
107
+ /**
108
+ * 注册生命周期钩子
109
+ */
110
+ private register;
111
+ /**
112
+ * 手动触发笔记选中事件
113
+ *
114
+ * MarginNote 没有提供"笔记选中"的原生生命周期钩子,因此需要开发者手动监听 MarginNote 的笔记选择相关 API,
115
+ * 并在检测到笔记选中时调用此方法。
116
+ *
117
+ * 调用此方法会触发 App 的 `onNoteSelected` 钩子。
118
+ *
119
+ * 典型用法:
120
+ * 1. 在 App 的 `onLaunch` 中注册 MarginNote 的笔记选择监听器(如通过 `MN.notificationCenter` 或其他 API)
121
+ * 2. 在监听器回调中调用 `this.lifecycle.triggerNoteSelected(note)`
122
+ * 3. 框架会自动调用 App 的 `onNoteSelected` 方法
123
+ *
124
+ * @param note - 被选中的笔记对象
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * class MyPlugin extends App {
129
+ * onLaunch() {
130
+ * // 注册笔记选择监听
131
+ * MN.notificationCenter.addObserver('noteSelected', (note) => {
132
+ * this.lifecycle?.triggerNoteSelected(note);
133
+ * });
134
+ * }
135
+ *
136
+ * onNoteSelected(note) {
137
+ * console.log('Note selected:', note);
138
+ * }
139
+ * }
140
+ * ```
141
+ */
142
+ triggerNoteSelected(note: MbBookNote): void;
143
+ /**
144
+ * 手动触发配置文件切换事件
145
+ *
146
+ * MarginNote 没有提供"配置文件切换"的原生生命周期钩子,因此需要开发者手动监听 MarginNote 的配置切换相关 API,
147
+ * 并在检测到配置切换时调用此方法。
148
+ *
149
+ * 调用此方法会触发 App 的 `onProfileChanged` 钩子。
150
+ *
151
+ * 典型用法:
152
+ * 1. 在 App 的 `onLaunch` 中注册 MarginNote 的配置切换监听器(如通过 `MN.notificationCenter` 或其他 API)
153
+ * 2. 在监听器回调中调用 `this.lifecycle.triggerProfileChanged(profileId)`
154
+ * 3. 框架会自动调用 App 的 `onProfileChanged` 方法
155
+ *
156
+ * @param profileId - 新的配置文件 ID
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * class MyPlugin extends App {
161
+ * onLaunch() {
162
+ * // 注册配置切换监听
163
+ * MN.notificationCenter.addObserver('profileChanged', (profileId) => {
164
+ * this.lifecycle?.triggerProfileChanged(profileId);
165
+ * });
166
+ * }
167
+ *
168
+ * onProfileChanged(profileId) {
169
+ * console.log('Profile changed to:', profileId);
170
+ * }
171
+ * }
172
+ * ```
173
+ */
174
+ triggerProfileChanged(profileId: string): void;
175
+ }
176
+
177
+ /**
178
+ * App 基类
179
+ * 插件主入口,管理插件生命周期
180
+ */
181
+
182
+ declare abstract class App implements PluginLifecycle {
183
+ private lifecycleManager?;
184
+ constructor();
185
+ /**
186
+ * 插件启动时调用
187
+ */
188
+ onLaunch?(): void;
189
+ /**
190
+ * 插件退出时调用
191
+ */
192
+ onExit?(): void;
193
+ /**
194
+ * 配置文件切换时调用
195
+ */
196
+ onProfileChanged?(profileId: string): void;
197
+ /**
198
+ * 笔记本切换时调用
199
+ */
200
+ onNotebookChanged?(notebookId: string): void;
201
+ /**
202
+ * 笔记本关闭时调用
203
+ */
204
+ onNotebookClosing?(notebookId: string): void;
205
+ /**
206
+ * 文档打开时调用
207
+ */
208
+ onDocumentOpened?(docMd5: string): void;
209
+ /**
210
+ * 文档关闭时调用
211
+ */
212
+ onDocumentClosing?(docMd5: string): void;
213
+ /**
214
+ * 笔记选中时调用
215
+ */
216
+ onNoteSelected?(note: any): void;
217
+ /**
218
+ * 获取生命周期管理器(用于手动触发事件)
219
+ *
220
+ * 返回 LifecycleManager 实例,用于在 App 子类中手动触发某些生命周期事件。
221
+ *
222
+ * 典型用法:
223
+ * - 在 `onLaunch` 中注册 MarginNote 的监听器(如笔记选择、配置切换等)
224
+ * - 在监听器回调中调用 `this.lifecycle.triggerNoteSelected(note)` 或 `this.lifecycle.triggerProfileChanged(profileId)`
225
+ * - 这些调用会触发对应的 `onNoteSelected` 或 `onProfileChanged` 钩子
226
+ *
227
+ * @example
228
+ * ```typescript
229
+ * class MyPlugin extends App {
230
+ * onLaunch() {
231
+ * // 注册笔记选择监听
232
+ * MN.notificationCenter.addObserver('noteSelected', (note) => {
233
+ * this.lifecycle?.triggerNoteSelected(note);
234
+ * });
235
+ * }
236
+ * }
237
+ * ```
238
+ */
239
+ protected get lifecycle(): LifecycleManager | undefined;
240
+ }
241
+
242
+ /**
243
+ * Controller 基类
244
+ * 处理业务逻辑,定义 actions 供 Web 端调用
245
+ */
246
+
247
+ declare abstract class Controller implements ControllerLifecycle {
248
+ private controllerName;
249
+ constructor(name?: string);
250
+ /**
251
+ * Controller 初始化时调用
252
+ */
253
+ onInit?(): void;
254
+ /**
255
+ * Controller 销毁时调用
256
+ */
257
+ onDestroy?(): void;
258
+ /**
259
+ * 定义供 Web 端调用的 actions
260
+ * 子类应该重写此属性以提供类型安全的 API
261
+ */
262
+ actions: Actions;
263
+ /**
264
+ * 注册 actions 到 Bridge
265
+ */
266
+ private registerActions;
267
+ /**
268
+ * 注销 actions
269
+ */
270
+ private unregisterActions;
271
+ /**
272
+ * 更新 actions(当 actions 发生变化时调用)
273
+ */
274
+ protected updateActions(): void;
275
+ }
276
+
277
+ /**
278
+ * 配置管理类
279
+ * 用于读取和持久化插件配置(基于 NSUserDefaults,类型由 marginnote 提供)
280
+ */
281
+ /**
282
+ * 配置管理器
283
+ */
284
+ declare class Config {
285
+ private prefix;
286
+ constructor(prefix: string);
287
+ get<T = any>(key: string, defaultValue?: T): T | undefined;
288
+ set<T = any>(key: string, value: T): boolean;
289
+ remove(key: string): boolean;
290
+ getAll(): Record<string, any>;
291
+ clear(): boolean;
292
+ }
293
+
294
+ /**
295
+ * 状态管理器
296
+ * 实现响应式状态管理,支持原生和 Web 端状态同步
297
+ */
298
+
299
+ type StateChangeListener<T = any> = (newValue: T, oldValue: T, key: string) => void;
300
+ interface StateOptions {
301
+ deep?: boolean;
302
+ immediate?: boolean;
303
+ }
304
+ /**
305
+ * 状态管理器类
306
+ */
307
+ declare class StateManager<T extends DictObj = DictObj> {
308
+ private state;
309
+ private watchHandles;
310
+ private webViewWatchHandles;
311
+ private registeredWebViews;
312
+ private autoSyncHandle;
313
+ private isSyncing;
314
+ constructor(initialState: T);
315
+ /**
316
+ * 获取状态值
317
+ */
318
+ get<K extends keyof T>(key: K): T[K];
319
+ /**
320
+ * 设置状态值
321
+ */
322
+ set<K extends keyof T>(key: K, value: T[K]): void;
323
+ /**
324
+ * 获取整个状态对象
325
+ */
326
+ getState(): T;
327
+ /**
328
+ * 监听状态变化
329
+ */
330
+ watch<K extends keyof T>(key: K, listener: StateChangeListener<T[K]>, options?: StateOptions): () => void;
331
+ /**
332
+ * 监听整个状态变化
333
+ */
334
+ watchAll(listener: (state: T) => void): () => void;
335
+ /**
336
+ * 同步状态到 WebView
337
+ */
338
+ syncToWebView(webViewId: string, state?: T): void;
339
+ /**
340
+ * 从 WebView 同步状态
341
+ */
342
+ syncFromWebView(webViewId: string, state: Partial<T>): void;
343
+ /**
344
+ * 注册需要同步状态的 WebView
345
+ */
346
+ registerWebView(webViewId: string): void;
347
+ /**
348
+ * 取消注册 WebView
349
+ */
350
+ unregisterWebView(webViewId: string): void;
351
+ /**
352
+ * 同步初始状态到新注册的 WebView
353
+ */
354
+ syncInitialState(webViewId: string): void;
355
+ /**
356
+ * 设置自动同步监听
357
+ */
358
+ private setupAutoSync;
359
+ /**
360
+ * 清理资源
361
+ */
362
+ destroy(): void;
363
+ }
364
+ /**
365
+ * 定义状态
366
+ */
367
+ declare function defineState<T extends DictObj>(name: string, initialState: T): StateManager<T>;
368
+ /**
369
+ * 获取状态管理器
370
+ */
371
+ declare function getState<T extends DictObj>(name: string): StateManager<T> | undefined;
372
+
373
+ /**
374
+ * Bridge 对象
375
+ * 用于在 WebView 中类型安全地调用 Controller 的 actions
376
+ */
377
+
378
+ /**
379
+ * Bridge 消息类型
380
+ */
381
+ interface BridgeMessage {
382
+ id: string;
383
+ controller: string;
384
+ action: string;
385
+ args: any[];
386
+ }
387
+ interface BridgeResponse {
388
+ id: string;
389
+ success: boolean;
390
+ data?: any;
391
+ error?: string;
392
+ }
393
+ /**
394
+ * Bridge 管理器
395
+ * 管理所有 Controller 的 actions,并提供类型安全的调用接口
396
+ */
397
+ declare class BridgeManager {
398
+ private controllers;
399
+ private pendingRequests;
400
+ /**
401
+ * 注册 Controller 的 actions
402
+ */
403
+ register(controllerName: string, actions: Actions): void;
404
+ /**
405
+ * 注销 Controller
406
+ */
407
+ unregister(controllerName: string): void;
408
+ /**
409
+ * 调用 action
410
+ */
411
+ call(controllerName: string, actionName: string, ...args: any[]): Promise<any>;
412
+ /**
413
+ * 处理来自 WebView 的消息
414
+ */
415
+ handleMessage(message: BridgeMessage): Promise<BridgeResponse>;
416
+ /**
417
+ * 获取所有已注册的 Controller 名称
418
+ */
419
+ getControllerNames(): string[];
420
+ /**
421
+ * 获取 Controller 的所有 action 名称
422
+ */
423
+ getActionNames(controllerName: string): string[];
424
+ }
425
+ /**
426
+ * 获取 Bridge 管理器实例
427
+ */
428
+ declare function getBridgeManager(): BridgeManager;
429
+ /**
430
+ * Bridge 对象(用于 WebView)
431
+ * 这个对象会被注入到 WebView 中,提供类型安全的 API 调用
432
+ */
433
+ declare const bridge: Record<string, Record<string, (...args: any[]) => Promise<any>>>;
434
+
435
+ /**
436
+ * 消息桥接
437
+ * 处理原生与 WebView 之间的双向通信
438
+ */
439
+
440
+ /**
441
+ * 消息桥接管理器
442
+ */
443
+ declare class MessageBridge {
444
+ private webViews;
445
+ /**
446
+ * 注册 WebView
447
+ */
448
+ registerWebView(webViewId: string, webView: any): void;
449
+ /**
450
+ * 注销 WebView
451
+ */
452
+ unregisterWebView(webViewId: string): void;
453
+ /**
454
+ * 注入 bridge 脚本到 WebView
455
+ */
456
+ private injectBridgeScript;
457
+ /**
458
+ * 处理来自 WebView 的消息
459
+ */
460
+ handleWebViewMessage(webViewId: string, message: BridgeMessage): Promise<BridgeResponse>;
461
+ /**
462
+ * 发送消息到 WebView
463
+ */
464
+ sendToWebView(webViewId: string, type: string, payload: any): void;
465
+ }
466
+ /**
467
+ * 获取消息桥接实例
468
+ */
469
+ declare function getMessageBridge(): MessageBridge;
470
+
471
+ /**
472
+ * Web 端 Bridge 类型定义
473
+ * 用于在 WebView 中提供类型安全的 bridge 对象
474
+ */
475
+ /**
476
+ * Web 端 Bridge 接口
477
+ * 这个接口会被注入到 WebView 中
478
+ */
479
+ interface WebBridge {
480
+ [controllerName: string]: {
481
+ [actionName: string]: (...args: any[]) => Promise<any>;
482
+ };
483
+ }
484
+ declare function createWebBridge(): WebBridge;
485
+
486
+ /**
487
+ * WebView 管理器
488
+ * 负责创建、管理和渲染 WebView(UIKit 类型由 marginnote 提供)
489
+ */
490
+
491
+ interface WebViewInstance {
492
+ id: string;
493
+ webView: any;
494
+ component: string;
495
+ props?: DictObj;
496
+ }
497
+ /**
498
+ * WebView 管理器类
499
+ */
500
+ declare class WebViewManager {
501
+ private webViews;
502
+ private messageBridge;
503
+ private componentCache;
504
+ /**
505
+ * 渲染 WebView
506
+ */
507
+ render(component: string, props?: DictObj, frame?: {
508
+ x: number;
509
+ y: number;
510
+ width: number;
511
+ height: number;
512
+ }): Promise<WebViewInstance | null>;
513
+ /**
514
+ * 加载组件文件
515
+ * 只允许加载编译后的文件(.js)或 HTML 文件(最终产物)
516
+ * 禁止运行时解析 .vue 或 .jsx 源文件
517
+ */
518
+ private loadComponent;
519
+ /**
520
+ * 解析组件内容
521
+ * 只支持 HTML 和 JS 文件(最终产物)
522
+ * 禁止运行时解析 .vue 或 .jsx 源文件
523
+ */
524
+ private parseComponentContent;
525
+ /**
526
+ * 加载类型定义文件
527
+ */
528
+ private loadTypeDefinitions;
529
+ /**
530
+ * 生成 HTML 内容
531
+ */
532
+ private generateHTML;
533
+ /**
534
+ * 销毁 WebView
535
+ */
536
+ destroy(webViewId: string): boolean;
537
+ /**
538
+ * 获取 WebView 实例
539
+ */
540
+ get(webViewId: string): WebViewInstance | undefined;
541
+ /**
542
+ * 获取所有 WebView 实例
543
+ */
544
+ getAll(): WebViewInstance[];
545
+ /**
546
+ * 更新 WebView 的 props
547
+ */
548
+ updateProps(webViewId: string, props: DictObj): boolean;
549
+ }
550
+ /**
551
+ * 获取 WebView 管理器实例
552
+ */
553
+ declare function getWebViewManager(): WebViewManager;
554
+
555
+ /**
556
+ * 原生 UI 管理器
557
+ * 负责创建和管理原生 UI 元素(UIKit 类型由 marginnote 提供)
558
+ */
559
+
560
+ interface UIElement {
561
+ id: string;
562
+ element: any;
563
+ type: 'button' | 'label' | 'view';
564
+ }
565
+ declare class NativeUIManager {
566
+ private elements;
567
+ createButton(config: ButtonConfig & {
568
+ frame?: {
569
+ x: number;
570
+ y: number;
571
+ width: number;
572
+ height: number;
573
+ };
574
+ }): UIElement | null;
575
+ createLabel(config: {
576
+ text: string;
577
+ frame?: {
578
+ x: number;
579
+ y: number;
580
+ width: number;
581
+ height: number;
582
+ };
583
+ color?: any;
584
+ }): UIElement | null;
585
+ private getColorForStyle;
586
+ destroy(elementId: string): boolean;
587
+ get(elementId: string): UIElement | undefined;
588
+ getAll(): UIElement[];
589
+ clear(): void;
590
+ }
591
+ declare function getNativeUIManager(): NativeUIManager;
592
+
593
+ /**
594
+ * 对话框工具函数
595
+ * 基于 marginnote 的 UIAlertView、UIAlertViewStyle 等(由 marginnote 提供)
596
+ */
597
+ /**
598
+ * 显示警告消息(不可交互)
599
+ */
600
+ declare function alert(message: string): void;
601
+ /**
602
+ * 弹出对话框
603
+ */
604
+ interface PopupOptions {
605
+ title?: string;
606
+ message: string;
607
+ type?: number;
608
+ buttons?: string[];
609
+ canCancel?: boolean;
610
+ multiLine?: boolean;
611
+ }
612
+ interface PopupResult {
613
+ inputContent?: string;
614
+ buttonIndex: number;
615
+ }
616
+ declare function popup(options: PopupOptions): Promise<PopupResult>;
617
+ /**
618
+ * 确认对话框
619
+ */
620
+ declare function confirm(title?: string, message?: string): Promise<boolean>;
621
+ /**
622
+ * 选择对话框
623
+ */
624
+ interface SelectResult {
625
+ value: string;
626
+ index: number;
627
+ }
628
+ declare function select(options: string[], title?: string, message?: string, canCancel?: boolean): Promise<SelectResult | null>;
629
+
630
+ /**
631
+ * 文件操作工具函数(NSFileManager 等由 marginnote 提供)
632
+ */
633
+ /**
634
+ * 读取文件内容
635
+ */
636
+ declare function readFile(path: string): string | null;
637
+ /**
638
+ * 检查文件是否存在
639
+ */
640
+ declare function fileExists(path: string): boolean;
641
+ /**
642
+ * 创建目录
643
+ */
644
+ declare function createDirectory(path: string, createIntermediates?: boolean): boolean;
645
+ /**
646
+ * 获取插件目录路径
647
+ */
648
+ declare function getAddonPath(): string | null;
649
+ /**
650
+ * 获取组件视图目录路径
651
+ */
652
+ declare function getViewsPath(): string | null;
653
+
654
+ /**
655
+ * 笔记操作工具函数
656
+ */
657
+
658
+ /**
659
+ * 获取笔记的所有文本内容(包括摘录和评论)
660
+ */
661
+ declare function getNoteAllText(note: MbBookNote): string;
662
+ /**
663
+ * 检查笔记是否存在
664
+ */
665
+ declare function isNoteExist(note: MbBookNote | string): boolean;
666
+ /**
667
+ * 获取笔记的链接笔记
668
+ */
669
+ declare function getLinkedNotes(note: MbBookNote): MbBookNote[];
670
+ /**
671
+ * 获取笔记的子笔记
672
+ */
673
+ declare function getChildNotes(note: MbBookNote): MbBookNote[];
674
+ /**
675
+ * 获取笔记的父笔记
676
+ */
677
+ declare function getParentNote(note: MbBookNote): MbBookNote | null;
678
+
679
+ export { type Actions, App, BridgeManager, type ButtonConfig, Config, Controller, type ControllerLifecycle, LifecycleManager, type LinkedNote, MN, MessageBridge, NativeUIManager, NoteDatabase, type PluginLifecycle, type StateDefinition, StateManager, type WebBridge, type WebViewConfig, WebViewManager, alert, bridge, confirm, createDirectory, createWebBridge, defineState, fileExists, getAddonPath, getBridgeManager, getChildNotes, getLinkedNotes, getMessageBridge, getNativeUIManager, getNoteAllText, getParentNote, getState, getViewsPath, getWebViewManager, isNoteExist, popup, readFile, select };