PluginDependency
Since v0.4.1
Declares a dependency on another plugin.
Example
Section titled “Example”export class UndoRedoPlugin extends BaseGridPlugin { static readonly dependencies: PluginDependency[] = [ { name: 'editing', required: true }, ];}Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
name | string | The name of the required plugin (matches the plugin’s name property). Use string names for loose coupling - avoids static imports. |
required? | boolean | Whether this dependency is required (hard) or optional (soft). - true: Plugin cannot function without it. Throws error if missing. - false: Plugin works with reduced functionality. Silent if missing (set severity to 'warn' or 'info' to opt into a message). |
severity? | error | warn | info | Explicit severity when this dependency is missing. Overrides the default derived from required. - 'error': throw (halts grid setup). Default when required is not false. - 'warn': log a console warning and continue (development only). - 'info': log a verbose console.debug message and continue (development only). v2.16.0+ |
when? | (pluginConfig: unknown) => boolean | Optional predicate that gates whether this dependency applies, evaluated against the depending plugin’s own resolved configuration (defaults merged with user config). Return false to skip the dependency entirely. v2.16.0+ |
reason? | string | Human-readable reason for this dependency. Shown in error/info messages to help users understand why. |
Property Details
Section titled “Property Details”required
Section titled “required”Default: true
Optional predicate that gates whether this dependency applies, evaluated
against the depending plugin’s own resolved configuration (defaults merged
with user config). Return false to skip the dependency entirely.
Lets a plugin require/recommend another plugin only under certain config — e.g. a plugin that needs a tool-panel host only when its tool panel is enabled. When omitted, the dependency always applies.
when: (cfg: PivotConfig) => cfg.showToolPanel === truereason
Section titled “reason”"UndoRedoPlugin needs EditingPlugin to track cell edits"
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://toolboxjs.com/llms-full.txt