> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
> Use this file to discover all available pages before exploring further.

# setLassoTitle

> 设置套索笔划或几何图形为标题。

<Note>
  该接口支持笔记中的撤销还原操作。

  只支持套索主图层的笔划、几何图形、文本框设置为标题，其他图层不支持。

  建议在点击套索工具栏按钮后进入的插件界面调用该接口。
</Note>

```ts theme={null}
static setLassoTitle(params: { style: number }): Promise<APIResponse<boolean>>;
```

**参数**

| 参数             | 类型       | 说明                                                  |
| -------------- | -------- | --------------------------------------------------- |
| `params.style` | `number` | 标题样式：`0` 去掉标题属性，`1` 黑底标题，`2` 灰白标题，`3` 灰黑标题，`4` 阴影标题 |

**返回**

* [`APIResponse<boolean>`](/zh/api-reference/supernote-plugin/types/api-response)：
  `result === true`表示设置标题成功。

## 示例

```ts wrap theme={null}
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;
}
```
