import type { ReactNode, Context, MutableRefObject, Ref, ComponentProps } from 'react'; import { createPortal } from 'react-dom'; import { StyleSheetManager } from 'styled-components'; import '../../init'; import type { ThemeMachineLike, DefaultSettableTheme, DefaultThemeDefinition } from '../../theme'; import type { Translation, TranslationPack } from '../../i18n'; import './connected-watcher'; export interface ConfigurationProps { /** Any components or nodes that should be impacted by the settings applied by this Configuration component. */ children: ReactNode; /** User locale as defined in [BCP-47](https://www.techonthenet.com/js/language_tags.php). */ locale?: string; /** Override rendering direction of the document. Direction will be based on the locale if now provided. */ direction?: 'ltr' | 'rtl'; /** Object with (partial) translations. */ translations?: Translation; /** Theme object used to override any or all Cosmos theme properties. */ theme?: DefaultSettableTheme; /** Theme mode for the application. Can be 'light', 'dark', or 'system'. */ themeMode?: 'light' | 'dark' | 'system'; /** Callback function triggered when the theme mode changes. */ onThemeModeChange?: (mode: NonNullable) => void; /** Disables loading Open Sans or Inter from Google Fonts. Only takes effect on the root configuration. */ disableDefaultFontLoading?: boolean; /** List of style sheets to inject in style sheet target. */ styleSheets?: string[]; /** * Target element for loading styles related to `styled-components`. * @deprecated */ styleSheetTarget?: ComponentProps['target']; /** * Target element for rendering a `ReactDOM` portal. * @deprecated */ portalTarget?: Parameters[1]; /** * Use native HTML5 controls for inputs instead of rich ones. * @default false */ renderNativeControls?: boolean; /** String to identify this configuration instance. */ id?: string; /** * Enable/disable testId attribute rendering for all components. * @default true */ testIds?: boolean; /** * Ref for the configuration root. */ ref?: Ref; } export interface ConfigurationContextValue { locale: string; direction: NonNullable; translations: TranslationPack; themeMachine: ThemeMachineLike; themeMode: NonNullable; onThemeModeChange: ConfigurationProps['onThemeModeChange']; styleSheetTarget: ConfigurationProps['styleSheetTarget']; portalTarget: ConfigurationProps['portalTarget']; loadedRef: MutableRefObject; renderNativeControls: boolean; testIds: NonNullable; /** @internal */ mountedStyleSheetManagers?: (typeof StyleSheetManager)[]; /** @internal */ initialized: boolean; } export declare const ConfigurationContext: Context; declare const legacyMetaKey: unique symbol; interface LegacyCosmosInstace { version: string; } declare global { interface Window { [legacyMetaKey]?: { push: (instance: LegacyCosmosInstace) => void; }; } } interface CosmosInstance extends LegacyCosmosInstace { mountedConfigs: string[]; mountOrder: string[]; mountCount: Record; } declare module '../../init' { interface CosmosGlobals { instances?: (CosmosInstance | LegacyCosmosInstace)[]; configurationContext?: Context; } } declare const Configuration: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export default Configuration; //# sourceMappingURL=Configuration.d.ts.map