Skip to main content
Only NOTE files have title data; DOC files do not.
static getTitles(NOTEPath: string, pageList: number[]): Promise<APIResponse<Title[]>>;
Parameters
ParameterTypeDescription
NOTEPathstringNOTE file path
pageListnumber[]Page index list (starts from 0)
Returns

Example

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

/**
 * Example: get titles of specified pages.
 */
export async function exampleGetTitles() {
 const NOTEPath = '/storage/emulated/0/Note/demo.note';
 const res = await PluginFileAPI.getTitles(NOTEPath, [0, 1, 2]);
 if (!res.success) {
 throw new Error(res.error?.message ?? 'getTitles call failed');
 }
 return res.result;
}