import { default as React, ComponentType, ReactNode } from 'react'; import { LibraryIntegration } from './library-integration'; /** * UI flag keys */ export declare const UI_FLAG_KEYS: { /** Enable dark mode */ readonly UI_DARK_MODE_ENABLED: "ui-dark-mode-enabled"; /** Enable animations */ readonly UI_ANIMATIONS_ENABLED: "ui-animations-enabled"; /** Enable reduced motion */ readonly UI_REDUCED_MOTION_ENABLED: "ui-reduced-motion-enabled"; /** Enable high contrast mode */ readonly UI_HIGH_CONTRAST_ENABLED: "ui-high-contrast-enabled"; /** Enable compact mode */ readonly UI_COMPACT_MODE_ENABLED: "ui-compact-mode-enabled"; /** Enable skeleton loading */ readonly UI_SKELETON_LOADING_ENABLED: "ui-skeleton-loading-enabled"; /** Enable virtual scrolling */ readonly UI_VIRTUAL_SCROLL_ENABLED: "ui-virtual-scroll-enabled"; /** Enable tooltips */ readonly UI_TOOLTIPS_ENABLED: "ui-tooltips-enabled"; /** Enable notifications */ readonly UI_NOTIFICATIONS_ENABLED: "ui-notifications-enabled"; /** Enable modals */ readonly UI_MODALS_ENABLED: "ui-modals-enabled"; /** Enable sidebars */ readonly UI_SIDEBARS_ENABLED: "ui-sidebars-enabled"; /** Enable new design system */ readonly UI_DESIGN_SYSTEM_V2: "ui-design-system-v2"; /** Enable experimental components */ readonly UI_EXPERIMENTAL_ENABLED: "ui-experimental-enabled"; /** Enable keyboard shortcuts */ readonly UI_KEYBOARD_SHORTCUTS_ENABLED: "ui-keyboard-shortcuts-enabled"; /** Enable drag and drop */ readonly UI_DND_ENABLED: "ui-dnd-enabled"; /** Enable inline editing */ readonly UI_INLINE_EDIT_ENABLED: "ui-inline-edit-enabled"; }; export type UiFlagKey = (typeof UI_FLAG_KEYS)[keyof typeof UI_FLAG_KEYS]; /** * UI flag configuration */ export interface UiFlagConfig { /** Enable dark mode */ readonly darkModeEnabled: boolean; /** Enable animations */ readonly animationsEnabled: boolean; /** Enable reduced motion */ readonly reducedMotionEnabled: boolean; /** Enable high contrast */ readonly highContrastEnabled: boolean; /** Enable compact mode */ readonly compactModeEnabled: boolean; /** Enable skeleton loading */ readonly skeletonLoadingEnabled: boolean; /** Enable virtual scrolling */ readonly virtualScrollEnabled: boolean; /** Enable tooltips */ readonly tooltipsEnabled: boolean; /** Enable notifications */ readonly notificationsEnabled: boolean; /** Enable modals */ readonly modalsEnabled: boolean; /** Enable sidebars */ readonly sidebarsEnabled: boolean; /** Use design system v2 */ readonly designSystemV2: boolean; /** Enable experimental */ readonly experimentalEnabled: boolean; /** Enable keyboard shortcuts */ readonly keyboardShortcutsEnabled: boolean; /** Enable drag and drop */ readonly dndEnabled: boolean; /** Enable inline editing */ readonly inlineEditEnabled: boolean; /** Index signature for Record compatibility */ [key: string]: unknown; } /** * Component variant configuration */ export interface ComponentVariantConfig

