APIResponse<boolean>:result === true表示当前视图支持手写,result === false表示当前视图不支持手写
PluginCommAPI
canHandwrite
检查当前视图是否支持手写。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
检查当前视图是否支持手写。
static canHandwrite(): Promise<APIResponse<boolean>>;
APIResponse<boolean>:
result === true 表示当前视图支持手写,result === false 表示当前视图不支持手写import { PluginCommAPI } from 'sn-plugin-lib';
/**
* 检查当前视图是否支持手写的示例。
*/
export async function exampleCanHandwrite() {
const res = await PluginCommAPI.canHandwrite();
if (!res.success) {
console.log('canHandwrite failed', res.error);
throw new Error(res.error?.message ?? 'canHandwrite 调用失败');
}
console.log('canHandwrite result', res.result);
return res.result;
}