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.

static generateLassoPreview(imagePath: string): Promise<APIResponse<LassoPreview>>;
Parameters
ParameterTypeDescription
imagePathstringOutput path for the preview image
Returns
  • APIResponse<T>: result is a lasso preview object with the following structure:
FieldTypeDescription
imagePathstringPath of the generated preview image
rectRectLasso area
rotateDegreenumberRotation angle

Example

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

/**
 * Example: generate a preview image for lasso elements.
 */
export async function exampleGenerateLassoPreview() {
  const res = await PluginCommAPI.generateLassoPreview('/storage/emulated/0/Note/out/lasso-preview.png');
  if (!res.success) {
    throw new Error(res.error?.message ?? 'generateLassoPreview call failed');
  }
  return res.result;
}