跳转到主要内容
套索元素之后才能调用这个接口,否则会调用失败。
static getLassoRect(): Promise<APIResponse<Rect>>;
返回

示例

import { PluginCommAPI, type Rect } from 'sn-plugin-lib';

/**
 * 获取套索框矩形的示例。
 */
export async function exampleGetLassoRect(): Promise<Rect> {
  const res = await PluginCommAPI.getLassoRect();
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getLassoRect 调用失败');
  }
  return res.result;
}