mn-docs-mcp 0.6.2 → 1.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/.trae/documents/libmn_cleanup_plan.md +51 -0
- package/.trae/documents/libmn_doc_restructure_plan.md +140 -0
- package/.trae/documents/libmn_indentation_plan.md +116 -0
- package/.trae/documents/libmn_title_hierarchy_plan.md +91 -0
- package/README.md +9 -7
- package/next-env.d.ts +6 -0
- package/next.config.mjs +14 -0
- package/package.json +25 -10
- package/postcss.config.mjs +7 -0
- package/scripts/sync-definitions.mjs +33 -0
- package/source.config.ts +5 -0
- package/src/app/[[...slug]]/page.tsx +259 -0
- package/src/app/api/search/route.ts +6 -0
- package/src/app/global.css +81 -0
- package/src/app/layout.tsx +33 -0
- package/src/components/JsbApiFooter.tsx +251 -0
- package/src/content/docs/{guides/contributing.md → contributing.md} +31 -6
- package/src/content/docs/{guides/cookbook → cookbook}/addon-settings.md +2 -2
- package/src/content/docs/{guides/cookbook → cookbook}/embed-webview-panel.md +2 -2
- package/src/content/docs/cookbook/meta.json +13 -0
- package/src/content/docs/{guides/cookbook → cookbook}/network-api-call.md +2 -2
- package/src/content/docs/{guides/cookbook → cookbook}/webview-bidirectional-js.md +1 -1
- package/src/content/docs/guides/getting-started.md +2 -2
- package/src/content/docs/guides/lifecycle-and-window.md +4 -4
- package/src/content/docs/guides/meta.json +14 -0
- package/src/content/docs/guides/mindmap-and-selection.md +2 -2
- package/src/content/docs/guides/native-ui.md +4 -4
- package/src/content/docs/guides/network-requests.md +8 -9
- package/src/content/docs/guides/notes-and-database.md +2 -2
- package/src/content/docs/guides/shortcut-keys.md +9 -9
- package/src/content/docs/guides/storage-and-files.md +4 -4
- package/src/content/docs/guides/toolbar-and-commands.md +1 -1
- package/src/content/docs/index.mdx +13 -38
- package/src/content/docs/libmn/data-converter.md +1572 -0
- package/src/content/docs/libmn/frame.md +279 -0
- package/src/content/docs/libmn/headers.md +234 -0
- package/src/content/docs/libmn/index.md +60 -0
- package/src/content/docs/libmn/internal-exposed.md +46 -0
- package/src/content/docs/libmn/locale.md +307 -0
- package/src/content/docs/libmn/menu.md +77 -0
- package/src/content/docs/libmn/meta.json +27 -0
- package/src/content/docs/libmn/mnbutton.md +966 -0
- package/src/content/docs/libmn/mncomment.md +533 -0
- package/src/content/docs/libmn/mnconnection.md +717 -0
- package/src/content/docs/libmn/mndocument.md +309 -0
- package/src/content/docs/libmn/mnextension-panel.md +340 -0
- package/src/content/docs/libmn/mnnote.md +533 -0
- package/src/content/docs/libmn/mnnotebook.md +725 -0
- package/src/content/docs/libmn/mnutil.md +2936 -0
- package/src/content/docs/libmn/mnwebview.md +693 -0
- package/src/content/docs/libmn/mustache.md +65 -0
- package/src/content/docs/libmn/response.md +352 -0
- package/src/content/docs/libmn/runtime-assets.md +64 -0
- package/src/content/docs/libmn/runtime-web-view-host.md +77 -0
- package/src/content/docs/libmn/runtime.md +178 -0
- package/src/content/docs/libmn/vendor-globals.md +34 -0
- package/src/content/docs/meta.json +11 -0
- package/src/content/docs/reference/black-box.md +2 -2
- package/src/content/docs/reference/foundation/meta.json +4 -0
- package/src/content/docs/reference/foundation/ns-attributed-string.md +1 -1
- package/src/content/docs/reference/foundation/ns-counted-set.md +1 -1
- package/src/content/docs/reference/foundation/ns-date-components.md +2 -2
- package/src/content/docs/reference/foundation/ns-date-formatter.md +1 -3
- package/src/content/docs/reference/foundation/ns-decimal-number.md +1 -1
- package/src/content/docs/reference/foundation/ns-enumerator.md +1 -1
- package/src/content/docs/reference/foundation/ns-error.md +2 -2
- package/src/content/docs/reference/foundation/ns-file-manager.md +1 -1
- package/src/content/docs/reference/foundation/ns-formatter.md +2 -2
- package/src/content/docs/reference/foundation/ns-json-serialization.md +10 -2
- package/src/content/docs/reference/foundation/ns-mutable-attributed-string.md +1 -1
- package/src/content/docs/reference/foundation/ns-mutable-character-set.md +1 -1
- package/src/content/docs/reference/foundation/ns-mutable-dictionary.md +1 -1
- package/src/content/docs/reference/foundation/ns-mutable-index-set.md +1 -1
- package/src/content/docs/reference/foundation/ns-mutable-set.md +1 -1
- package/src/content/docs/reference/foundation/ns-mutable-string.md +1 -1
- package/src/content/docs/reference/foundation/ns-mutable-url-request.md +2 -3
- package/src/content/docs/reference/foundation/ns-null.md +1 -1
- package/src/content/docs/reference/foundation/ns-number-formatter.md +1 -1
- package/src/content/docs/reference/foundation/ns-operation.md +2 -2
- package/src/content/docs/reference/foundation/ns-pointer-array.md +1 -1
- package/src/content/docs/reference/foundation/ns-proxy.md +5 -3
- package/src/content/docs/reference/foundation/ns-scanner.md +7 -1
- package/src/content/docs/reference/foundation/ns-set.md +1 -1
- package/src/content/docs/reference/foundation/ns-simple-c-string.md +3 -4
- package/src/content/docs/reference/foundation/ns-time-zone.md +1 -1
- package/src/content/docs/reference/foundation/ns-ubiquitous-key-value-store.md +61 -0
- package/src/content/docs/reference/foundation/ns-url-connection.md +2 -2
- package/src/content/docs/reference/foundation/ns-url-request.md +2 -2
- package/src/content/docs/reference/foundation/ns-url-response.md +5 -5
- package/src/content/docs/reference/foundation/ns-url.md +1 -1
- package/src/content/docs/reference/foundation/ns-user-defaults.md +5 -5
- package/src/content/docs/reference/foundation/ns-value.md +15 -15
- package/src/content/docs/reference/global/agent-tools.md +91 -0
- package/src/content/docs/reference/global/application.md +4 -4
- package/src/content/docs/reference/global/builtin-commands.md +2 -2
- package/src/content/docs/reference/global/database.md +4 -4
- package/src/content/docs/reference/global/document.md +21 -0
- package/src/content/docs/reference/global/global-variables.md +22 -5
- package/src/content/docs/reference/global/jsb.md +6 -4
- package/src/content/docs/reference/global/meta.json +18 -0
- package/src/content/docs/reference/global/note.md +2 -2
- package/src/content/docs/reference/global/notebook.md +21 -0
- package/src/content/docs/reference/global/popup-menu-item.md +2 -2
- package/src/content/docs/reference/global/popup-menu.md +5 -6
- package/src/content/docs/reference/global/search-manager.md +12 -6
- package/src/content/docs/reference/global/self.md +1 -13
- package/src/content/docs/reference/js-runtime.md +5 -4
- package/src/content/docs/reference/marginnote/document-controller.md +37 -5
- package/src/content/docs/reference/marginnote/jsextension.md +7 -7
- package/src/content/docs/reference/marginnote/mb-book-note.md +162 -72
- package/src/content/docs/reference/marginnote/mb-book.md +3 -3
- package/src/content/docs/reference/marginnote/mb-model-tool.md +2 -2
- package/src/content/docs/reference/marginnote/mb-topic.md +13 -2
- package/src/content/docs/reference/marginnote/meta.json +18 -0
- package/src/content/docs/reference/marginnote/mindmap-node.md +2 -2
- package/src/content/docs/reference/marginnote/mindmap-view.md +2 -2
- package/src/content/docs/reference/marginnote/notebook-controller.md +1 -1
- package/src/content/docs/reference/marginnote/outline-view.md +2 -2
- package/src/content/docs/reference/marginnote/reader-controller.md +1 -1
- package/src/content/docs/reference/marginnote/study-controller.md +19 -19
- package/src/content/docs/reference/meta.json +14 -0
- package/src/content/docs/reference/quartzcore/caanimation-group.md +3 -3
- package/src/content/docs/reference/quartzcore/cabasic-animation.md +3 -3
- package/src/content/docs/reference/quartzcore/caemitter-layer.md +44 -0
- package/src/content/docs/reference/quartzcore/cagradient-layer.md +1 -1
- package/src/content/docs/reference/quartzcore/cakeyframe-animation.md +3 -3
- package/src/content/docs/reference/quartzcore/calayer.md +1 -1
- package/src/content/docs/reference/quartzcore/camedia-timing-function.md +1 -1
- package/src/content/docs/reference/quartzcore/caproperty-animation.md +1 -1
- package/src/content/docs/reference/quartzcore/careplicator-layer.md +2 -2
- package/src/content/docs/reference/quartzcore/cascroll-layer.md +1 -1
- package/src/content/docs/reference/quartzcore/cashape-layer.md +2 -2
- package/src/content/docs/reference/quartzcore/catext-layer.md +4 -4
- package/src/content/docs/reference/quartzcore/catransaction.md +5 -3
- package/src/content/docs/reference/quartzcore/catransform-layer.md +3 -3
- package/src/content/docs/reference/quartzcore/catransition.md +10 -6
- package/src/content/docs/reference/quartzcore/cavalue-function.md +1 -1
- package/src/content/docs/reference/quartzcore/meta.json +4 -0
- package/src/content/docs/reference/uikit/meta.json +4 -0
- package/src/content/docs/reference/uikit/ns-mutable-paragraph-style.md +3 -3
- package/src/content/docs/reference/uikit/ns-paragraph-style.md +3 -4
- package/src/content/docs/reference/uikit/ns-text-storage.md +4 -5
- package/src/content/docs/reference/uikit/uiactivity-indicator-view.md +2 -2
- package/src/content/docs/reference/uikit/uiapplication.md +1 -1
- package/src/content/docs/reference/uikit/uibar-button-item.md +3 -4
- package/src/content/docs/reference/uikit/uibar-item.md +2 -3
- package/src/content/docs/reference/uikit/uibezier-path.md +2 -2
- package/src/content/docs/reference/uikit/uibutton.md +1 -1
- package/src/content/docs/reference/uikit/uicollection-view-cell.md +5 -5
- package/src/content/docs/reference/uikit/uicollection-view-controller.md +22 -2
- package/src/content/docs/reference/uikit/uicollection-view-flow-layout.md +54 -0
- package/src/content/docs/reference/uikit/uicollection-view-layout.md +9 -2
- package/src/content/docs/reference/uikit/uicollection-view.md +13 -4
- package/src/content/docs/reference/uikit/uicolor.md +1 -1
- package/src/content/docs/reference/uikit/uicontrol.md +3 -5
- package/src/content/docs/reference/uikit/uidate-picker.md +1 -1
- package/src/content/docs/reference/uikit/uievent.md +2 -2
- package/src/content/docs/reference/uikit/uifont.md +1 -1
- package/src/content/docs/reference/uikit/uigesture-recognizer.md +1 -1
- package/src/content/docs/reference/uikit/uiimage-picker-controller.md +1 -1
- package/src/content/docs/reference/uikit/uiimage-view.md +2 -2
- package/src/content/docs/reference/uikit/uiimage.md +2 -2
- package/src/content/docs/reference/uikit/uikey-command.md +2 -2
- package/src/content/docs/reference/uikit/uilabel.md +3 -3
- package/src/content/docs/reference/uikit/uilocal-notification.md +2 -2
- package/src/content/docs/reference/uikit/uilong-press-gesture-recognizer.md +2 -2
- package/src/content/docs/reference/uikit/uinavigation-bar.md +2 -2
- package/src/content/docs/reference/uikit/uinavigation-controller.md +1 -1
- package/src/content/docs/reference/uikit/uinavigation-item.md +1 -1
- package/src/content/docs/reference/uikit/uipage-control.md +1 -1
- package/src/content/docs/reference/uikit/uipage-view-controller.md +1 -1
- package/src/content/docs/reference/uikit/uipan-gesture-recognizer.md +1 -1
- package/src/content/docs/reference/uikit/uipasteboard.md +1 -1
- package/src/content/docs/reference/uikit/uipicker-view.md +3 -3
- package/src/content/docs/reference/uikit/uipinch-gesture-recognizer.md +1 -1
- package/src/content/docs/reference/uikit/uipopover-controller.md +1 -1
- package/src/content/docs/reference/uikit/uiresponder.md +3 -4
- package/src/content/docs/reference/uikit/uirotation-gesture-recognizer.md +1 -1
- package/src/content/docs/reference/uikit/uiscreen-mode.md +2 -2
- package/src/content/docs/reference/uikit/uiscrollview.md +1 -1
- package/src/content/docs/reference/uikit/uisearch-bar.md +25 -2
- package/src/content/docs/reference/uikit/uisegmented-control.md +1 -1
- package/src/content/docs/reference/uikit/uislider.md +1 -1
- package/src/content/docs/reference/uikit/uiswipe-gesture-recognizer.md +1 -1
- package/src/content/docs/reference/uikit/uiswitch.md +2 -2
- package/src/content/docs/reference/uikit/uitab-bar-controller.md +2 -2
- package/src/content/docs/reference/uikit/uitab-bar-item.md +1 -1
- package/src/content/docs/reference/uikit/uitab-bar.md +1 -1
- package/src/content/docs/reference/uikit/uitable-view-cell.md +6 -6
- package/src/content/docs/reference/uikit/uitable-view-controller.md +1 -1
- package/src/content/docs/reference/uikit/uitable-view.md +3 -3
- package/src/content/docs/reference/uikit/uitap-gesture-recognizer.md +2 -2
- package/src/content/docs/reference/uikit/uitext-input-mode.md +7 -3
- package/src/content/docs/reference/uikit/uitext-position.md +5 -5
- package/src/content/docs/reference/uikit/uitext-range.md +4 -4
- package/src/content/docs/reference/uikit/uitext-view.md +2 -2
- package/src/content/docs/reference/uikit/uitextfield.md +3 -3
- package/src/content/docs/reference/uikit/uitoolbar.md +1 -1
- package/src/content/docs/reference/uikit/uitouch.md +3 -3
- package/src/content/docs/reference/uikit/uiview-controller.md +2 -2
- package/src/content/docs/reference/uikit/uiview.md +5 -5
- package/src/content/docs/reference/uikit/uiwebview.md +5 -5
- package/src/content/docs/reference/uikit/uiwindow.md +2 -2
- package/src/content/docs/reference/utility/menu-controller.md +1 -1
- package/src/content/docs/reference/utility/meta.json +4 -0
- package/src/content/docs/reference/utility/sqlite-result-set.md +1 -1
- package/src/content/docs/reference/utility/sqlite-statement.md +2 -2
- package/src/content/docs/reference/utility/zip-archive.md +13 -14
- package/src/content/docs/reference/value-sturct.md +105 -0
- package/src/lib/layout.tsx +31 -0
- package/src/lib/source.ts +7 -0
- package/tsconfig.json +42 -3
- package/astro.config.mjs +0 -126
- package/src/client/jsb-api-footer.ts +0 -242
- package/src/components/Footer.astro +0 -57
- package/src/components/Search.astro +0 -330
- package/src/content.config.ts +0 -7
- package/src/styles/starlight-overrides.css +0 -23
- /package/src/content/docs/{guides/cookbook → cookbook}/append-selection-as-comment.md +0 -0
- /package/src/content/docs/{guides/cookbook → cookbook}/batch-rename-notes.md +0 -0
- /package/src/content/docs/{guides/cookbook → cookbook}/export-notebook.md +0 -0
- /package/src/content/docs/{guides/cookbook → cookbook}/focus-note-in-mindmap.md +0 -0
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MNNote
|
|
3
|
+
description: LibMN中的MNNote对象使用文档。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`MNNote`是用于操作卡片的核心对象,提供卡片读取、定位、修改、内容提取和关联管理等功能,访问和管理卡片数据。
|
|
7
|
+
|
|
8
|
+
## 构造函数
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
new MNNote(note:MNNote|MbBookNote|string|NoteConfig,alert?:boolean)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
构造一个新的MNNote实例。
|
|
15
|
+
|
|
16
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
17
|
+
|:-------|:-----|:-----|:-----|
|
|
18
|
+
| `note` | `MNNote\|MbBookNote\|string\|NoteConfig` | 是 | 可传`MNNote`、`MbBookNote`、卡片id、`marginnote4app://note/...`链接、`current`等关键字、或建卡配置对象。 |
|
|
19
|
+
| `alert` | `boolean` | 否 | 保留参数,当前实现中不会改变返回逻辑。 |
|
|
20
|
+
|
|
21
|
+
## 类成员(Class members)
|
|
22
|
+
|
|
23
|
+
### 属性
|
|
24
|
+
|
|
25
|
+
| 字段名 | 类型 | 说明 |
|
|
26
|
+
|:-------|:-----|:-----|
|
|
27
|
+
| `noteCache` | `Record<string,MNNote>` | 缓存已包装过的卡片实例,避免重复创建。 |
|
|
28
|
+
|
|
29
|
+
### 方法
|
|
30
|
+
|
|
31
|
+
#### `getNoteFromCache`
|
|
32
|
+
|
|
33
|
+
##### 类型
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
static getNoteFromCache(noteId:string):MNNote|undefined
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
##### 说明
|
|
40
|
+
|
|
41
|
+
按`noteId`直接读缓存。
|
|
42
|
+
|
|
43
|
+
##### 参数
|
|
44
|
+
|
|
45
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
46
|
+
|:-------|:-----|:-----|:-----|
|
|
47
|
+
| `noteId` | `string` | 是 | 目标卡片id。 |
|
|
48
|
+
|
|
49
|
+
##### 返回值
|
|
50
|
+
|
|
51
|
+
- 类型:`MNNote|undefined`
|
|
52
|
+
- 语义:返回缓存中的MNNote实例或undefined。
|
|
53
|
+
|
|
54
|
+
#### `noteFromId`
|
|
55
|
+
|
|
56
|
+
##### 类型
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
static noteFromId(noteId:string):MNNote|undefined
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
##### 说明
|
|
63
|
+
|
|
64
|
+
按id获取`MNNote`,命中缓存就复用,未命中就创建并写回缓存。
|
|
65
|
+
|
|
66
|
+
##### 参数
|
|
67
|
+
|
|
68
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
69
|
+
|:-------|:-----|:-----|:-----|
|
|
70
|
+
| `noteId` | `string` | 是 | 目标卡片id。 |
|
|
71
|
+
|
|
72
|
+
##### 返回值
|
|
73
|
+
|
|
74
|
+
- 类型:`MNNote|undefined`
|
|
75
|
+
- 语义:返回MNNote实例或undefined。
|
|
76
|
+
|
|
77
|
+
#### `noteFromNote`
|
|
78
|
+
|
|
79
|
+
##### 类型
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
static noteFromNote(note:MbBookNote):MNNote|undefined
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
##### 说明
|
|
86
|
+
|
|
87
|
+
把原生`MbBookNote`包装成`MNNote`并接入缓存。
|
|
88
|
+
|
|
89
|
+
##### 参数
|
|
90
|
+
|
|
91
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
92
|
+
|:-------|:-----|:-----|:-----|
|
|
93
|
+
| `note` | `MbBookNote` | 是 | 原生卡片对象。 |
|
|
94
|
+
|
|
95
|
+
##### 返回值
|
|
96
|
+
|
|
97
|
+
- 类型:`MNNote|undefined`
|
|
98
|
+
- 语义:返回MNNote实例或undefined。
|
|
99
|
+
|
|
100
|
+
## 实例成员(Instance members)
|
|
101
|
+
|
|
102
|
+
### 属性
|
|
103
|
+
|
|
104
|
+
| 字段名 | 类型 | 说明 |
|
|
105
|
+
|:-------|:-----|:-----|
|
|
106
|
+
| `note` | `MbBookNote` | 当前包装对象对应的原生卡片。 |
|
|
107
|
+
| `noteId` | `string` | 当前卡片id。 |
|
|
108
|
+
| `id` | `string` | `noteId`别名。 |
|
|
109
|
+
| `type` | `"textNote"|"blankTextNote"|"imageNote"|"videoNote"` | 返回当前卡片的主内容类型。 |
|
|
110
|
+
| `isBlankNote` | `boolean` | 判断是否为空白摘录卡。 |
|
|
111
|
+
| `notebookId` | `string` | 当前卡片所在学习集id。 |
|
|
112
|
+
| `notebook` | `MNNotebook` | 当前卡片所在学习集包装对象。 |
|
|
113
|
+
| `originNoteId` | `string|undefined` | 对应文档摘录原始卡片id。 |
|
|
114
|
+
| `originNote` | `MNNote|undefined` | 返回`originNoteId`对应的`MNNote`。 |
|
|
115
|
+
| `groupNoteId` | `string|undefined` | 返回合并组主卡id。 |
|
|
116
|
+
| `groupNote` | `MNNote|undefined` | 返回合并组主卡对象。 |
|
|
117
|
+
| `groupMode` | `number` | 返回分组模式值。 |
|
|
118
|
+
| `mindmapBranchClose` | `boolean` | 返回脑图分支折叠状态。 |
|
|
119
|
+
| `childNotes` | `MNNote[]` | 返回直接子卡数组。 |
|
|
120
|
+
| `parentNote` | `MNNote|undefined` | 读取父卡,写入时把当前卡片挂到新父卡下。 |
|
|
121
|
+
| `parentNoteId` | `string|undefined` | 返回父卡id。 |
|
|
122
|
+
| `childMindMap` | `MNNote|undefined` | 返回子脑图对应卡片。 |
|
|
123
|
+
| `descendantNodes` | `{descendant:MNNote[],treeIndex:number[][]}` | 返回所有后代卡及其树路径索引。 |
|
|
124
|
+
| `ancestorNodes` | `MNNote[]` | 返回从当前卡向上的祖先链。 |
|
|
125
|
+
| `brotherNotes` | `MNNote[]` | 返回同级卡片数组。 |
|
|
126
|
+
| `indexInBrotherNotes` | `number` | 返回当前卡在同级中的索引。 |
|
|
127
|
+
| `titles` | `string[]` | 读写分号分隔的标题集合,写入时会去重。 |
|
|
128
|
+
| `title` | `string` | 主标题视图,读取时会去掉`{{...}}`来源标题。 |
|
|
129
|
+
| `noteTitle` | `string` | 原始标题字符串,不过滤`{{...}}`片段。 |
|
|
130
|
+
| `titlesFromMarkdown` | `string[]` | 返回标题中`{{...}}`片段。 |
|
|
131
|
+
| `titlesWithoutMarkdownSource` | `string[]` | 返回去掉`{{...}}`后的标题集合。 |
|
|
132
|
+
| `excerpt` | `{type:string,text?:string,textFirst?:boolean,isBlankNote?:boolean,imageHash?:string,audioHash?:string,videoHash?:string,pageNos?:number[]}` | 返回摘录聚合信息,包含类型、文本、媒体hash和页码。 |
|
|
133
|
+
| `_excerptCache` | `{info:{type:string,text?:string,textFirst?:boolean,isBlankNote?:boolean,imageHash?:string,audioHash?:string,videoHash?:string,pageNos?:number[]},refreshTime:number}|undefined` | 摘录缓存对象。 |
|
|
134
|
+
| `excerptType` | `"text"|"image"|"video"|"audio"|undefined` | 返回主摘录类型。 |
|
|
135
|
+
| `isOCR` | `boolean` | 判断当前摘录是否按OCR文本优先处理。 |
|
|
136
|
+
| `textFirst` | `boolean` | 控制摘录以文本优先还是图片优先。 |
|
|
137
|
+
| `excerptText` | `string|undefined` | 主摘录文本。 |
|
|
138
|
+
| `excerptTextMarkdown` | `boolean|undefined` | 标记摘录文本是否按Markdown解释。 |
|
|
139
|
+
| `mainExcerptText` | `string` | 带空字符串兜底的摘录文本访问入口。 |
|
|
140
|
+
| `excerptPic` | `ExcerptPic|undefined` | 返回主摘录图片结构,附带尺寸与选区信息。 |
|
|
141
|
+
| `excerptPicData` | `NSData|undefined` | 返回主摘录图片二进制数据。 |
|
|
142
|
+
| `excerptVideoData` | `NSData|undefined` | 返回主摘录视频二进制数据。 |
|
|
143
|
+
| `excerptAudioData` | `NSData|undefined` | 返回主摘录音频二进制数据。 |
|
|
144
|
+
| `image` | `UIImage|undefined` | 返回卡片中第一张图片对象。 |
|
|
145
|
+
| `imageId` | `string|undefined` | 返回第一张图片的资源id。 |
|
|
146
|
+
| `imageData` | `NSData|undefined` | 返回第一张图片的二进制数据。 |
|
|
147
|
+
| `images` | `UIImage[]|undefined` | 返回全部图片对象。 |
|
|
148
|
+
| `imageDatas` | `NSData[]|undefined` | 返回全部图片二进制数据。 |
|
|
149
|
+
| `hasVideo` | `boolean` | 判断是否包含视频摘录。 |
|
|
150
|
+
| `videoId` | `string|undefined` | 返回视频资源id。 |
|
|
151
|
+
| `videoData` | `NSData|undefined` | 返回视频二进制数据。 |
|
|
152
|
+
| `comments` | `NoteComment[]` | 返回原生评论数组。 |
|
|
153
|
+
| `MNComments` | `MNComment[]` | 返回评论包装对象数组。 |
|
|
154
|
+
| `tags` | `string[]` | 读取标签名数组,写入时会覆盖旧标签。 |
|
|
155
|
+
| `linkedNotes` | `object[]` | 返回卡片链接关系集合。 |
|
|
156
|
+
| `summaryLinks` | `object[]` | 返回摘要链接集合。 |
|
|
157
|
+
| `mediaList` | `object[]` | 返回媒体列表。 |
|
|
158
|
+
| `excerptsTextPic` | `{ocr:string[],html:string[],md:string[]}` | 聚合当前卡及其链接卡的摘录文本和图片转写结果。 |
|
|
159
|
+
| `commentsTextPic` | `{html:string[],md:string[]}` | 聚合评论里的文本和绘图内容。 |
|
|
160
|
+
| `excerptsText` | `string[]` | 收集当前卡和链接卡里的摘录文本。 |
|
|
161
|
+
| `commentsText` | `string[]` | 收集评论文本,过滤标签和卡片链接。 |
|
|
162
|
+
| `allTextPic` | `{html:string,ocr:string,md:string}` | 返回整卡文本和图片信息的拼接结果。 |
|
|
163
|
+
| `allText` | `string` | 返回整卡纯文本长字符串。 |
|
|
164
|
+
| `excerptsCommentsText` | `string[]` | 返回摘录与评论文本数组,过滤链接和标签噪音。 |
|
|
165
|
+
| `colorIndex` | `number` | 读写卡片颜色索引。 |
|
|
166
|
+
| `color` | `string` | 用颜色名读写卡片颜色。 |
|
|
167
|
+
| `getNoteColorHex` | `string` | 返回当前颜色的Hex值。 |
|
|
168
|
+
| `colorHex` | `string` | `getNoteColorHex`别名。 |
|
|
169
|
+
| `fillIndex` | `number` | 读写填充样式索引。 |
|
|
170
|
+
| `createDate` | `string` | 创建时间字符串。 |
|
|
171
|
+
| `createDateNumber` | `number` | 创建时间时间戳。 |
|
|
172
|
+
| `modifiedDate` | `string` | 最后修改时间字符串。 |
|
|
173
|
+
| `modifiedDateNumber` | `number` | 最后修改时间时间戳。 |
|
|
174
|
+
| `noteURL` | `string` | 返回卡片链接。 |
|
|
175
|
+
| `url` | `string` | `noteURL`别名。 |
|
|
176
|
+
| `notes` | `MNNote[]` | 返回当前卡与它的链接卡集合。 |
|
|
177
|
+
| `docMd5` | `string|undefined` | 返回关联文档md5。 |
|
|
178
|
+
| `startPage` | `number|undefined` | 返回起始页码。 |
|
|
179
|
+
| `endPage` | `number|undefined` | 返回结束页码。 |
|
|
180
|
+
| `pageNos` | `number[]` | 返回当前卡及关联卡涉及的页码集合。 |
|
|
181
|
+
| `document` | `MNDocument` | 返回当前卡关联文档对象。 |
|
|
182
|
+
| `exist` | `boolean` | 判断底层卡片是否仍存在。 |
|
|
183
|
+
|
|
184
|
+
### 方法
|
|
185
|
+
|
|
186
|
+
#### `getExcerptInfo`
|
|
187
|
+
|
|
188
|
+
##### 类型
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
getExcerptInfo():object|undefined
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
##### 说明
|
|
195
|
+
|
|
196
|
+
返回摘录细节对象,包括类型、hash、选区、页码等。
|
|
197
|
+
|
|
198
|
+
##### 返回值
|
|
199
|
+
|
|
200
|
+
- 类型:`object|undefined`
|
|
201
|
+
- 语义:返回摘录细节对象或undefined。
|
|
202
|
+
|
|
203
|
+
#### `open`
|
|
204
|
+
|
|
205
|
+
##### 类型
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
open():void
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
##### 说明
|
|
212
|
+
|
|
213
|
+
在MarginNote中打开当前卡片。
|
|
214
|
+
|
|
215
|
+
##### 返回值
|
|
216
|
+
|
|
217
|
+
- 类型:`void`
|
|
218
|
+
- 语义:无返回值。
|
|
219
|
+
|
|
220
|
+
#### `appendExcerptText`
|
|
221
|
+
|
|
222
|
+
##### 类型
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
appendExcerptText(text:string):void
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
##### 说明
|
|
229
|
+
|
|
230
|
+
在摘录正文末尾追加文本。
|
|
231
|
+
|
|
232
|
+
##### 参数
|
|
233
|
+
|
|
234
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
235
|
+
|:-------|:-----|:-----|:-----|
|
|
236
|
+
| `text` | `string` | 是 | 要追加的文本。 |
|
|
237
|
+
|
|
238
|
+
##### 返回值
|
|
239
|
+
|
|
240
|
+
- 类型:`void`
|
|
241
|
+
- 语义:无返回值。
|
|
242
|
+
|
|
243
|
+
#### `prependExcerptText`
|
|
244
|
+
|
|
245
|
+
##### 类型
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
prependExcerptText(text:string):void
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
##### 说明
|
|
252
|
+
|
|
253
|
+
在摘录正文开头插入文本。
|
|
254
|
+
|
|
255
|
+
##### 参数
|
|
256
|
+
|
|
257
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
258
|
+
|:-------|:-----|:-----|:-----|
|
|
259
|
+
| `text` | `string` | 是 | 要插入的文本。 |
|
|
260
|
+
|
|
261
|
+
##### 返回值
|
|
262
|
+
|
|
263
|
+
- 类型:`void`
|
|
264
|
+
- 语义:无返回值。
|
|
265
|
+
|
|
266
|
+
#### `copy`
|
|
267
|
+
|
|
268
|
+
##### 类型
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
copy():void
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
##### 说明
|
|
275
|
+
|
|
276
|
+
复制当前卡的关键信息到剪贴板。
|
|
277
|
+
|
|
278
|
+
##### 返回值
|
|
279
|
+
|
|
280
|
+
- 类型:`void`
|
|
281
|
+
- 语义:无返回值。
|
|
282
|
+
|
|
283
|
+
#### `config`
|
|
284
|
+
|
|
285
|
+
##### 类型
|
|
286
|
+
|
|
287
|
+
```ts
|
|
288
|
+
config(opt?:{first?:boolean}):object
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
##### 说明
|
|
292
|
+
|
|
293
|
+
按配置导出卡片对象。
|
|
294
|
+
|
|
295
|
+
##### 参数
|
|
296
|
+
|
|
297
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
298
|
+
|:-------|:-----|:-----|:-----|
|
|
299
|
+
| `opt` | `{first?:boolean}` | 否 | 导出选项,默认`{first:true}`。 |
|
|
300
|
+
|
|
301
|
+
##### 返回值
|
|
302
|
+
|
|
303
|
+
- 类型:`object`
|
|
304
|
+
- 语义:返回卡片配置对象。
|
|
305
|
+
|
|
306
|
+
#### `realGroupNoteIdForTopicId`
|
|
307
|
+
|
|
308
|
+
##### 类型
|
|
309
|
+
|
|
310
|
+
```ts
|
|
311
|
+
realGroupNoteIdForTopicId(nodebookid?:string):string
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
##### 说明
|
|
315
|
+
|
|
316
|
+
返回当前卡在指定学习集下的真实组卡id。
|
|
317
|
+
|
|
318
|
+
##### 参数
|
|
319
|
+
|
|
320
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
321
|
+
|:-------|:-----|:-----|:-----|
|
|
322
|
+
| `nodebookid` | `string` | 否 | 目标学习集id,默认当前学习集。 |
|
|
323
|
+
|
|
324
|
+
##### 返回值
|
|
325
|
+
|
|
326
|
+
- 类型:`string`
|
|
327
|
+
- 语义:返回真实组卡id。
|
|
328
|
+
|
|
329
|
+
#### `realGroupNoteForTopicId`
|
|
330
|
+
|
|
331
|
+
##### 类型
|
|
332
|
+
|
|
333
|
+
```ts
|
|
334
|
+
realGroupNoteForTopicId(nodebookid?:string):MNNote
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
##### 说明
|
|
338
|
+
|
|
339
|
+
返回指定学习集下的真实组卡对象。
|
|
340
|
+
|
|
341
|
+
##### 参数
|
|
342
|
+
|
|
343
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
344
|
+
|:-------|:-----|:-----|:-----|
|
|
345
|
+
| `nodebookid` | `string` | 否 | 目标学习集id,默认当前学习集。 |
|
|
346
|
+
|
|
347
|
+
##### 返回值
|
|
348
|
+
|
|
349
|
+
- 类型:`MNNote`
|
|
350
|
+
- 语义:返回真实组卡对象。
|
|
351
|
+
|
|
352
|
+
#### `noteInDocForTopicId`
|
|
353
|
+
|
|
354
|
+
##### 类型
|
|
355
|
+
|
|
356
|
+
```ts
|
|
357
|
+
noteInDocForTopicId(nodebookid?:string):MNNote
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
##### 说明
|
|
361
|
+
|
|
362
|
+
按学习集映射返回对应卡片对象。
|
|
363
|
+
|
|
364
|
+
##### 参数
|
|
365
|
+
|
|
366
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
367
|
+
|:-------|:-----|:-----|:-----|
|
|
368
|
+
| `nodebookid` | `string` | 否 | 目标学习集id,默认当前学习集。 |
|
|
369
|
+
|
|
370
|
+
##### 返回值
|
|
371
|
+
|
|
372
|
+
- 类型:`MNNote`
|
|
373
|
+
- 语义:返回映射后的卡片对象。
|
|
374
|
+
|
|
375
|
+
#### `processMarkdownBase64Images`
|
|
376
|
+
|
|
377
|
+
##### 类型
|
|
378
|
+
|
|
379
|
+
```ts
|
|
380
|
+
processMarkdownBase64Images():void
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
##### 说明
|
|
384
|
+
|
|
385
|
+
处理正文里Base64图片引用。
|
|
386
|
+
|
|
387
|
+
##### 返回值
|
|
388
|
+
|
|
389
|
+
- 类型:`void`
|
|
390
|
+
- 语义:无返回值。
|
|
391
|
+
|
|
392
|
+
#### `allNoteText`
|
|
393
|
+
|
|
394
|
+
##### 类型
|
|
395
|
+
|
|
396
|
+
```ts
|
|
397
|
+
allNoteText():string
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
##### 说明
|
|
401
|
+
|
|
402
|
+
返回标题、正文、评论拼接文本,不含链接和标签。
|
|
403
|
+
|
|
404
|
+
##### 返回值
|
|
405
|
+
|
|
406
|
+
- 类型:`string`
|
|
407
|
+
- 语义:返回拼接后的文本。
|
|
408
|
+
|
|
409
|
+
#### `setTitle`
|
|
410
|
+
|
|
411
|
+
##### 类型
|
|
412
|
+
|
|
413
|
+
```ts
|
|
414
|
+
setTitle(title:string):MNNote
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
##### 说明
|
|
418
|
+
|
|
419
|
+
设置标题并返回自身,便于链式调用。
|
|
420
|
+
|
|
421
|
+
##### 参数
|
|
422
|
+
|
|
423
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
424
|
+
|:-------|:-----|:-----|:-----|
|
|
425
|
+
| `title` | `string` | 是 | 新标题。 |
|
|
426
|
+
|
|
427
|
+
##### 返回值
|
|
428
|
+
|
|
429
|
+
- 类型:`MNNote`
|
|
430
|
+
- 语义:返回自身,便于链式调用。
|
|
431
|
+
|
|
432
|
+
#### `setTtiles`
|
|
433
|
+
|
|
434
|
+
##### 类型
|
|
435
|
+
|
|
436
|
+
```ts
|
|
437
|
+
setTtiles(titles:string[]):MNNote
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
##### 说明
|
|
441
|
+
|
|
442
|
+
设置多标题并返回自身。
|
|
443
|
+
|
|
444
|
+
##### 参数
|
|
445
|
+
|
|
446
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
447
|
+
|:-------|:-----|:-----|:-----|
|
|
448
|
+
| `titles` | `string[]` | 是 | 标题数组。 |
|
|
449
|
+
|
|
450
|
+
##### 返回值
|
|
451
|
+
|
|
452
|
+
- 类型:`MNNote`
|
|
453
|
+
- 语义:返回自身,便于链式调用。
|
|
454
|
+
|
|
455
|
+
#### `setTitleAndUpdateFromMarkdown`
|
|
456
|
+
|
|
457
|
+
##### 类型
|
|
458
|
+
|
|
459
|
+
```ts
|
|
460
|
+
setTitleAndUpdateFromMarkdown(title:string|string[]):MNNote
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
##### 说明
|
|
464
|
+
|
|
465
|
+
先设置标题,再把正文Markdown标题补进`{{...}}`来源标题。
|
|
466
|
+
|
|
467
|
+
##### 参数
|
|
468
|
+
|
|
469
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
470
|
+
|:-------|:-----|:-----|:-----|
|
|
471
|
+
| `title` | `string|string[]` | 是 | 字符串或标题数组。 |
|
|
472
|
+
|
|
473
|
+
##### 返回值
|
|
474
|
+
|
|
475
|
+
- 类型:`MNNote`
|
|
476
|
+
- 语义:返回自身,便于链式调用。
|
|
477
|
+
|
|
478
|
+
#### `updateTitleFromMarkdown`
|
|
479
|
+
|
|
480
|
+
##### 类型
|
|
481
|
+
|
|
482
|
+
```ts
|
|
483
|
+
updateTitleFromMarkdown():MNNote
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
##### 说明
|
|
487
|
+
|
|
488
|
+
仅根据现有Markdown内容刷新来源标题片段。
|
|
489
|
+
|
|
490
|
+
##### 返回值
|
|
491
|
+
|
|
492
|
+
- 类型:`MNNote`
|
|
493
|
+
- 语义:返回自身,便于链式调用。
|
|
494
|
+
|
|
495
|
+
#### `_getMDContent`
|
|
496
|
+
|
|
497
|
+
##### 类型
|
|
498
|
+
|
|
499
|
+
```ts
|
|
500
|
+
_getMDContent():string
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
##### 说明
|
|
504
|
+
|
|
505
|
+
提取正文与评论中的Markdown内容。
|
|
506
|
+
|
|
507
|
+
##### 返回值
|
|
508
|
+
|
|
509
|
+
- 类型:`string`
|
|
510
|
+
- 语义:返回Markdown内容。
|
|
511
|
+
|
|
512
|
+
#### `getMDContent`
|
|
513
|
+
|
|
514
|
+
##### 类型
|
|
515
|
+
|
|
516
|
+
```ts
|
|
517
|
+
getMDContent(withBase64?:boolean):string
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
##### 说明
|
|
521
|
+
|
|
522
|
+
把当前卡转换成完整Markdown文本。
|
|
523
|
+
|
|
524
|
+
##### 参数
|
|
525
|
+
|
|
526
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
527
|
+
|:-------|:-----|:-----|:-----|
|
|
528
|
+
| `withBase64` | `boolean` | 否 | 为`true`时会把图片内容转成Base64文本嵌入。 |
|
|
529
|
+
|
|
530
|
+
##### 返回值
|
|
531
|
+
|
|
532
|
+
- 类型:`string`
|
|
533
|
+
- 语义:返回完整的Markdown文本。
|