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
| Parameter | Type | Description |
|---|
imagePath | string | Output path for the preview image |
Returns
APIResponse<T>: result is a lasso preview object with the following structure:
| Field | Type | Description |
|---|
imagePath | string | Path of the generated preview image |
rect | Rect | Lasso area |
rotateDegree | number | Rotation 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;
}