import { AdapterDomain, AdapterStatusInfo, DomainAdapterConfig, AdapterStatusType, DbAdapter, AuthAdapter, PaymentsAdapter, AiAdapter, FileStorageAdapter, AdminAdapter, LoggerAdapter, AdapterError } from '@geenius/adapters'; import { JSX, Context } from 'solid-js'; import { ClassValue } from 'clsx'; /** * @module AdapterCard * @package @geenius/adapters/solidjs * @description Renders the Tailwind-based adapter summary card for the SolidJS * variant. The card surfaces provider status, latency, and domain metadata for * one adapter domain in the dashboard views. */ /** * Props for rendering a single adapter summary card in the SolidJS dashboard grid. * * @property domain Adapter domain represented by the card. * @property status Current provider health and metadata for the domain. * @property onClick Optional callback fired when the card is activated. * @property onErrorAction Optional recovery callback shown when the status has an error. * @property errorActionLabel Optional label for the error recovery action. * @property class Optional class name merged into the card container. */ interface AdapterCardProps { domain: AdapterDomain; status: AdapterStatusInfo; onClick?: () => void; onErrorAction?: () => void; errorActionLabel?: string; class?: string; } /** * Renders a clickable SolidJS summary card for one adapter domain. * * @param props Card props including the adapter domain, status payload, and click handler. * @returns An interactive button when selection is enabled, otherwise a static summary card. */ declare function AdapterCard(props: AdapterCardProps): JSX.Element; /** * @module AdapterConfigForm * @package @geenius/adapters/solidjs * @description Renders the Tailwind-based SolidJS adapter configuration form. * It provides a variant-parity counterpart to the React form while preserving * Solid primitives and reactivity semantics. */ /** * Props accepted by the SolidJS adapter configuration form. * * @property domain Adapter domain being configured in the current dialog * @property initialConfig Existing configuration values used to hydrate the form * @property onSave Async or sync handler that persists the submitted configuration * @property onCancel Optional callback invoked when the user dismisses the form * @property class Optional class merged onto the form root * @property titleId Optional identifier applied to the form title for dialog labelling */ interface AdapterConfigFormProps { domain: AdapterDomain; initialConfig?: DomainAdapterConfig; onSave: (config: DomainAdapterConfig) => Promise | void; onCancel?: () => void; class?: string; titleId?: string; } /** * Renders the adapter configuration workflow for a single adapter domain. * * @param props Component props controlling the selected domain and form callbacks * @returns A provider chooser and credential form styled with the SolidJS variant * @example * ```tsx * saveConfig('storage', config)} * onCancel={() => setOpen(false)} * /> * ``` */ declare function AdapterConfigForm(props: AdapterConfigFormProps): JSX.Element; /** * @module AdapterList * @package @geenius/adapters/solidjs * @description Renders the searchable adapter grid for the SolidJS variant. * The list consumes provider status from context and delegates selection * events to the hosting page or dashboard shell. */ /** * Props for rendering the SolidJS adapter list and optional status filter controls. * * @property onSelect Optional callback invoked when a domain card is selected. * @property filterStatus Optional status filter applied before rendering the grid. * @property class Optional class name merged into the outer wrapper. */ interface AdapterListProps { onSelect?: (domain: AdapterDomain) => void; filterStatus?: AdapterStatusType; class?: string; } /** * Renders the searchable SolidJS adapter list backed by shared provider state. * * @param props List props including selection callback, status filtering, and wrapper class names. * @returns The adapter grid or an empty state when no entries are available. */ declare function AdapterList(props: AdapterListProps): JSX.Element; /** * @module AdapterStatusBadge * @package @geenius/adapters/solidjs * @description Renders the Tailwind-based adapter status badge for the SolidJS * variant. The badge exposes the shared adapter status vocabulary in a compact, * themeable visual treatment. */ /** * Props for rendering the SolidJS adapter status badge. * * @property status Shared adapter status vocabulary value to display. * @property showLabel Whether the human-readable label should be rendered. * @property size Visual size variant for the badge and status dot. * @property class Optional class name merged into the badge wrapper. */ interface AdapterStatusBadgeProps { status: AdapterStatusType; showLabel?: boolean; size?: "sm" | "md"; class?: string; } /** * Renders a compact SolidJS badge for the current adapter lifecycle state. * * @param props Badge props including the status token, optional label visibility, and size variant. * @returns A styled badge element that mirrors the shared adapter status taxonomy. */ declare function AdapterStatusBadge(props: AdapterStatusBadgeProps): JSX.Element; /** * @module utils * @package @geenius/adapters/solidjs * @description Provides SolidJS-specific utility helpers for composing * Tailwind class names. The module wraps `clsx` and `tailwind-merge` to keep * SolidJS component styling deterministic and ergonomic. */ /** * Merge CSS class names with Tailwind support. * Combines clsx (for conditional classes) with tailwind-merge (to resolve conflicts). * * This utility ensures that Tailwind classes override each other correctly: * cn('px-2', 'px-4') → 'px-4' (not both) * Also handles conditional classes: * cn('p-2', isActive() && 'bg-blue-500') * * @param inputs - Class names, arrays, objects, or conditional values * @returns Merged and deduplicated class string * * @example * ```ts * cn('px-2 py-1', 'px-4') // 'py-1 px-4' * cn('p-2', isActive() && 'bg-blue') // 'p-2 bg-blue' or 'p-2' * cn({ 'text-red': isError(), 'text-green': isSuccess() }) // conditional classes * ``` */ declare function cn(...inputs: ClassValue[]): string; /** * @module AdapterDetailPage * @package @geenius/adapters/solidjs * @description Renders the single-domain adapter detail view for the SolidJS * variant. The page surfaces current provider health, available providers, and * inline configuration for one adapter domain. */ /** * Props for rendering the SolidJS single-domain adapter detail page. * * @property domain Adapter domain whose provider details should be displayed. * @property onBack Optional callback for returning to the dashboard view. * @property onConfigure Optional callback invoked with submitted adapter configuration. * @property class Optional class name merged into the page container. */ interface AdapterDetailPageProps { domain: AdapterDomain; onBack?: () => void; onConfigure?: (domain: AdapterDomain, config: DomainAdapterConfig) => Promise | void; class?: string; } /** * Renders the SolidJS adapter detail page for one adapter domain. * * @param props Page props including the selected domain and optional back-navigation handler. * @returns The detail view with provider health, available providers, and configuration affordances. */ declare function AdapterDetailPage(props: AdapterDetailPageProps): JSX.Element; /** * @module AdaptersPage * @package @geenius/adapters/solidjs * @description Renders the Tailwind-based adapters overview for the SolidJS * package. The page summarizes adapter health, supports status filtering, and * provides an accessible modal workflow for configuring each adapter domain. */ type RegistryEntry = { domain: AdapterDomain; provider: string; status: AdapterStatusType; }; /** * Props accepted by the SolidJS adapters overview page. * * @property onNavigateDetail Optional callback used instead of opening the inline modal * @property onConfigure Optional callback invoked with submitted adapter configuration * @property class Optional class merged onto the page root * @property configByDomain Optional configuration snapshot used to hydrate modal forms * @property registryEntries Optional adapter registry snapshot rendered above the grid */ interface AdaptersPageProps { onNavigateDetail?: (domain: AdapterDomain) => void; onConfigure?: (domain: AdapterDomain, config: DomainAdapterConfig) => Promise | void; class?: string; configByDomain?: Partial>; registryEntries?: RegistryEntry[]; } /** * Renders the adapter management dashboard for the SolidJS variant. * * @param props Page props controlling navigation overrides and registry data * @returns A dashboard with status filters, adapter cards, and a modal editor * @example * ```tsx * navigate(`/adapters/${domain}`)} /> * ``` */ declare function AdaptersPage(props: AdaptersPageProps): JSX.Element; /** * @module index * @package @geenius/adapters/solidjs * @description Defines the SolidJS adapter primitives for reading adapter * instances and adapter status state from the SolidJS provider context. These * primitives are part of the public SolidJS runtime package and avoid * unpublished shared framework subpaths. */ /** * Reads the configured database adapter from the current SolidJS adapter context. * * @returns The active database adapter implementation for the provider tree. * @throws {AdapterContextError} When the provider or adapter is unavailable. */ declare function createDb(): DbAdapter; /** * Reads the configured authentication adapter from the current SolidJS context. * * @returns The active authentication adapter implementation. * @throws {AdapterContextError} When the provider or adapter is unavailable. */ declare function createAuth(): AuthAdapter; /** * Reads the configured authentication adapter from the current SolidJS context. * Alias for {@link createAuth} matching the React `useAuthAdapter` convention. * * @returns The active authentication adapter implementation. * @throws {AdapterContextError} When the provider or adapter is unavailable. */ declare function createAuthAdapter(): AuthAdapter; /** * Reads the configured payments adapter from the current SolidJS context. * * @returns The active payments adapter implementation. * @throws {AdapterContextError} When the provider or adapter is unavailable. */ declare function createPayments(): PaymentsAdapter; /** * Reads the configured AI adapter from the current SolidJS context. * * @returns The active AI adapter implementation. * @throws {AdapterContextError} When the provider or adapter is unavailable. */ declare function createAi(): AiAdapter; /** * Reads the configured file-storage adapter from the current SolidJS context. * * @returns The active file-storage adapter implementation. * @throws {AdapterContextError} When the provider or adapter is unavailable. */ declare function createFileStorage(): FileStorageAdapter; /** * Reads the configured file-storage adapter using the PRD's storage primitive name. * * @returns The active file-storage adapter implementation. * @throws {AdapterContextError} When the provider or adapter is unavailable. */ declare function createStorage(): FileStorageAdapter; /** * Reads the configured admin adapter from the current SolidJS context. * * @returns The active admin adapter implementation. * @throws {AdapterContextError} When the provider or adapter is unavailable. */ declare function createAdmin(): AdminAdapter; /** * Reads the configured logger adapter from the current SolidJS context. * * @returns The active logger adapter implementation. * @throws {AdapterContextError} When the provider or adapter is unavailable. */ declare function createLogger(): LoggerAdapter; /** * Returns the full adapter status record from the current SolidJS context. * * @returns A status object keyed by adapter domain. */ declare function createAdapterStatuses(): Record; /** * Creates a memoized reader for a single adapter domain status. * * @param domain Adapter domain whose status should be observed. * @returns A getter that always reflects the latest status for that domain. */ declare function createAdapterStatus(domain: AdapterDomain): () => AdapterStatusInfo; /** * Creates a memoized readiness reader for a single adapter domain. * * @param domain Adapter domain to inspect. * @returns A getter that reports whether the domain is ready for use. */ declare function createIsAdapterReady(domain: AdapterDomain): () => boolean; /** * Accesses every adapter and status helper from the current provider context. * * @returns A stable object exposing adapters, statuses, and loading helpers. */ declare function createAdapters(): { db: DbAdapter | undefined; auth: AuthAdapter | undefined; payments: PaymentsAdapter | undefined; ai: AiAdapter | undefined; storage: FileStorageAdapter | undefined; fileStorage: FileStorageAdapter | undefined; admin: AdminAdapter | undefined; logger: LoggerAdapter | undefined; statuses: Record; isLoading: boolean; isReady: (domain: AdapterDomain) => boolean; }; /** * @module index * @package @geenius/adapters/solidjs * @description Implements the SolidJS adapter provider and context access * helpers. This module owns adapter status initialization for the SolidJS * runtime package while keeping the shared package framework-agnostic. */ /** * Complete adapter implementation map accepted by the SolidJS provider. * * @property db Database adapter implementation. * @property auth Authentication adapter implementation. * @property payments Payments adapter implementation. * @property ai AI adapter implementation. * @property storage File-storage adapter implementation. * @property admin Admin adapter implementation. * @property logger Logger adapter implementation. */ interface AdapterDomainMap { db: DbAdapter; auth: AuthAdapter; payments: PaymentsAdapter; ai: AiAdapter; storage: FileStorageAdapter; admin: AdminAdapter; logger: LoggerAdapter; } /** * Public SolidJS provider domain key alias derived from the adapter map. * * Use this when a consumer needs a key constrained to configured provider slots * rather than the wider shared adapter-domain vocabulary. */ type AdapterDomainKey = keyof AdapterDomainMap; /** * SolidJS adapter bag keyed by domain. * * @property db Database adapter implementation when configured. * @property auth Authentication adapter implementation when configured. * @property payments Payments adapter implementation when configured. * @property ai AI adapter implementation when configured. * @property storage File-storage adapter implementation when configured. * @property fileStorage Alias for the file-storage adapter accepted by the slot API. * @property admin Admin adapter implementation when configured. * @property logger Logger adapter implementation when configured. */ interface AdapterSet extends Partial { fileStorage?: FileStorageAdapter; } /** Registry shape accepted by the public SolidJS provider. */ type AdapterRegistry = AdapterSet; /** * SolidJS adapter context value exposed to primitives and provider consumers. * * @property adapters Adapter bag passed into the provider. * @property statuses Current status record for each adapter domain. * @property getAdapter Returns a configured adapter for a specific domain or throws when missing. * @property isReady Reports whether a domain is configured and connected. * @property isLoading Indicates whether initial health checks are still running. */ interface AdapterContextValue { adapters: AdapterSet; statuses: Record; getAdapter: (domain: K) => AdapterDomainMap[K]; isReady: (domain: AdapterDomain) => boolean; isLoading: boolean; } declare const AdapterContext: Context; type ProviderChildren = Parameters[0]["children"]; /** * Map of domain-specific health probes supplied by the host app. * * When a domain has a custom probe, the provider calls it instead of the * built-in probe during the health-check lifecycle. The probe receives the * adapter instance for its domain and the full adapter bag. */ type AdapterHealthProbeMap = Partial<{ [D in AdapterDomainKey]: (adapter: AdapterDomainMap[D], adapters: AdapterSet) => Promise | void; }>; /** * Props accepted by the SolidJS adapter provider. * * @property adapters Adapter bag made available to descendant primitives and components. * @property registry Optional registry alias for adapter overrides. * @property db Optional direct database adapter override. * @property auth Optional direct authentication adapter override. * @property payments Optional direct payments adapter override. * @property ai Optional direct AI adapter override. * @property storage Optional direct file-storage adapter override. * @property fileStorage Optional slot-API alias for the file-storage adapter. * @property admin Optional direct admin adapter override. * @property logger Optional direct logger adapter override. * @property children Solid subtree that should receive adapter context. * @property healthCheck Whether the provider should probe configured adapters on mount. * @property healthProbes Optional domain-specific health probes supplied by the host app. * @property statusOverrides Optional deterministic status overrides for tests and previews. * @property onError Optional typed error callback invoked when provider lifecycle checks fail. */ interface AdapterProviderProps extends Partial { adapters?: AdapterSet; registry?: Partial; fileStorage?: FileStorageAdapter; children: ProviderChildren; healthCheck?: boolean; healthProbes?: AdapterHealthProbeMap; statusOverrides?: Partial>>; onError?: (error: AdapterError) => void; } /** * Public compatibility alias for the SolidJS adapter provider props. * * The plural name mirrors the public `AdaptersProvider` component alias while * preserving the exact same prop contract as `AdapterProviderProps`. */ type AdaptersProviderProps = AdapterProviderProps; /** * Provides the SolidJS adapter context and optional health-check lifecycle. * * @param props Provider props including the adapter bag, child tree, and optional health-check settings. * @returns A SolidJS context provider that exposes adapters and derived status metadata. */ declare function AdapterProvider(props: AdapterProviderProps): JSX.Element; /** * Public compatibility alias matching the plural provider naming convention. * * Consumers can use either `AdapterProvider` or `AdaptersProvider`; both mount * the same SolidJS context and accept `AdapterProviderProps`. */ declare const AdaptersProvider: typeof AdapterProvider; /** * Reads the SolidJS adapter context from the nearest provider. * * @returns The active adapter context value with adapters, statuses, and readiness helpers. * @throws {AdapterContextError} When called outside of an `` tree. */ declare function useAdapterContext(): AdapterContextValue; export { AdapterCard, type AdapterCardProps, AdapterConfigForm, type AdapterConfigFormProps, type AdapterContextValue, AdapterDetailPage, type AdapterDetailPageProps, type AdapterDomainKey, type AdapterDomainMap, type AdapterHealthProbeMap, AdapterList, type AdapterListProps, AdapterProvider, type AdapterProviderProps, type AdapterRegistry, type AdapterSet, AdapterStatusBadge, type AdapterStatusBadgeProps, AdaptersPage, type AdaptersPageProps, AdaptersProvider, type AdaptersProviderProps, cn, createAdapterStatus, createAdapterStatuses, createAdapters, createAdmin, createAi, createAuth, createAuthAdapter, createDb, createFileStorage, createIsAdapterReady, createLogger, createPayments, createStorage, useAdapterContext };