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.
Files changed (222) hide show
  1. package/.trae/documents/libmn_cleanup_plan.md +51 -0
  2. package/.trae/documents/libmn_doc_restructure_plan.md +140 -0
  3. package/.trae/documents/libmn_indentation_plan.md +116 -0
  4. package/.trae/documents/libmn_title_hierarchy_plan.md +91 -0
  5. package/README.md +9 -7
  6. package/next-env.d.ts +6 -0
  7. package/next.config.mjs +14 -0
  8. package/package.json +25 -10
  9. package/postcss.config.mjs +7 -0
  10. package/scripts/sync-definitions.mjs +33 -0
  11. package/source.config.ts +5 -0
  12. package/src/app/[[...slug]]/page.tsx +259 -0
  13. package/src/app/api/search/route.ts +6 -0
  14. package/src/app/global.css +81 -0
  15. package/src/app/layout.tsx +33 -0
  16. package/src/components/JsbApiFooter.tsx +251 -0
  17. package/src/content/docs/{guides/contributing.md → contributing.md} +31 -6
  18. package/src/content/docs/{guides/cookbook → cookbook}/addon-settings.md +2 -2
  19. package/src/content/docs/{guides/cookbook → cookbook}/embed-webview-panel.md +2 -2
  20. package/src/content/docs/cookbook/meta.json +13 -0
  21. package/src/content/docs/{guides/cookbook → cookbook}/network-api-call.md +2 -2
  22. package/src/content/docs/{guides/cookbook → cookbook}/webview-bidirectional-js.md +1 -1
  23. package/src/content/docs/guides/getting-started.md +2 -2
  24. package/src/content/docs/guides/lifecycle-and-window.md +4 -4
  25. package/src/content/docs/guides/meta.json +14 -0
  26. package/src/content/docs/guides/mindmap-and-selection.md +2 -2
  27. package/src/content/docs/guides/native-ui.md +4 -4
  28. package/src/content/docs/guides/network-requests.md +8 -9
  29. package/src/content/docs/guides/notes-and-database.md +2 -2
  30. package/src/content/docs/guides/shortcut-keys.md +9 -9
  31. package/src/content/docs/guides/storage-and-files.md +4 -4
  32. package/src/content/docs/guides/toolbar-and-commands.md +1 -1
  33. package/src/content/docs/index.mdx +13 -38
  34. package/src/content/docs/libmn/data-converter.md +1572 -0
  35. package/src/content/docs/libmn/frame.md +279 -0
  36. package/src/content/docs/libmn/headers.md +234 -0
  37. package/src/content/docs/libmn/index.md +60 -0
  38. package/src/content/docs/libmn/internal-exposed.md +46 -0
  39. package/src/content/docs/libmn/locale.md +307 -0
  40. package/src/content/docs/libmn/menu.md +77 -0
  41. package/src/content/docs/libmn/meta.json +27 -0
  42. package/src/content/docs/libmn/mnbutton.md +966 -0
  43. package/src/content/docs/libmn/mncomment.md +533 -0
  44. package/src/content/docs/libmn/mnconnection.md +717 -0
  45. package/src/content/docs/libmn/mndocument.md +309 -0
  46. package/src/content/docs/libmn/mnextension-panel.md +340 -0
  47. package/src/content/docs/libmn/mnnote.md +533 -0
  48. package/src/content/docs/libmn/mnnotebook.md +725 -0
  49. package/src/content/docs/libmn/mnutil.md +2936 -0
  50. package/src/content/docs/libmn/mnwebview.md +693 -0
  51. package/src/content/docs/libmn/mustache.md +65 -0
  52. package/src/content/docs/libmn/response.md +352 -0
  53. package/src/content/docs/libmn/runtime-assets.md +64 -0
  54. package/src/content/docs/libmn/runtime-web-view-host.md +77 -0
  55. package/src/content/docs/libmn/runtime.md +178 -0
  56. package/src/content/docs/libmn/vendor-globals.md +34 -0
  57. package/src/content/docs/meta.json +11 -0
  58. package/src/content/docs/reference/black-box.md +2 -2
  59. package/src/content/docs/reference/foundation/meta.json +4 -0
  60. package/src/content/docs/reference/foundation/ns-attributed-string.md +1 -1
  61. package/src/content/docs/reference/foundation/ns-counted-set.md +1 -1
  62. package/src/content/docs/reference/foundation/ns-date-components.md +2 -2
  63. package/src/content/docs/reference/foundation/ns-date-formatter.md +1 -3
  64. package/src/content/docs/reference/foundation/ns-decimal-number.md +1 -1
  65. package/src/content/docs/reference/foundation/ns-enumerator.md +1 -1
  66. package/src/content/docs/reference/foundation/ns-error.md +2 -2
  67. package/src/content/docs/reference/foundation/ns-file-manager.md +1 -1
  68. package/src/content/docs/reference/foundation/ns-formatter.md +2 -2
  69. package/src/content/docs/reference/foundation/ns-json-serialization.md +10 -2
  70. package/src/content/docs/reference/foundation/ns-mutable-attributed-string.md +1 -1
  71. package/src/content/docs/reference/foundation/ns-mutable-character-set.md +1 -1
  72. package/src/content/docs/reference/foundation/ns-mutable-dictionary.md +1 -1
  73. package/src/content/docs/reference/foundation/ns-mutable-index-set.md +1 -1
  74. package/src/content/docs/reference/foundation/ns-mutable-set.md +1 -1
  75. package/src/content/docs/reference/foundation/ns-mutable-string.md +1 -1
  76. package/src/content/docs/reference/foundation/ns-mutable-url-request.md +2 -3
  77. package/src/content/docs/reference/foundation/ns-null.md +1 -1
  78. package/src/content/docs/reference/foundation/ns-number-formatter.md +1 -1
  79. package/src/content/docs/reference/foundation/ns-operation.md +2 -2
  80. package/src/content/docs/reference/foundation/ns-pointer-array.md +1 -1
  81. package/src/content/docs/reference/foundation/ns-proxy.md +5 -3
  82. package/src/content/docs/reference/foundation/ns-scanner.md +7 -1
  83. package/src/content/docs/reference/foundation/ns-set.md +1 -1
  84. package/src/content/docs/reference/foundation/ns-simple-c-string.md +3 -4
  85. package/src/content/docs/reference/foundation/ns-time-zone.md +1 -1
  86. package/src/content/docs/reference/foundation/ns-ubiquitous-key-value-store.md +61 -0
  87. package/src/content/docs/reference/foundation/ns-url-connection.md +2 -2
  88. package/src/content/docs/reference/foundation/ns-url-request.md +2 -2
  89. package/src/content/docs/reference/foundation/ns-url-response.md +5 -5
  90. package/src/content/docs/reference/foundation/ns-url.md +1 -1
  91. package/src/content/docs/reference/foundation/ns-user-defaults.md +5 -5
  92. package/src/content/docs/reference/foundation/ns-value.md +15 -15
  93. package/src/content/docs/reference/global/agent-tools.md +91 -0
  94. package/src/content/docs/reference/global/application.md +4 -4
  95. package/src/content/docs/reference/global/builtin-commands.md +2 -2
  96. package/src/content/docs/reference/global/database.md +4 -4
  97. package/src/content/docs/reference/global/document.md +21 -0
  98. package/src/content/docs/reference/global/global-variables.md +22 -5
  99. package/src/content/docs/reference/global/jsb.md +6 -4
  100. package/src/content/docs/reference/global/meta.json +18 -0
  101. package/src/content/docs/reference/global/note.md +2 -2
  102. package/src/content/docs/reference/global/notebook.md +21 -0
  103. package/src/content/docs/reference/global/popup-menu-item.md +2 -2
  104. package/src/content/docs/reference/global/popup-menu.md +5 -6
  105. package/src/content/docs/reference/global/search-manager.md +12 -6
  106. package/src/content/docs/reference/global/self.md +1 -13
  107. package/src/content/docs/reference/js-runtime.md +5 -4
  108. package/src/content/docs/reference/marginnote/document-controller.md +37 -5
  109. package/src/content/docs/reference/marginnote/jsextension.md +7 -7
  110. package/src/content/docs/reference/marginnote/mb-book-note.md +162 -72
  111. package/src/content/docs/reference/marginnote/mb-book.md +3 -3
  112. package/src/content/docs/reference/marginnote/mb-model-tool.md +2 -2
  113. package/src/content/docs/reference/marginnote/mb-topic.md +13 -2
  114. package/src/content/docs/reference/marginnote/meta.json +18 -0
  115. package/src/content/docs/reference/marginnote/mindmap-node.md +2 -2
  116. package/src/content/docs/reference/marginnote/mindmap-view.md +2 -2
  117. package/src/content/docs/reference/marginnote/notebook-controller.md +1 -1
  118. package/src/content/docs/reference/marginnote/outline-view.md +2 -2
  119. package/src/content/docs/reference/marginnote/reader-controller.md +1 -1
  120. package/src/content/docs/reference/marginnote/study-controller.md +19 -19
  121. package/src/content/docs/reference/meta.json +14 -0
  122. package/src/content/docs/reference/quartzcore/caanimation-group.md +3 -3
  123. package/src/content/docs/reference/quartzcore/cabasic-animation.md +3 -3
  124. package/src/content/docs/reference/quartzcore/caemitter-layer.md +44 -0
  125. package/src/content/docs/reference/quartzcore/cagradient-layer.md +1 -1
  126. package/src/content/docs/reference/quartzcore/cakeyframe-animation.md +3 -3
  127. package/src/content/docs/reference/quartzcore/calayer.md +1 -1
  128. package/src/content/docs/reference/quartzcore/camedia-timing-function.md +1 -1
  129. package/src/content/docs/reference/quartzcore/caproperty-animation.md +1 -1
  130. package/src/content/docs/reference/quartzcore/careplicator-layer.md +2 -2
  131. package/src/content/docs/reference/quartzcore/cascroll-layer.md +1 -1
  132. package/src/content/docs/reference/quartzcore/cashape-layer.md +2 -2
  133. package/src/content/docs/reference/quartzcore/catext-layer.md +4 -4
  134. package/src/content/docs/reference/quartzcore/catransaction.md +5 -3
  135. package/src/content/docs/reference/quartzcore/catransform-layer.md +3 -3
  136. package/src/content/docs/reference/quartzcore/catransition.md +10 -6
  137. package/src/content/docs/reference/quartzcore/cavalue-function.md +1 -1
  138. package/src/content/docs/reference/quartzcore/meta.json +4 -0
  139. package/src/content/docs/reference/uikit/meta.json +4 -0
  140. package/src/content/docs/reference/uikit/ns-mutable-paragraph-style.md +3 -3
  141. package/src/content/docs/reference/uikit/ns-paragraph-style.md +3 -4
  142. package/src/content/docs/reference/uikit/ns-text-storage.md +4 -5
  143. package/src/content/docs/reference/uikit/uiactivity-indicator-view.md +2 -2
  144. package/src/content/docs/reference/uikit/uiapplication.md +1 -1
  145. package/src/content/docs/reference/uikit/uibar-button-item.md +3 -4
  146. package/src/content/docs/reference/uikit/uibar-item.md +2 -3
  147. package/src/content/docs/reference/uikit/uibezier-path.md +2 -2
  148. package/src/content/docs/reference/uikit/uibutton.md +1 -1
  149. package/src/content/docs/reference/uikit/uicollection-view-cell.md +5 -5
  150. package/src/content/docs/reference/uikit/uicollection-view-controller.md +22 -2
  151. package/src/content/docs/reference/uikit/uicollection-view-flow-layout.md +54 -0
  152. package/src/content/docs/reference/uikit/uicollection-view-layout.md +9 -2
  153. package/src/content/docs/reference/uikit/uicollection-view.md +13 -4
  154. package/src/content/docs/reference/uikit/uicolor.md +1 -1
  155. package/src/content/docs/reference/uikit/uicontrol.md +3 -5
  156. package/src/content/docs/reference/uikit/uidate-picker.md +1 -1
  157. package/src/content/docs/reference/uikit/uievent.md +2 -2
  158. package/src/content/docs/reference/uikit/uifont.md +1 -1
  159. package/src/content/docs/reference/uikit/uigesture-recognizer.md +1 -1
  160. package/src/content/docs/reference/uikit/uiimage-picker-controller.md +1 -1
  161. package/src/content/docs/reference/uikit/uiimage-view.md +2 -2
  162. package/src/content/docs/reference/uikit/uiimage.md +2 -2
  163. package/src/content/docs/reference/uikit/uikey-command.md +2 -2
  164. package/src/content/docs/reference/uikit/uilabel.md +3 -3
  165. package/src/content/docs/reference/uikit/uilocal-notification.md +2 -2
  166. package/src/content/docs/reference/uikit/uilong-press-gesture-recognizer.md +2 -2
  167. package/src/content/docs/reference/uikit/uinavigation-bar.md +2 -2
  168. package/src/content/docs/reference/uikit/uinavigation-controller.md +1 -1
  169. package/src/content/docs/reference/uikit/uinavigation-item.md +1 -1
  170. package/src/content/docs/reference/uikit/uipage-control.md +1 -1
  171. package/src/content/docs/reference/uikit/uipage-view-controller.md +1 -1
  172. package/src/content/docs/reference/uikit/uipan-gesture-recognizer.md +1 -1
  173. package/src/content/docs/reference/uikit/uipasteboard.md +1 -1
  174. package/src/content/docs/reference/uikit/uipicker-view.md +3 -3
  175. package/src/content/docs/reference/uikit/uipinch-gesture-recognizer.md +1 -1
  176. package/src/content/docs/reference/uikit/uipopover-controller.md +1 -1
  177. package/src/content/docs/reference/uikit/uiresponder.md +3 -4
  178. package/src/content/docs/reference/uikit/uirotation-gesture-recognizer.md +1 -1
  179. package/src/content/docs/reference/uikit/uiscreen-mode.md +2 -2
  180. package/src/content/docs/reference/uikit/uiscrollview.md +1 -1
  181. package/src/content/docs/reference/uikit/uisearch-bar.md +25 -2
  182. package/src/content/docs/reference/uikit/uisegmented-control.md +1 -1
  183. package/src/content/docs/reference/uikit/uislider.md +1 -1
  184. package/src/content/docs/reference/uikit/uiswipe-gesture-recognizer.md +1 -1
  185. package/src/content/docs/reference/uikit/uiswitch.md +2 -2
  186. package/src/content/docs/reference/uikit/uitab-bar-controller.md +2 -2
  187. package/src/content/docs/reference/uikit/uitab-bar-item.md +1 -1
  188. package/src/content/docs/reference/uikit/uitab-bar.md +1 -1
  189. package/src/content/docs/reference/uikit/uitable-view-cell.md +6 -6
  190. package/src/content/docs/reference/uikit/uitable-view-controller.md +1 -1
  191. package/src/content/docs/reference/uikit/uitable-view.md +3 -3
  192. package/src/content/docs/reference/uikit/uitap-gesture-recognizer.md +2 -2
  193. package/src/content/docs/reference/uikit/uitext-input-mode.md +7 -3
  194. package/src/content/docs/reference/uikit/uitext-position.md +5 -5
  195. package/src/content/docs/reference/uikit/uitext-range.md +4 -4
  196. package/src/content/docs/reference/uikit/uitext-view.md +2 -2
  197. package/src/content/docs/reference/uikit/uitextfield.md +3 -3
  198. package/src/content/docs/reference/uikit/uitoolbar.md +1 -1
  199. package/src/content/docs/reference/uikit/uitouch.md +3 -3
  200. package/src/content/docs/reference/uikit/uiview-controller.md +2 -2
  201. package/src/content/docs/reference/uikit/uiview.md +5 -5
  202. package/src/content/docs/reference/uikit/uiwebview.md +5 -5
  203. package/src/content/docs/reference/uikit/uiwindow.md +2 -2
  204. package/src/content/docs/reference/utility/menu-controller.md +1 -1
  205. package/src/content/docs/reference/utility/meta.json +4 -0
  206. package/src/content/docs/reference/utility/sqlite-result-set.md +1 -1
  207. package/src/content/docs/reference/utility/sqlite-statement.md +2 -2
  208. package/src/content/docs/reference/utility/zip-archive.md +13 -14
  209. package/src/content/docs/reference/value-sturct.md +105 -0
  210. package/src/lib/layout.tsx +31 -0
  211. package/src/lib/source.ts +7 -0
  212. package/tsconfig.json +42 -3
  213. package/astro.config.mjs +0 -126
  214. package/src/client/jsb-api-footer.ts +0 -242
  215. package/src/components/Footer.astro +0 -57
  216. package/src/components/Search.astro +0 -330
  217. package/src/content.config.ts +0 -7
  218. package/src/styles/starlight-overrides.css +0 -23
  219. /package/src/content/docs/{guides/cookbook → cookbook}/append-selection-as-comment.md +0 -0
  220. /package/src/content/docs/{guides/cookbook → cookbook}/batch-rename-notes.md +0 -0
  221. /package/src/content/docs/{guides/cookbook → cookbook}/export-notebook.md +0 -0
  222. /package/src/content/docs/{guides/cookbook → cookbook}/focus-note-in-mindmap.md +0 -0
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  title: NSValue
3
- description: 通用值对象封装(CGRect/CGPoint/CGSize/NSRange 等)。
3
+ description: 通用值对象封装([CGRect](/reference/value-sturct/#cgrect)/[CGPoint](/reference/value-sturct/#cgpoint)/[CGSize](/reference/value-sturct/#cgsize)/[NSRange](/reference/value-sturct/#nsrange)/[CGAffineTransform](/reference/value-sturct/#cgaffinetransform)/[CATransform3D](/reference/value-sturct/#catransform3d)等)。
4
4
  ---
5
5
 
6
- `NSValue` 用于封装非对象类型的值(例如 `CGPoint`、`CGRect`、`CGSize`、`NSRange`、`CGAffineTransform`、`CATransform3D` 等),以便在集合中传递或作为返回值使用。
6
+ `NSValue`用于封装非对象类型的值,例如[`CGPoint`](/reference/value-sturct/#cgpoint)、[`CGRect`](/reference/value-sturct/#cgrect)、[`CGSize`](/reference/value-sturct/#cgsize)、[`NSRange`](/reference/value-sturct/#nsrange)、[`CGAffineTransform`](/reference/value-sturct/#cgaffinetransform)、[`CATransform3D`](/reference/value-sturct/#catransform3d)等,以便在集合中传递或作为返回值使用。
7
7
 
8
8
  ## 类成员 (Class members)
9
9
 
10
10
  ### `valueWithCGPoint`
11
11
 
12
- CGPoint 创建。
12
+ [CGPoint](/reference/value-sturct/#cgpoint)创建。
13
13
 
14
14
  ```javascript
15
15
  static valueWithCGPoint(point: any): NSValue
@@ -27,7 +27,7 @@ static valueWithCGPoint(point: any): NSValue
27
27
 
28
28
  ### `valueWithCGSize`
29
29
 
30
- CGSize 创建。
30
+ [CGSize](/reference/value-sturct/#cgsize)创建。
31
31
 
32
32
  ```javascript
33
33
  static valueWithCGSize(size: any): NSValue
@@ -45,7 +45,7 @@ static valueWithCGSize(size: any): NSValue
45
45
 
46
46
  ### `valueWithCGRect`
47
47
 
48
- CGRect 创建。
48
+ [CGRect](/reference/value-sturct/#cgrect)创建。
49
49
 
50
50
  ```javascript
51
51
  static valueWithCGRect(rect: any): NSValue
@@ -63,7 +63,7 @@ static valueWithCGRect(rect: any): NSValue
63
63
 
64
64
  ### `valueWithCGAffineTransform`
65
65
 
66
- CGAffineTransform 创建。
66
+ [CGAffineTransform](/reference/value-sturct/#cgaffinetransform)创建。
67
67
 
68
68
  ```javascript
69
69
  static valueWithCGAffineTransform(transform: any): NSValue
@@ -81,7 +81,7 @@ static valueWithCGAffineTransform(transform: any): NSValue
81
81
 
82
82
  ### `valueWithRange`
83
83
 
84
- NSRange 创建。
84
+ [NSRange](/reference/value-sturct/#nsrange)创建。
85
85
 
86
86
  ```javascript
87
87
  static valueWithRange(range: any): NSValue
@@ -99,7 +99,7 @@ static valueWithRange(range: any): NSValue
99
99
 
100
100
  ### `valueWithCATransform3D`
101
101
 
102
- CATransform3D 创建(若环境中提供)。
102
+ [CATransform3D](/reference/value-sturct/#catransform3d)创建。
103
103
 
104
104
  ```javascript
105
105
  static valueWithCATransform3D(transform3d: any): NSValue
@@ -119,7 +119,7 @@ static valueWithCATransform3D(transform3d: any): NSValue
119
119
 
120
120
  ### `CGPointValue`
121
121
 
122
- CGPoint 值。
122
+ [CGPoint](/reference/value-sturct/#cgpoint)值。
123
123
 
124
124
  ```javascript
125
125
  CGPointValue(): any
@@ -131,7 +131,7 @@ CGPointValue(): any
131
131
 
132
132
  ### `CGSizeValue`
133
133
 
134
- CGSize 值。
134
+ [CGSize](/reference/value-sturct/#cgsize)值。
135
135
 
136
136
  ```javascript
137
137
  CGSizeValue(): any
@@ -143,7 +143,7 @@ CGSizeValue(): any
143
143
 
144
144
  ### `CGRectValue`
145
145
 
146
- CGRect 值。
146
+ [CGRect](/reference/value-sturct/#cgrect)值。
147
147
 
148
148
  ```javascript
149
149
  CGRectValue(): any
@@ -155,7 +155,7 @@ CGRectValue(): any
155
155
 
156
156
  ### `CGAffineTransformValue`
157
157
 
158
- CGAffineTransform 值。
158
+ [CGAffineTransform](/reference/value-sturct/#cgaffinetransform)值。
159
159
 
160
160
  ```javascript
161
161
  CGAffineTransformValue(): any
@@ -167,7 +167,7 @@ CGAffineTransformValue(): any
167
167
 
168
168
  ### `rangeValue`
169
169
 
170
- NSRange 值。
170
+ [NSRange](/reference/value-sturct/#nsrange)值。
171
171
 
172
172
  ```javascript
173
173
  rangeValue(): any
@@ -179,7 +179,7 @@ rangeValue(): any
179
179
 
180
180
  ### `CATransform3DValue`
181
181
 
182
- CATransform3D 值。
182
+ [CATransform3D](/reference/value-sturct/#catransform3d)值。
183
183
 
184
184
  ```javascript
185
185
  CATransform3DValue(): any
@@ -191,4 +191,4 @@ CATransform3DValue(): any
191
191
 
192
192
  ## 相关
193
193
 
194
- - `CGPoint` / `CGRect` / `CGSize` / `NSRange`(作为值类型)
194
+ - [`CGPoint`](/reference/value-sturct/#cgpoint) / [`CGRect`](/reference/value-sturct/#cgrect) / [`CGSize`](/reference/value-sturct/#cgsize) / [`NSRange`](/reference/value-sturct/#nsrange) / [`CGAffineTransform`](/reference/value-sturct/#cgaffinetransform) / [`CATransform3D`](/reference/value-sturct/#catransform3d)作为值类型
@@ -0,0 +1,91 @@
1
+ ---
2
+ title: AgentTools
3
+ description: 全局工具对象。用于注册、获取、列举与执行工具。
4
+ ---
5
+
6
+ **[Deprecated]** `AgentTools`是全局对象,不是原生类。用于注册工具并统一调用。
7
+
8
+ 已被弃用,不建议使用。
9
+
10
+ ## 实例成员 (Instance members)
11
+
12
+ `AgentTools`是全局对象,默认不以实例化方式使用。
13
+
14
+ ## 类成员 (Class members)
15
+
16
+ ### 方法
17
+
18
+ ### `register`
19
+
20
+ 注册工具对象。
21
+
22
+ ```javascript
23
+ register(tool: object): void
24
+ ```
25
+
26
+ <details>
27
+ <summary>目前内置的mn.search工具的注册源代码</summary>
28
+
29
+ ```javascript
30
+ register({
31
+ name: 'mn.search',
32
+ info: {name:'mn.search', kind:'search', scopes:['topic','all','page'], description:'Search notes or pages via SearchManager'},
33
+ run: function(input){
34
+ input = input || {};
35
+ var app2 = null;
36
+ try { app2 = Application.sharedInstance(); } catch (e2) {}
37
+ var mgr2 = app2 && app2.searchManager ? app2.searchManager : null;
38
+ if (!mgr2) { throw new Error('search_manager_unavailable'); }
39
+ var q = normalizeString(input.query, '');
40
+ var scope = normalizeString(input.scope, 'topic').toLowerCase();
41
+ if (scope !== 'topic' && scope !== 'all' && scope !== 'page') { scope = 'topic'; }
42
+ var titleOnly = !!input.titleOnly;
43
+ var beginsWith = !!input.beginsWith;
44
+ var limit = (input.limit != null) ? input.limit : 50;
45
+ var noteOnly = (input.noteOnly != null) ? !!input.noteOnly : false;
46
+ var topicid = normalizeNullable(input.topicid);
47
+ if (scope === 'page') {
48
+ return mgr2.searchPage(q, beginsWith, limit);
49
+ }
50
+ if (input.useFts) {
51
+ return mgr2.searchFts3Text(q, titleOnly, topicid, limit, noteOnly);
52
+ }
53
+ return mgr2.searchText(q, titleOnly, topicid, beginsWith, limit);
54
+ }
55
+ });
56
+ ```
57
+ </details>
58
+
59
+ ### `get`
60
+
61
+ 按名称获取工具。
62
+
63
+ ```javascript
64
+ get(name: string): object | null
65
+ ```
66
+
67
+ ### `list`
68
+
69
+ 列出已注册工具。
70
+
71
+ ```javascript
72
+ list(): object[]
73
+ ```
74
+
75
+ ### `run`
76
+
77
+ 执行指定工具。
78
+
79
+ ```javascript
80
+ run(name: string, input: any): Promise<any>
81
+ ```
82
+
83
+ ## 使用规范
84
+
85
+ - `register`时缺少名称会被忽略,同名注册会覆盖。
86
+ - `run`找不到工具时会抛错;工具对象没有`run`实现时常见返回`null`。
87
+ - 目前会内建工具`mn.search`,执行前可先`list/get`检查。
88
+
89
+ ## 相关
90
+
91
+ - [SearchManager](/reference/global/search-manager/)
@@ -58,7 +58,7 @@ studyController(window: UIWindow): StudyController
58
58
 
59
59
  | Name | Type | Description |
60
60
  | :--- | :--- | :--- |
61
- | `window` | `UIWindow` | 目标窗口(通常传 `self.window`)。 |
61
+ | `window` | `UIWindow` | 目标窗口(默认传 `self.window`)。 |
62
62
 
63
63
  **Return Value:**
64
64
 
@@ -163,7 +163,7 @@ queryCommandWithKeyFlagsInWindow(command: string, keyFlags: any, window: UIWindo
163
163
 
164
164
  该接口用于查询某个内建command在“当前窗口+修饰键(keyFlags)”上下文里是否可用,以及是否处于勾选态。你可以用它来:
165
165
 
166
- - 判断某个command当前是否能执行(例如编辑态/无焦点时可能禁用)。
166
+ - 判断某个command当前是否能执行(例如编辑态/无焦点时会禁用)。
167
167
  - 在调用`processCommandWithKeyFlagsInWindow(...)`之前做保护性判断。
168
168
 
169
169
  已确认返回值至少包含:
@@ -193,7 +193,7 @@ processCommandWithKeyFlagsInWindow(command: string, keyFlags: any, window: UIWin
193
193
 
194
194
  这里的command同样是MarginNote内建命令的字符串标识(可理解为某个菜单动作/操作的ID)。只要command字符串是系统可识别的命令标识,就可以直接调用执行(例如已确认`ZoomToFit`可执行)。
195
195
 
196
- 可用的command列表没有单一集中枚举,建议参考内建command清单页,并在运行时用`queryCommandWithKeyFlagsInWindow`确认`disabled:false`后再执行:
196
+ 可用的command列表没有单一集中枚举,参考内建command清单页,并用`queryCommandWithKeyFlagsInWindow`确认`disabled:false`后再执行:
197
197
 
198
198
  - [内建command清单](/reference/global/builtin-commands/)
199
199
 
@@ -288,7 +288,7 @@ unregsiterHtmlCommentEditor(commentTag: string): void
288
288
 
289
289
  ### `importDocument`
290
290
 
291
- 导入文档(由运行时实现决定入库位置与返回值含义)。
291
+ 导入文档,使得在MN可访问到的范围内的文档在文档库中可见。
292
292
 
293
293
  ```javascript
294
294
  importDocument(fileUrl: string): string
@@ -3,12 +3,12 @@ title: 内建command清单
3
3
  description: MarginNote内建command字符串速查表(用于query/processCommand调用)。
4
4
  ---
5
5
 
6
- 本页汇总一些常见内建command字符串。它们通常用于:
6
+ 本页汇总一些常见内建command字符串。它们默认用于:
7
7
 
8
8
  - `Application.queryCommandWithKeyFlagsInWindow(command,keyFlags,window)`查询可用性与checked状态。
9
9
  - `Application.processCommandWithKeyFlagsInWindow(command,keyFlags,window)`执行内建命令。
10
10
 
11
- 注意:该清单可能随版本变化;当某个command在运行时表现为`disabled:true`,可能是当前上下文不可用,也可能是版本差异导致不存在。
11
+ 注意:该清单会随版本变化;当某个command表现为`disabled:true`,是当前上下文不可用,也是版本差异导致不存在。
12
12
 
13
13
  ## Root(全局分发)
14
14
 
@@ -3,7 +3,7 @@ title: Database
3
3
  description: MarginNote 核心数据库访问对象(MbModelTool),用于获取/修改笔记、笔记本与文档。
4
4
  ---
5
5
 
6
- `Database` 即底层类型 `MbModelTool` 的单例,用于访问 MarginNote 的笔记与文档数据。通过 `Database.sharedInstance()` 获取。修改数据后建议使用 [UndoManager](/reference/utility/undo-manager/) 的 `undoGrouping(title, topicid, fn)` 包裹,并调用 `Application.sharedInstance().refreshAfterDBChanged(topicid)` 刷新界面。
6
+ `Database` 即底层类型 `MbModelTool` 的单例,用于访问 MarginNote 的笔记与文档数据。通过 `Database.sharedInstance()` 获取。修改数据后使用 [UndoManager](/reference/utility/undo-manager/) 的 `undoGrouping(title, topicid, fn)` 包裹,并调用 `Application.sharedInstance().refreshAfterDBChanged(topicid)` 刷新界面。
7
7
 
8
8
  ## 类成员 (Class members)
9
9
 
@@ -176,7 +176,7 @@ allDocuments(): NSArray
176
176
 
177
177
  ### `savedb`
178
178
 
179
- 手动保存数据库到磁盘。慎用,通常由系统自动管理。
179
+ 手动保存数据库到磁盘。慎用,默认由系统自动管理。
180
180
 
181
181
  ```javascript
182
182
  savedb(): void
@@ -371,7 +371,7 @@ getSketchNotesForMindMap(topicid: string): NSArray
371
371
 
372
372
  ### `transDictionaryToJSCompatible` / `transArrayToJSCompatible`
373
373
 
374
- 将原生容器转换为更易于 JS 使用的结构(行为以运行时实现为准)。
374
+ 将原生容器转换为更易于 JS 使用的结构。
375
375
 
376
376
  ```javascript
377
377
  static transDictionaryToJSCompatible(dic: NSDictionary): NSDictionary
@@ -387,7 +387,7 @@ static transArrayToJSCompatible(arr: NSArray): NSArray
387
387
 
388
388
  **Return Value:**
389
389
 
390
- - `any`: 导入结果(通常为导入的笔记本对象或状态)。
390
+ - `any`: 导入结果(为导入的笔记本对象或状态)。
391
391
 
392
392
  ## 相关
393
393
 
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: Document
3
+ description: 全局别名对象。语义上等同于MbBook。
4
+ ---
5
+
6
+ `Document`是插件环境的全局导出别名,语义上等同于[MbBook](/reference/marginnote/mb-book/)。
7
+
8
+ ## 关系说明
9
+
10
+ - `Document`与`MbBook`是同一文档对象在全局入口层的别名语义,不是两套模型。
11
+ - 主键语义为`docMd5`。
12
+ - 对象生命周期由宿主数据层管理,不把投影字段当强一致缓存长期持有。
13
+
14
+ ## 用法
15
+
16
+ 完整属性与方法请直接参考[MbBook](/reference/marginnote/mb-book/)。
17
+
18
+ ## 相关
19
+
20
+ - [MbBook](/reference/marginnote/mb-book/)
21
+ - [Database](/reference/global/database/)
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: 全局入口对象(Global Variables)
3
- description: MarginNote插件运行时直接注入到JS环境的全局变量清单与用法入口。
3
+ description: MarginNote插件环境直接注入到JS环境的全局变量清单与用法入口。
4
4
  ---
5
- 本页列出MarginNote插件运行时可直接使用的全局变量名。这些全局名对应的对象通常是单例、工厂对象、或系统级入口。
5
+ 本页列出MarginNote插件环境可直接使用的全局变量名。这些全局名对应的对象默认是单例、工厂对象、或系统级入口。
6
6
 
7
7
  > 说明:本页仅做索引。每个对象的完整属性/方法请进入对应参考页。
8
8
 
@@ -42,6 +42,16 @@ description: MarginNote插件运行时直接注入到JS环境的全局变量清
42
42
  <td>数据库访问</td>
43
43
  <td><a href="/reference/global/database/">Database</a></td>
44
44
  </tr>
45
+ <tr>
46
+ <td><code>Document</code></td>
47
+ <td>文档入口别名(等同MbBook)</td>
48
+ <td><a href="/reference/global/document/">Document</a></td>
49
+ </tr>
50
+ <tr>
51
+ <td><code>Notebook</code></td>
52
+ <td>笔记本入口别名(等同MbTopic)</td>
53
+ <td><a href="/reference/global/notebook/">Notebook</a></td>
54
+ </tr>
45
55
  <tr>
46
56
  <td><code>Note</code></td>
47
57
  <td>创建笔记</td>
@@ -59,9 +69,14 @@ description: MarginNote插件运行时直接注入到JS环境的全局变量清
59
69
  </tr>
60
70
  <tr>
61
71
  <td><code>SearchManager</code></td>
62
- <td>搜索与索引(<code>Application.sharedInstance().searchManager</code>)</td>
72
+ <td>搜索与索引</td>
63
73
  <td><a href="/reference/global/search-manager/">SearchManager</a></td>
64
74
  </tr>
75
+ <tr>
76
+ <td><code>AgentTools</code></td>
77
+ <td>工具注册与执行</td>
78
+ <td><a href="/reference/global/agent-tools/">AgentTools</a></td>
79
+ </tr>
65
80
  </tbody>
66
81
  </table>
67
82
 
@@ -207,15 +222,16 @@ description: MarginNote插件运行时直接注入到JS环境的全局变量清
207
222
 
208
223
  ## 其它对象
209
224
 
210
- 本页不再列出Foundation/UIKit/QuartzCore与JavaScript原生环境的全量对象清单;它们的参考条目请在侧边栏对应分组中查阅。下面仅给出常见入口与例子。
225
+ MarginNote插件环境还可用绝大部分的Foundation/UIKit/QuartzCore与JavaScript原生环境,它们的参考条目请在侧边栏对应分组中查阅,下面仅给出常见入口与例子。
211
226
 
212
227
  ### Foundation
213
228
 
214
- 多数Foundation类可直接使用(通常以类/单例形式导出)。例:
229
+ 多数Foundation类可直接使用(默认以类/单例形式导出)。例:
215
230
 
216
231
  - [NSFileManager](/reference/foundation/ns-file-manager/)
217
232
  - [NSData](/reference/foundation/ns-data/)
218
233
  - [NSTimer](/reference/foundation/ns-timer/)
234
+ - [NSUbiquitousKeyValueStore](/reference/foundation/ns-ubiquitous-key-value-store/)
219
235
 
220
236
  ### UIKit
221
237
 
@@ -232,6 +248,7 @@ description: MarginNote插件运行时直接注入到JS环境的全局变量清
232
248
  - [CALayer](/reference/quartzcore/calayer/)
233
249
  - [CAShapeLayer](/reference/quartzcore/cashape-layer/)
234
250
  - [CATransaction](/reference/quartzcore/catransaction/)
251
+ - [CAEmitterLayer](/reference/quartzcore/caemitter-layer/)
235
252
 
236
253
  ### JavaScript原生环境
237
254
 
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  title: JSB
3
- description: JavaScript 桥接核心,连接插件 JS 与运行时对象的入口对象。
3
+ description: JavaScript 桥接核心,连接插件 JS 与宿主对象的入口对象。
4
4
  ---
5
- JSB(JavaScript Bridge)是插件运行时的桥接核心对象:类定义、插件入口、日志与包内脚本加载都通过它完成。
5
+ JSB(JavaScript Bridge)是插件环境的桥接核心对象:类定义、插件入口、日志与包内脚本加载都通过它完成。
6
6
 
7
7
  ## 实例成员 (Instance members)
8
8
 
9
- `JSB` 是全局对象,通常不以“实例化”的方式使用。
9
+ `JSB` 是全局对象,默认不以“实例化”的方式使用。
10
10
 
11
11
  ## 类成员 (Class members)
12
12
 
@@ -14,7 +14,9 @@ JSB(JavaScript Bridge)是插件运行时的桥接核心对象:类定义、
14
14
 
15
15
  ### `defineClass`
16
16
 
17
- 定义一个可被运行时识别并回调的类,**所有插件的入口**。
17
+ 定义一个可被插件环境识别并回调的类,只在插件入口处使用。
18
+
19
+ 注意:该方法定义的类非js的类,this并不会指向该类的实例,而应使用[self](/reference/global/self/) 替代
18
20
 
19
21
  ```javascript
20
22
  defineClass(declaration: string, instanceMembers: object, classMembers?: object): any
@@ -0,0 +1,18 @@
1
+ {
2
+ "title": "全局与入口",
3
+ "pages": [
4
+ "global-variables",
5
+ "jsb",
6
+ "application",
7
+ "search-manager",
8
+ "database",
9
+ "document",
10
+ "notebook",
11
+ "note",
12
+ "agent-tools",
13
+ "popup-menu",
14
+ "popup-menu-item",
15
+ "self",
16
+ "builtin-commands"
17
+ ]
18
+ }
@@ -3,13 +3,13 @@ title: Note
3
3
  description: 全局注入的笔记工厂对象,用于创建新笔记(MbBookNote)。
4
4
  ---
5
5
 
6
- `Note` 是 MarginNote 运行时注入到 JavaScript 环境中的**全局对象**之一,用于创建新笔记。
6
+ `Note` 是 MarginNote 宿主注入到 JavaScript 环境中的**全局对象**之一,用于创建新笔记。
7
7
 
8
8
  需要特别注意:创建笔记的方法**不在** `MbBookNote` 类上,而是在全局 `Note` 对象上(这是由 MarginNote 的 JSExport 导出方式决定的)。
9
9
 
10
10
  ## 实例成员 (Instance members)
11
11
 
12
- `Note` 是全局对象,通常不以实例形式使用。
12
+ `Note` 是全局对象,默认不以实例形式使用。
13
13
 
14
14
  ## 类成员 (Class members)
15
15
 
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: Notebook
3
+ description: 全局别名对象。语义上等同于MbTopic。
4
+ ---
5
+
6
+ `Notebook`是插件环境的全局导出别名,语义上等同于[MbTopic](/reference/marginnote/mb-topic/)。
7
+
8
+ ## 关系说明
9
+
10
+ - `Notebook`与`MbTopic`是同一类主题对象在全局入口层的别名语义,不是两套模型。
11
+ - 主键语义为`topicId/topicid`。
12
+ - 对象生命周期由宿主数据层管理,不把`documents/notes`当强一致缓存长期持有。
13
+
14
+ ## 用法
15
+
16
+ 完整属性与方法请直接参考[MbTopic](/reference/marginnote/mb-topic/)。
17
+
18
+ ## 相关
19
+
20
+ - [MbTopic](/reference/marginnote/mb-topic/)
21
+ - [Database](/reference/global/database/)
@@ -3,14 +3,14 @@ title: PopupMenuItem
3
3
  description: PopupMenu 的菜单项对象(全局注入)。
4
4
  ---
5
5
 
6
- `PopupMenuItem` 是运行时注入的全局类型(对应原生 QBPopupMenuItem)。通常由运行时创建并用于渲染;可读属性包含标题与动作标识。
6
+ `PopupMenuItem` 是宿主注入的全局类型(对应原生 QBPopupMenuItem)。默认由插件环境创建并用于渲染;可读属性包含标题与动作标识。
7
7
 
8
8
  ## 实例成员 (Instance members)
9
9
 
10
10
  | 属性 | 类型 | 说明 |
11
11
  |---|---|---|
12
12
  | `title` | `string` | 显示标题。 |
13
- | `actionString` | `string` | 动作标识字符串(用途依赖运行时)。 |
13
+ | `actionString` | `string` | 动作标识字符串(用途依赖插件环境)。 |
14
14
 
15
15
  ## 相关
16
16
 
@@ -3,7 +3,7 @@ title: PopupMenu
3
3
  description: 轻量弹出菜单视图(全局注入),用于展示一组 PopupMenuItem。
4
4
  ---
5
5
 
6
- `PopupMenu` 是运行时注入的全局类(对应原生 QBPopupMenu)。常用于在指定 rect 附近弹出一组菜单项。
6
+ `PopupMenu` 是宿主注入的全局类(对应原生 QBPopupMenu)。常用于在指定 rect 附近弹出一组菜单项。
7
7
 
8
8
  ## 类成员 (Class members)
9
9
 
@@ -20,19 +20,18 @@ description: 轻量弹出菜单视图(全局注入),用于展示一组 Pop
20
20
  |---|---|---|
21
21
  | `visible` | `boolean` | 是否可见。 |
22
22
  | `items` | `NSArray` | 菜单项列表。 |
23
- | `arrowDirection` | `number` | 箭头方向(枚举值以运行时为准)。 |
24
- | `targetWinRect` | `CGRect` | 目标窗口 rect(只读)。 |
23
+ | `arrowDirection` | `number` | 箭头方向Default/Up/Down/Left/Right,数值 0/1/2/3/4。 |
24
+ | `targetWinRect` | [`CGRect`](/reference/value-sturct/#cgrect) | 目标窗口 rect(只读)。 |
25
25
 
26
26
  ### 方法
27
27
 
28
28
  | 方法 | 参数 | 返回值 | 说明 |
29
29
  |---|---|---|---|
30
- | `showInViewTargetRectAnimated(view, targetRect, animated)` | view: `UIView`, targetRect: `CGRect`, animated: boolean | — | 在 view 中显示。 |
31
- | `updateWithTargetRect(targetRect)` | targetRect: `CGRect` | — | 更新目标 rect。 |
30
+ | `showInViewTargetRectAnimated(view, targetRect, animated)` | view: `UIView`, targetRect: [`CGRect`](/reference/value-sturct/#cgrect), animated: boolean | — | 在 view 中显示。 |
31
+ | `updateWithTargetRect(targetRect)` | targetRect: [`CGRect`](/reference/value-sturct/#cgrect) | — | 更新目标 rect。 |
32
32
  | `dismissAnimated(animated)` | animated: boolean | — | 关闭菜单。 |
33
33
 
34
34
  ## 相关
35
35
 
36
36
  - [PopupMenuItem](/reference/global/popup-menu-item/)
37
37
  - [UIView](/reference/uikit/uiview/)
38
-
@@ -3,7 +3,7 @@ title: SearchManager
3
3
  description: 搜索与索引管理器(全文检索、URL 搜索、相似笔记检索等)。
4
4
  ---
5
5
 
6
- `SearchManager` 通过 `Application.sharedInstance().searchManager` 获取。其返回结构与索引能力会随版本变化;建议先在控制台打印返回值结构再做兼容处理。
6
+ `SearchManager` 通过 `Application.sharedInstance().searchManager` 获取。其返回结构与索引能力会随版本变化;先在控制台打印返回值结构再做兼容处理。
7
7
 
8
8
  ## 实例成员 (Instance members)
9
9
 
@@ -22,9 +22,9 @@ description: 搜索与索引管理器(全文检索、URL 搜索、相似笔记
22
22
  | `searchText(query, titleOnly, topicid, beginsWith, limit)` | 文本搜索。 |
23
23
  | `searchTextNoteOnly(query, titleOnly, topicid, beginsWith, limit, noteOnly)` | 文本搜索(可限定只搜笔记)。 |
24
24
  | `searchTextWordList(textWordLst, titleOnly, topicid, beginsWith, limit)` | 使用分词列表进行搜索。 |
25
- | `searchFts3Text(query, titleOnly, topicid, limit, noteOnly)` | 通过 FTS3 搜索(实现依赖运行时)。 |
26
- | `searchURLs(urls, topicid)` | 按 URL 列表搜索。 |
27
- | `searchPage(query, beginsWith, limit)` | 页内搜索(实现依赖运行时)。 |
25
+ | `searchFts3Text(query, titleOnly, topicid, limit, noteOnly)` | 通过 FTS3 搜索。 |
26
+ | `searchURLs(urls, topicid)` | 按 URL 列表搜索。插件环境`urls`必须为`NSArray`,传原始字符串会报`TypeError: Cannot convert primitive to NSArray`。`topicid`可传`string`或`NSArray`。 |
27
+ | `searchPage(query, beginsWith, limit)` | 页内搜索。 |
28
28
  | `snippetForFts3RowId(rowid)` / `snippetForPageRowId(rowid)` | 获取 snippet(结果摘要)。 |
29
29
 
30
30
  ### 同步与索引
@@ -43,9 +43,15 @@ description: 搜索与索引管理器(全文检索、URL 搜索、相似笔记
43
43
  | `findSimilarNotes(queryVector, topicId, k)` | 向量相似笔记检索。 |
44
44
  | `batchFindSimilarNotes(queryVectors, topicId, k)` | 批量向量相似检索。 |
45
45
  | `findSimilarNotesHybrid(queryVector, queryText, topicId, k, semanticWeight, bm25Weight)` | 语义+BM25 混合检索。 |
46
- | `loadVectorCacheForTopic(topicId)` / `syncTopicVectorsForceCompletion(topicId, force, completion)` / `invalidateVectorCacheForTopics(topicIds)` | 向量缓存相关(实现依赖运行时)。 |
46
+ | `loadVectorCacheForTopic(topicId)` / `syncTopicVectorsForceCompletion(topicId, force, completion)` / `invalidateVectorCacheForTopics(topicIds)` | 向量缓存相关。 |
47
+
48
+ ### 已确认行为
49
+
50
+ - `searchPage(...)`有命中时返回数组对象,无命中时返回空数组。
51
+ - `searchPage("", ...)`返回`undefined`,不是空数组。
52
+ - 当前样本中`searchFts3Text(...)`有命中与无命中都会返回空数组,结果受索引状态影响较大。
53
+ - `snippetForFts3RowId(rowid)`与`snippetForPageRowId(rowid)`在当前样本中返回`undefined`。
47
54
 
48
55
  ## 相关
49
56
 
50
57
  - [Application](/reference/global/application/) — `Application.sharedInstance().searchManager`
51
-
@@ -3,19 +3,7 @@ title: self
3
3
  description: 在 JSExtension 实例方法内指向当前插件实例的上下文。
4
4
  ---
5
5
 
6
- 在 `JSB.defineClass` 定义的**实例方法**内部,`self` 指向该插件类的当前实例。用于访问插件自身的 `window` 以及你在实例上挂载的属性(如自定义的 viewController、layout 函数等)。
7
-
8
- ## 实例成员 (Instance members)
9
-
10
- ### 属性
11
-
12
- | 属性 | 类型 | 说明 |
13
- |------|------|------|
14
- | `window` | `UIWindow` | 当前插件所在窗口。常与 `Application.sharedInstance().studyController(self.window)` 配合获取学习控制器。 |
15
-
16
- ## 类成员 (Class members)
17
-
18
- `self` 是实例上下文变量,不以类成员形式存在。
6
+ 在 `JSB.defineClass` 定义的**实例方法**内部,`self` 指向该类的当前实例,用于访问定义的类实例属性。
19
7
 
20
8
  ## 说明
21
9
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: JavaScript原生环境
3
- description: MarginNote插件运行时的JavaScriptCore能力边界、内置对象与常见误区。
3
+ description: MarginNote插件环境的JavaScriptCore能力边界、内置对象与常见问题。
4
4
  ---
5
- MarginNote插件运行在JavaScriptCore中,而不是浏览器环境。这意味着标准JavaScript内置对象可用,但浏览器相关API通常不存在,且宿主会额外注入自己的对象与能力。
5
+ MarginNote插件运行在JavaScriptCore中,而不是浏览器环境。这意味着标准JavaScript内置对象可用,但浏览器相关API默认不存在,且宿主会额外注入自己的对象与能力。
6
6
 
7
7
  ## 内置对象一览
8
8
 
@@ -73,12 +73,13 @@ MarginNote插件运行在JavaScriptCore中,而不是浏览器环境。这意
73
73
  | [NaN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/NaN) | 非数值常量 |
74
74
  | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined) | 未定义常量 |
75
75
 
76
- ## 环境差异与建议
76
+ ## 环境差异与规范
77
77
 
78
78
  - 插件环境没有原生fetch。需要网络请求时,请使用文档提供的网络请求API。
79
- - 插件环境没有setTimeout/setInterval。建议使用NSTimer完成延时与轮询。
79
+ - 插件环境没有setTimeout/setInterval。使用NSTimer完成延时与轮询。
80
80
 
81
81
  ## 相关
82
82
 
83
83
  - [NSTimer](/reference/foundation/ns-timer/)
84
84
  - [网络请求](/guides/network-requests/)
85
+ - [Value Sturct](/reference/value-sturct/)