1 | import * as nbformat from '@jupyterlab/nbformat';
|
2 | import { IObservableString } from '@jupyterlab/observables';
|
3 | import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
|
4 | import { PartialJSONObject, ReadonlyPartialJSONObject } from '@lumino/coreutils';
|
5 | import { ISignal } from '@lumino/signaling';
|
6 |
|
7 |
|
8 |
|
9 | export interface IOutputModel extends IRenderMime.IMimeModel {
|
10 | |
11 |
|
12 |
|
13 | readonly changed: ISignal<this, void>;
|
14 | |
15 |
|
16 |
|
17 | readonly type: string;
|
18 | |
19 |
|
20 |
|
21 | readonly executionCount: nbformat.ExecutionCount;
|
22 | |
23 |
|
24 |
|
25 | readonly streamText?: IObservableString;
|
26 | |
27 |
|
28 |
|
29 | trusted: boolean;
|
30 | |
31 |
|
32 |
|
33 | dispose(): void;
|
34 | |
35 |
|
36 |
|
37 | toJSON(): nbformat.IOutput;
|
38 | }
|
39 |
|
40 |
|
41 |
|
42 | export declare namespace IOutputModel {
|
43 | |
44 |
|
45 |
|
46 | interface IOptions {
|
47 | |
48 |
|
49 |
|
50 | value: nbformat.IOutput;
|
51 | |
52 |
|
53 |
|
54 | trusted?: boolean;
|
55 | }
|
56 | }
|
57 |
|
58 |
|
59 |
|
60 | export declare class OutputModel implements IOutputModel {
|
61 | |
62 |
|
63 |
|
64 | constructor(options: IOutputModel.IOptions);
|
65 | /**
|
66 | * A signal emitted when the output model changes.
|
67 | */
|
68 | get changed(): ISignal<this, void>;
|
69 | /**
|
70 | * The output type.
|
71 | */
|
72 | readonly type: string;
|
73 | /**
|
74 | * The execution count.
|
75 | */
|
76 | readonly executionCount: nbformat.ExecutionCount;
|
77 | /**
|
78 | * Whether the model is trusted.
|
79 | */
|
80 | readonly trusted: boolean;
|
81 | /**
|
82 | * Dispose of the resources used by the output model.
|
83 | */
|
84 | dispose(): void;
|
85 | /**
|
86 | * The data associated with the model.
|
87 | */
|
88 | get data(): ReadonlyPartialJSONObject;
|
89 | get streamText(): IObservableString | undefined;
|
90 | /**
|
91 | * The metadata associated with the model.
|
92 | */
|
93 | get metadata(): ReadonlyPartialJSONObject;
|
94 | /**
|
95 | * Set the data associated with the model.
|
96 | *
|
97 | * #### Notes
|
98 | * Depending on the implementation of the mime model,
|
99 | * this call may or may not have deferred effects,
|
100 | */
|
101 | setData(options: IRenderMime.IMimeModel.ISetDataOptions): void;
|
102 | /**
|
103 | * Serialize the model to JSON.
|
104 | */
|
105 | toJSON(): nbformat.IOutput;
|
106 | /**
|
107 | * Update an observable JSON object using a readonly JSON object.
|
108 | */
|
109 | private _updateObservable;
|
110 | private _changed;
|
111 | private _raw;
|
112 | private _rawMetadata;
|
113 | private _rawData;
|
114 | private _text?;
|
115 | private _metadata;
|
116 | }
|
117 | /**
|
118 | * The namespace for OutputModel statics.
|
119 | */
|
120 | export declare namespace OutputModel {
|
121 | |
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 | function getData(output: nbformat.IOutput): PartialJSONObject;
|
129 | |
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | function getMetadata(output: nbformat.IOutput): PartialJSONObject;
|
137 | }
|