UNPKG

1.68 kBTypeScriptView Raw
1import * as React from "react";
2import type { OverlayInstance } from "../../components/overlay2/overlayInstance";
3export interface OverlaysContextState {
4 /**
5 * Whether the context instance is being used within a tree which has an `<OverlaysProvider>`.
6 * `useOverlayStack()` will work if this is `false` in Blueprint v5, but this will be unsupported
7 * in Blueprint v6; all applications with overlays will be required to configure a provider to
8 * manage global overlay state.
9 *
10 * @see https://github.com/palantir/blueprint/wiki/Overlay2-migration
11 */
12 hasProvider: boolean;
13 /**
14 * The application-wide global overlay stack.
15 */
16 stack: React.MutableRefObject<OverlayInstance[]>;
17}
18/**
19 * A React context used to interact with the overlay stack in an application.
20 * Users should take care to make sure that only _one_ of these is instantiated and used within an
21 * application.
22 *
23 * You will likely not be using this OverlaysContext directly, it's mostly used internally by the
24 * Overlay2 component.
25 *
26 * For more information, see the [OverlaysProvider documentation](https://blueprintjs.com/docs/#core/context/overlays-provider).
27 */
28export declare const OverlaysContext: React.Context<OverlaysContextState>;
29export interface OverlaysProviderProps {
30 /** The component subtree which will have access to this overlay stack context. */
31 children: React.ReactNode;
32}
33/**
34 * Overlays context provider, necessary for the `useOverlayStack` hook.
35 *
36 * @see https://blueprintjs.com/docs/#core/context/overlays-provider
37 */
38export declare const OverlaysProvider: ({ children }: OverlaysProviderProps) => React.JSX.Element;