1 | import { ITranslator } from '@jupyterlab/translation';
|
2 | import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
|
3 | import { Notebook } from '.';
|
4 | /**
|
5 | * The NotebookTrust status item.
|
6 | */
|
7 | export declare class NotebookTrustStatus extends VDomRenderer<NotebookTrustStatus.Model> {
|
8 | /**
|
9 | * Construct a new status item.
|
10 | */
|
11 | constructor(translator?: ITranslator);
|
12 | /**
|
13 | * Render the NotebookTrust status item.
|
14 | */
|
15 | render(): JSX.Element | null;
|
16 | translator: ITranslator;
|
17 | }
|
18 | /**
|
19 | * A namespace for NotebookTrust statics.
|
20 | */
|
21 | export declare namespace NotebookTrustStatus {
|
22 | /**
|
23 | * A VDomModel for the NotebookTrust status item.
|
24 | */
|
25 | class Model extends VDomModel {
|
26 | /**
|
27 | * The number of trusted code cells in the current notebook.
|
28 | */
|
29 | get trustedCells(): number;
|
30 | /**
|
31 | * The total number of code cells in the current notebook.
|
32 | */
|
33 | get totalCells(): number;
|
34 | /**
|
35 | * Whether the active cell is trusted.
|
36 | */
|
37 | get activeCellTrusted(): boolean;
|
38 | /**
|
39 | * The current notebook for the model.
|
40 | */
|
41 | get notebook(): Notebook | null;
|
42 | set notebook(model: Notebook | null);
|
43 | /**
|
44 | * When the notebook model changes, update the trust state.
|
45 | */
|
46 | private _onModelChanged;
|
47 | /**
|
48 | * When the active cell changes, update the trust state.
|
49 | */
|
50 | private _onActiveCellChanged;
|
51 | /**
|
52 | * Given a notebook model, figure out how many of the code cells are trusted.
|
53 | */
|
54 | private _deriveCellTrustState;
|
55 | /**
|
56 | * Get the current state of the model.
|
57 | */
|
58 | private _getAllState;
|
59 | /**
|
60 | * Trigger a change in the renderer.
|
61 | */
|
62 | private _triggerChange;
|
63 | private _trustedCells;
|
64 | private _totalCells;
|
65 | private _activeCellTrusted;
|
66 | private _notebook;
|
67 | }
|
68 | }
|