/** * Plugin validation functions. * Validates that plugins conform to the ProseQLPlugin interface and * detects conflicts between plugins. */ import { Effect } from "effect"; import { PluginError } from "../errors/plugin-errors.js"; import { type DatabaseConfig } from "../types/database-config-types.js"; import type { CustomIdGenerator, ProseQLPlugin } from "./plugin-types.js"; /** * Validates that a plugin conforms to the ProseQLPlugin interface. * * Checks: * - `name` is a non-empty string * - `codecs` entries have `name`, `extensions`, `encode`, and `decode` * - `operators` entries have `name` starting with `$` and an `evaluate` function * - `idGenerators` entries have `name` and `generate` * * @param plugin - The plugin to validate * @returns Effect - Succeeds if valid, fails with PluginError if not */ export declare const validatePlugin: (plugin: ProseQLPlugin) => Effect.Effect; /** * Validates that all plugin dependencies are satisfied. * For each plugin with `dependencies`, verifies that every dependency name * appears in the plugin array. * * @param plugins - Array of plugins to validate * @returns Effect - Succeeds if all dependencies satisfied, fails with PluginError listing missing dependencies */ export declare const validateDependencies: (plugins: ReadonlyArray) => Effect.Effect; /** * Validates that no custom operators conflict with built-in operators * and that no two plugins register operators with the same name. * * @param plugins - Array of plugins to validate * @returns Effect - Succeeds if no conflicts, fails with PluginError listing the conflict */ export declare const validateOperatorConflicts: (plugins: ReadonlyArray) => Effect.Effect; /** * Validates that all collection-configured `idGenerator` names exist in the plugin registry. * Called at init time to ensure fast failure with clear error messages. * * @param config - The database configuration with collection configs * @param idGenerators - Map of ID generator names to generators from the plugin registry * @returns Effect - Succeeds if all references are valid, fails with PluginError listing the missing generator */ export declare const validateIdGeneratorReferences: (config: DatabaseConfig, idGenerators: Map) => Effect.Effect; //# sourceMappingURL=plugin-validation.d.ts.map