import { RefObject } from "react"; import { BottomSheetInstance, Sheets, StackBehavior } from "./types"; interface HistoryEntry { id: string; context: string; behavior: StackBehavior; } export declare const PrivateManager: { history: HistoryEntry[]; context(options?: { context?: string; id?: string; }): string | undefined; registerRef: (id: string, context: string, instance: RefObject) => void; /** * Get internal ref of a sheet by the given id. * * @param id Id of the sheet * @param context Context in which the sheet is rendered. Normally this function returns the top most rendered sheet ref automatically. */ get: (id: SheetId | (string & {}), context?: string) => RefObject>; add: (id: string, context: string) => void; remove: (id: string, context: string) => void; zIndex: (id: string, context?: string) => number; stack: () => { id: string; context: string; }[]; /** * Get the top-most sheet in the stack */ topSheet: () => { id: string; context: string; } | null; /** * Check if a sheet is currently visible */ isSheetVisible: (id: string, context?: string) => boolean; /** * Clear all history entries */ clearHistory: () => void; /** * Reset all internal state. Useful for testing or HMR. */ reset: () => void; }; declare class _SheetManager { /** * Show the Modal Sheet with an id. * * @param id id of the Sheet to show * @param options */ show(id: SheetId | (string & {}), options?: { /** * Any data to pass to the Sheet. Will be available from the component `props` prop on the modal sheet. */ payload?: Sheets[SheetId]["payload"]; /** * Receive payload from the Sheet when it closes */ onClose?: (data: Sheets[SheetId]["returnValue"] | undefined) => void; /** * Provide `context` of the `SheetProvider` where you want to show the action sheet. */ context?: string; /** * Stack behavior for this sheet. * - `switch`: (default) Closes current sheet, shows new one * - `replace`: Swaps content with crossfade animation * - `push`: Stacks new sheet on top of current */ stackBehavior?: StackBehavior; }): Promise; /** * An async hide function. This is useful when you want to show one Sheet after closing another. * * @param id id of the Sheet to show * @param options */ hide(id: SheetId | (string & {}), options?: { /** * Return some data to the caller on closing the Sheet. */ payload?: Sheets[SheetId]["returnValue"]; /** * Provide `context` of the `SheetProvider` to hide the action sheet. */ context?: string; }): Promise; /** * Hide all the opened Sheets. * * @param id Hide all sheets for the specific id. */ hideAll(id?: SheetId | (string & {})): void; /** * Replace the current sheet with a new one using crossfade animation. * This is a convenience method for show() with stackBehavior: 'replace'. */ replace(id: SheetId | (string & {}), options?: { payload?: Sheets[SheetId]["payload"]; onClose?: (data: Sheets[SheetId]["returnValue"] | undefined) => void; context?: string; }): Promise; /** * Push a new sheet on top of the current one, creating a stack. * This is a convenience method for show() with stackBehavior: 'push'. * */ push(id: SheetId | (string & {}), options?: { payload?: Sheets[SheetId]["payload"]; onClose?: (data: Sheets[SheetId]["returnValue"] | undefined) => void; context?: string; }): Promise; /** * Pop the top sheet from the stack and restore the previous one. * Only works when sheets were opened with stackBehavior: 'push'. */ pop(): void; /** * Get the internal ref of a sheet instance. * * @param id Id of the sheet * @param context Optional context of the SheetProvider */ get(id: SheetId | (string & {}), context?: string): BottomSheetInstance | undefined; /** * Check if a specific sheet is currently visible. */ isVisible(id: SheetId | (string & {}), context?: string): boolean; /** * Reset all internal state. Useful for testing environments. */ reset(): void; } /** * SheetManager is used to imperatively show/hide any sheet with a unique id prop. */ export declare const SheetManager: _SheetManager; export {}; //# sourceMappingURL=manager.d.ts.map