UNPKG

1.9 kBTypeScriptView Raw
1/**
2 * @fileoverview This component is DEPRECATED, and the code is frozen.
3 * All changes & bugfixes should be made to PanelStack2 instead.
4 */
5import type * as React from "react";
6/**
7 * An object describing a panel in a `PanelStack`.
8 *
9 * @deprecated use `Panel<T>` with PanelStack2
10 */
11export interface IPanel<P = {}> {
12 /**
13 * The component type to render for this panel. This must be a reference to
14 * the component class or SFC, _not_ a JSX element, so it can be re-created
15 * dynamically when needed.
16 */
17 component: React.ComponentType<P & IPanelProps>;
18 /**
19 * HTML title to be passed to the <Text> component
20 */
21 htmlTitle?: string;
22 /**
23 * The props passed to the component type when it is rendered. The methods
24 * in `IPanelProps` will be injected by `PanelStack`.
25 */
26 props?: P;
27 /**
28 * The title to be displayed above this panel. It is also used as the text
29 * of the back button for any panel opened by this panel.
30 */
31 title?: React.ReactNode;
32}
33/**
34 * Include this interface in your panel component's props type to access these
35 * two functions which are injected by `PanelStack`.
36 *
37 * ```tsx
38 * import { IPanelProps } from "@blueprintjs/core";
39 * export class SettingsPanel extends React.Component<IPanelProps & ISettingsPanelProps> {...}
40 * ```
41 *
42 * @deprecated use `PanelActions<T>` with PanelStack2
43 */
44export interface IPanelProps {
45 /**
46 * Call this method to programatically close this panel. If this is the only
47 * panel on the stack then this method will do nothing.
48 *
49 * Remember that the panel header always contains a "back" button that
50 * closes this panel on click (unless there is only one panel on the stack).
51 */
52 closePanel(): void;
53 /**
54 * Call this method to open a new panel on the top of the stack.
55 */
56 openPanel<P>(panel: IPanel<P>): void;
57}