跳转到主要内容
static getStickerSize(path: string): Promise<APIResponse<Size>>;
参数
参数类型说明
pathstring贴纸路径
返回

示例

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;
}