1 | import { Widget } from '@lumino/widgets';
|
2 | import { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor';
|
3 | import { ICellModel } from './model';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export declare class InputArea extends Widget {
|
11 | |
12 |
|
13 |
|
14 | constructor(options: InputArea.IOptions);
|
15 | /**
|
16 | * The model used by the widget.
|
17 | */
|
18 | readonly model: ICellModel;
|
19 | /**
|
20 | * The content factory used by the widget.
|
21 | */
|
22 | readonly contentFactory: InputArea.IContentFactory;
|
23 | /**
|
24 | * Get the CodeEditorWrapper used by the cell.
|
25 | */
|
26 | get editorWidget(): CodeEditorWrapper;
|
27 | /**
|
28 | * Get the CodeEditor used by the cell.
|
29 | */
|
30 | get editor(): CodeEditor.IEditor;
|
31 | /**
|
32 | * Get the prompt node used by the cell.
|
33 | */
|
34 | get promptNode(): HTMLElement;
|
35 | /**
|
36 | * Get the rendered input area widget, if any.
|
37 | */
|
38 | get renderedInput(): Widget;
|
39 | /**
|
40 | * Render an input instead of the text editor.
|
41 | */
|
42 | renderInput(widget: Widget): void;
|
43 | /**
|
44 | * Show the text editor.
|
45 | */
|
46 | showEditor(): void;
|
47 | /**
|
48 | * Set the prompt of the input area.
|
49 | */
|
50 | setPrompt(value: string): void;
|
51 | /**
|
52 | * Dispose of the resources held by the widget.
|
53 | */
|
54 | dispose(): void;
|
55 | private _prompt;
|
56 | private _editor;
|
57 | private _rendered;
|
58 | }
|
59 | /**
|
60 | * A namespace for `InputArea` statics.
|
61 | */
|
62 | export declare namespace InputArea {
|
63 | |
64 |
|
65 |
|
66 | interface IOptions {
|
67 | |
68 |
|
69 |
|
70 | model: ICellModel;
|
71 | |
72 |
|
73 |
|
74 | contentFactory: IContentFactory;
|
75 | |
76 |
|
77 |
|
78 | editorOptions?: Omit<CodeEditor.IOptions, 'host' | 'model'>;
|
79 | }
|
80 | |
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | interface IContentFactory {
|
87 | |
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | readonly editorFactory: CodeEditor.Factory;
|
94 | |
95 |
|
96 |
|
97 | createInputPrompt(): IInputPrompt;
|
98 | }
|
99 | |
100 |
|
101 |
|
102 |
|
103 |
|
104 | class ContentFactory implements IContentFactory {
|
105 | |
106 |
|
107 |
|
108 | constructor(options: ContentFactory.IOptions);
|
109 | /**
|
110 | * Return the `CodeEditor.Factory` being used.
|
111 | */
|
112 | get editorFactory(): CodeEditor.Factory;
|
113 | /**
|
114 | * Create an input prompt.
|
115 | */
|
116 | createInputPrompt(): IInputPrompt;
|
117 | private _editor;
|
118 | }
|
119 | /**
|
120 | * A namespace for the input area content factory.
|
121 | */
|
122 | namespace ContentFactory {
|
123 | |
124 |
|
125 |
|
126 | interface IOptions {
|
127 | |
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 | editorFactory: CodeEditor.Factory;
|
134 | }
|
135 | }
|
136 | }
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 | export interface IInputPrompt extends Widget {
|
144 | |
145 |
|
146 |
|
147 | executionCount: string | null;
|
148 | }
|
149 |
|
150 |
|
151 |
|
152 | export declare class InputPrompt extends Widget implements IInputPrompt {
|
153 | constructor();
|
154 | /**
|
155 | * The execution count for the prompt.
|
156 | */
|
157 | get executionCount(): string | null;
|
158 | set executionCount(value: string | null);
|
159 | private _executionCount;
|
160 | }
|