@servlyadmin/runtime-react
Advanced tools
| import React from 'react'; | ||
| import { CacheStrategy, RetryConfig } from '@servlyadmin/runtime-core'; | ||
| export { BindingContext, CacheStrategy, ComponentData, FetchOptions, LayoutElement, PropDefinition, RetryConfig, clearAllCaches, compareVersions, fetchComponent, getRegistryUrl, invalidateCache, isComponentAvailable, parseVersion, prefetchComponents, resolveVersion, satisfiesVersion, setRegistryUrl } from '@servlyadmin/runtime-core'; | ||
| /** | ||
| * ServlyComponent | ||
| * React wrapper for Servly runtime renderer with slot support | ||
| */ | ||
| /** | ||
| * Slot content type - React nodes keyed by slot name | ||
| */ | ||
| type SlotContent = Record<string, React.ReactNode>; | ||
| /** | ||
| * Props for ServlyComponent | ||
| */ | ||
| interface ServlyComponentProps<P = Record<string, any>> { | ||
| /** Component ID from the registry */ | ||
| id: string; | ||
| /** Version specifier (exact, range, or "latest") */ | ||
| version?: string; | ||
| /** Props to pass to the component */ | ||
| props?: P; | ||
| /** Slot content - React nodes to portal into named slots */ | ||
| slots?: SlotContent; | ||
| /** Fallback UI while loading or on error */ | ||
| fallback?: React.ReactNode; | ||
| /** Error callback */ | ||
| onError?: (error: Error) => void; | ||
| /** Load complete callback */ | ||
| onLoad?: () => void; | ||
| /** Custom className for wrapper */ | ||
| className?: string; | ||
| /** Custom styles for wrapper */ | ||
| style?: React.CSSProperties; | ||
| /** Show loading skeleton */ | ||
| showSkeleton?: boolean; | ||
| /** Cache strategy */ | ||
| cacheStrategy?: CacheStrategy; | ||
| /** Retry configuration */ | ||
| retryConfig?: Partial<RetryConfig>; | ||
| /** Event handlers keyed by element ID then event name */ | ||
| eventHandlers?: Record<string, Record<string, (e: Event) => void>>; | ||
| /** Children - rendered into default slot if no slots prop */ | ||
| children?: React.ReactNode; | ||
| /** Wait for Tailwind CSS to load before showing component (prevents FOUC) */ | ||
| waitForStyles?: boolean; | ||
| } | ||
| /** | ||
| * ServlyComponent - React wrapper for Servly runtime with slot support | ||
| */ | ||
| declare function ServlyComponent<P = Record<string, any>>({ id, version, props, slots, fallback, onError, onLoad, className, style, showSkeleton, cacheStrategy, retryConfig, eventHandlers, children, waitForStyles, }: ServlyComponentProps<P>): React.ReactElement | null; | ||
| export { ServlyComponent, type ServlyComponentProps, ServlyComponent as default }; |
| import React from 'react'; | ||
| import { CacheStrategy, RetryConfig } from '@servlyadmin/runtime-core'; | ||
| export { BindingContext, CacheStrategy, ComponentData, FetchOptions, LayoutElement, PropDefinition, RetryConfig, clearAllCaches, compareVersions, fetchComponent, getRegistryUrl, invalidateCache, isComponentAvailable, parseVersion, prefetchComponents, resolveVersion, satisfiesVersion, setRegistryUrl } from '@servlyadmin/runtime-core'; | ||
| /** | ||
| * ServlyComponent | ||
| * React wrapper for Servly runtime renderer with slot support | ||
| */ | ||
| /** | ||
| * Slot content type - React nodes keyed by slot name | ||
| */ | ||
| type SlotContent = Record<string, React.ReactNode>; | ||
| /** | ||
| * Props for ServlyComponent | ||
| */ | ||
| interface ServlyComponentProps<P = Record<string, any>> { | ||
| /** Component ID from the registry */ | ||
| id: string; | ||
| /** Version specifier (exact, range, or "latest") */ | ||
| version?: string; | ||
| /** Props to pass to the component */ | ||
| props?: P; | ||
| /** Slot content - React nodes to portal into named slots */ | ||
| slots?: SlotContent; | ||
| /** Fallback UI while loading or on error */ | ||
| fallback?: React.ReactNode; | ||
| /** Error callback */ | ||
| onError?: (error: Error) => void; | ||
| /** Load complete callback */ | ||
| onLoad?: () => void; | ||
| /** Custom className for wrapper */ | ||
| className?: string; | ||
| /** Custom styles for wrapper */ | ||
| style?: React.CSSProperties; | ||
| /** Show loading skeleton */ | ||
| showSkeleton?: boolean; | ||
| /** Cache strategy */ | ||
| cacheStrategy?: CacheStrategy; | ||
| /** Retry configuration */ | ||
| retryConfig?: Partial<RetryConfig>; | ||
| /** Event handlers keyed by element ID then event name */ | ||
| eventHandlers?: Record<string, Record<string, (e: Event) => void>>; | ||
| /** Children - rendered into default slot if no slots prop */ | ||
| children?: React.ReactNode; | ||
| /** Wait for Tailwind CSS to load before showing component (prevents FOUC) */ | ||
| waitForStyles?: boolean; | ||
| } | ||
| /** | ||
| * ServlyComponent - React wrapper for Servly runtime with slot support | ||
| */ | ||
| declare function ServlyComponent<P = Record<string, any>>({ id, version, props, slots, fallback, onError, onLoad, className, style, showSkeleton, cacheStrategy, retryConfig, eventHandlers, children, waitForStyles, }: ServlyComponentProps<P>): React.ReactElement | null; | ||
| export { ServlyComponent, type ServlyComponentProps, ServlyComponent as default }; |
+2
-2
| { | ||
| "name": "@servlyadmin/runtime-react", | ||
| "version": "0.1.34", | ||
| "version": "0.1.35", | ||
| "description": "React wrapper for Servly runtime renderer", | ||
@@ -49,2 +49,2 @@ "type": "module", | ||
| } | ||
| } | ||
| } |
29673
18.64%6
50%632
8.97%