#[plugin_api]Expand description
Marker attribute for customizing individual API methods
This attribute is parsed by #[plugin_api_impl] but doesn’t generate any code itself.
§Options
skip- Exclude method from TypeScript generationjs_name = "..."- Custom JavaScript method nameasync_promise- Method returnsPromise<T>async_thenable- Method returnsProcessHandle<T>(cancellable)ts_type = "..."- Custom TypeScript type for a parameterts_return = "..."- Custom TypeScript return type
§Examples
ⓘ
// Skip internal helper
#[plugin_api(skip)]
fn internal_helper(&self) { ... }
// Async method with custom return type
#[plugin_api(async_promise, js_name = "fetchData", ts_return = "DataResult")]
fn fetch_data_start(&self) -> u64 { ... }
// Cancellable operation
#[plugin_api(async_thenable, js_name = "spawnProcess", ts_return = "SpawnResult")]
fn spawn_process_start(&self, cmd: String) -> u64 { ... }