> ## 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.

# flipLassoElements

> 原地翻转当前套索中的元素。

<Note>
  必须套索之后才能调用该接口，否则会调用失败。
</Note>

```ts theme={null}
static flipLassoElements(flipType: number): Promise<APIResponse<boolean>>;
```

**参数**

| 参数         | 类型       | 说明                                       |
| ---------- | -------- | ---------------------------------------- |
| `flipType` | `number` | 翻转类型，仅支持 `1` 和 `2`。`1` 表示水平翻转，`2` 表示垂直翻转 |

**说明**

* 该接口会对当前套索中的元素执行原地翻转
* 当前只支持水平翻转和垂直翻转两种方式

**返回**

* [`APIResponse<boolean>`](/zh/api-reference/supernote-plugin/types/api-response)：
  `result === true` 表示原地翻转成功

## 示例

```ts wrap theme={null}
import { PluginCommAPI } from 'sn-plugin-lib';

/**
 * 原地翻转当前套索中的元素。
 */
export async function exampleFlipLassoElements(flipType: 1 | 2) {
  console.log('flipLassoElements flipType:', flipType);
  const res = await PluginCommAPI.flipLassoElements(flipType);
  if (!res.success) {
    throw new Error(res.error?.message ?? 'flipLassoElements 调用失败');
  }
  console.log('flipLassoElements result:', res.result);
  return res.result;
}
```
