Skip to content

LifecycleAPI

Defined in: namespaces.ts:1093

onDependencyAvailable(depId, handler): void

Defined in: namespaces.ts:1095

Registers a handler called when a dependency becomes available.

string

() => void

void


onDependencyUnavailable(depId, handler): void

Defined in: namespaces.ts:1097

Registers a handler called when a dependency becomes unavailable.

string

() => void

void


getDependencyStatus(): Promise<DependencyStatus[]>

Defined in: namespaces.ts:1108

Returns the current status of all declared dependencies (system + plugin).

Each entry includes installation state, version info, and satisfaction status. System dependencies are probed via check.command; plugin dependencies are resolved from the host’s plugin registry.

Promise<DependencyStatus[]>

Promise resolving to an array of dependency status objects.


recheckDependencies(): Promise<DependencyStatus[]>

Defined in: namespaces.ts:1119

Re-runs both system and plugin dependency checks and updates state.

Call after the user installs a missing system dependency (e.g., brew install yt-dlp). If all required deps become satisfied, the plugin transitions from degraded to active. Fires onDependencyStatusChanged handlers if any status changed.

Promise<DependencyStatus[]>

Promise resolving to the updated dependency status array.


onDependencyStatusChanged(handler): string

Defined in: namespaces.ts:1132

Registers a handler called when any dependency status changes.

Fires on:

  • Host-side recheckDependencies() (manual or SwiftUI-triggered)
  • Plugin-side recheckDependencies() (JS bridge call)
  • Dependency plugin lifecycle changes (activate, deactivate, degraded)

(statuses) => void

Callback receiving the full updated status array.

string

A token string that can be used to identify the registration.