复制
static getStickerSize(path: string): Promise<APIResponse<Size>>;
| 参数 | 类型 | 说明 |
|---|---|---|
path | string | 贴纸路径 |
APIResponse<Size>:result为Size
示例
复制
import { PluginCommAPI } from 'sn-plugin-lib';
/**
* 获取贴纸尺寸的示例。
*/
export async function exampleGetStickerSize() {
const stickerPath = '/storage/emulated/0/Note/stickers/demo.png';
const res = await PluginCommAPI.getStickerSize(stickerPath);
if (!res.success) {
throw new Error(res.error?.message ?? 'getStickerSize 调用失败');
}
return res.result;
}