跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.supernote.com/llms.txt

Use this file to discover all available pages before exploring further.

static getCurrentFilePath(): Promise<APIResponse<string>>;

示例

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

/**
 * 获取当前文件路径的示例。
 */
export async function exampleGetCurrentFilePath() {
  const res = await PluginCommAPI.getCurrentFilePath();
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getCurrentFilePath 调用失败');
  }
  return res.result;
}