import { ComponentType } from 'react'; export type VariantRegistry
= Record {
/** Registered variants keyed by the backend variant name. */
variants: VariantRegistry ;
/** Rendered when the incoming variant is unknown or absent. Required so an
* unrecognized backend variant degrades gracefully instead of crashing. */
fallback: ComponentType ;
/** Label used in the dev warning logged on an unknown variant. */
name?: string;
}
/**
* Builds a block that dispatches on `variant` to a registered component,
* falling back to `fallback` (with a dev warning) when the variant is unknown.
*
* This is the single place an n-variant block resolves its variant, so no block
* re-hand-rolls `variants[variant as keyof typeof variants]` or forgets the
* unknown-variant guard. Adding a variant becomes: write one presentational
* component + register it — existing variants are never touched (open/closed).
*
* Works for any block whose variants share a props shape `P`; the caller passes
* the resolved `variant` plus those props.
*/
export declare function createVariantBlock ({ variants, fallback, name, }: CreateVariantBlockConfig ): ComponentType ;
export {};