/** * Web Context Context * */ import React from 'react'; import type { AnchorProps } from '../elements/Anchor'; import type { ScrollViewProps } from '../fragments/scroll-view/ScrollView'; import type { ButtonProps } from '../components/button/Button'; import type { AvatarProps } from '../components/avatar/Avatar'; import type { AvatarGroupProps } from '../components/avatar/AvatarGroup'; import type { BadgeProps } from '../components/badge/Badge'; import type { BreadcrumbProps } from '../components/breadcrumb/Breadcrumb'; import type { BreadcrumbItemProps } from '../components/breadcrumb/BreadcrumbItem'; import type { InfoCardProps } from '../components/info-card/InfoCard'; import type { SliderProps } from '../components/slider/Slider'; import type { TagProps } from '../components/tag/Tag'; import type { TagGroupProps } from '../components/tag/TagGroup'; import type { TimelineProps } from '../components/timeline/Timeline'; import type { TimelineItemProps } from '../components/timeline/TimelineItem'; import type { VisuallyHiddenProps } from '../components/visually-hidden/VisuallyHidden'; import type { DrawerProps } from '../components/drawer/types'; import type { DialogProps } from '../components/dialog/types'; import type { TooltipProps } from '../components/tooltip/types'; import type { SectionProps } from '../components/section/Section'; import type { FormRowProps } from '../components/form-row/FormRowHelpers'; import type { UploadProps } from '../components/upload/types'; import type { SkeletonProps } from '../components/Skeleton'; import type { HelpButtonProps } from '../components/HelpButton'; import type { TableProps } from '../components/Table'; export declare type ContextComponents = { Button?: Partial; Anchor?: Partial; Avatar?: Partial; AvatarGroup?: Partial; Badge?: Partial; Breadcrumb?: Partial; BreadcrumbItem?: Partial; InfoCard?: Partial; Slider?: Partial; Tag?: Partial; TagGroup?: Partial; Timeline?: Partial; TimelineItem?: Partial; VisuallyHidden?: Partial; Drawer?: Partial; Dialog?: Partial; Tooltip?: Partial; Section?: Partial; ScrollView?: Partial; Upload?: Partial; Skeleton?: Partial; HelpButton?: Partial; Table?: Partial; NumberFormat?: Record; Pagination?: Record; FormRow?: FormRowProps; }; export declare type ContextProps = ContextComponents & { /** * Will enable all skeletons inside this provider/context scope */ skeleton?: boolean | string; /** * Define what breakpoints should be used by the MediaQuery component and hook */ breakpoints?: Record; /** * Defines the locale (internal translation) used by some components */ locale?: Locale; /** * Provide your own translations. Use the same format as defined in the translation files */ translation?: Translation; /** * Defines the currency used by the NumberFormat component */ currency?: string; /** * Defines the currencyDisplay used by the NumberFormat component */ currency_display?: string; /** * Update any given provider/context properties */ update?: (props: ContextProps) => void; /** * Update any given provider/context properties, but only for the particular scope */ updateCurrent?: (props: ContextProps) => void; /** * Update the used locale from within the context */ setLocale?: (locale: Locale) => void; /** * Update the used locale from within the context, but only for the particular scope */ setCurrentLocale?: (locale: Locale) => void; locales?: Locales; __context__?: Record; updateTranslation?: (locale: Locale, translation: Translation) => void; getTranslation?: (props: GetTranslationProps) => Translation; }; export declare type GetTranslationProps = Partial<{ lang?: Locale; locale?: Locale; }>; export declare type Locale = string | 'nb-NO' | 'en-GB' | 'en-US'; export declare type ComponentTranslationsName = string | keyof ContextComponents; export declare type ComponentTranslation = string; export declare type ComponentTranslations = Record; export declare type Locales = Record; export declare type Translation = Record< /** * Support only "HelpButton" */ ComponentTranslationsName, ComponentTranslations>; export declare type TranslationConsumer = Record< /** * Support "HelpButton.title" */ ComponentTranslationsName, ComponentTranslation | ComponentTranslations>; export declare function prepareContext(props?: ContextProps): Props & ContextProps; declare const Context: React.Context; export default Context;