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.
static insertFiveStar(starPoints: Point[]): Promise<APIResponse<boolean>>;
参数
| 参数 | 类型 | 说明 |
|---|
starPoints | Point[] | 五角星点集(像素点坐标系),必须为 6 个点且首尾点相同 |
返回
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;
}