import * as H from 'history'; import * as React from 'react'; /** * Describes a tab. * * @template ID The type that includes all possible tab IDs (typically a union of string constants). */ export interface Tab { id: ID; label: React.ReactFragment; /** * Whether the tab is hidden in the tab bar. */ hidden?: boolean; } /** * An element to pass to Tab's tabBarEndFragment prop to fill all width between the tabs (on the left) and the * other tabBarEndFragment elements (on the right). */ export declare const Spacer: () => JSX.Element; /** * Properties for the Tabs components and its wrappers. * * @template ID The type that includes all possible tab IDs (typically a union of string constants). * @template T The type that describes a tab. */ interface TabsProps> { /** All tabs. */ tabs: T[]; /** * A fragment to display at the end of the tab bar. If specified, the tabs will not flex grow to fill the * width. */ tabBarEndFragment?: React.ReactFragment; children: React.ReactFragment; id?: string; className?: string; tabClassName?: string; /** Optional handler when a tab is selected */ onSelectTab?: (tab: ID) => void; } /** * The class name to use for other elements injected via tabBarEndFragment that should have a bottom border. */ export declare const TabBorderClassName = "tab-bar__end-fragment-other-element"; /** * A wrapper for Tabs that persists view state (the currently active tab) in localStorage. */ export declare class TabsWithLocalStorageViewStatePersistence> extends React.PureComponent & { /** * A key unique to this UI element that is used for persisting the view state. */ storageKey: string; }, { activeTab: ID | undefined; }> { constructor(props: TabsProps & { storageKey: string; }); private static readFromLocalStorage; private static saveToLocalStorage; render(): JSX.Element | null; private onSelectTab; private renderTab; } interface TabsWithURLViewStatePersistenceProps> extends TabsProps { location: H.Location; } /** * A wrapper for Tabs that persists view state (the currently active tab) in the current page's URL. * * URL whose fragment (hash) ends with "$x" are considered to have active tab "x" (where "x" is the tab's ID). */ export declare class TabsWithURLViewStatePersistence> extends React.PureComponent, { activeTab: ID | undefined; }> { constructor(props: TabsWithURLViewStatePersistenceProps); /** * Returns the URL hash (which can be used as a relative URL) that specifies the given tab. If the URL hash * already contains a tab ID, it replaces it; otherwise it appends it to the current URL fragment. If the tabID * argument is null, then the tab ID is removed from the URL. */ static urlForTabID(location: H.Location, tabID: string | null): H.LocationDescriptorObject; private readFromURL; componentWillReceiveProps(nextProps: TabsWithURLViewStatePersistenceProps): void; render(): JSX.Element | null; private renderTab; } export {}; //# sourceMappingURL=Tabs.d.ts.map