import { LadrillosComponent } from '../types'; import { LazyStrategy } from './lazy'; /** * Component registration configuration */ export interface ComponentConfig { name: string; path: string; useShadowDOM?: boolean; /** * Lazy loading configuration: * - `false` (default): Load immediately * - `true`: Lazy load using default strategy (visible with 100px margin) * - `LazyStrategy`: Custom lazy loading strategy */ lazy?: boolean | LazyStrategy; } /** * Result of a batch component registration */ export interface RegisterComponentsResult { /** Components that registered successfully */ success: string[]; /** Components that failed with their errors */ failed: Array<{ name: string; error: Error; }>; /** Components that were skipped (already registered) */ skipped: string[]; } declare class Ladrillos { components: Record; private readonly registeredNames; constructor(); registerComponent(name: string, path: string, useShadowDOM?: boolean, lazy?: boolean | LazyStrategy): Promise; /** * Register multiple components at once with parallel fetching. * * Benefits over sequential registration: * - Parallel network requests via Promise.allSettled * - Early deduplication check (skips already registered) * - Defines each component as soon as its source and dependencies are ready * - Returns detailed results for error handling * * @example * ```js * // Array syntax * await ladrillos.registerComponents([ * { name: 'my-header', path: './header.html' }, * { name: 'my-footer', path: './footer.html', useShadowDOM: false } * ]); * * // Object syntax * await ladrillos.registerComponents({ * 'my-header': './header.html', * 'my-footer': { path: './footer.html', useShadowDOM: false } * }); * ``` */ registerComponents(configs: ComponentConfig[] | Record>): Promise; /** * Force load a lazy component programmatically. * Useful for preloading components before they're visible. */ loadLazyComponent(name: string): Promise; } export declare const ladrillos: Ladrillos; export {};