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 deleteLayers(notePath: string, page: number, layerIds: number[]): Promise<APIResponse<boolean>>;
参数
| 参数 | 类型 | 说明 |
|---|
notePath | string | 笔记文件路径 |
page | number | 页面索引(从 0 开始) |
layerIds | number[] | 需要删除的图层 ID(1-3)列表 |
返回
import { PluginFileAPI } from 'sn-plugin-lib';
/**
* 删除图层的示例。
*/
export async function exampleDeleteLayers() {
const notePath = '/storage/emulated/0/Note/demo.note';
const page = 1;
const res = await PluginFileAPI.deleteLayers(notePath, page, [1, 2]);
if (!res.success) {
throw new Error(res.error?.message ?? 'deleteLayers 调用失败');
}
return res.result;
}