{ /** Component identifier */ readonly componentId: string; /** Feature flag key */ readonly flagKey: string; /** Variant A (flag disabled) */ readonly variantA: ComponentType

; /** Variant B (flag enabled) */ readonly variantB: ComponentType

; /** Track variant exposure */ readonly trackExposure?: boolean; } /** * Style variant configuration */ export interface StyleVariantConfig { /** Style identifier */ readonly styleId: string; /** Feature flag key */ readonly flagKey: string; /** Styles when flag is disabled */ readonly disabledStyles: Record; /** Styles when flag is enabled */ readonly enabledStyles: Record; } /** * Default UI flag configuration */ export declare const DEFAULT_UI_FLAG_CONFIG: UiFlagConfig; /** * Create UI flag integration */ export declare function createUiFlagIntegration(): LibraryIntegration; declare const uiIntegration: LibraryIntegration; /** * UI flags helper class */ declare class UiFlagsHelper { setFlagGetter(getter: (flagKey: string) => boolean): void; isDarkModeEnabled(): boolean; isAnimationsEnabled(): boolean; isReducedMotionEnabled(): boolean; isHighContrastEnabled(): boolean; isCompactModeEnabled(): boolean; isSkeletonLoadingEnabled(): boolean; isVirtualScrollEnabled(): boolean; isTooltipsEnabled(): boolean; isNotificationsEnabled(): boolean; isModalsEnabled(): boolean; isSidebarsEnabled(): boolean; isDesignSystemV2Enabled(): boolean; isExperimentalEnabled(): boolean; isKeyboardShortcutsEnabled(): boolean; isDndEnabled(): boolean; isInlineEditEnabled(): boolean; getAllFlags(): Record; private getFlag; } /** * Global UI flags helper instance */ export declare const uiFlags: UiFlagsHelper; /** * Hook to get UI flag configuration */ export declare function useUiFlagConfig(): UiFlagConfig; /** * Hook to check a specific UI flag */ export declare function useUiFlag(flagKey: UiFlagKey): boolean; /** * Hook for animation settings based on flags */ export declare function useAnimationSettings(): { enabled: boolean; duration: number; easing: string; }; /** * Hook for theme settings based on flags */ export declare function useThemeSettings(): { isDark: boolean; isHighContrast: boolean; isCompact: boolean; themeClass: string; }; /** * Register a component variant */ export declare function registerComponentVariant

(config: ComponentVariantConfig

): void; /** * Get component variant based on flag state */ export declare function getComponentVariant

(componentId: string, getFlag: (flagKey: string) => boolean): ComponentType

| null; /** * Register a style variant */ export declare function registerStyleVariant(config: StyleVariantConfig): void; /** * Get style variant based on flag state */ export declare function getStyleVariant(styleId: string, getFlag: (flagKey: string) => boolean): Record; /** * Hook to use component variant */ export declare function useComponentVariant

(componentId: string, getFlag: (flagKey: string) => boolean): ComponentType

| null; /** * Hook to use style variant */ export declare function useStyleVariant(styleId: string, getFlag: (flagKey: string) => boolean): Record; /** * Props for FlaggedUIComponent */ export interface FlaggedUIComponentProps

{ /** Feature flag key */ readonly flagKey: UiFlagKey | string; /** Component when flag is enabled */ readonly enabledComponent: ComponentType

; /** Component when flag is disabled */ readonly disabledComponent?: ComponentType

; /** Props to pass to the component */ readonly componentProps?: P; /** Fallback when disabled and no component */ readonly fallback?: ReactNode; /** Flag getter function */ readonly getFlag?: (flagKey: string) => boolean; } /** * Render component based on flag state */ export declare function FlaggedUIComponent

({ flagKey, enabledComponent: EnabledComponent, disabledComponent: DisabledComponent, componentProps, fallback, getFlag, }: FlaggedUIComponentProps

): React.JSX.Element | null; /** * HOC to wrap component with flag check */ export declare function withUiFlag

(Component: ComponentType

, flagKey: UiFlagKey | string, options?: { fallback?: ComponentType

; getFlag?: (flagKey: string) => boolean; }): ComponentType

; /** * Get CSS classes based on UI flags */ export declare function getUiFlagClasses(config: UiFlagConfig): string; /** * Hook to get UI flag CSS classes */ export declare function useUiFlagClasses(): string; /** * Apply UI flags to document root */ export declare function applyUiFlagsToDocument(config: UiFlagConfig): void; export { uiIntegration };