该接口支持笔记中的撤销还原操作。只支持套索主图层的笔划、几何图形、文本框设置为标题,其他图层不支持。建议在点击套索工具栏按钮后进入的插件界面调用该接口。
返回
APIResponse<boolean>:result === true表示设置标题成功。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
设置套索笔划或几何图形为标题。
static setLassoTitle(params: { style: number }): Promise<APIResponse<boolean>>;
| 参数 | 类型 | 说明 |
|---|---|---|
params.style | number | 标题样式:0 去掉标题属性,1 黑底标题,2 灰白标题,3 灰黑标题,4 阴影标题 |
APIResponse<boolean>:
result === true表示设置标题成功。import { PluginNoteAPI } from 'sn-plugin-lib';
/**
* 设置套索标题样式的示例。
*/
export async function exampleSetLassoTitle() {
const res = await PluginNoteAPI.setLassoTitle({ style: 1 });
if (!res.success) {
throw new Error(res.error?.message ?? 'setLassoTitle 调用失败');
}
return res.result;
}