import type { ComponentType } from "react"; import type { AttributeType, ClassType, DataType, OperationType, RelationType } from "./data/elements"; import type { PageContainerType } from "./enums"; import type { ActionDefinition } from "./structural/actions"; import type { Action, Application, NavigationItem, PageDefinition } from "./structural/application"; import type { PageContainer, VisualElement } from "./visual/layout"; export declare const MODEL_LOADER_SERVICE: unique symbol; export declare const MODEL_REGISTRY_SERVICE: unique symbol; export declare const NAVIGATION_BADGE_SERVICE: unique symbol; export declare const THEME_SERVICE: unique symbol; /** * @internal Framework service token for action handler hook factories. * Built-in handlers are registered by actionType. * Developers override actions via the type-safe `createCustomizations()` factory. */ export declare const ACTION_HANDLER_FACTORY: unique symbol; /** * @internal Framework service token for component overrides. * Developers register components via the type-safe `createCustomizations()` factory. * Framework INJECTS the VisualElement as `element` prop. */ export declare const COMPONENT_OVERRIDE: unique symbol; /** * @internal Framework service token for the component override manager. * Used internally by `useComponentOverride` hook. */ export declare const COMPONENT_OVERRIDE_SERVICE: unique symbol; export declare const NOTIFICATION_SERVICE: unique symbol; export declare const DIALOG_SERVICE: unique symbol; export declare const UNSAVED_CHANGES_GUARD: unique symbol; export declare const SESSION_TIMEOUT_GUARD: unique symbol; export declare const LOADING_SERVICE: unique symbol; export declare const I18N_SERVICE: unique symbol; /** * Runtime context passed to action handlers when action triggers. */ export interface ActionHandlerContext { /** The transfer being acted upon */ transfer?: unknown; /** Selected rows for bulk/table operations */ selectedRows?: unknown[]; /** Dialog closer if action is in a dialog */ closeDialog?: () => void; /** Navigation context for page transitions */ navigation?: unknown; /** Data store for transfer operations */ data?: unknown; /** Model registry for lookups */ registry?: ModelRegistryService; } /** * Action handler hook factory type. * Framework INJECTS the Action model element when calling your handler. * * @param action - The Action model element (injected by framework) * @returns Handler function to execute when action triggers * * @example * ```typescript * function useMyHandler(action: Action) { * const { showSuccess } = useNotification(); * const operation = action.actionDefinition.operation; * * return async (ctx: ActionHandlerContext) => { * console.log(`Handling ${action.name}:`, ctx.transfer); * showSuccess('Done!'); * }; * } * ``` */ export type ActionHandlerHook = (action: Action) => ActionHandlerFn; /** * Handler function called when the action is triggered. */ export type ActionHandlerFn = (context: ActionHandlerContext) => Promise; /** * @internal Framework-internal service properties for action handler registration. * * **Do not use directly.** Developers should use the generated `createCustomizations()` * factory with human-readable page and action names instead. * * @see {@link CustomizationsConfig} for the runtime format (also internal) */ export interface ActionHandlerFactoryProperties { /** @internal The action's xmi:id — resolved automatically by the factory */ sourceId: string; } /** * Service properties for built-in action handler registration (internal). */ export interface BuiltInActionHandlerFactoryProperties { /** The action type this built-in handles (e.g., 'ui:DeleteActionDefinition') */ actionType: string; /** Marker for built-in handlers */ builtin: true; } /** * Type for a component that can be used as an override. * Framework INJECTS the VisualElement as the `element` prop. * * @example * ```typescript * const MyTableComponent: OverrideComponent = ({ element }) => { * return ; * }; * ``` */ export type OverrideComponent = ComponentType<{ element: T; } & Record>; /** * @internal Framework-internal component override registration object. * * **Do not use directly.** Developers should register component overrides via * the generated `createCustomizations()` factory using human-readable names: * * @example * ```typescript * // Use the generated type-safe factory: * createCustomizations({ * components: { * OrderSummaryWidget: MyCustomComponent, * }, * componentInterceptors: { * TextInput: (element, page) => isEmail(element) ? EmailInput : null, * }, * }); * ``` */ export interface ComponentOverride { /** @internal Override a specific element — resolved automatically by the factory */ sourceId?: string; /** Override all elements of this type (e.g., 'Table', 'TextInput') */ elementType?: string; /** Override all elements within a container type */ containerType?: PageContainerType; /** The component to render instead of the default */ component: OverrideComponent; } /** * @internal Framework-internal service properties for component override registration. * * **Do not use directly.** Use the generated `createCustomizations()` factory * with `components` (by name) or `componentInterceptors` (by @type) instead. */ export interface ComponentOverrideProperties { /** @internal Element identity — resolved automatically by the factory */ sourceId?: string; /** Override all elements of this type (e.g., 'Table', 'TextInput') */ elementType?: string; } /** * @internal Framework-internal service for managing component overrides at runtime. * Used internally by `useComponentOverride` hook. */ export interface ComponentOverrideService { /** Register a component override, returns unregister function */ register(override: ComponentOverride): () => void; /** Get override for element with priority: sourceId > elementType > containerType */ getOverride(element: VisualElement, containerType?: PageContainerType): OverrideComponent | null; /** Subscribe to override changes */ subscribe(callback: () => void): () => void; /** Get current snapshot of all registered overrides */ getSnapshot(): ComponentOverride[]; } export interface ModelLoaderService { load(source: string): Promise; } export interface RegistrySnapshot { applications: Application[]; activeApplication: Application | null; activeActorName: string | null; } export interface ModelRegistryService { registerModel(apps: Application[]): void; getApplications(): Application[]; getApplication(actorName: string): Application; getActiveApplication(): Application; setActiveApplication(actorName: string): void; resolveById(id: string): T | undefined; resolveClassType(ref: string): ClassType | undefined; resolveRelationType(ref: string): RelationType | undefined; resolveAttributeType(ref: string): AttributeType | undefined; resolvePageDefinition(ref: string): PageDefinition | undefined; resolvePageContainer(ref: string): PageContainer | undefined; resolveVisualElement(id: string): VisualElement | undefined; resolveActionDefinition(ref: string): ActionDefinition | undefined; resolveDataType(ref: string): DataType | undefined; resolveOperationType(ref: string): OperationType | undefined; resolveNavigationItem(id: string): NavigationItem | undefined; subscribe(callback: () => void): () => void; getSnapshot(): RegistrySnapshot; } export interface BadgeInfo { count?: number; color?: "primary" | "secondary" | "error" | "warning" | "info" | "success"; max?: number; showZero?: boolean; } export interface NavigationBadgeService { getBadge(itemId: string): BadgeInfo | null; setBadge(itemId: string, badge: BadgeInfo | null): void; subscribe(callback: () => void): () => void; getSnapshot(): Map; } export interface ThemeConfig { mode: "light" | "dark"; /** @deprecated Use muiThemeOptions.palette.primary instead */ primaryColor?: string; /** @deprecated Use muiThemeOptions.palette.secondary instead */ secondaryColor?: string; /** * MUI theme options to merge with defaults. * Provides full customization of Material-UI theme. */ muiThemeOptions?: Record; /** * Whether the theme is using system preference. * When true, mode will automatically track OS/browser preference. */ isSystemMode?: boolean; /** * Density level controlling semantic spacing and sizing. * - `compact` — tight spacing, smaller controls * - `comfortable` — default MUI sizing (no overrides) * - `standard` — generous spacing, larger touch targets */ density?: "compact" | "comfortable" | "standard"; /** * Named theme preset. When set, provides default primary/secondary colors * and background tints. Explicit `primaryColor`/`secondaryColor` override * the preset values. * * Built-in presets: 'classic', 'corporate', 'ocean', 'slate', 'indigo', 'forest', 'royal' */ preset?: "classic" | "corporate" | "ocean" | "slate" | "indigo" | "forest" | "royal" | (string & {}); } export interface ThemeService { getTheme(): ThemeConfig; setTheme(config: Partial): void; subscribe(callback: () => void): () => void; getSnapshot(): ThemeConfig; } //# sourceMappingURL=services.d.ts.map