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.

This API gets cached Element data by element uuid, including strokes, links, titles, geometries, and text boxes.
After calling clearElementCache(), previously obtained Element objects/uuids can no longer be used to read cached data.
static getCacheElement(uuid: string): Promise<APIResponse<Element>>;
Parameters
ParameterTypeDescription
uuidstringElement UUID
Returns

Example

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

/**
 * Example: get cached Element by uuid.
 */
export async function exampleGetCacheElement(uuid: string) {
 const res = (await PluginCommAPI.getCacheElement(uuid)) as any;
 if (!res.success) {
 console.log('getCacheElement failed', res.error);
 throw new Error(res.error?.message ?? 'getCacheElement call failed');
 }
 console.log('getCacheElement result', res.result);
 return res.result;
}