必须套索之后才能调用该接口,否则会调用失败。
说明
- 该接口会对当前套索中的元素执行原地翻转
- 当前只支持水平翻转和垂直翻转两种方式
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 flipLassoElements(flipType: number): Promise<APIResponse<boolean>>;
| 参数 | 类型 | 说明 |
|---|---|---|
flipType | number | 翻转类型,仅支持 1 和 2。1 表示水平翻转,2 表示垂直翻转 |
APIResponse<boolean>:
result === true 表示原地翻转成功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;
}