UNPKG

1.63 kBTypeScriptView Raw
1import { ReactWidget } from '@jupyterlab/ui-components';
2import * as React from 'react';
3/**
4 * Abstract collapser base class.
5 *
6 * ### Notes
7 * A collapser is a visible div to the left of a cell's
8 * input/output that a user can click on to collapse the
9 * input/output.
10 */
11export declare abstract class Collapser extends ReactWidget {
12 /**
13 * Construct a new collapser.
14 */
15 constructor();
16 /**
17 * Is the input/output of the parent collapsed.
18 */
19 get collapsed(): boolean;
20 /**
21 * Render the collapser with the virtual DOM.
22 */
23 protected render(): React.ReactElement<any>;
24 /**
25 * Handle the click event.
26 */
27 protected abstract handleClick(e: React.MouseEvent<HTMLDivElement>): void;
28}
29/**
30 * A collapser subclass to collapse a cell's input area.
31 */
32export declare class InputCollapser extends Collapser {
33 /**
34 * Construct a new input collapser.
35 */
36 constructor();
37 /**
38 * Is the cell's input collapsed?
39 */
40 get collapsed(): boolean;
41 /**
42 * Handle a click event for the user to collapse the cell's input.
43 */
44 protected handleClick(e: React.MouseEvent<HTMLDivElement>): void;
45}
46/**
47 * A collapser subclass to collapse a cell's output area.
48 */
49export declare class OutputCollapser extends Collapser {
50 /**
51 * Construct a new output collapser.
52 */
53 constructor();
54 /**
55 * Is the cell's output collapsed?
56 */
57 get collapsed(): boolean;
58 /**
59 * Handle a click event for the user to collapse the cell's output.
60 */
61 protected handleClick(e: React.MouseEvent<HTMLDivElement>): void;
62}