SDK 文档版本:v0.1.25
在当前文件当前页当前图层插入一个五角星。
static insertFiveStar(starPoints: Point[]): Promise<APIResponse<boolean>>;
starPoints
Point[]
APIResponse<boolean>
result === true
import { PluginCommAPI } from 'sn-plugin-lib'; /** * 插入五角星的示例(需要 6 个点且首尾一致)。 */ export async function exampleInsertFiveStar() { const starPoints = [ { x: 100, y: 20 }, { x: 120, y: 80 }, { x: 180, y: 80 }, { x: 130, y: 120 }, { x: 150, y: 180 }, { x: 100, y: 20 }, ]; const res = await PluginCommAPI.insertFiveStar(starPoints); if (!res.success) { throw new Error(res.error?.message ?? 'insertFiveStar 调用失败'); } return res.result; }