UNPKG

1.51 kBTypeScriptView Raw
1import { Widget } from '@lumino/widgets';
2import { Message } from '@lumino/messaging';
3import { ITranslator } from '@jupyterlab/translation';
4/**
5 * Placeholder widget options
6 */
7export interface IPlaceholderOptions {
8 /**
9 * Prompt element CSS class
10 */
11 promptClass?: string;
12 /**
13 * Ellipsis button callback
14 */
15 callback: (e: MouseEvent) => void;
16 /**
17 * Text to include with the placeholder
18 */
19 text?: string;
20 /**
21 * Translator object
22 */
23 translator?: ITranslator;
24}
25/**
26 * An base class for placeholders
27 *
28 * ### Notes
29 * A placeholder is the element that is shown when input/output
30 * is hidden.
31 */
32export declare class Placeholder extends Widget {
33 /**
34 * Construct a new placeholder.
35 */
36 constructor(options: IPlaceholderOptions);
37 /**
38 * The text displayed in the placeholder.
39 */
40 set text(t: string);
41 get text(): string;
42 protected onAfterAttach(msg: Message): void;
43 protected onBeforeDetach(msg: Message): void;
44 private _callback;
45 private _cell;
46 private _textContent;
47}
48/**
49 * The input placeholder class.
50 */
51export declare class InputPlaceholder extends Placeholder {
52 /**
53 * Construct a new input placeholder.
54 */
55 constructor(options: IPlaceholderOptions);
56}
57/**
58 * The output placeholder class.
59 */
60export declare class OutputPlaceholder extends Placeholder {
61 /**
62 * Construct a new output placeholder.
63 */
64 constructor(options: IPlaceholderOptions);
65}