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