Skip to content

PluginDependency

Since v0.4.1

Declares a dependency on another plugin.

export class UndoRedoPlugin extends BaseGridPlugin {
static readonly dependencies: PluginDependency[] = [
{ name: 'editing', required: true },
];
}
PropertyTypeDescription
namestringThe name of the required plugin (matches the plugin’s name property). Use string names for loose coupling - avoids static imports.
required?booleanWhether 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 | infoExplicit 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) => booleanOptional 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?stringHuman-readable reason for this dependency. Shown in error/info messages to help users understand why.

Default: true


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).

When omitted, a missing hard dependency throws and a missing soft dependency is silent — preserving backward-compatible behavior.


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 === true

"UndoRedoPlugin needs EditingPlugin to track cell edits"