Skip to main content

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.

You must select text in DOC before calling this API; otherwise the call will fail.
static getLastSelectedText(): Promise<APIResponse<string>>;
Returns

Example

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

/**
 * Example: get the last selected text.
 */
export async function exampleGetLastSelectedText() {
  const res = await PluginDocAPI.getLastSelectedText();
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getLastSelectedText call failed');
  }
  return res.result;
}