Skip to main content
static getFileMachineType(notePath: string): Promise<APIResponse<number>>;
Parameters
ParameterTypeDescription
notePathstringNote/annotation file path
Returns

Example

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

/**
 * Example: get the device type that created this note/annotation file.
 */
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 call failed');
  }
  return res.result;
}