Skip to main content
static getCurrentFilePath(): Promise<APIResponse<string>>;

Example

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

/**
 * Example: get current file path.
 */
export async function exampleGetCurrentFilePath() {
 const res = await PluginCommAPI.getCurrentFilePath();
 if (!res.success) {
 throw new Error(res.error?.message ?? 'getCurrentFilePath call failed');
 }
 return res.result;
}