跳转到主要内容
static getFileMachineType(notePath: string): Promise<APIResponse<number>>;
参数
参数类型说明
notePathstring笔记/mark文件路径
返回
  • APIResponse<number>result 为设备类型:0=A51=A62=A6X3=A5X4=Nomad5=Manta

示例

import { PluginFileAPI } from 'sn-plugin-lib';

/**
 * 获取创建该笔记/批注文件的设备类型示例。
 */
export async function exampleGetFileMachineType() {
  const notePath = '/storage/emulated/0/Note/demo.note';

  const res = await PluginFileAPI.getFileMachineType(notePath);
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getFileMachineType 调用失败');
  }
  return res.result;
}