import { SharedValue } from "react-native-reanimated"; import React from "react"; import { BottomSheetInstance, SheetPayload, SheetProviderProps, Sheets, StackBehavior } from "./types"; export declare const providerRegistryStack: string[]; /** * An object that holds all the sheet components against their ids. */ export declare const sheetsRegistry: { [context: string]: { [id: string]: React.ElementType; }; }; export interface SheetProps { sheetId: SheetId; payload?: Sheets[SheetId]["payload"]; } export declare function registerSheet(id: SheetId | (string & {}), Sheet: React.ElementType, ...contexts: string[]): void; /** * The SheetProvider makes available the sheets in a given context. The default context is * `global`. However if you want to render a Sheet within another sheet or if you want to render * Sheets in a modal. You can use a separate Provider with a custom context value. * * > **Note:** Context names must be unique across all `SheetProvider` instances. * * @example * ```ts * // Define your SheetProvider in the component/modal where * // you want to show some Sheets. * * * // Then register your sheet at module level (outside JSX): * registerSheet('local-sheet', LocalSheet, 'local-context'); * ``` */ export declare function SheetProvider({ context, statusBar, scaleConfig, children, }: SheetProviderProps): React.JSX.Element; export declare const SheetRefContext: React.Context | null>>; interface StackBehaviorContextValue { behavior: StackBehavior; isTransitioning: boolean; previousSheetId: string | null; } /** * Get id of the current context. */ export declare const useProviderContext: () => string; /** * Get id of the current sheet */ export declare const useSheetIDContext: () => string | undefined; /** * Get the current sheet animation context. */ export declare const useSheetSharedContext: () => { isFullScreen: SharedValue; fullScreenValues: SharedValue>; topInset: number; }; /** * Get stack behavior context for the current sheet. */ export declare const useStackBehaviorContext: () => StackBehaviorContextValue; /** * Get the current Sheet's internal ref. * Note: `current` may be null before the sheet is fully mounted. */ export declare const useSheetRef: () => React.MutableRefObject>; /** * Get the payload this sheet was opened with. */ export declare function useSheetPayload(): Sheets[SheetId]["payload"]; /** * Listen to sheet events. */ export declare function useOnSheet(id: SheetId | (string & {}), type: "show" | "hide" | "onclose", listener: (payload: SheetPayload, context: string, ...args: unknown[]) => void): void; export {}; //# sourceMappingURL=provider.d.ts.map