import { SelectedChannel } from '@jetshop/core/components/ChannelContext/ChannelContext'; import { Channel } from '@jetshop/core/types'; import { Item } from '@jetshop/ui/Checkbox/CheckboxGroup'; import React from 'react'; export interface RenderCallback { (props: { channels: Channel[]; currencyItems: Item[]; languageItems: Item[]; selectedChannel: SelectedChannel; hasChanged: boolean; onSelect: SelectChannel; onCurrencySelect: (currency: string) => void; onLanguageSelect: (language: string) => void; }): React.ReactElement; } export interface ChannelSelectorProps { /** Any array of channels to display */ channels: Channel[]; /** The default-selected channel */ initialChannel: SelectedChannel; /** * Render callback to pass state to composed child components * @param {arr} channels * @param {arr} currencyItems * @param {arr} languageItems * @param {obj} selectedChannel selected channel * @param {boolean} hasChanged Whether the selection has changed from the default * @param {func} onSelect Call with the channel to set the selected channel * @param {func} onCurrencySelect Call with the currency to set the selected currnecy * @param {func} onLanguageSelect Call with the language to set the selected lanauge */ render: RenderCallback; } export interface ChannelSelectorState { selectedChannel: SelectedChannel; hasChanged: boolean; } export type SelectChannel = (channel: number | string, culture?: string, currency?: string, country?: string) => void; export type SelectCurrency = (currency: string) => void; export type SelectLanguage = (language: string) => void; /** Wraps either MiniSelector or LargeSelector and provides controlled state */ export default class ChannelSelector extends React.Component { state: { selectedChannel: SelectedChannel; hasChanged: boolean; }; setDirtyState: () => void; componentDidUpdate(_prevProps: any, prevState: any): void; selectChannel: SelectChannel; selectCurrency: SelectCurrency; selectLanguage: SelectLanguage; render(): React.ReactElement>; } export declare const LangCurrWrapper: import("linaria/lib/StyledMeta").StyledMeta & React.FunctionComponent & React.HTMLAttributes & { as?: React.ElementType; }>; export declare const SelectorBody: import("linaria/lib/StyledMeta").StyledMeta & React.FunctionComponent & React.HTMLAttributes & { as?: React.ElementType; }>; export declare const Title: import("linaria/lib/StyledMeta").StyledMeta & React.FunctionComponent & React.HTMLAttributes & { as?: React.ElementType; }>;