import * as react from 'react'; import { ReactNode, HTMLAttributes } from 'react'; interface BaseItem { /** * Restrict where the item is displayed * * @defaultValue 'all' */ on?: 'menu' | 'nav' | 'all'; } interface MainItem extends BaseLinkItem { type?: 'main'; icon?: ReactNode; text: ReactNode; description?: ReactNode; } interface MenuItem extends BaseItem { type: 'menu'; icon?: ReactNode; text: ReactNode; url?: string; items: ((MainItem & { /** * Options when displayed on navigation menu */ menu?: HTMLAttributes & { banner?: ReactNode; footer?: ReactNode; }; }) | CustomItem)[]; /** * @defaultValue false */ secondary?: boolean; } interface CustomItem extends BaseItem { type: 'custom'; /** * @defaultValue false */ secondary?: boolean; children: ReactNode; } type LinkItemType = MainItem | IconItem | ButtonItem | MenuItem | CustomItem; interface BaseLinkItem extends BaseItem { url: string; /** * When the item is marked as active * * @defaultValue 'url' */ active?: 'url' | 'nested-url' | 'none'; external?: boolean; } declare const BaseLinkItem: react.ForwardRefExoticComponent<{ item: BaseLinkItem; } & HTMLAttributes & react.RefAttributes>; interface ButtonItem extends BaseLinkItem { type: 'button'; icon?: ReactNode; text: ReactNode; /** * @defaultValue false */ secondary?: boolean; } declare const ButtonItem: react.ForwardRefExoticComponent<{ item: ButtonItem; } & HTMLAttributes & react.RefAttributes>; interface IconItem extends BaseLinkItem { type: 'icon'; /** * `aria-label` of icon button */ label?: string; icon: ReactNode; text: ReactNode; /** * @defaultValue true */ secondary?: boolean; } declare const IconItem: react.ForwardRefExoticComponent<{ item: IconItem; } & HTMLAttributes & react.RefAttributes>; interface NavProviderProps { /** * Use transparent background * * @defaultValue none */ transparentMode?: 'always' | 'top' | 'none'; } interface TitleProps { title?: ReactNode; /** * Redirect url of title * @defaultValue '/' */ url?: string; } declare function NavProvider({ transparentMode, children, }: NavProviderProps & { children: ReactNode; }): ReactNode; interface NavOptions extends SharedNavProps { enabled: boolean; component: ReactNode; } interface SharedNavProps extends TitleProps, NavProviderProps { /** * Show/hide search toggle * * Note: Enable/disable search from root provider instead */ enableSearch?: boolean; children?: ReactNode; } interface BaseLayoutProps { /** * Remove theme switcher component */ disableThemeSwitch?: boolean; /** * Enable Language Switch * * @defaultValue false */ i18n?: boolean; /** * GitHub url */ githubUrl?: string; links?: LinkItemType[]; /** * Replace or disable navbar */ nav?: Partial; children?: ReactNode; } /** * Get Links Items with shortcuts */ declare function getLinks(links?: LinkItemType[], githubUrl?: string): LinkItemType[]; declare function replaceOrDefault(obj: { enabled?: boolean; component?: ReactNode; } | undefined, def: ReactNode, disabled?: ReactNode): ReactNode; export { type BaseLayoutProps as B, IconItem as I, type LinkItemType as L, NavProvider as N, type SharedNavProps as S, getLinks as g, replaceOrDefault as r };