mn-docs-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +4 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +11 -0
- package/README.md +99 -0
- package/astro.config.mjs +126 -0
- package/package.json +30 -0
- package/pnpm-workspace.yaml +4 -0
- package/public/favicon.svg +1 -0
- package/scripts/mcp/build-index.mjs +9 -0
- package/scripts/mcp/cli.mjs +61 -0
- package/scripts/mcp/lib.mjs +303 -0
- package/scripts/mcp/server-http.mjs +74 -0
- package/scripts/mcp/server.mjs +91 -0
- package/src/assets/houston.webp +0 -0
- package/src/client/jsb-api-footer.ts +242 -0
- package/src/components/Footer.astro +57 -0
- package/src/components/Search.astro +330 -0
- package/src/content/docs/guides/contributing.md +82 -0
- package/src/content/docs/guides/cookbook/addon-settings.md +53 -0
- package/src/content/docs/guides/cookbook/append-selection-as-comment.md +46 -0
- package/src/content/docs/guides/cookbook/batch-rename-notes.md +53 -0
- package/src/content/docs/guides/cookbook/embed-webview-panel.md +158 -0
- package/src/content/docs/guides/cookbook/export-notebook.md +48 -0
- package/src/content/docs/guides/cookbook/focus-note-in-mindmap.md +34 -0
- package/src/content/docs/guides/cookbook/network-api-call.md +135 -0
- package/src/content/docs/guides/cookbook/webview-bidirectional-js.md +112 -0
- package/src/content/docs/guides/getting-started.md +88 -0
- package/src/content/docs/guides/lifecycle-and-window.md +76 -0
- package/src/content/docs/guides/mindmap-and-selection.md +76 -0
- package/src/content/docs/guides/native-ui.md +136 -0
- package/src/content/docs/guides/network-requests.md +309 -0
- package/src/content/docs/guides/notes-and-database.md +99 -0
- package/src/content/docs/guides/shortcut-keys.md +105 -0
- package/src/content/docs/guides/storage-and-files.md +91 -0
- package/src/content/docs/guides/toolbar-and-commands.md +64 -0
- package/src/content/docs/index.mdx +44 -0
- package/src/content/docs/reference/black-box.md +19 -0
- package/src/content/docs/reference/foundation/ns-array.md +699 -0
- package/src/content/docs/reference/foundation/ns-attributed-string.md +379 -0
- package/src/content/docs/reference/foundation/ns-character-set.md +436 -0
- package/src/content/docs/reference/foundation/ns-counted-set.md +78 -0
- package/src/content/docs/reference/foundation/ns-data.md +183 -0
- package/src/content/docs/reference/foundation/ns-date-components.md +24 -0
- package/src/content/docs/reference/foundation/ns-date-formatter.md +70 -0
- package/src/content/docs/reference/foundation/ns-date.md +236 -0
- package/src/content/docs/reference/foundation/ns-decimal-number.md +437 -0
- package/src/content/docs/reference/foundation/ns-dictionary.md +376 -0
- package/src/content/docs/reference/foundation/ns-enumerator.md +36 -0
- package/src/content/docs/reference/foundation/ns-error.md +75 -0
- package/src/content/docs/reference/foundation/ns-file-handle.md +445 -0
- package/src/content/docs/reference/foundation/ns-file-manager.md +275 -0
- package/src/content/docs/reference/foundation/ns-formatter.md +131 -0
- package/src/content/docs/reference/foundation/ns-hash-table.md +304 -0
- package/src/content/docs/reference/foundation/ns-http-url-response.md +73 -0
- package/src/content/docs/reference/foundation/ns-index-path.md +185 -0
- package/src/content/docs/reference/foundation/ns-index-set.md +527 -0
- package/src/content/docs/reference/foundation/ns-json-serialization.md +24 -0
- package/src/content/docs/reference/foundation/ns-keyed-archiver.md +364 -0
- package/src/content/docs/reference/foundation/ns-keyed-unarchiver.md +324 -0
- package/src/content/docs/reference/foundation/ns-locale.md +82 -0
- package/src/content/docs/reference/foundation/ns-map-table.md +216 -0
- package/src/content/docs/reference/foundation/ns-mutable-array.md +452 -0
- package/src/content/docs/reference/foundation/ns-mutable-attributed-string.md +336 -0
- package/src/content/docs/reference/foundation/ns-mutable-character-set.md +132 -0
- package/src/content/docs/reference/foundation/ns-mutable-data.md +206 -0
- package/src/content/docs/reference/foundation/ns-mutable-dictionary.md +176 -0
- package/src/content/docs/reference/foundation/ns-mutable-index-set.md +155 -0
- package/src/content/docs/reference/foundation/ns-mutable-ordered-set.md +465 -0
- package/src/content/docs/reference/foundation/ns-mutable-set.md +189 -0
- package/src/content/docs/reference/foundation/ns-mutable-string.md +190 -0
- package/src/content/docs/reference/foundation/ns-mutable-url-request.md +26 -0
- package/src/content/docs/reference/foundation/ns-notification-center.md +30 -0
- package/src/content/docs/reference/foundation/ns-notification.md +73 -0
- package/src/content/docs/reference/foundation/ns-null.md +24 -0
- package/src/content/docs/reference/foundation/ns-number-formatter.md +147 -0
- package/src/content/docs/reference/foundation/ns-number.md +393 -0
- package/src/content/docs/reference/foundation/ns-operation-queue.md +227 -0
- package/src/content/docs/reference/foundation/ns-operation.md +248 -0
- package/src/content/docs/reference/foundation/ns-ordered-set.md +706 -0
- package/src/content/docs/reference/foundation/ns-pointer-array.md +192 -0
- package/src/content/docs/reference/foundation/ns-predicate.md +199 -0
- package/src/content/docs/reference/foundation/ns-proxy.md +178 -0
- package/src/content/docs/reference/foundation/ns-scanner.md +448 -0
- package/src/content/docs/reference/foundation/ns-set.md +586 -0
- package/src/content/docs/reference/foundation/ns-simple-c-string.md +20 -0
- package/src/content/docs/reference/foundation/ns-time-zone.md +86 -0
- package/src/content/docs/reference/foundation/ns-timer.md +24 -0
- package/src/content/docs/reference/foundation/ns-url-components.md +80 -0
- package/src/content/docs/reference/foundation/ns-url-connection.md +169 -0
- package/src/content/docs/reference/foundation/ns-url-request.md +224 -0
- package/src/content/docs/reference/foundation/ns-url-response.md +97 -0
- package/src/content/docs/reference/foundation/ns-url.md +31 -0
- package/src/content/docs/reference/foundation/ns-user-defaults.md +302 -0
- package/src/content/docs/reference/foundation/ns-uuid.md +52 -0
- package/src/content/docs/reference/foundation/ns-value.md +194 -0
- package/src/content/docs/reference/global/application.md +301 -0
- package/src/content/docs/reference/global/builtin-commands.md +294 -0
- package/src/content/docs/reference/global/database.md +395 -0
- package/src/content/docs/reference/global/global-variables.md +32 -0
- package/src/content/docs/reference/global/jsb.md +89 -0
- package/src/content/docs/reference/global/note.md +64 -0
- package/src/content/docs/reference/global/popup-menu-item.md +18 -0
- package/src/content/docs/reference/global/popup-menu.md +38 -0
- package/src/content/docs/reference/global/search-manager.md +51 -0
- package/src/content/docs/reference/global/self.md +28 -0
- package/src/content/docs/reference/js-runtime.md +28 -0
- package/src/content/docs/reference/marginnote/document-controller.md +45 -0
- package/src/content/docs/reference/marginnote/jsextension.md +119 -0
- package/src/content/docs/reference/marginnote/mb-book-note.md +192 -0
- package/src/content/docs/reference/marginnote/mb-book.md +35 -0
- package/src/content/docs/reference/marginnote/mb-model-tool.md +66 -0
- package/src/content/docs/reference/marginnote/mb-topic.md +36 -0
- package/src/content/docs/reference/marginnote/mindmap-node.md +27 -0
- package/src/content/docs/reference/marginnote/mindmap-view.md +24 -0
- package/src/content/docs/reference/marginnote/note-comment.md +29 -0
- package/src/content/docs/reference/marginnote/notebook-controller.md +36 -0
- package/src/content/docs/reference/marginnote/outline-view.md +23 -0
- package/src/content/docs/reference/marginnote/reader-controller.md +26 -0
- package/src/content/docs/reference/marginnote/study-controller.md +100 -0
- package/src/content/docs/reference/quartzcore/caanimation-group.md +44 -0
- package/src/content/docs/reference/quartzcore/caanimation.md +23 -0
- package/src/content/docs/reference/quartzcore/cabasic-animation.md +19 -0
- package/src/content/docs/reference/quartzcore/cagradient-layer.md +27 -0
- package/src/content/docs/reference/quartzcore/cakeyframe-animation.md +19 -0
- package/src/content/docs/reference/quartzcore/calayer.md +135 -0
- package/src/content/docs/reference/quartzcore/camedia-timing-function.md +25 -0
- package/src/content/docs/reference/quartzcore/caproperty-animation.md +46 -0
- package/src/content/docs/reference/quartzcore/careplicator-layer.md +27 -0
- package/src/content/docs/reference/quartzcore/cascroll-layer.md +21 -0
- package/src/content/docs/reference/quartzcore/cashape-layer.md +34 -0
- package/src/content/docs/reference/quartzcore/catext-layer.md +28 -0
- package/src/content/docs/reference/quartzcore/catiled-layer.md +26 -0
- package/src/content/docs/reference/quartzcore/catransaction.md +46 -0
- package/src/content/docs/reference/quartzcore/catransform-layer.md +18 -0
- package/src/content/docs/reference/quartzcore/catransition.md +44 -0
- package/src/content/docs/reference/quartzcore/cavalue-function.md +22 -0
- package/src/content/docs/reference/uikit/ns-mutable-paragraph-style.md +20 -0
- package/src/content/docs/reference/uikit/ns-paragraph-style.md +20 -0
- package/src/content/docs/reference/uikit/ns-text-storage.md +20 -0
- package/src/content/docs/reference/uikit/uiactivity-indicator-view.md +20 -0
- package/src/content/docs/reference/uikit/uialertview.md +25 -0
- package/src/content/docs/reference/uikit/uiapplication.md +128 -0
- package/src/content/docs/reference/uikit/uibar-button-item.md +20 -0
- package/src/content/docs/reference/uikit/uibar-item.md +20 -0
- package/src/content/docs/reference/uikit/uibezier-path.md +143 -0
- package/src/content/docs/reference/uikit/uibutton.md +27 -0
- package/src/content/docs/reference/uikit/uicollection-view-cell.md +24 -0
- package/src/content/docs/reference/uikit/uicollection-view-controller.md +32 -0
- package/src/content/docs/reference/uikit/uicollection-view-layout-attributes.md +43 -0
- package/src/content/docs/reference/uikit/uicollection-view-layout.md +60 -0
- package/src/content/docs/reference/uikit/uicollection-view.md +83 -0
- package/src/content/docs/reference/uikit/uicolor.md +23 -0
- package/src/content/docs/reference/uikit/uicontrol.md +20 -0
- package/src/content/docs/reference/uikit/uidate-picker.md +37 -0
- package/src/content/docs/reference/uikit/uidevice.md +83 -0
- package/src/content/docs/reference/uikit/uievent.md +36 -0
- package/src/content/docs/reference/uikit/uifont.md +39 -0
- package/src/content/docs/reference/uikit/uigesture-recognizer.md +152 -0
- package/src/content/docs/reference/uikit/uiimage-picker-controller.md +41 -0
- package/src/content/docs/reference/uikit/uiimage-view.md +38 -0
- package/src/content/docs/reference/uikit/uiimage.md +58 -0
- package/src/content/docs/reference/uikit/uikey-command.md +31 -0
- package/src/content/docs/reference/uikit/uilabel.md +27 -0
- package/src/content/docs/reference/uikit/uilocal-notification.md +28 -0
- package/src/content/docs/reference/uikit/uilong-press-gesture-recognizer.md +25 -0
- package/src/content/docs/reference/uikit/uinavigation-bar.md +52 -0
- package/src/content/docs/reference/uikit/uinavigation-controller.md +46 -0
- package/src/content/docs/reference/uikit/uinavigation-item.md +42 -0
- package/src/content/docs/reference/uikit/uipage-control.md +35 -0
- package/src/content/docs/reference/uikit/uipage-view-controller.md +37 -0
- package/src/content/docs/reference/uikit/uipan-gesture-recognizer.md +32 -0
- package/src/content/docs/reference/uikit/uipasteboard.md +24 -0
- package/src/content/docs/reference/uikit/uipicker-view.md +37 -0
- package/src/content/docs/reference/uikit/uipinch-gesture-recognizer.md +23 -0
- package/src/content/docs/reference/uikit/uipopover-controller.md +39 -0
- package/src/content/docs/reference/uikit/uiresponder.md +20 -0
- package/src/content/docs/reference/uikit/uirotation-gesture-recognizer.md +23 -0
- package/src/content/docs/reference/uikit/uiscreen-mode.md +17 -0
- package/src/content/docs/reference/uikit/uiscreen.md +65 -0
- package/src/content/docs/reference/uikit/uiscrollview.md +134 -0
- package/src/content/docs/reference/uikit/uisearch-bar.md +58 -0
- package/src/content/docs/reference/uikit/uisegmented-control.md +64 -0
- package/src/content/docs/reference/uikit/uislider.md +50 -0
- package/src/content/docs/reference/uikit/uiswipe-gesture-recognizer.md +23 -0
- package/src/content/docs/reference/uikit/uiswitch.md +22 -0
- package/src/content/docs/reference/uikit/uitab-bar-controller.md +39 -0
- package/src/content/docs/reference/uikit/uitab-bar-item.md +34 -0
- package/src/content/docs/reference/uikit/uitab-bar.md +44 -0
- package/src/content/docs/reference/uikit/uitable-view-cell.md +57 -0
- package/src/content/docs/reference/uikit/uitable-view-controller.md +30 -0
- package/src/content/docs/reference/uikit/uitable-view.md +100 -0
- package/src/content/docs/reference/uikit/uitap-gesture-recognizer.md +20 -0
- package/src/content/docs/reference/uikit/uitext-input-mode.md +47 -0
- package/src/content/docs/reference/uikit/uitext-position.md +44 -0
- package/src/content/docs/reference/uikit/uitext-range.md +42 -0
- package/src/content/docs/reference/uikit/uitext-view.md +46 -0
- package/src/content/docs/reference/uikit/uitextfield.md +32 -0
- package/src/content/docs/reference/uikit/uitoolbar.md +35 -0
- package/src/content/docs/reference/uikit/uitouch.md +39 -0
- package/src/content/docs/reference/uikit/uiview-controller.md +36 -0
- package/src/content/docs/reference/uikit/uiview.md +47 -0
- package/src/content/docs/reference/uikit/uiwebview.md +229 -0
- package/src/content/docs/reference/uikit/uiwindow.md +47 -0
- package/src/content/docs/reference/utility/menu-controller.md +27 -0
- package/src/content/docs/reference/utility/speech-manager.md +118 -0
- package/src/content/docs/reference/utility/sqlite-database.md +201 -0
- package/src/content/docs/reference/utility/sqlite-result-set.md +266 -0
- package/src/content/docs/reference/utility/sqlite-statement.md +44 -0
- package/src/content/docs/reference/utility/undo-manager.md +89 -0
- package/src/content/docs/reference/utility/zip-archive.md +29 -0
- package/src/content.config.ts +7 -0
- package/src/definitions/Foundation/JSBFoundation.h +9 -0
- package/src/definitions/Foundation/JSBFoundation.m +530 -0
- package/src/definitions/Foundation/JSBNSArray.h +81 -0
- package/src/definitions/Foundation/JSBNSAssertionHandler.h +23 -0
- package/src/definitions/Foundation/JSBNSAttributedString.h +42 -0
- package/src/definitions/Foundation/JSBNSBlockOperation.h +20 -0
- package/src/definitions/Foundation/JSBNSBundle.h +80 -0
- package/src/definitions/Foundation/JSBNSByteCountFormatter.h +28 -0
- package/src/definitions/Foundation/JSBNSCache.h +31 -0
- package/src/definitions/Foundation/JSBNSCachedURLResponse.h +22 -0
- package/src/definitions/Foundation/JSBNSCalendar.h +88 -0
- package/src/definitions/Foundation/JSBNSCharacterSet.h +50 -0
- package/src/definitions/Foundation/JSBNSCoder.h +88 -0
- package/src/definitions/Foundation/JSBNSComparisonPredicate.h +27 -0
- package/src/definitions/Foundation/JSBNSCompoundPredicate.h +23 -0
- package/src/definitions/Foundation/JSBNSCondition.h +22 -0
- package/src/definitions/Foundation/JSBNSConditionLock.h +26 -0
- package/src/definitions/Foundation/JSBNSConstantString.h +18 -0
- package/src/definitions/Foundation/JSBNSCountedSet.h +21 -0
- package/src/definitions/Foundation/JSBNSData.h +44 -0
- package/src/definitions/Foundation/JSBNSDataDetector.h +20 -0
- package/src/definitions/Foundation/JSBNSDate.h +37 -0
- package/src/definitions/Foundation/JSBNSDateComponents.h +56 -0
- package/src/definitions/Foundation/JSBNSDateFormatter.h +91 -0
- package/src/definitions/Foundation/JSBNSDecimalNumber.h +47 -0
- package/src/definitions/Foundation/JSBNSDecimalNumberHandler.h +23 -0
- package/src/definitions/Foundation/JSBNSDictionary.h +79 -0
- package/src/definitions/Foundation/JSBNSDirectoryEnumerator.h +25 -0
- package/src/definitions/Foundation/JSBNSEnumerator.h +18 -0
- package/src/definitions/Foundation/JSBNSError.h +28 -0
- package/src/definitions/Foundation/JSBNSException.h +30 -0
- package/src/definitions/Foundation/JSBNSExpression.h +48 -0
- package/src/definitions/Foundation/JSBNSFileCoordinator.h +29 -0
- package/src/definitions/Foundation/JSBNSFileHandle.h +51 -0
- package/src/definitions/Foundation/JSBNSFileManager.h +82 -0
- package/src/definitions/Foundation/JSBNSFileSecurity.h +32 -0
- package/src/definitions/Foundation/JSBNSFileVersion.h +35 -0
- package/src/definitions/Foundation/JSBNSFileWrapper.h +41 -0
- package/src/definitions/Foundation/JSBNSFormatter.h +23 -0
- package/src/definitions/Foundation/JSBNSHTTPCookie.h +34 -0
- package/src/definitions/Foundation/JSBNSHTTPCookieStorage.h +26 -0
- package/src/definitions/Foundation/JSBNSHTTPURLResponse.h +21 -0
- package/src/definitions/Foundation/JSBNSHashTable.h +38 -0
- package/src/definitions/Foundation/JSBNSIndexPath.h +34 -0
- package/src/definitions/Foundation/JSBNSIndexSet.h +47 -0
- package/src/definitions/Foundation/JSBNSInputStream.h +28 -0
- package/src/definitions/Foundation/JSBNSInvocation.h +32 -0
- package/src/definitions/Foundation/JSBNSInvocationOperation.h +20 -0
- package/src/definitions/Foundation/JSBNSJSONSerialization.h +19 -0
- package/src/definitions/Foundation/JSBNSKeyedArchiver.h +40 -0
- package/src/definitions/Foundation/JSBNSKeyedUnarchiver.h +38 -0
- package/src/definitions/Foundation/JSBNSLinguisticTagger.h +31 -0
- package/src/definitions/Foundation/JSBNSLocale.h +39 -0
- package/src/definitions/Foundation/JSBNSLock.h +20 -0
- package/src/definitions/Foundation/JSBNSMachPort.h +26 -0
- package/src/definitions/Foundation/JSBNSMapTable.h +34 -0
- package/src/definitions/Foundation/JSBNSMessagePort.h +15 -0
- package/src/definitions/Foundation/JSBNSMetadataItem.h +22 -0
- package/src/definitions/Foundation/JSBNSMetadataQuery.h +53 -0
- package/src/definitions/Foundation/JSBNSMetadataQueryAttributeValueTuple.h +21 -0
- package/src/definitions/Foundation/JSBNSMetadataQueryResultGroup.h +24 -0
- package/src/definitions/Foundation/JSBNSMethodSignature.h +24 -0
- package/src/definitions/Foundation/JSBNSMutableArray.h +51 -0
- package/src/definitions/Foundation/JSBNSMutableAttributedString.h +39 -0
- package/src/definitions/Foundation/JSBNSMutableCharacterSet.h +26 -0
- package/src/definitions/Foundation/JSBNSMutableData.h +29 -0
- package/src/definitions/Foundation/JSBNSMutableDictionary.h +29 -0
- package/src/definitions/Foundation/JSBNSMutableIndexSet.h +25 -0
- package/src/definitions/Foundation/JSBNSMutableOrderedSet.h +50 -0
- package/src/definitions/Foundation/JSBNSMutableSet.h +28 -0
- package/src/definitions/Foundation/JSBNSMutableString.h +31 -0
- package/src/definitions/Foundation/JSBNSMutableURLRequest.h +38 -0
- package/src/definitions/Foundation/JSBNSNetService.h +43 -0
- package/src/definitions/Foundation/JSBNSNetServiceBrowser.h +33 -0
- package/src/definitions/Foundation/JSBNSNotification.h +23 -0
- package/src/definitions/Foundation/JSBNSNotificationCenter.h +27 -0
- package/src/definitions/Foundation/JSBNSNotificationQueue.h +22 -0
- package/src/definitions/Foundation/JSBNSNull.h +17 -0
- package/src/definitions/Foundation/JSBNSNumber.h +51 -0
- package/src/definitions/Foundation/JSBNSNumberFormatter.h +136 -0
- package/src/definitions/Foundation/JSBNSOperation.h +34 -0
- package/src/definitions/Foundation/JSBNSOperationQueue.h +32 -0
- package/src/definitions/Foundation/JSBNSOrderedSet.h +70 -0
- package/src/definitions/Foundation/JSBNSOrthography.h +27 -0
- package/src/definitions/Foundation/JSBNSOutputStream.h +33 -0
- package/src/definitions/Foundation/JSBNSPipe.h +26 -0
- package/src/definitions/Foundation/JSBNSPointerArray.h +33 -0
- package/src/definitions/Foundation/JSBNSPort.h +27 -0
- package/src/definitions/Foundation/JSBNSPredicate.h +31 -0
- package/src/definitions/Foundation/JSBNSProcessInfo.h +42 -0
- package/src/definitions/Foundation/JSBNSProgress.h +45 -0
- package/src/definitions/Foundation/JSBNSPropertyListSerialization.h +24 -0
- package/src/definitions/Foundation/JSBNSProxy.h +29 -0
- package/src/definitions/Foundation/JSBNSPurgeableData.h +16 -0
- package/src/definitions/Foundation/JSBNSRecursiveLock.h +20 -0
- package/src/definitions/Foundation/JSBNSRegularExpression.h +35 -0
- package/src/definitions/Foundation/JSBNSRunLoop.h +38 -0
- package/src/definitions/Foundation/JSBNSScanner.h +44 -0
- package/src/definitions/Foundation/JSBNSSet.h +52 -0
- package/src/definitions/Foundation/JSBNSSimpleCString.h +18 -0
- package/src/definitions/Foundation/JSBNSSortDescriptor.h +32 -0
- package/src/definitions/Foundation/JSBNSStream.h +26 -0
- package/src/definitions/Foundation/JSBNSString.h +178 -0
- package/src/definitions/Foundation/JSBNSTextCheckingResult.h +52 -0
- package/src/definitions/Foundation/JSBNSThread.h +46 -0
- package/src/definitions/Foundation/JSBNSTimeZone.h +46 -0
- package/src/definitions/Foundation/JSBNSTimer.h +29 -0
- package/src/definitions/Foundation/JSBNSURL.h +110 -0
- package/src/definitions/Foundation/JSBNSURLAuthenticationChallenge.h +24 -0
- package/src/definitions/Foundation/JSBNSURLCache.h +30 -0
- package/src/definitions/Foundation/JSBNSURLComponents.h +38 -0
- package/src/definitions/Foundation/JSBNSURLConnection.h +45 -0
- package/src/definitions/Foundation/JSBNSURLCredential.h +30 -0
- package/src/definitions/Foundation/JSBNSURLCredentialStorage.h +25 -0
- package/src/definitions/Foundation/JSBNSURLProtectionSpace.h +29 -0
- package/src/definitions/Foundation/JSBNSURLProtocol.h +32 -0
- package/src/definitions/Foundation/JSBNSURLRequest.h +40 -0
- package/src/definitions/Foundation/JSBNSURLResponse.h +22 -0
- package/src/definitions/Foundation/JSBNSURLSession.h +103 -0
- package/src/definitions/Foundation/JSBNSURLSessionConfiguration.h +58 -0
- package/src/definitions/Foundation/JSBNSURLSessionDataTask.h +18 -0
- package/src/definitions/Foundation/JSBNSURLSessionDownloadTask.h +20 -0
- package/src/definitions/Foundation/JSBNSURLSessionTask.h +58 -0
- package/src/definitions/Foundation/JSBNSURLSessionUploadTask.h +18 -0
- package/src/definitions/Foundation/JSBNSUUID.h +22 -0
- package/src/definitions/Foundation/JSBNSUbiquitousKeyValueStore.h +37 -0
- package/src/definitions/Foundation/JSBNSUndoManager.h +50 -0
- package/src/definitions/Foundation/JSBNSUserDefaults.h +52 -0
- package/src/definitions/Foundation/JSBNSValue.h +53 -0
- package/src/definitions/Foundation/JSBNSValueTransformer.h +24 -0
- package/src/definitions/Foundation/JSBNSXMLParser.h +34 -0
- package/src/definitions/JSBApplication.h +59 -0
- package/src/definitions/JSBDocumentController.h +32 -0
- package/src/definitions/JSBJSExtension.h +34 -0
- package/src/definitions/JSBMNFileSystem.h +50 -0
- package/src/definitions/JSBMNFileSystem.m +267 -0
- package/src/definitions/JSBMarginNote.h +9 -0
- package/src/definitions/JSBMarginNote.m +183 -0
- package/src/definitions/JSBMbBook.h +22 -0
- package/src/definitions/JSBMbBookNote.h +78 -0
- package/src/definitions/JSBMbModelTool.h +47 -0
- package/src/definitions/JSBMbTopic.h +28 -0
- package/src/definitions/JSBMenuController.h +21 -0
- package/src/definitions/JSBMindMapNode.h +20 -0
- package/src/definitions/JSBMindMapView.h +15 -0
- package/src/definitions/JSBNotebookController.h +22 -0
- package/src/definitions/JSBOutlineView.h +14 -0
- package/src/definitions/JSBPopupMenu.h +37 -0
- package/src/definitions/JSBPopupMenuItem.h +19 -0
- package/src/definitions/JSBReaderController.h +18 -0
- package/src/definitions/JSBSQLite.h +109 -0
- package/src/definitions/JSBSearchManager.h +55 -0
- package/src/definitions/JSBSearchManager.m +4 -0
- package/src/definitions/JSBSpeechManager.h +31 -0
- package/src/definitions/JSBStudyController.h +32 -0
- package/src/definitions/JSBUndoManager.h +23 -0
- package/src/definitions/JSBZipArchive.h +28 -0
- package/src/definitions/QuartzCore/JSBCAAnimation.h +21 -0
- package/src/definitions/QuartzCore/JSBCAAnimationGroup.h +37 -0
- package/src/definitions/QuartzCore/JSBCABasicAnimation.h +16 -0
- package/src/definitions/QuartzCore/JSBCADisplayLink.h +26 -0
- package/src/definitions/QuartzCore/JSBCAEAGLLayer.h +16 -0
- package/src/definitions/QuartzCore/JSBCAEmitterBehavior.h +24 -0
- package/src/definitions/QuartzCore/JSBCAEmitterCell.h +40 -0
- package/src/definitions/QuartzCore/JSBCAEmitterLayer.h +31 -0
- package/src/definitions/QuartzCore/JSBCAGradientLayer.h +20 -0
- package/src/definitions/QuartzCore/JSBCAKeyframeAnimation.h +16 -0
- package/src/definitions/QuartzCore/JSBCALayer.h +98 -0
- package/src/definitions/QuartzCore/JSBCAMediaTimingFunction.h +22 -0
- package/src/definitions/QuartzCore/JSBCAPropertyAnimation.h +39 -0
- package/src/definitions/QuartzCore/JSBCAReplicatorLayer.h +23 -0
- package/src/definitions/QuartzCore/JSBCAScrollLayer.h +18 -0
- package/src/definitions/QuartzCore/JSBCAShapeLayer.h +27 -0
- package/src/definitions/QuartzCore/JSBCATextLayer.h +23 -0
- package/src/definitions/QuartzCore/JSBCATiledLayer.h +21 -0
- package/src/definitions/QuartzCore/JSBCATransaction.h +32 -0
- package/src/definitions/QuartzCore/JSBCATransformLayer.h +15 -0
- package/src/definitions/QuartzCore/JSBCATransition.h +37 -0
- package/src/definitions/QuartzCore/JSBCAValueFunction.h +20 -0
- package/src/definitions/QuartzCore/JSBQuartzCore.h +9 -0
- package/src/definitions/QuartzCore/JSBQuartzCore.m +106 -0
- package/src/definitions/UIKit/JSBNSLayoutConstraint.h +30 -0
- package/src/definitions/UIKit/JSBNSLayoutManager.h +94 -0
- package/src/definitions/UIKit/JSBNSMutableParagraphStyle.h +16 -0
- package/src/definitions/UIKit/JSBNSParagraphStyle.h +37 -0
- package/src/definitions/UIKit/JSBNSShadow.h +20 -0
- package/src/definitions/UIKit/JSBNSStringDrawingContext.h +22 -0
- package/src/definitions/UIKit/JSBNSTextAttachment.h +24 -0
- package/src/definitions/UIKit/JSBNSTextContainer.h +27 -0
- package/src/definitions/UIKit/JSBNSTextStorage.h +31 -0
- package/src/definitions/UIKit/JSBNSTextTab.h +38 -0
- package/src/definitions/UIKit/JSBUIAcceleration.h +24 -0
- package/src/definitions/UIKit/JSBUIAccelerometer.h +28 -0
- package/src/definitions/UIKit/JSBUIAccessibilityElement.h +24 -0
- package/src/definitions/UIKit/JSBUIActionSheet.h +37 -0
- package/src/definitions/UIKit/JSBUIActivity.h +26 -0
- package/src/definitions/UIKit/JSBUIActivityIndicatorView.h +22 -0
- package/src/definitions/UIKit/JSBUIActivityItemProvider.h +22 -0
- package/src/definitions/UIKit/JSBUIActivityViewController.h +20 -0
- package/src/definitions/UIKit/JSBUIAlertView.h +39 -0
- package/src/definitions/UIKit/JSBUIApplication.h +37 -0
- package/src/definitions/UIKit/JSBUIAttachmentBehavior.h +26 -0
- package/src/definitions/UIKit/JSBUIBarButtonItem.h +48 -0
- package/src/definitions/UIKit/JSBUIBarItem.h +26 -0
- package/src/definitions/UIKit/JSBUIBezierPath.h +55 -0
- package/src/definitions/UIKit/JSBUIButton.h +51 -0
- package/src/definitions/UIKit/JSBUICollectionReusableView.h +26 -0
- package/src/definitions/UIKit/JSBUICollectionView.h +53 -0
- package/src/definitions/UIKit/JSBUICollectionViewCell.h +14 -0
- package/src/definitions/UIKit/JSBUICollectionViewController.h +21 -0
- package/src/definitions/UIKit/JSBUICollectionViewFlowLayout.h +29 -0
- package/src/definitions/UIKit/JSBUICollectionViewFlowLayoutInvalidationContext.h +25 -0
- package/src/definitions/UIKit/JSBUICollectionViewLayout.h +58 -0
- package/src/definitions/UIKit/JSBUICollectionViewLayoutAttributes.h +40 -0
- package/src/definitions/UIKit/JSBUICollectionViewLayoutInvalidationContext.h +36 -0
- package/src/definitions/UIKit/JSBUICollectionViewTransitionLayout.h +15 -0
- package/src/definitions/UIKit/JSBUICollectionViewUpdateItem.h +36 -0
- package/src/definitions/UIKit/JSBUICollisionBehavior.h +30 -0
- package/src/definitions/UIKit/JSBUIColor.h +67 -0
- package/src/definitions/UIKit/JSBUIControl.h +39 -0
- package/src/definitions/UIKit/JSBUIDatePicker.h +26 -0
- package/src/definitions/UIKit/JSBUIDevice.h +37 -0
- package/src/definitions/UIKit/JSBUIDictationPhrase.h +38 -0
- package/src/definitions/UIKit/JSBUIDocument.h +46 -0
- package/src/definitions/UIKit/JSBUIDocumentInteractionController.h +32 -0
- package/src/definitions/UIKit/JSBUIDynamicAnimator.h +27 -0
- package/src/definitions/UIKit/JSBUIDynamicBehavior.h +27 -0
- package/src/definitions/UIKit/JSBUIDynamicItemBehavior.h +30 -0
- package/src/definitions/UIKit/JSBUIEvent.h +24 -0
- package/src/definitions/UIKit/JSBUIFont.h +30 -0
- package/src/definitions/UIKit/JSBUIFontDescriptor.h +36 -0
- package/src/definitions/UIKit/JSBUIGestureRecognizer.h +44 -0
- package/src/definitions/UIKit/JSBUIGravityBehavior.h +24 -0
- package/src/definitions/UIKit/JSBUIImage.h +59 -0
- package/src/definitions/UIKit/JSBUIImagePickerController.h +30 -0
- package/src/definitions/UIKit/JSBUIImageView.h +28 -0
- package/src/definitions/UIKit/JSBUIInputView.h +15 -0
- package/src/definitions/UIKit/JSBUIInterpolatingMotionEffect.h +18 -0
- package/src/definitions/UIKit/JSBUIKeyCommand.h +25 -0
- package/src/definitions/UIKit/JSBUIKit.h +9 -0
- package/src/definitions/UIKit/JSBUIKit.m +614 -0
- package/src/definitions/UIKit/JSBUILabel.h +38 -0
- package/src/definitions/UIKit/JSBUILocalNotification.h +20 -0
- package/src/definitions/UIKit/JSBUILocalizedIndexedCollation.h +23 -0
- package/src/definitions/UIKit/JSBUILongPressGestureRecognizer.h +22 -0
- package/src/definitions/UIKit/JSBUIManagedDocument.h +26 -0
- package/src/definitions/UIKit/JSBUIMarkupTextPrintFormatter.h +17 -0
- package/src/definitions/UIKit/JSBUIMenuController.h +28 -0
- package/src/definitions/UIKit/JSBUIMenuItem.h +25 -0
- package/src/definitions/UIKit/JSBUIMotionEffect.h +24 -0
- package/src/definitions/UIKit/JSBUIMotionEffectGroup.h +16 -0
- package/src/definitions/UIKit/JSBUINavigationBar.h +47 -0
- package/src/definitions/UIKit/JSBUINavigationController.h +34 -0
- package/src/definitions/UIKit/JSBUINavigationItem.h +45 -0
- package/src/definitions/UIKit/JSBUINib.h +19 -0
- package/src/definitions/UIKit/JSBUIPageControl.h +24 -0
- package/src/definitions/UIKit/JSBUIPageViewController.h +27 -0
- package/src/definitions/UIKit/JSBUIPanGestureRecognizer.h +23 -0
- package/src/definitions/UIKit/JSBUIPasteboard.h +46 -0
- package/src/definitions/UIKit/JSBUIPercentDrivenInteractiveTransition.h +24 -0
- package/src/definitions/UIKit/JSBUIPickerView.h +28 -0
- package/src/definitions/UIKit/JSBUIPinchGestureRecognizer.h +19 -0
- package/src/definitions/UIKit/JSBUIPopoverBackgroundView.h +22 -0
- package/src/definitions/UIKit/JSBUIPopoverController.h +31 -0
- package/src/definitions/UIKit/JSBUIPrintFormatter.h +33 -0
- package/src/definitions/UIKit/JSBUIPrintInfo.h +26 -0
- package/src/definitions/UIKit/JSBUIPrintInteractionController.h +36 -0
- package/src/definitions/UIKit/JSBUIPrintPageRenderer.h +31 -0
- package/src/definitions/UIKit/JSBUIPrintPaper.h +22 -0
- package/src/definitions/UIKit/JSBUIProgressView.h +24 -0
- package/src/definitions/UIKit/JSBUIPushBehavior.h +28 -0
- package/src/definitions/UIKit/JSBUIReferenceLibraryViewController.h +19 -0
- package/src/definitions/UIKit/JSBUIRefreshControl.h +21 -0
- package/src/definitions/UIKit/JSBUIResponder.h +57 -0
- package/src/definitions/UIKit/JSBUIRotationGestureRecognizer.h +19 -0
- package/src/definitions/UIKit/JSBUIScreen.h +36 -0
- package/src/definitions/UIKit/JSBUIScreenEdgePanGestureRecognizer.h +18 -0
- package/src/definitions/UIKit/JSBUIScreenMode.h +19 -0
- package/src/definitions/UIKit/JSBUIScrollView.h +53 -0
- package/src/definitions/UIKit/JSBUISearchBar.h +55 -0
- package/src/definitions/UIKit/JSBUISearchDisplayController.h +28 -0
- package/src/definitions/UIKit/JSBUISegmentedControl.h +46 -0
- package/src/definitions/UIKit/JSBUISimpleTextPrintFormatter.h +18 -0
- package/src/definitions/UIKit/JSBUISlider.h +41 -0
- package/src/definitions/UIKit/JSBUISnapBehavior.h +18 -0
- package/src/definitions/UIKit/JSBUISplitViewController.h +26 -0
- package/src/definitions/UIKit/JSBUIStepper.h +31 -0
- package/src/definitions/UIKit/JSBUIStoryboard.h +19 -0
- package/src/definitions/UIKit/JSBUIStoryboardPopoverSegue.h +17 -0
- package/src/definitions/UIKit/JSBUIStoryboardSegue.h +23 -0
- package/src/definitions/UIKit/JSBUISwipeGestureRecognizer.h +19 -0
- package/src/definitions/UIKit/JSBUISwitch.h +20 -0
- package/src/definitions/UIKit/JSBUITabBar.h +33 -0
- package/src/definitions/UIKit/JSBUITabBarController.h +26 -0
- package/src/definitions/UIKit/JSBUITabBarItem.h +26 -0
- package/src/definitions/UIKit/JSBUITableView.h +70 -0
- package/src/definitions/UIKit/JSBUITableViewCell.h +48 -0
- package/src/definitions/UIKit/JSBUITableViewController.h +19 -0
- package/src/definitions/UIKit/JSBUITableViewHeaderFooterView.h +22 -0
- package/src/definitions/UIKit/JSBUITapGestureRecognizer.h +20 -0
- package/src/definitions/UIKit/JSBUITextChecker.h +27 -0
- package/src/definitions/UIKit/JSBUITextField.h +44 -0
- package/src/definitions/UIKit/JSBUITextInputMode.h +41 -0
- package/src/definitions/UIKit/JSBUITextInputStringTokenizer.h +40 -0
- package/src/definitions/UIKit/JSBUITextPosition.h +38 -0
- package/src/definitions/UIKit/JSBUITextRange.h +38 -0
- package/src/definitions/UIKit/JSBUITextSelectionRect.h +36 -0
- package/src/definitions/UIKit/JSBUITextView.h +34 -0
- package/src/definitions/UIKit/JSBUIToolbar.h +22 -0
- package/src/definitions/UIKit/JSBUITouch.h +49 -0
- package/src/definitions/UIKit/JSBUIVideoEditorController.h +19 -0
- package/src/definitions/UIKit/JSBUIView.h +140 -0
- package/src/definitions/UIKit/JSBUIViewController.h +127 -0
- package/src/definitions/UIKit/JSBUIViewPrintFormatter.h +15 -0
- package/src/definitions/UIKit/JSBUIWebView.h +38 -0
- package/src/definitions/UIKit/JSBUIWindow.h +32 -0
- package/src/styles/starlight-overrides.css +23 -0
- package/tsconfig.json +5 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Database
|
|
3
|
+
description: MarginNote 核心数据库访问对象(MbModelTool),用于获取/修改笔记、笔记本与文档。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`Database` 即底层类型 `MbModelTool` 的单例,用于访问 MarginNote 的笔记与文档数据。通过 `Database.sharedInstance()` 获取。修改数据后建议使用 [UndoManager](/reference/utility/undo-manager/) 的 `undoGrouping(title, topicid, fn)` 包裹,并调用 `Application.sharedInstance().refreshAfterDBChanged(topicid)` 刷新界面。
|
|
7
|
+
|
|
8
|
+
## 类成员 (Class members)
|
|
9
|
+
|
|
10
|
+
### `sharedInstance`
|
|
11
|
+
|
|
12
|
+
获取全局唯一的数据库工具实例。
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
static sharedInstance(): MbModelTool
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Return Value:**
|
|
19
|
+
|
|
20
|
+
- `MbModelTool`: 数据库工具单例。
|
|
21
|
+
|
|
22
|
+
## 实例成员 (Instance members)
|
|
23
|
+
|
|
24
|
+
### 方法
|
|
25
|
+
|
|
26
|
+
### `getNoteById`
|
|
27
|
+
|
|
28
|
+
根据笔记 ID 获取笔记。
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
getNoteById(noteId: string): MbBookNote | undefined
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Parameters:**
|
|
35
|
+
|
|
36
|
+
| Name | Type | Description |
|
|
37
|
+
| :--- | :--- | :--- |
|
|
38
|
+
| `noteId` | `string` | 笔记唯一 ID。 |
|
|
39
|
+
|
|
40
|
+
**Return Value:**
|
|
41
|
+
|
|
42
|
+
- `MbBookNote | undefined`: 对应的笔记对象,若不存在则返回 undefined。
|
|
43
|
+
|
|
44
|
+
### `getNotebookById`
|
|
45
|
+
|
|
46
|
+
根据笔记本 ID 获取笔记本。
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
getNotebookById(topicId: string): MbTopic | undefined
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Parameters:**
|
|
53
|
+
|
|
54
|
+
| Name | Type | Description |
|
|
55
|
+
| :--- | :--- | :--- |
|
|
56
|
+
| `topicId` | `string` | 笔记本 ID。 |
|
|
57
|
+
|
|
58
|
+
**Return Value:**
|
|
59
|
+
|
|
60
|
+
- `MbTopic | undefined`: 对应的笔记本对象。
|
|
61
|
+
|
|
62
|
+
### `getDocumentById`
|
|
63
|
+
|
|
64
|
+
根据文档 MD5 获取文档。
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
getDocumentById(docMd5: string): MbBook | undefined
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Parameters:**
|
|
71
|
+
|
|
72
|
+
| Name | Type | Description |
|
|
73
|
+
| :--- | :--- | :--- |
|
|
74
|
+
| `docMd5` | `string` | 文档 MD5。 |
|
|
75
|
+
|
|
76
|
+
**Return Value:**
|
|
77
|
+
|
|
78
|
+
- `MbBook | undefined`: 对应的文档对象。
|
|
79
|
+
|
|
80
|
+
### `getMediaByHash`
|
|
81
|
+
|
|
82
|
+
根据媒体哈希获取二进制数据。
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
getMediaByHash(hash: string): NSData | undefined
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Parameters:**
|
|
89
|
+
|
|
90
|
+
| Name | Type | Description |
|
|
91
|
+
| :--- | :--- | :--- |
|
|
92
|
+
| `hash` | `string` | 媒体哈希字符串。 |
|
|
93
|
+
|
|
94
|
+
**Return Value:**
|
|
95
|
+
|
|
96
|
+
- `NSData | undefined`: 媒体数据。
|
|
97
|
+
|
|
98
|
+
### `getFlashcardByNoteId`
|
|
99
|
+
|
|
100
|
+
按 Evernote 笔记 ID 与笔记本获取闪卡(笔记)。
|
|
101
|
+
|
|
102
|
+
```javascript
|
|
103
|
+
getFlashcardByNoteId(noteId: string, topicId: string): MbBookNote | undefined
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Parameters:**
|
|
107
|
+
|
|
108
|
+
| Name | Type | Description |
|
|
109
|
+
| :--- | :--- | :--- |
|
|
110
|
+
| `noteId` | `string` | 原始笔记 ID (Evernote ID)。 |
|
|
111
|
+
| `topicId` | `string` | 笔记本 ID。 |
|
|
112
|
+
|
|
113
|
+
**Return Value:**
|
|
114
|
+
|
|
115
|
+
- `MbBookNote | undefined`: 对应的闪卡笔记。
|
|
116
|
+
|
|
117
|
+
### `getFlashcardsByNoteId`
|
|
118
|
+
|
|
119
|
+
按 Evernote 笔记 ID 获取所有关联闪卡。
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
getFlashcardsByNoteId(noteId: string): NSArray
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Parameters:**
|
|
126
|
+
|
|
127
|
+
| Name | Type | Description |
|
|
128
|
+
| :--- | :--- | :--- |
|
|
129
|
+
| `noteId` | `string` | 原始笔记 ID。 |
|
|
130
|
+
|
|
131
|
+
**Return Value:**
|
|
132
|
+
|
|
133
|
+
- `NSArray`: 包含 `MbBookNote` 的数组。
|
|
134
|
+
|
|
135
|
+
### `hasFlashcardByNoteId`
|
|
136
|
+
|
|
137
|
+
是否存在该 Evernote 笔记的闪卡。
|
|
138
|
+
|
|
139
|
+
```javascript
|
|
140
|
+
hasFlashcardByNoteId(noteId: string): boolean
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Parameters:**
|
|
144
|
+
|
|
145
|
+
| Name | Type | Description |
|
|
146
|
+
| :--- | :--- | :--- |
|
|
147
|
+
| `noteId` | `string` | 原始笔记 ID。 |
|
|
148
|
+
|
|
149
|
+
**Return Value:**
|
|
150
|
+
|
|
151
|
+
- `boolean`: 是否存在。
|
|
152
|
+
|
|
153
|
+
### `allNotebooks`
|
|
154
|
+
|
|
155
|
+
获取所有笔记本。
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
allNotebooks(): NSArray
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Return Value:**
|
|
162
|
+
|
|
163
|
+
- `NSArray`: 包含所有 `MbTopic` 的数组。
|
|
164
|
+
|
|
165
|
+
### `allDocuments`
|
|
166
|
+
|
|
167
|
+
获取所有文档。
|
|
168
|
+
|
|
169
|
+
```javascript
|
|
170
|
+
allDocuments(): NSArray
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Return Value:**
|
|
174
|
+
|
|
175
|
+
- `NSArray`: 包含所有 `MbBook` 的数组。
|
|
176
|
+
|
|
177
|
+
### `savedb`
|
|
178
|
+
|
|
179
|
+
手动保存数据库到磁盘。慎用,通常由系统自动管理。
|
|
180
|
+
|
|
181
|
+
```javascript
|
|
182
|
+
savedb(): void
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### `setNotebookSyncDirty`
|
|
186
|
+
|
|
187
|
+
将笔记本标记为同步脏(需要同步)。
|
|
188
|
+
|
|
189
|
+
```javascript
|
|
190
|
+
setNotebookSyncDirty(topicid: string): void
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Parameters:**
|
|
194
|
+
|
|
195
|
+
| Name | Type | Description |
|
|
196
|
+
| :--- | :--- | :--- |
|
|
197
|
+
| `topicid` | `string` | 笔记本 ID。 |
|
|
198
|
+
|
|
199
|
+
### `saveHistoryArchiveKey`
|
|
200
|
+
|
|
201
|
+
保存历史归档。
|
|
202
|
+
|
|
203
|
+
```javascript
|
|
204
|
+
saveHistoryArchiveKey(topicid: string, key: string): NSArray
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Parameters:**
|
|
208
|
+
|
|
209
|
+
| Name | Type | Description |
|
|
210
|
+
| :--- | :--- | :--- |
|
|
211
|
+
| `topicid` | `string` | 笔记本 ID。 |
|
|
212
|
+
| `key` | `string` | 归档键名。 |
|
|
213
|
+
|
|
214
|
+
**Return Value:**
|
|
215
|
+
|
|
216
|
+
- `NSArray`: 归档数据。
|
|
217
|
+
|
|
218
|
+
### `loadHistoryArchiveKey`
|
|
219
|
+
|
|
220
|
+
加载历史归档。
|
|
221
|
+
|
|
222
|
+
```javascript
|
|
223
|
+
loadHistoryArchiveKey(topicid: string, key: string): NSArray
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Parameters:**
|
|
227
|
+
|
|
228
|
+
| Name | Type | Description |
|
|
229
|
+
| :--- | :--- | :--- |
|
|
230
|
+
| `topicid` | `string` | 笔记本 ID。 |
|
|
231
|
+
| `key` | `string` | 归档键名。 |
|
|
232
|
+
|
|
233
|
+
**Return Value:**
|
|
234
|
+
|
|
235
|
+
- `NSArray`: 归档数据。
|
|
236
|
+
|
|
237
|
+
### `deleteBookNote`
|
|
238
|
+
|
|
239
|
+
删除单条笔记(不删子节点)。
|
|
240
|
+
|
|
241
|
+
```javascript
|
|
242
|
+
deleteBookNote(noteId: string): void
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Parameters:**
|
|
246
|
+
|
|
247
|
+
| Name | Type | Description |
|
|
248
|
+
| :--- | :--- | :--- |
|
|
249
|
+
| `noteId` | `string` | 笔记 ID。 |
|
|
250
|
+
|
|
251
|
+
### `deleteBookNoteTree`
|
|
252
|
+
|
|
253
|
+
删除笔记及其所有后代。
|
|
254
|
+
|
|
255
|
+
```javascript
|
|
256
|
+
deleteBookNoteTree(noteId: string): void
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**Parameters:**
|
|
260
|
+
|
|
261
|
+
| Name | Type | Description |
|
|
262
|
+
| :--- | :--- | :--- |
|
|
263
|
+
| `noteId` | `string` | 笔记 ID。 |
|
|
264
|
+
|
|
265
|
+
### `cloneNotesToTopic`
|
|
266
|
+
|
|
267
|
+
将笔记克隆到指定笔记本。
|
|
268
|
+
|
|
269
|
+
```javascript
|
|
270
|
+
cloneNotesToTopic(notes: NSArray, topicid: string): NSArray
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
**Parameters:**
|
|
274
|
+
|
|
275
|
+
| Name | Type | Description |
|
|
276
|
+
| :--- | :--- | :--- |
|
|
277
|
+
| `notes` | `NSArray` | `MbBookNote` 数组。 |
|
|
278
|
+
| `topicid` | `string` | 目标笔记本 ID。 |
|
|
279
|
+
|
|
280
|
+
**Return Value:**
|
|
281
|
+
|
|
282
|
+
- `NSArray`: 克隆后的新笔记数组。
|
|
283
|
+
|
|
284
|
+
### `cloneNotesToFlashcardsToTopic`
|
|
285
|
+
|
|
286
|
+
将笔记克隆为闪卡到指定笔记本。
|
|
287
|
+
|
|
288
|
+
```javascript
|
|
289
|
+
cloneNotesToFlashcardsToTopic(notes: NSArray, topicid: string): NSArray
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**Parameters:**
|
|
293
|
+
|
|
294
|
+
| Name | Type | Description |
|
|
295
|
+
| :--- | :--- | :--- |
|
|
296
|
+
| `notes` | `NSArray` | `MbBookNote` 数组。 |
|
|
297
|
+
| `topicid` | `string` | 目标笔记本 ID。 |
|
|
298
|
+
|
|
299
|
+
**Return Value:**
|
|
300
|
+
|
|
301
|
+
- `NSArray`: 克隆后的新笔记数组。
|
|
302
|
+
|
|
303
|
+
### `exportNotebookStorePath`
|
|
304
|
+
|
|
305
|
+
导出笔记本。
|
|
306
|
+
|
|
307
|
+
```javascript
|
|
308
|
+
exportNotebookStorePath(topicid: string, storePath: string): boolean
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
**Parameters:**
|
|
312
|
+
|
|
313
|
+
| Name | Type | Description |
|
|
314
|
+
| :--- | :--- | :--- |
|
|
315
|
+
| `topicid` | `string` | 笔记本 ID。 |
|
|
316
|
+
| `storePath` | `string` | 导出路径。 |
|
|
317
|
+
|
|
318
|
+
**Return Value:**
|
|
319
|
+
|
|
320
|
+
- `boolean`: 是否成功。
|
|
321
|
+
|
|
322
|
+
### `importNotebookFromStorePathMerge`
|
|
323
|
+
|
|
324
|
+
从路径导入笔记本。
|
|
325
|
+
|
|
326
|
+
```javascript
|
|
327
|
+
importNotebookFromStorePathMerge(storePath: string, merge: boolean): any
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### `createNoteWithTitleTopicid`
|
|
331
|
+
|
|
332
|
+
在指定笔记本创建新笔记。
|
|
333
|
+
|
|
334
|
+
```javascript
|
|
335
|
+
createNoteWithTitleTopicid(title: string, topicid: string): MbBookNote
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### `getSketchNoteForMindMapFocusNoteId`
|
|
339
|
+
|
|
340
|
+
获取脑图草稿笔记(Sketch)。
|
|
341
|
+
|
|
342
|
+
```javascript
|
|
343
|
+
getSketchNoteForMindMapFocusNoteId(topicid: string, focusNoteId: string): MbBookNote
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### `getSketchNoteForDocumentMd5Page`
|
|
347
|
+
|
|
348
|
+
获取指定文档页的草稿笔记(Sketch)。
|
|
349
|
+
|
|
350
|
+
```javascript
|
|
351
|
+
getSketchNoteForDocumentMd5Page(topicid: string, md5: string, page: number): MbBookNote
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### `getSketchNotesForDocumentMd5Page`
|
|
355
|
+
|
|
356
|
+
获取指定文档页的草稿笔记列表(Sketch)。
|
|
357
|
+
|
|
358
|
+
```javascript
|
|
359
|
+
getSketchNotesForDocumentMd5Page(topicid: string, md5: string, page: number): NSArray
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### `getSketchNotesForMindMap`
|
|
363
|
+
|
|
364
|
+
获取脑图草稿笔记列表(Sketch)。
|
|
365
|
+
|
|
366
|
+
```javascript
|
|
367
|
+
getSketchNotesForMindMap(topicid: string): NSArray
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## 兼容性工具(类方法)
|
|
371
|
+
|
|
372
|
+
### `transDictionaryToJSCompatible` / `transArrayToJSCompatible`
|
|
373
|
+
|
|
374
|
+
将原生容器转换为更易于 JS 使用的结构(行为以运行时实现为准)。
|
|
375
|
+
|
|
376
|
+
```javascript
|
|
377
|
+
static transDictionaryToJSCompatible(dic: NSDictionary): NSDictionary
|
|
378
|
+
static transArrayToJSCompatible(arr: NSArray): NSArray
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
**Parameters:**
|
|
382
|
+
|
|
383
|
+
| Name | Type | Description |
|
|
384
|
+
| :--- | :--- | :--- |
|
|
385
|
+
| `storePath` | `string` | 导入文件路径。 |
|
|
386
|
+
| `merge` | `boolean` | 是否合并。 |
|
|
387
|
+
|
|
388
|
+
**Return Value:**
|
|
389
|
+
|
|
390
|
+
- `any`: 导入结果(通常为导入的笔记本对象或状态)。
|
|
391
|
+
|
|
392
|
+
## 相关
|
|
393
|
+
|
|
394
|
+
- [MbBookNote](/reference/marginnote/mb-book-note/)、[MbTopic](/reference/marginnote/mb-topic/)、[MbBook](/reference/marginnote/mb-book/)
|
|
395
|
+
- [教程:笔记与数据库](/guides/notes-and-database/)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 全局入口对象(Global Variables)
|
|
3
|
+
description: MarginNote 插件运行时直接注入到 JS 环境的全局变量清单与用法入口。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
本页列出 **MarginNote 插件运行时可直接使用的全局变量名**(你在 JS 里直接输入即可访问)。这些全局名对应的对象通常是 **单例**、**工厂对象**、或 **系统级入口**。
|
|
7
|
+
|
|
8
|
+
> 说明:本页仅做“可发现性索引”。每个对象的完整属性/方法请进入对应参考页。
|
|
9
|
+
|
|
10
|
+
## 全局变量清单
|
|
11
|
+
|
|
12
|
+
| 全局变量名 | 对应原生类/说明 | 核心用途 | 参考 |
|
|
13
|
+
| :--- | :--- | :--- | :--- |
|
|
14
|
+
| `JSB` | Bridge | 定义类、日志输出、require | [JSB](/reference/global/jsb/) |
|
|
15
|
+
| `self` | `JSExtension` 实例 | 当前插件实例(仅实例方法内可用) | [self](/reference/global/self/) |
|
|
16
|
+
| `Application` | `JSBApplication` | App 全局单例:路径、HUD、openURL、studyController | [Application](/reference/global/application/) |
|
|
17
|
+
| `Database` | `MbModelTool` 单例 | 笔记/笔记本/文档数据库访问 | [Database](/reference/global/database/) |
|
|
18
|
+
| `Note` | 笔记工厂(全局) | 创建新笔记:`Note.createWithTitleNotebookDocument(...)` | [Note](/reference/global/note/) |
|
|
19
|
+
| `UndoManager` | `JSBUndoManager` 单例 | undoGrouping/撤销重做 | [UndoManager](/reference/utility/undo-manager/) |
|
|
20
|
+
| `SpeechManager` | `JSBSpeechManager` 单例 | 语音朗读 | [SpeechManager](/reference/utility/speech-manager/) |
|
|
21
|
+
| `ZipArchive` | `JSBZipArchive` | zip 压缩/解压 | [ZipArchive](/reference/utility/zip-archive/) |
|
|
22
|
+
| `MenuController` | 菜单控制器(全局) | 表格化菜单视图 | [MenuController](/reference/utility/menu-controller/) |
|
|
23
|
+
| `PopupMenu` | 弹出菜单(全局) | 轻量弹出菜单 | [PopupMenu](/reference/global/popup-menu/) |
|
|
24
|
+
| `PopupMenuItem` | 弹出菜单项(全局) | 菜单项对象 | [PopupMenuItem](/reference/global/popup-menu-item/) |
|
|
25
|
+
| `SQLiteDatabase` | `JSBSQLiteDatabase` | SQLite 连接器 | [SQLiteDatabase](/reference/utility/sqlite-database/) |
|
|
26
|
+
| `NSFileManager` | `NSFileManager` 单例 | 文件管理 | [NSFileManager](/reference/foundation/ns-file-manager/)(待补齐:全量接口) |
|
|
27
|
+
| `NSUserDefaults` | `NSUserDefaults` 单例 | 偏好设置存储 | [NSUserDefaults](/reference/foundation/ns-user-defaults/) |
|
|
28
|
+
| `NSNotificationCenter` | `NSNotificationCenter` 单例 | 通知中心 | [NSNotificationCenter](/reference/foundation/ns-notification-center/) |
|
|
29
|
+
| `UIApplication` | `UIApplication` 单例 | iOS 应用级入口(openURL 等) | [UIApplication](/reference/uikit/uiapplication/) |
|
|
30
|
+
| `UIPasteboard` | `UIPasteboard` 单例 | 系统剪贴板 | [UIPasteboard](/reference/uikit/uipasteboard/) |
|
|
31
|
+
| `UIDevice` | `UIDevice` 单例 | 设备信息 | [UIDevice](/reference/uikit/uidevice/) |
|
|
32
|
+
| `UIScreen` | `UIScreen` 单例 | 屏幕信息 | [UIScreen](/reference/uikit/uiscreen/) |
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: JSB
|
|
3
|
+
description: JavaScript 桥接核心,连接插件 JS 与运行时对象的入口对象。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
JSB(JavaScript Bridge)是插件运行时的桥接核心对象:类定义、插件入口、日志与包内脚本加载都通过它完成。
|
|
7
|
+
|
|
8
|
+
## 实例成员 (Instance members)
|
|
9
|
+
|
|
10
|
+
`JSB` 是全局对象,通常不以“实例化”的方式使用。
|
|
11
|
+
|
|
12
|
+
## 类成员 (Class members)
|
|
13
|
+
|
|
14
|
+
### 方法
|
|
15
|
+
|
|
16
|
+
### `defineClass`
|
|
17
|
+
|
|
18
|
+
定义一个可被运行时识别并回调的类,**所有插件的入口**。
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
defineClass(declaration: string, instanceMembers: object, classMembers?: object): any
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Parameters:**
|
|
25
|
+
|
|
26
|
+
| Name | Type | Description |
|
|
27
|
+
| :--- | :--- | :--- |
|
|
28
|
+
| `declaration` | `string` | 类声明,例如 `'MyAddon : JSExtension'`。 |
|
|
29
|
+
| `instanceMembers` | `object` | 实例方法与属性的集合。在此对象中定义的方法/属性在**实例**上调用(如 `sceneWillConnect`、`notebookWillOpen`、`queryAddonCommandStatus` 等)。 |
|
|
30
|
+
| `classMembers` | `object?` | 类方法与属性的集合。在此对象中定义的方法在**类**上调用(如 `addonDidConnect`)。 |
|
|
31
|
+
|
|
32
|
+
**Return Value:**
|
|
33
|
+
|
|
34
|
+
- `any`: 类构造器。
|
|
35
|
+
|
|
36
|
+
### `newAddon`
|
|
37
|
+
|
|
38
|
+
**插件入口函数**。MarginNote 加载插件时调用,你必须实现并返回插件类。
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
newAddon(mainPath: string): any
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Parameters:**
|
|
45
|
+
|
|
46
|
+
| Name | Type | Description |
|
|
47
|
+
| :--- | :--- | :--- |
|
|
48
|
+
| `mainPath` | `string` | 插件包根目录路径。 |
|
|
49
|
+
|
|
50
|
+
**Return Value:**
|
|
51
|
+
|
|
52
|
+
- `any`: 必须返回由 `defineClass` 创建的类(构造器)。注意:是类本身,不是实例。
|
|
53
|
+
|
|
54
|
+
### `log`
|
|
55
|
+
|
|
56
|
+
向 MarginNote 控制台输出日志,类似 `console.log`。
|
|
57
|
+
|
|
58
|
+
```javascript
|
|
59
|
+
log(format: string, ...args: any[]): void
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Parameters:**
|
|
63
|
+
|
|
64
|
+
| Name | Type | Description |
|
|
65
|
+
| :--- | :--- | :--- |
|
|
66
|
+
| `format` | `string` | 格式化字符串,支持 `%@`、`%d` 等 Objective-C 格式。 |
|
|
67
|
+
| `...args` | `any[]` | 对应格式化字符串的参数。 |
|
|
68
|
+
|
|
69
|
+
### `require`
|
|
70
|
+
|
|
71
|
+
加载插件包内其他 JS 文件。
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
require(name: string): void
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Parameters:**
|
|
78
|
+
|
|
79
|
+
| Name | Type | Description |
|
|
80
|
+
| :--- | :--- | :--- |
|
|
81
|
+
| `name` | `string` | 插件包内 JS 文件路径/文件名。 |
|
|
82
|
+
|
|
83
|
+
**Note:**
|
|
84
|
+
无模块作用域,所有文件共享全局作用域;推荐使用 Webpack 等打包工具。
|
|
85
|
+
|
|
86
|
+
## 说明
|
|
87
|
+
|
|
88
|
+
- 插件主类必须通过 `JSB.defineClass('MyAddon : JSExtension', instanceMembers, classMembers)` 定义,并在全局实现 `JSB.newAddon = function(mainPath) { return MyAddon; }`(或等价形式)。
|
|
89
|
+
- 参见 [JSExtension](/reference/marginnote/jsextension/) 了解生命周期方法,[快速开始](/guides/getting-started/) 了解完整示例。
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Note
|
|
3
|
+
description: 全局注入的笔记工厂对象,用于创建新笔记(MbBookNote)。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`Note` 是 MarginNote 运行时注入到 JavaScript 环境中的**全局对象**之一,用于创建新笔记。
|
|
7
|
+
|
|
8
|
+
需要特别注意:创建笔记的方法**不在** `MbBookNote` 类上,而是在全局 `Note` 对象上(这是由 MarginNote 的 JSExport 导出方式决定的)。
|
|
9
|
+
|
|
10
|
+
## 实例成员 (Instance members)
|
|
11
|
+
|
|
12
|
+
`Note` 是全局对象,通常不以实例形式使用。
|
|
13
|
+
|
|
14
|
+
## 类成员 (Class members)
|
|
15
|
+
|
|
16
|
+
### 方法
|
|
17
|
+
|
|
18
|
+
### `createWithTitleNotebookDocument`
|
|
19
|
+
|
|
20
|
+
在指定笔记本与文档下创建一条新笔记。
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
createWithTitleNotebookDocument(title: string, notebook: MbTopic, doc: MbBook): MbBookNote
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Parameters:**
|
|
27
|
+
|
|
28
|
+
| Name | Type | Description |
|
|
29
|
+
| :--- | :--- | :--- |
|
|
30
|
+
| `title` | `string` | 笔记标题。 |
|
|
31
|
+
| `notebook` | `MbTopic` | 所属笔记本(Topic)。 |
|
|
32
|
+
| `doc` | `MbBook` | 来源文档(Book)。 |
|
|
33
|
+
|
|
34
|
+
**Return Value:**
|
|
35
|
+
|
|
36
|
+
- `MbBookNote`: 创建成功的新笔记对象。
|
|
37
|
+
|
|
38
|
+
### 示例
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
var db = Database.sharedInstance();
|
|
42
|
+
var notebook = db.getNotebookById("NOTEBOOK_ID");
|
|
43
|
+
var doc = db.getDocumentById("DOC_MD5");
|
|
44
|
+
|
|
45
|
+
if (notebook && doc) {
|
|
46
|
+
var topicid = notebook.topicId || notebook.topicid; // 兼容不同 getter 命名
|
|
47
|
+
UndoManager.sharedInstance().undoGrouping(
|
|
48
|
+
"创建笔记",
|
|
49
|
+
topicid,
|
|
50
|
+
function () {
|
|
51
|
+
var note = Note.createWithTitleNotebookDocument("新笔记", notebook, doc);
|
|
52
|
+
// note 为 MbBookNote
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
Application.sharedInstance().refreshAfterDBChanged(topicid);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 相关
|
|
60
|
+
|
|
61
|
+
- [Database](/reference/global/database/) — 获取 notebook/doc
|
|
62
|
+
- [MbTopic](/reference/marginnote/mb-topic/)、[MbBook](/reference/marginnote/mb-book/)
|
|
63
|
+
- [MbBookNote](/reference/marginnote/mb-book-note/) — 创建结果类型
|
|
64
|
+
- [UndoManager](/reference/utility/undo-manager/)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: PopupMenuItem
|
|
3
|
+
description: PopupMenu 的菜单项对象(全局注入)。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`PopupMenuItem` 是运行时注入的全局类型(对应原生 QBPopupMenuItem)。通常由运行时创建并用于渲染;可读属性包含标题与动作标识。
|
|
7
|
+
|
|
8
|
+
## 实例成员 (Instance members)
|
|
9
|
+
|
|
10
|
+
| 属性 | 类型 | 说明 |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| `title` | `string` | 显示标题。 |
|
|
13
|
+
| `actionString` | `string` | 动作标识字符串(用途依赖运行时)。 |
|
|
14
|
+
|
|
15
|
+
## 相关
|
|
16
|
+
|
|
17
|
+
- [PopupMenu](/reference/global/popup-menu/)
|
|
18
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: PopupMenu
|
|
3
|
+
description: 轻量弹出菜单视图(全局注入),用于展示一组 PopupMenuItem。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`PopupMenu` 是运行时注入的全局类(对应原生 QBPopupMenu)。常用于在指定 rect 附近弹出一组菜单项。
|
|
7
|
+
|
|
8
|
+
## 类成员 (Class members)
|
|
9
|
+
|
|
10
|
+
| 方法 | 参数 | 返回值 | 说明 |
|
|
11
|
+
|---|---|---|---|
|
|
12
|
+
| `currentMenu()` | — | `PopupMenu \| null` | 获取当前显示的菜单(若有)。 |
|
|
13
|
+
| `popupMenuWithItems(items)` | items: `NSArray` | `PopupMenu` | 用 items 创建菜单实例。 |
|
|
14
|
+
|
|
15
|
+
## 实例成员 (Instance members)
|
|
16
|
+
|
|
17
|
+
### 属性
|
|
18
|
+
|
|
19
|
+
| 属性 | 类型 | 说明 |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `visible` | `boolean` | 是否可见。 |
|
|
22
|
+
| `items` | `NSArray` | 菜单项列表。 |
|
|
23
|
+
| `arrowDirection` | `number` | 箭头方向(枚举值以运行时为准)。 |
|
|
24
|
+
| `targetWinRect` | `CGRect` | 目标窗口 rect(只读)。 |
|
|
25
|
+
|
|
26
|
+
### 方法
|
|
27
|
+
|
|
28
|
+
| 方法 | 参数 | 返回值 | 说明 |
|
|
29
|
+
|---|---|---|---|
|
|
30
|
+
| `showInViewTargetRectAnimated(view, targetRect, animated)` | view: `UIView`, targetRect: `CGRect`, animated: boolean | — | 在 view 中显示。 |
|
|
31
|
+
| `updateWithTargetRect(targetRect)` | targetRect: `CGRect` | — | 更新目标 rect。 |
|
|
32
|
+
| `dismissAnimated(animated)` | animated: boolean | — | 关闭菜单。 |
|
|
33
|
+
|
|
34
|
+
## 相关
|
|
35
|
+
|
|
36
|
+
- [PopupMenuItem](/reference/global/popup-menu-item/)
|
|
37
|
+
- [UIView](/reference/uikit/uiview/)
|
|
38
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SearchManager
|
|
3
|
+
description: 搜索与索引管理器(全文检索、URL 搜索、相似笔记检索等)。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`SearchManager` 通过 `Application.sharedInstance().searchManager` 获取。其返回结构与索引能力会随版本变化;建议先在控制台打印返回值结构再做兼容处理。
|
|
7
|
+
|
|
8
|
+
## 实例成员 (Instance members)
|
|
9
|
+
|
|
10
|
+
### 属性(只读)
|
|
11
|
+
|
|
12
|
+
| 属性 | 类型 | 说明 |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| `ftsIndexing` | `boolean` | FTS 索引是否正在构建/工作中。 |
|
|
15
|
+
| `propIndexing` | `boolean` | 属性索引是否正在构建/工作中。 |
|
|
16
|
+
| `vectorIndexing` | `boolean` | 向量索引是否正在构建/工作中。 |
|
|
17
|
+
|
|
18
|
+
### 常用搜索
|
|
19
|
+
|
|
20
|
+
| 方法 | 说明 |
|
|
21
|
+
|---|---|
|
|
22
|
+
| `searchText(query, titleOnly, topicid, beginsWith, limit)` | 文本搜索。 |
|
|
23
|
+
| `searchTextNoteOnly(query, titleOnly, topicid, beginsWith, limit, noteOnly)` | 文本搜索(可限定只搜笔记)。 |
|
|
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)` | 页内搜索(实现依赖运行时)。 |
|
|
28
|
+
| `snippetForFts3RowId(rowid)` / `snippetForPageRowId(rowid)` | 获取 snippet(结果摘要)。 |
|
|
29
|
+
|
|
30
|
+
### 同步与索引
|
|
31
|
+
|
|
32
|
+
| 方法 | 说明 |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `syncTopicForceBlock(topicid, force, block)` | 同步/构建指定笔记本的索引(block 为回调)。 |
|
|
35
|
+
| `syncDB()` / `syncDBAfterMigration()` | 同步索引数据库。 |
|
|
36
|
+
| `hasTopicIndex(topicid)` / `hasVectorIndex(topicid)` / `hasBookIndex(md5)` | 检查索引是否存在。 |
|
|
37
|
+
| `resetBookIndex()` | 重置文档索引(慎用)。 |
|
|
38
|
+
|
|
39
|
+
### 相似检索(向量)
|
|
40
|
+
|
|
41
|
+
| 方法 | 说明 |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `findSimilarNotes(queryVector, topicId, k)` | 向量相似笔记检索。 |
|
|
44
|
+
| `batchFindSimilarNotes(queryVectors, topicId, k)` | 批量向量相似检索。 |
|
|
45
|
+
| `findSimilarNotesHybrid(queryVector, queryText, topicId, k, semanticWeight, bm25Weight)` | 语义+BM25 混合检索。 |
|
|
46
|
+
| `loadVectorCacheForTopic(topicId)` / `syncTopicVectorsForceCompletion(topicId, force, completion)` / `invalidateVectorCacheForTopics(topicIds)` | 向量缓存相关(实现依赖运行时)。 |
|
|
47
|
+
|
|
48
|
+
## 相关
|
|
49
|
+
|
|
50
|
+
- [Application](/reference/global/application/) — `Application.sharedInstance().searchManager`
|
|
51
|
+
|