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