Returns
APIResponse<number>, whereresultis one of:0: not encrypted1: encrypted and locked (not unlocked in the current plugin session)2: encrypted and unlocked in the current plugin session
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get the encryption status of a file or directory.
static getPathEncryptionStatus(filePath: string): Promise<APIResponse<number>>;
| Parameter | Type | Description |
|---|---|---|
filePath | string | File or directory path |
APIResponse<number>, where result is one of:
0: not encrypted1: encrypted and locked (not unlocked in the current plugin session)2: encrypted and unlocked in the current plugin sessionimport { PluginFileAPI } from 'sn-plugin-lib';
/**
* Example: get the encryption status of a file or directory.
*/
export async function exampleGetPathEncryptionStatus() {
const filePath = '/storage/emulated/0/Note/demo.note';
const res = await PluginFileAPI.getPathEncryptionStatus(filePath);
if (!res.success) {
throw new Error(res.error?.message ?? 'getPathEncryptionStatus call failed');
}
return res.result;
}