import type { MintConfig, MintFactory, MintProp } from './types.js'; /** * Statically-imported fallback factories, keyed by mint name. * * Components pass their *default* mint's factory here — Button imports * `scaleMint` directly and calls `mintRegistry.apply(el, mint, { scale: * scaleMint })` — so the default effect ships tree-shaken with the component * instead of dragging the whole built-in set (micro-interactions, the ripple * engine, compose, presets — ~3.9 KB min) into every consumer bundle. Same * precedence as `resolveIcon(name, fallback)`: a registry entry (consumer * override / loaded built-in) wins, the direct import is only the fallback. * See docs/ICON-DESIGN.md → "Icon resolution & tree-shaking". */ export type MintFallbacks = Readonly>>; /** * @internal Shared with ./compose.ts so composite string members resolve * through the same demand-load; not part of the public API. */ export declare function loadBuiltinMints(): Promise; declare class MintRegistry { private mints; private instances; /** Register a mint globally */ register(name: string, factory: MintFactory): void; /** * Register a built-in mint — only if the name is still free. Used by the * built-in set (`registerDefaultMints()`) so the * demand-load NEVER clobbers a consumer override: a `register()` entry * survives regardless of whether it ran before or during the load. A later * explicit `register()` call still overrides as before. */ registerBuiltin(name: string, factory: MintFactory): void; /** Get a mint factory by name */ get(name: string): MintFactory | undefined; /** Check if a mint is registered */ has(name: string): boolean; /** * Apply mints to an element using polymorphic input. * * Resolution order per name: registry entry (consumer `register()` override * or an already-loaded built-in) → `fallbacks` (statically imported by the * caller) → lazy-loaded built-in set. Names that resolve synchronously are * applied synchronously; unresolved names wait for the built-ins chunk * (one-time microtask + fetch). Events firing inside that fetch window are * NOT replayed — on a slow network, a click landing before a demand-loaded * click-triggered mint (ripple, shake) finished loading is lost for that * effect. Acceptable for decorative effects (documented contract, see * mint/README.md); consumers who need first-interaction guarantees register * the effect statically up front (`registerDefaultMints()`). * * One apply() per element: a second apply() on the same element replaces * the instances map the first one registered, and the first cleanup then * deletes it — `update()` for the second application would go dead. Every * in-repo caller pairs exactly one apply() per element with its `$effect` * teardown, which upholds this. The same effect name twice in one mint * array is equally degenerate: the instances map keys by name, and the * entries' inline config vars share one element — last writer wins. */ apply(el: HTMLElement, mint: MintProp, fallbacks?: MintFallbacks): () => void; /** Normalize polymorphic mint prop to consistent format */ private normalizeMintProp; /** * Update mint config for an element. * * No-op for a name still inside the demand-load fetch window (it is not in * the element's instances map yet) — same decorative-effect contract as the * lost-first-interaction case documented on `apply()`. */ update(el: HTMLElement, name: string, config: MintConfig): void; /** List all registered mint names */ list(): string[]; /** * Clear all mints. Test-only escape hatch: this does NOT reset the * demand-load latch (`builtinsLoading` here, `defaultMintsRegistered` in * ./presets.ts), so built-ins stay gone until a module reload — tests use * `vi.resetModules()` for a fresh registry. Pre-existing behaviour from the * eager-registration era, kept as-is. */ clear(): void; } export declare const mintRegistry: MintRegistry; export {};