import { CSSProperties } from "react"; import { Breakpoint } from "@mui/system"; import { HeaderBuilder } from "../Header/HeaderBuilder"; import { ResponsiveBuilder } from "../shared/ResponsiveBuilder"; import { LEFT_EDGE_SIDEBAR_ID, RIGHT_EDGE_SIDEBAR_ID, HEADER_ID, CONTENT_ID, FOOTER_ID } from "../utils/constant"; import { Responsive } from "../utils/types"; export declare type PersistentBehavior = "fit" | "flexible" | "none"; export declare type DrawerAnchor = "left" | "right"; export declare type DrawerVariant = "temporary" | "persistent" | "permanent"; export declare type EdgeSidebarConfig = PersistentSidebarConfig | PermanentSidebarConfig | TemporarySidebarConfig; export interface CollapsibleSidebarConfig { /** * If `true`, this sidebar can be collapsed */ collapsible?: boolean; /** * If `collapsible: true`, when sidebar collapsed will have this width (support all CSS units) */ collapsedWidth?: number | string; /** * If `collapsible: true`, when hover on collapsed sidebar it will expand to specified `width` without affecting other components. */ uncollapsedOnHover?: boolean; /** * @deprecated autoExpanded will be remove in the next major version, use 'uncollapsedOnHover' instead */ autoExpanded?: boolean; /** * sidebar's width (support all CSS units) */ width: number | string; /** * If header with `position: relative` clip this sidebar, when scroll the page will cause this sidebar to stick with header */ headerMagnetEnabled?: boolean; } export interface PermanentSidebarConfig extends CollapsibleSidebarConfig { /** * Material UI Drawer : permanent * https://material-ui.com/components/drawers/#permanent-drawer */ variant: "permanent"; } export interface PersistentSidebarConfig extends CollapsibleSidebarConfig { /** * Effect to other components when this sidebar open. Possible values are 'fit' | 'flexible' | 'none' */ persistentBehavior: PersistentBehavior | Partial>; /** * Material UI Drawer : persistent * https://material-ui.com/components/drawers/#persistent-drawer */ variant: "persistent"; } export interface TemporarySidebarConfig { /** * sidebar's width (support all CSS units) */ width: number | string; /** * Material UI Drawer : persistent * https://material-ui.com/components/drawers/#temporary-drawer */ variant: "temporary"; } export declare type EdgeSidebarSetupParams = { config: Responsive; hidden?: boolean | Breakpoint[]; autoCollapse?: Breakpoint; }; export declare type SidebarState = { collapsed?: boolean; open?: boolean; }; export declare class EdgeSidebarBuilder extends ResponsiveBuilder { id?: LEFT_EDGE_SIDEBAR_ID | RIGHT_EDGE_SIDEBAR_ID; readonly autoCollapse: EdgeSidebarSetupParams["autoCollapse"]; state?: SidebarState; effectedBy: { header?: HeaderBuilder; }; constructor(params: EdgeSidebarSetupParams); setState(state: SidebarState): void; isFlexiblePersistent(breakpoint: Breakpoint, id?: HEADER_ID | CONTENT_ID | FOOTER_ID): boolean; getOccupiedSpace(id?: HEADER_ID | CONTENT_ID | FOOTER_ID): Partial>; getZIndex(theme?: import("@mui/material").Theme): Partial>; getWidth(): Partial>; getDrawerVariant(): Partial>; getSxProps(theme?: import("@mui/material").Theme): { display?: Partial> | undefined; width: Partial>; zIndex: Partial>; }; getFinalWidth: (config: CollapsibleSidebarConfig | undefined) => string | number | undefined; getEdgeTriggerSxDisplay(options: { field: "open" | "collapsed"; display?: CSSProperties["display"]; }): Partial>; static isPersistentConfig: (config?: EdgeSidebarConfig | undefined) => config is PersistentSidebarConfig; static isNonePersistentConfig: (config?: EdgeSidebarConfig | undefined, id?: "footer" | "header" | "content" | undefined) => boolean; static isFlexiblePersistentConfig: (config?: EdgeSidebarConfig | undefined, id?: "footer" | "header" | "content" | undefined) => boolean; static isCollapsibleConfig: (config?: EdgeSidebarConfig | undefined) => config is PersistentSidebarConfig | PermanentSidebarConfig; static isPermanentConfig: (config?: EdgeSidebarConfig | undefined) => config is PermanentSidebarConfig; static isTemporaryConfig: (config?: EdgeSidebarConfig | undefined) => config is TemporarySidebarConfig; }