//#region ../@warlock.js/seal/src/plugins/plugin-system.d.ts /** * Seal Plugin System * * Allows extending validators with custom functionality via plugins */ type PluginContext = { /** Plugin name */name: string; /** Plugin version */ version?: string; }; type SealPlugin = { /** Plugin metadata */name: string; version?: string; description?: string; /** * Install function - called when plugin is registered * This is where you inject methods into validators * * @example * ```ts * install() { * Object.assign(StringValidator.prototype, { * slug(this: StringValidator) { * return this.pattern(/^[a-z0-9-]+$/); * } * }); * } * ``` */ install: (context: PluginContext) => void | Promise; /** * Uninstall the plugin (optional) * Clean up any injected methods */ uninstall?: () => void | Promise; }; /** * Register a plugin * * @example * ```ts * const slugPlugin: SealPlugin = { * name: "slug", * install() { * Object.assign(StringValidator.prototype, { * slug(this: StringValidator) { * return this.pattern(/^[a-z0-9-]+$/); * } * }); * } * }; * * registerPlugin(slugPlugin); * ``` */ declare function registerPlugin(plugin: SealPlugin): Promise; /** * Unregister a plugin */ declare function unregisterPlugin(pluginName: string): Promise; /** * Check if a plugin is installed */ declare function hasPlugin(pluginName: string): boolean; /** * Get list of installed plugins */ declare function getInstalledPlugins(): SealPlugin[]; //#endregion export { PluginContext, SealPlugin, getInstalledPlugins, hasPlugin, registerPlugin, unregisterPlugin }; //# sourceMappingURL=plugin-system.d.mts.map