import type { ColumnSelectMode } from "./ColumnSelectMode.js"; import type { GroupRollupMode } from "./GroupRollupMode.js"; /** * Static, immutable configuration for a plugin. * * Returned once per plugin from `get_static_config()` at registration * time and cached in [`crate::renderer::PluginRecord`]. Consumers * (renderer, session, queries, components) read these fields off the * renderer's active-plugin metadata rather than calling back into JS. * * `` reads this exactly once per plugin (at * `registerPlugin` time) and caches it for the lifetime of the * application. The result must be stable; do not mutate any field * after registration. */ export type PluginStaticConfig = { /** * The unique key for this plugin. Used as the `plugin` field in a * `ViewerConfig` and as the display name key in the * `` UI. */ name: string; /** * Category in the plugin picker menu. */ category?: string | null; /** * Soft limit on the number of columns the plugin will render. * Triggers the "Rendering N of M" warning when the view exceeds * this value (until dismissed). */ max_columns?: number | null; /** * Soft limit on the number of cells (rows × columns) the plugin * will render. Triggers the "Rendering N of M" warning when the view * exceeds this value (until dismissed). */ max_cells?: number | null; /** * Column add/remove behavior. `"select"` exclusively selects the * added column, removing other columns. `"toggle"` toggles the * column on or off based on its current state, leaving other * columns alone. */ select_mode?: ColumnSelectMode; /** * Minimum number of columns the plugin requires to render. Mostly * affects drag/drop and column-remove button behavior. `undefined` * is treated identically to `1`. */ min_config_columns?: number | null; /** * Named column slots. Named columns have replace/swap behavior in * drag/drop rather than insert. The length must be at least * `min_config_columns`. */ config_column_names?: Array; /** * Group-rollup modes the plugin accepts, in preference order. * The first entry that matches a feature flag becomes the default. */ group_rollup_modes?: Array | null; /** * Plugin load priority. Higher numbers win; ties resolve in * registration order. The highest-priority plugin is loaded by * default unless `restore({ plugin })` overrides it. */ priority?: number | null; /** * Whether this plugin opts into per-column style controls in the * settings sidebar. When `true`, the StyleTab is shown for active * columns and the plugin's `column_config_schema` is queried for * the per-column field set. When `false` or omitted, no StyleTab * is shown. */ can_render_column_styles?: boolean; };