import type { ACIExtension, ExtensionInfo, ValidationResult } from './types.js';
/**
 * Registry for ACI extensions
 *
 * Provides centralized management of Layer 4 extensions including:
 * - Registration and unregistration
 * - Lookup by ID or shortcode
 * - Validation of extension metadata and structure
 * - Lifecycle management (load/unload hooks)
 *
 * @example
 * ```typescript
 * const registry = new ExtensionRegistry();
 *
 * // Register an extension
 * registry.register(myExtension);
 *
 * // Look up by ID
 * const ext = registry.get('aci-ext-governance-v1');
 *
 * // Look up by shortcode
 * const ext2 = registry.getByShortcode('gov');
 *
 * // List all extensions
 * const all = registry.list();
 * ```
 */
export declare class ExtensionRegistry {
    /** Map of extensionId to extension instance */
    private extensions;
    /** Map of shortcode to extensionId for quick lookup */
    private shortcodes;
    /** Map of extensionId to registration timestamp */
    private registrationTimes;
    /** Map of extensionId to loaded state */
    private loadedState;
    /**
     * Register an extension with the registry
     *
     * Validates the extension metadata and structure, then registers it
     * for use. If the extension has an onLoad hook, it will be called.
     *
     * @param extension - The extension to register
     * @throws {ValidationError} If extension fails validation
     * @throws {ConflictError} If extensionId or shortcode is already registered
     *
     * @example
     * ```typescript
     * registry.register({
     *   extensionId: 'aci-ext-custom-v1',
     *   name: 'Custom Extension',
     *   version: '1.0.0',
     *   shortcode: 'cust',
     *   publisher: 'did:web:example.com',
     *   description: 'A custom extension',
     *   requiredACIVersion: '>=1.0.0',
     * });
     * ```
     */
    register(extension: ACIExtension): Promise<void>;
    /**
     * Unregister an extension from the registry
     *
     * If the extension has an onUnload hook, it will be called before removal.
     *
     * @param extensionId - The ID of the extension to unregister
     * @throws {NotFoundError} If extension is not registered
     *
     * @example
     * ```typescript
     * await registry.unregister('aci-ext-custom-v1');
     * ```
     */
    unregister(extensionId: string): Promise<void>;
    /**
     * Get an extension by its ID
     *
     * @param extensionId - The extension ID to look up
     * @returns The extension if found, undefined otherwise
     *
     * @example
     * ```typescript
     * const ext = registry.get('aci-ext-governance-v1');
     * if (ext) {
     *   // Use extension
     * }
     * ```
     */
    get(extensionId: string): ACIExtension | undefined;
    /**
     * Get an extension by its shortcode
     *
     * @param shortcode - The shortcode to look up (e.g., "gov", "audit")
     * @returns The extension if found, undefined otherwise
     *
     * @example
     * ```typescript
     * const ext = registry.getByShortcode('gov');
     * ```
     */
    getByShortcode(shortcode: string): ACIExtension | undefined;
    /**
     * Get extension ID by shortcode
     *
     * @param shortcode - The shortcode to look up
     * @returns The extension ID if found, undefined otherwise
     */
    getIdByShortcode(shortcode: string): string | undefined;
    /**
     * Check if an extension is registered
     *
     * @param extensionId - The extension ID to check
     * @returns True if registered, false otherwise
     */
    has(extensionId: string): boolean;
    /**
     * Check if a shortcode is registered
     *
     * @param shortcode - The shortcode to check
     * @returns True if registered, false otherwise
     */
    hasShortcode(shortcode: string): boolean;
    /**
     * List all registered extensions
     *
     * @returns Array of extension information
     *
     * @example
     * ```typescript
     * const extensions = registry.list();
     * for (const info of extensions) {
     *   console.log(`${info.name} (${info.shortcode})`);
     * }
     * ```
     */
    list(): ExtensionInfo[];
    /**
     * Get multiple extensions by their IDs
     *
     * @param extensionIds - Array of extension IDs
     * @returns Array of found extensions (missing ones are omitted)
     */
    getMany(extensionIds: string[]): ACIExtension[];
    /**
     * Get multiple extensions by their shortcodes
     *
     * @param shortcodes - Array of shortcodes
     * @returns Array of found extensions (missing ones are omitted)
     */
    getManyByShortcode(shortcodes: string[]): ACIExtension[];
    /**
     * Validate an extension's metadata and structure
     *
     * Checks:
     * - Extension ID format (aci-ext-{name}-v{version})
     * - Shortcode format (lowercase, 1-10 chars)
     * - Required metadata fields
     * - Version format (semver)
     * - Hook implementations
     *
     * @param extension - The extension to validate
     * @returns Validation result with errors and warnings
     *
     * @example
     * ```typescript
     * const result = registry.validate(myExtension);
     * if (!result.valid) {
     *   console.error('Validation errors:', result.errors);
     * }
     * ```
     */
    validate(extension: ACIExtension): ValidationResult;
    /**
     * Get the count of registered extensions
     *
     * @returns Number of registered extensions
     */
    get size(): number;
    /**
     * Clear all registered extensions
     *
     * Calls onUnload for each extension before clearing.
     * Use with caution - primarily for testing.
     */
    clear(): Promise<void>;
    /**
     * Get available hooks for an extension
     *
     * @param extension - The extension to check
     * @returns Array of hook names that are implemented
     */
    private getAvailableHooks;
}
/**
 * Create a new extension registry instance
 *
 * @returns A new ExtensionRegistry instance
 *
 * @example
 * ```typescript
 * const registry = createExtensionRegistry();
 * await registry.register(myExtension);
 * ```
 */
export declare function createExtensionRegistry(): ExtensionRegistry;
//# sourceMappingURL=registry.d.ts.map