返回
APIResponse<number>,result取值:0:文件未加密1:文件已加密,但当前插件会话中尚未解密2:文件已加密,且已在当前插件会话中解密
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
获取文件或目录的加密状态。
static getPathEncryptionStatus(filePath: string): Promise<APIResponse<number>>;
| 参数 | 类型 | 说明 |
|---|---|---|
filePath | string | 文件或目录路径 |
APIResponse<number>,result 取值:
0:文件未加密1:文件已加密,但当前插件会话中尚未解密2:文件已加密,且已在当前插件会话中解密import { PluginFileAPI } from 'sn-plugin-lib';
/**
* 查询文件或目录加密状态的示例。
*/
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 调用失败');
}
return res.result;
}