import type { Database, SqlValue } from '@quereus/quereus'; import type { PluginManifest, PluginRegistrations } from './manifest.js'; /** * Plugin module interface - what we expect from a plugin module */ export interface PluginModule { /** Default export - the plugin registration function */ default: (db: Database, config?: Record) => Promise | PluginRegistrations; } /** * Dynamically loads and registers a plugin module * * @param url The URL to the ES module (can be https:// or file:// URL) * @param db The Database instance to register the module with * @param config Configuration values to pass to the module * @returns The plugin's manifest if available */ export declare function dynamicLoadModule(url: string, db: Database, config?: Record): Promise; /** * Validates that a URL is likely to be a valid plugin module * * @param url The URL to validate * @returns true if the URL appears valid */ export declare function validatePluginUrl(url: string): boolean; /** Loader options for loadPlugin */ export interface LoadPluginOptions { /** * Environment hint. Defaults to auto-detection. * 'browser' enables optional CDN resolution when allowCdn is true. */ env?: 'auto' | 'browser' | 'node'; /** * Allow resolving npm: specs to a public CDN in browser contexts. * Disabled by default (opt-in). */ allowCdn?: boolean; /** Which CDN to use when allowCdn is true. Defaults to 'jsdelivr'. */ cdn?: 'jsdelivr' | 'unpkg' | 'esm.sh'; } /** * High-level plugin loader that accepts npm specs or direct URLs. * * Examples: * - npm:@scope/quereus-plugin-foo@^1 * - @scope/quereus-plugin-foo (npm package name) * - https://raw.githubusercontent.com/user/repo/main/plugin.js * - file:///path/to/plugin.js (Node only) */ export declare function loadPlugin(spec: string, db: Database, config?: Record, options?: LoadPluginOptions): Promise; //# sourceMappingURL=plugin-loader.d.ts.map