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: MNComment
|
|
3
|
+
description: LibMN中的MNComment对象API文档。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`MNComment`是用于处理卡片评论的对象,提供评论类型识别、内容读取、媒体数据获取和链接管理等功能,访问和管理评论数据。
|
|
7
|
+
|
|
8
|
+
## 构造函数
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
new MNComment(comment: NoteComment)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
构造一个新的MNComment实例。
|
|
15
|
+
|
|
16
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
17
|
+
|:-------|:-----|:-----|:-----|
|
|
18
|
+
| `comment` | `NoteComment` | 是 | 原生评论对象。 |
|
|
19
|
+
|
|
20
|
+
## 类成员(Class members)
|
|
21
|
+
|
|
22
|
+
### 属性
|
|
23
|
+
|
|
24
|
+
无。
|
|
25
|
+
|
|
26
|
+
### 方法
|
|
27
|
+
|
|
28
|
+
#### `commentBelongsToType`
|
|
29
|
+
|
|
30
|
+
##### 类型
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
static commentBelongsToType(comment: NoteComment,types: string[]): boolean
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
##### 说明
|
|
37
|
+
|
|
38
|
+
判断评论是否属于给定类型集合,支持原始`comment.type`和标准化类型名两种匹配。
|
|
39
|
+
|
|
40
|
+
##### 参数
|
|
41
|
+
|
|
42
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
43
|
+
|:----------|:--------------|:-----|:-------------------------------------------|
|
|
44
|
+
| `comment` | `NoteComment` | 是 | 原生评论对象。 |
|
|
45
|
+
| `types` | `string[]` | 是 | 允许的类型列表,支持原始type和规范化type。 |
|
|
46
|
+
|
|
47
|
+
##### 返回值
|
|
48
|
+
|
|
49
|
+
- 类型:`boolean`
|
|
50
|
+
- 语义:命中任一类型返回true,没有命中返回false。
|
|
51
|
+
|
|
52
|
+
#### `getCommentType`
|
|
53
|
+
|
|
54
|
+
##### 类型
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
static getCommentType(comment: NoteComment): string|undefined
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
##### 说明
|
|
61
|
+
|
|
62
|
+
根据评论内容和原始type返回标准化评论类型。
|
|
63
|
+
|
|
64
|
+
##### 参数
|
|
65
|
+
|
|
66
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
67
|
+
|:----------|:--------------|:-----|:-------------------|
|
|
68
|
+
| `comment` | `NoteComment` | 是 | 待识别的评论对象。 |
|
|
69
|
+
|
|
70
|
+
##### 返回值
|
|
71
|
+
|
|
72
|
+
- 类型:`string|undefined`
|
|
73
|
+
- 语义:返回规范化类型字符串,无法识别时返回undefined。
|
|
74
|
+
|
|
75
|
+
## 实例成员(Instance members)
|
|
76
|
+
|
|
77
|
+
### 属性
|
|
78
|
+
|
|
79
|
+
#### `imageId`
|
|
80
|
+
|
|
81
|
+
##### 类型
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
get imageId(): string|undefined
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
##### 说明
|
|
88
|
+
|
|
89
|
+
返回图片评论对应的媒体hash。
|
|
90
|
+
|
|
91
|
+
##### 返回值
|
|
92
|
+
|
|
93
|
+
- 类型:`string|undefined`
|
|
94
|
+
- 语义:图片型评论返回媒体hash,非图片型返回undefined。
|
|
95
|
+
|
|
96
|
+
#### `imageData`
|
|
97
|
+
|
|
98
|
+
##### 类型
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
get imageData(): NSData|undefined
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
##### 说明
|
|
105
|
+
|
|
106
|
+
返回图片评论对应的媒体二进制数据。
|
|
107
|
+
|
|
108
|
+
##### 返回值
|
|
109
|
+
|
|
110
|
+
- 类型:`NSData|undefined`
|
|
111
|
+
- 语义:图片型评论返回图片二进制数据,其他类型返回undefined。
|
|
112
|
+
|
|
113
|
+
#### `videoId`
|
|
114
|
+
|
|
115
|
+
##### 类型
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
get videoId(): string|undefined
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
##### 说明
|
|
122
|
+
|
|
123
|
+
返回音视频评论对应的媒体hash。
|
|
124
|
+
|
|
125
|
+
##### 返回值
|
|
126
|
+
|
|
127
|
+
- 类型:`string|undefined`
|
|
128
|
+
- 语义:audioComment返回hash,其他类型返回undefined。
|
|
129
|
+
|
|
130
|
+
#### `audioId`
|
|
131
|
+
|
|
132
|
+
##### 类型
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
get audioId(): string|undefined
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
##### 说明
|
|
139
|
+
|
|
140
|
+
返回音频评论对应的媒体hash。
|
|
141
|
+
|
|
142
|
+
##### 返回值
|
|
143
|
+
|
|
144
|
+
- 类型:`string|undefined`
|
|
145
|
+
- 语义:audioComment返回hash,其他类型返回undefined。
|
|
146
|
+
|
|
147
|
+
#### `audioData`
|
|
148
|
+
|
|
149
|
+
##### 类型
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
get audioData(): NSData|undefined
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
##### 说明
|
|
156
|
+
|
|
157
|
+
返回音频评论对应的媒体二进制数据。
|
|
158
|
+
|
|
159
|
+
##### 返回值
|
|
160
|
+
|
|
161
|
+
- 类型:`NSData|undefined`
|
|
162
|
+
- 语义:audioComment返回媒体数据,其他类型返回undefined。
|
|
163
|
+
|
|
164
|
+
#### `videoData`
|
|
165
|
+
|
|
166
|
+
##### 类型
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
get videoData(): NSData|undefined
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
##### 说明
|
|
173
|
+
|
|
174
|
+
返回音视频评论对应的媒体二进制数据。
|
|
175
|
+
|
|
176
|
+
##### 返回值
|
|
177
|
+
|
|
178
|
+
- 类型:`NSData|undefined`
|
|
179
|
+
- 语义:audioComment返回媒体数据,其他类型返回undefined。
|
|
180
|
+
|
|
181
|
+
#### `text`
|
|
182
|
+
|
|
183
|
+
##### 类型
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
get text(): string
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
##### 说明
|
|
190
|
+
|
|
191
|
+
返回当前评论的文本内容。
|
|
192
|
+
|
|
193
|
+
##### 返回值
|
|
194
|
+
|
|
195
|
+
- 类型:`string`
|
|
196
|
+
- 语义:有文本时返回文本,没有可用文本时返回空字符串。
|
|
197
|
+
|
|
198
|
+
#### `markdown`
|
|
199
|
+
|
|
200
|
+
##### 类型
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
get markdown(): boolean
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
##### 说明
|
|
207
|
+
|
|
208
|
+
判断当前评论是否为Markdown评论。
|
|
209
|
+
|
|
210
|
+
##### 返回值
|
|
211
|
+
|
|
212
|
+
- 类型:`boolean`
|
|
213
|
+
- 语义:类型为markdownComment时返回true,否则返回false。
|
|
214
|
+
|
|
215
|
+
#### `markdown`
|
|
216
|
+
|
|
217
|
+
##### 类型
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
set markdown(markdown: boolean): void
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
##### 说明
|
|
224
|
+
|
|
225
|
+
在普通文本评论和Markdown评论之间切换。
|
|
226
|
+
|
|
227
|
+
##### 返回值
|
|
228
|
+
|
|
229
|
+
- 类型:`void`
|
|
230
|
+
- 语义:完成切换后立即返回。
|
|
231
|
+
|
|
232
|
+
#### `text`
|
|
233
|
+
|
|
234
|
+
##### 类型
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
set text(text: string): void
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
##### 说明
|
|
241
|
+
|
|
242
|
+
更新当前评论文本,并同步写回原始卡片评论。
|
|
243
|
+
|
|
244
|
+
##### 返回值
|
|
245
|
+
|
|
246
|
+
- 类型:`void`
|
|
247
|
+
- 语义:写入完成后立即返回。
|
|
248
|
+
|
|
249
|
+
#### `tags`
|
|
250
|
+
|
|
251
|
+
##### 类型
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
get tags(): string[]|undefined
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
##### 说明
|
|
258
|
+
|
|
259
|
+
返回标签评论中的标签列表。
|
|
260
|
+
|
|
261
|
+
##### 返回值
|
|
262
|
+
|
|
263
|
+
- 类型:`string[]|undefined`
|
|
264
|
+
- 语义:tagComment返回以#开头的标签列表,其他类型返回undefined。
|
|
265
|
+
|
|
266
|
+
#### `direction`
|
|
267
|
+
|
|
268
|
+
##### 类型
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
get direction(): 'one-way'|'both'|undefined
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
##### 说明
|
|
275
|
+
|
|
276
|
+
返回链接评论的链接方向。
|
|
277
|
+
|
|
278
|
+
##### 返回值
|
|
279
|
+
|
|
280
|
+
- 类型:`'one-way'|'both'|undefined`
|
|
281
|
+
- 语义:linkComment返回方向值,其他类型返回undefined。
|
|
282
|
+
|
|
283
|
+
#### `direction`
|
|
284
|
+
|
|
285
|
+
##### 类型
|
|
286
|
+
|
|
287
|
+
```ts
|
|
288
|
+
set direction(direction: 'one-way'|'both'): void
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
##### 说明
|
|
292
|
+
|
|
293
|
+
设置链接评论方向,并同步处理反向链接。
|
|
294
|
+
|
|
295
|
+
##### 返回值
|
|
296
|
+
|
|
297
|
+
- 类型:`void`
|
|
298
|
+
- 语义:执行方向切换后返回。
|
|
299
|
+
|
|
300
|
+
#### `note`
|
|
301
|
+
|
|
302
|
+
##### 类型
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
get note(): MNNote|undefined
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
##### 说明
|
|
309
|
+
|
|
310
|
+
返回链接或留白评论关联的目标卡片。
|
|
311
|
+
|
|
312
|
+
##### 返回值
|
|
313
|
+
|
|
314
|
+
- 类型:`MNNote|undefined`
|
|
315
|
+
- 语义:可解析时返回MNNote实例,无法关联卡片时返回undefined。
|
|
316
|
+
|
|
317
|
+
### 方法
|
|
318
|
+
|
|
319
|
+
#### `refresh`
|
|
320
|
+
|
|
321
|
+
##### 类型
|
|
322
|
+
|
|
323
|
+
```ts
|
|
324
|
+
refresh(): void
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
##### 说明
|
|
328
|
+
|
|
329
|
+
按`originalNoteId`和`index`重新读取评论内容并刷新类型。
|
|
330
|
+
|
|
331
|
+
##### 参数
|
|
332
|
+
|
|
333
|
+
无。
|
|
334
|
+
|
|
335
|
+
##### 返回值
|
|
336
|
+
|
|
337
|
+
- 类型:`void`
|
|
338
|
+
- 语义:同步完成后返回。
|
|
339
|
+
|
|
340
|
+
#### `copyImage`
|
|
341
|
+
|
|
342
|
+
##### 类型
|
|
343
|
+
|
|
344
|
+
```ts
|
|
345
|
+
copyImage(): void
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
##### 说明
|
|
349
|
+
|
|
350
|
+
复制当前评论对应的图片数据到剪贴板。
|
|
351
|
+
|
|
352
|
+
##### 参数
|
|
353
|
+
|
|
354
|
+
无。
|
|
355
|
+
|
|
356
|
+
##### 返回值
|
|
357
|
+
|
|
358
|
+
- 类型:`void`
|
|
359
|
+
- 语义:复制动作触发后立即返回。
|
|
360
|
+
|
|
361
|
+
#### `copyText`
|
|
362
|
+
|
|
363
|
+
##### 类型
|
|
364
|
+
|
|
365
|
+
```ts
|
|
366
|
+
copyText(): void
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
##### 说明
|
|
370
|
+
|
|
371
|
+
复制当前评论文本到剪贴板。
|
|
372
|
+
|
|
373
|
+
##### 参数
|
|
374
|
+
|
|
375
|
+
无。
|
|
376
|
+
|
|
377
|
+
##### 返回值
|
|
378
|
+
|
|
379
|
+
- 类型:`void`
|
|
380
|
+
- 语义:复制动作触发后立即返回。
|
|
381
|
+
|
|
382
|
+
#### `copy`
|
|
383
|
+
|
|
384
|
+
##### 类型
|
|
385
|
+
|
|
386
|
+
```ts
|
|
387
|
+
copy(): void
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
##### 说明
|
|
391
|
+
|
|
392
|
+
按评论类型自动复制文本或图片内容。
|
|
393
|
+
|
|
394
|
+
##### 参数
|
|
395
|
+
|
|
396
|
+
无。
|
|
397
|
+
|
|
398
|
+
##### 返回值
|
|
399
|
+
|
|
400
|
+
- 类型:`void`
|
|
401
|
+
- 语义:复制动作触发后立即返回。
|
|
402
|
+
|
|
403
|
+
#### `remove`
|
|
404
|
+
|
|
405
|
+
##### 类型
|
|
406
|
+
|
|
407
|
+
```ts
|
|
408
|
+
remove(): void
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
##### 说明
|
|
412
|
+
|
|
413
|
+
从原始卡片中删除当前评论。
|
|
414
|
+
|
|
415
|
+
##### 参数
|
|
416
|
+
|
|
417
|
+
无。
|
|
418
|
+
|
|
419
|
+
##### 返回值
|
|
420
|
+
|
|
421
|
+
- 类型:`void`
|
|
422
|
+
- 语义:删除动作发起后返回。
|
|
423
|
+
|
|
424
|
+
#### `replaceLink`
|
|
425
|
+
|
|
426
|
+
##### 类型
|
|
427
|
+
|
|
428
|
+
```ts
|
|
429
|
+
replaceLink(note: MNNote|MbBookNote|string): void
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
##### 说明
|
|
433
|
+
|
|
434
|
+
将链接评论目标替换为指定卡片,并根据方向维护反向链接。
|
|
435
|
+
|
|
436
|
+
##### 参数
|
|
437
|
+
|
|
438
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
439
|
+
|:-------|:---------|:-----------|:---------|
|
|
440
|
+
| `note` | `MNNote\|MbBookNote\|string` | 是 | 目标卡片。 |
|
|
441
|
+
|
|
442
|
+
##### 返回值
|
|
443
|
+
|
|
444
|
+
- 类型:`void`
|
|
445
|
+
- 语义:替换完成后返回。
|
|
446
|
+
|
|
447
|
+
#### `hasBackLink`
|
|
448
|
+
|
|
449
|
+
##### 类型
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
hasBackLink(): boolean
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
##### 说明
|
|
456
|
+
|
|
457
|
+
检查当前链接评论是否存在反向链接。
|
|
458
|
+
|
|
459
|
+
##### 参数
|
|
460
|
+
|
|
461
|
+
无。
|
|
462
|
+
|
|
463
|
+
##### 返回值
|
|
464
|
+
|
|
465
|
+
- 类型:`boolean`
|
|
466
|
+
- 语义:存在反链返回true,不存在返回false。
|
|
467
|
+
|
|
468
|
+
#### `removeBackLink`
|
|
469
|
+
|
|
470
|
+
##### 类型
|
|
471
|
+
|
|
472
|
+
```ts
|
|
473
|
+
removeBackLink(): void
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
##### 说明
|
|
477
|
+
|
|
478
|
+
移除当前链接评论对应的反向链接。
|
|
479
|
+
|
|
480
|
+
##### 参数
|
|
481
|
+
|
|
482
|
+
无。
|
|
483
|
+
|
|
484
|
+
##### 返回值
|
|
485
|
+
|
|
486
|
+
- 类型:`void`
|
|
487
|
+
- 语义:反链删除完成后返回。
|
|
488
|
+
|
|
489
|
+
#### `addBackLink`
|
|
490
|
+
|
|
491
|
+
##### 类型
|
|
492
|
+
|
|
493
|
+
```ts
|
|
494
|
+
addBackLink(force: boolean): void
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
##### 说明
|
|
498
|
+
|
|
499
|
+
为当前链接评论补充反向链接。
|
|
500
|
+
|
|
501
|
+
##### 参数
|
|
502
|
+
|
|
503
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
504
|
+
|:--------|:----------|:-----|:--------------------------------------------|
|
|
505
|
+
| `force` | `boolean` | 否 | 为true时忽略当前direction,强制尝试补反链。 |
|
|
506
|
+
|
|
507
|
+
##### 返回值
|
|
508
|
+
|
|
509
|
+
- 类型:`void`
|
|
510
|
+
- 语义:补反链动作完成后返回。
|
|
511
|
+
|
|
512
|
+
#### `belongsToType`
|
|
513
|
+
|
|
514
|
+
##### 类型
|
|
515
|
+
|
|
516
|
+
```ts
|
|
517
|
+
belongsToType(types: string[]): boolean
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
##### 说明
|
|
521
|
+
|
|
522
|
+
判断当前评论实例是否命中类型列表。
|
|
523
|
+
|
|
524
|
+
##### 参数
|
|
525
|
+
|
|
526
|
+
| 参数名 | 类型 | 必填 | 说明 |
|
|
527
|
+
|:--------|:-----------|:-----|:-----------------|
|
|
528
|
+
| `types` | `string[]` | 是 | 允许的类型列表。 |
|
|
529
|
+
|
|
530
|
+
##### 返回值
|
|
531
|
+
|
|
532
|
+
- 类型:`boolean`
|
|
533
|
+
- 语义:实例类型命中列表返回true,否则返回false。
|