import { ComponentType, ReactElement, ReactNode } from 'react'; import { ActionLifecycle, AnyComponentInterceptor, ItemContainerConfig, ColumnCustomizerFn, CustomComponent, CustomizationsConfig, DateValidationProps, GuestPageProps, HeroComponentProps, LayoutAppBarProps, LayoutBreadcrumbsProps, LayoutFooterProps, LayoutNavigationDrawerProps, NavigationItem, PageCustomization, SubThemeHook, TableRowHighlightConfig, VisualPropertySet, PageDefinition, VisualElement } from '@judo/model-api'; /** * @internal Context value for the customizations system. * * This is a framework-internal contract. Developers access customizations * through the generated `createCustomizations()` factory, not this context directly. */ export interface CustomizationsContextType { /** Internal version counter for HMR / change detection */ version: number; /** @internal Get the page customization bundle (keyed by page's xmi:id, resolved from the model element) */ getPageCustomization(pageSourceId: string): PageCustomization | undefined; /** @internal Get the custom component (keyed by element's xmi:id, resolved from the model element) */ getComponent(elementSourceId: string): CustomComponent | undefined; /** Get the component interceptor for an element @type */ getComponentInterceptor(elementType: string): AnyComponentInterceptor | undefined; /** Get the sub-theme provider for a named sub-theme */ getSubThemeProvider(subThemeName: string): SubThemeHook | undefined; /** Get the redirect handler component for the /_redirect route */ getRedirectHandler(): ComponentType | undefined; /** Get custom routes to inject into the router */ getCustomRoutes(): Array<{ path: string; element: ReactElement; }> | undefined; /** Get the menu customizer function */ getMenuCustomizer(): ((items: NavigationItem[]) => NavigationItem[]) | undefined; /** Get the footer text (static or dynamic) */ getFooterText(): string | (() => string) | undefined; /** Get the custom hero component for the AppBar */ getHeroComponent(): ComponentType | undefined; /** Get the settings page component */ getSettingsPage(): ComponentType | undefined; /** Get the custom guest page component (for supportGuestAccess mode) */ getGuestComponent(): ComponentType | undefined; /** Get the custom AppBar layout slot component */ getAppBarComponent(): ComponentType | undefined; /** Get the custom NavigationDrawer layout slot component */ getNavigationDrawerComponent(): ComponentType | undefined; /** Get the custom Footer layout slot component */ getFooterComponent(): ComponentType | undefined; /** Get the custom Breadcrumbs layout slot component */ getBreadcrumbsComponent(): ComponentType | undefined; } /** * Hook to access customizations context. * @throws Error if used outside CustomizationsProvider */ export declare function useCustomizations(): CustomizationsContextType; /** * Hook to access customizations context (optional). * Returns null if no CustomizationsProvider is in the tree. */ export declare function useCustomizationsOptional(): CustomizationsContextType | null; /** * Returns the custom component for a visual element, if registered. * * @internal This is a framework-internal hook used by `VisualElementRenderer`. * Developers register component overrides via the type-safe `createCustomizations()` * factory using human-readable names — never raw sourceIds. * * @param element - The VisualElement model object (identity resolved from element["xmi:id"]) * @returns The custom component or null */ export declare function useComponentOverride(element: VisualElement): CustomComponent | null; /** * Returns an intercepted component for a visual element based on its @type. * * @internal This is a framework-internal hook used by `VisualElementRenderer`. * Developers register interceptors via the type-safe `createCustomizations()` * factory using the `componentInterceptors` property with human-readable @type keys * (e.g., 'TextInput', 'Table'). * * Called after `useComponentOverride` (per-element override takes priority over type interceptor). * * @param element - The VisualElement model object * @returns The intercepted custom component or null */ export declare function useComponentInterceptor(element: VisualElement): CustomComponent | null; /** * Returns the sub-theme provider hook for an element's `subTheme` property. * * @internal This is a framework-internal hook used by `SubThemeWrapper`. * Developers register sub-theme providers via the type-safe `createCustomizations()` * factory using the `subThemeProviders` property with human-readable sub-theme names. * * @param element - The VisualElement model object (must have `subTheme` property) * @returns The SubThemeHook or null if not registered */ export declare function useSubThemeProvider(element: VisualElement): SubThemeHook | null; /** * Returns the action lifecycle overrides for a specific action on a page. * Used by the action dispatch system to compose overrides with built-in handlers. * * @param page - The PageDefinition * @param action - The Action to check * @returns Partial ActionLifecycle or null */ export declare function usePageActionOverrides(page: PageDefinition | undefined, action: { "xmi:id"?: string; } | undefined): Partial | null; /** * Returns visual property overrides for an element on the current page. * * @internal This is a framework-internal hook used by `useVisualBinding` and component renderers. * Developers provide visual property overrides via the type-safe `createCustomizations()` * factory using human-readable element names within page scopes. * * @param element - The VisualElement model object * @returns Partial VisualPropertySet or null */ export declare function useVisualPropertyOverrides(element: VisualElement): Partial | null; /** * Returns the typeahead provider for a text input element on the current page. * * @internal This is a framework-internal hook called by input renderers. * Developers register typeahead providers via the type-safe `createCustomizations()` * factory using human-readable element names. * * @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied) * @returns The typeahead provider function, or undefined if not registered */ export declare function useTypeaheadProvider(elementSourceId: string | undefined): ((text: string) => Promise) | undefined; /** * Returns the row highlighting configuration for a table element on the current page. * * @internal This is a framework-internal hook called by `TableRenderer`. * Developers register row highlighting via the type-safe `createCustomizations()` * factory using human-readable table element names. * * @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied) * @returns Array of highlight configs, or undefined if not registered */ export declare function useTableRowHighlighting(elementSourceId: string | undefined): TableRowHighlightConfig[] | undefined; /** * Returns a wrapped enumeration option filter for an enum input element on the current page. * * @internal This is a framework-internal hook called by `InputRenderer`. * Developers register enum filters via the type-safe `createCustomizations()` * factory using human-readable element names. * * @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied) * @returns A function that takes options and returns filtered options, or undefined if not registered */ export declare function useEnumOptionFilter(elementSourceId: string | undefined): ((options: Array<{ value: string; label: string; }>) => Array<{ value: string; label: string; }>) | undefined; /** * Returns resolved date validation props for a date/datetime input element on the current page. * * @internal This is a framework-internal hook called by date input renderers. * Developers register date validation via the type-safe `createCustomizations()` * factory using human-readable element names. * * @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied) * @returns Resolved date validation props, or undefined if not registered */ export declare function useDateValidationProps(elementSourceId: string | undefined): DateValidationProps | undefined; /** * Returns all column customizer functions for the current page. * * @internal This is a framework-internal hook called by `TableRenderer`. * Developers register column customizers via the type-safe `createCustomizations()` * factory using human-readable column element names. * * @returns Record of column xmi:id → customizer function, or undefined if not registered */ export declare function useColumnCustomizers(): Record | undefined; /** * Returns the item container configuration for a specific table element. * * @internal This is a framework-internal hook called by `TableRenderer`. * Developers register item container configs via the type-safe `createCustomizations()` * factory using human-readable table element names. * * @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied) * @returns Item container config or undefined if not registered */ export declare function useItemContainerConfig(elementSourceId: string | undefined): ItemContainerConfig | undefined; /** * @internal Hook to get the resolved action overrides for the current page. * Returns all action overrides keyed by action xmi:id. */ export declare function useResolvedPageActionOverrides(): Record> | null; /** * @internal Get lifecycle overrides for a specific action. * The actionSourceId is the action's xmi:id, resolved from the Action model object * (not developer-supplied). */ export declare function useActionLifecycleOverrides(actionSourceId: string | undefined): Partial | null; /** * Provider that calls the registered page action hook and provides * the resolved overrides to descendants. * Must be rendered inside PageProvider. */ export declare function PageActionOverridesProvider({ children }: { children: ReactNode; }): import("react/jsx-runtime").JSX.Element; /** * Provider that calls the registered visual properties hook and provides * the resolved overrides to descendants. * Must be rendered inside PageProvider. */ export declare function VisualPropertiesProvider({ children }: { children: ReactNode; }): import("react/jsx-runtime").JSX.Element; /** * Props for CustomizationsProvider. */ export interface CustomizationsProviderProps { children: ReactNode; /** The customizations config (from createCustomizations() or manually built) */ customizations?: CustomizationsConfig | null; } /** * Provider for the customizations system. * * Stores the config in a ref and uses a version counter for HMR support. * When the customizations object identity changes (e.g., during HMR), * the version bumps and all consumers re-render with new values. * * @example * ```tsx * * * * ``` */ export declare function CustomizationsProvider({ children, customizations }: CustomizationsProviderProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=customizations-context.d.ts.map