Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
在笔记应用中,向当前打开的笔记页的主图层插入文字链接。
static insertTextLink(textLink: { destPath: string; destPage?: number; style: number; linkType: number; rect: Rect; fontSize: number; fullText: string; showText: string; isItalic: number; }): Promise<APIResponse<number>>;
textLink.destPath
string
linkType === 4
textLink.destPage
number
linkType === 0
linkType === 2
textLink.style
0
1
2
textLink.linkType
3
4
textLink.rect
Rect
textLink.fontSize
textLink.fullText
textLink.showText
textLink.isItalic
linkType
insertTextLink
0..4
linkType=6
Link
LassoLink
APIResponse<number>
result
-1
-2
import { PluginNoteAPI, type Rect } from 'sn-plugin-lib'; /** * 向当前打开的笔记页插入文本链接的示例。 */ export async function exampleInsertTextLink() { const rect: Rect = { left: 100, top: 100, right: 300, bottom: 160 }; const res = await PluginNoteAPI.insertTextLink({ destPath: '/storage/emulated/0/Note/demo.note', destPage: 1, style: 0, linkType: 0, rect, fontSize: 32, fullText: 'Full Text', showText: 'Show Text', isItalic: 0, }); if (!res.success) { throw new Error(res.error?.message ?? 'insertTextLink 调用失败'); } return res.result; }