import type { Component } from 'vue';
/**
 * Minimum shape every host's schema module must satisfy. Hosts extend this
 * with their own metadata / capability fields via the generic.
 */
export type RegistryModuleBase = Readonly<{
    type: string;
    compatibilityDate: string;
}>;
/**
 * Per-entry shape produced by the factory before host-specific extras are
 * applied. Hosts widen this via `TEntryExtras` returned from
 * `deriveEntryExtras` (e.g. form's `deprecated` / `supersededBy`).
 */
export type RegistryDraft<TModule extends RegistryModuleBase> = Readonly<{
    type: string;
    compatibilityDate: string;
    config: Component;
    runtime: Component;
    module: TModule;
}>;
export type RegistryOptions<TModule extends RegistryModuleBase, TEntryExtras extends object> = Readonly<{
    /** Error-message prefix, e.g. `shwfed-form`. */
    hostName: string;
    /** Folder segment under `<host>/`, e.g. `fields`, `columns`, `buttons`. */
    dirSegment: string;
    /** Eager `import.meta.glob` over the host's schema.ts files. */
    schemaModules: Record<string, TModule>;
    /** Eager `import.meta.glob` over the host's config.vue files (default import). */
    configModules: Record<string, Component>;
    /** Eager `import.meta.glob` over the host's runtime.vue files (default import). */
    runtimeModules: Record<string, Component>;
    /**
     * Optional per-module validation beyond the type/date drift checks. Throw
     * to fail at module load. Used by table to require `toColumnDef`
     * to be a function.
     */
    validateModule?: (mod: TModule, type: string, date: string) => void;
    /**
     * Optional factory producing host-specific extras for each draft. Receives
     * the full draft set first (so hosts can compute cross-entry data such as
     * deprecation), then returns a per-draft mapper. Defaults to no extras.
     */
    deriveEntryExtras?: (drafts: ReadonlyArray<RegistryDraft<TModule>>) => (draft: RegistryDraft<TModule>) => TEntryExtras;
}>;
export type RegistryEntry<TModule extends RegistryModuleBase, TEntryExtras extends object> = Readonly<{
    type: string;
    compatibilityDate: string;
    config: Component;
    runtime: Component;
    module: TModule;
} & TEntryExtras>;
export type Registry<TModule extends RegistryModuleBase, TEntryExtras extends object> = Readonly<{
    ENTRIES: ReadonlyArray<RegistryEntry<TModule, TEntryExtras>>;
    find: (type: string, compatibilityDate: string) => RegistryEntry<TModule, TEntryExtras> | undefined;
}>;
export declare function defineRegistry<TModule extends RegistryModuleBase, TEntryExtras extends object = Record<never, never>>(options: RegistryOptions<TModule, TEntryExtras>): Registry<TModule, TEntryExtras>;
