@jupyterlab/rendermime 0.19.1-alpha.0 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,60 +1,60 @@
1
- import { ReadonlyJSONObject } from '@phosphor/coreutils';
2
- import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
3
- /**
4
- * The default mime model implementation.
5
- */
6
- export declare class MimeModel implements IRenderMime.IMimeModel {
7
- /**
8
- * Construct a new mime model.
9
- */
10
- constructor(options?: MimeModel.IOptions);
11
- /**
12
- * Whether the model is trusted.
13
- */
14
- readonly trusted: boolean;
15
- /**
16
- * The data associated with the model.
17
- */
18
- readonly data: ReadonlyJSONObject;
19
- /**
20
- * The metadata associated with the model.
21
- */
22
- readonly metadata: ReadonlyJSONObject;
23
- /**
24
- * Set the data associated with the model.
25
- *
26
- * #### Notes
27
- * Depending on the implementation of the mime model,
28
- * this call may or may not have deferred effects,
29
- */
30
- setData(options: IRenderMime.IMimeModel.ISetDataOptions): void;
31
- private _callback;
32
- private _data;
33
- private _metadata;
34
- }
35
- /**
36
- * The namespace for MimeModel class statics.
37
- */
38
- export declare namespace MimeModel {
39
- /**
40
- * The options used to create a mime model.
41
- */
42
- interface IOptions {
43
- /**
44
- * Whether the model is trusted. Defaults to `false`.
45
- */
46
- trusted?: boolean;
47
- /**
48
- * A callback function for when the data changes.
49
- */
50
- callback?: (options: IRenderMime.IMimeModel.ISetDataOptions) => void;
51
- /**
52
- * The initial mime data.
53
- */
54
- data?: ReadonlyJSONObject;
55
- /**
56
- * The initial mime metadata.
57
- */
58
- metadata?: ReadonlyJSONObject;
59
- }
60
- }
1
+ import { ReadonlyJSONObject } from '@phosphor/coreutils';
2
+ import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
3
+ /**
4
+ * The default mime model implementation.
5
+ */
6
+ export declare class MimeModel implements IRenderMime.IMimeModel {
7
+ /**
8
+ * Construct a new mime model.
9
+ */
10
+ constructor(options?: MimeModel.IOptions);
11
+ /**
12
+ * Whether the model is trusted.
13
+ */
14
+ readonly trusted: boolean;
15
+ /**
16
+ * The data associated with the model.
17
+ */
18
+ readonly data: ReadonlyJSONObject;
19
+ /**
20
+ * The metadata associated with the model.
21
+ */
22
+ readonly metadata: ReadonlyJSONObject;
23
+ /**
24
+ * Set the data associated with the model.
25
+ *
26
+ * #### Notes
27
+ * Depending on the implementation of the mime model,
28
+ * this call may or may not have deferred effects,
29
+ */
30
+ setData(options: IRenderMime.IMimeModel.ISetDataOptions): void;
31
+ private _callback;
32
+ private _data;
33
+ private _metadata;
34
+ }
35
+ /**
36
+ * The namespace for MimeModel class statics.
37
+ */
38
+ export declare namespace MimeModel {
39
+ /**
40
+ * The options used to create a mime model.
41
+ */
42
+ interface IOptions {
43
+ /**
44
+ * Whether the model is trusted. Defaults to `false`.
45
+ */
46
+ trusted?: boolean;
47
+ /**
48
+ * A callback function for when the data changes.
49
+ */
50
+ callback?: (options: IRenderMime.IMimeModel.ISetDataOptions) => void;
51
+ /**
52
+ * The initial mime data.
53
+ */
54
+ data?: ReadonlyJSONObject;
55
+ /**
56
+ * The initial mime metadata.
57
+ */
58
+ metadata?: ReadonlyJSONObject;
59
+ }
60
+ }
package/lib/mimemodel.js CHANGED
@@ -1,54 +1,54 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * The default mime model implementation.
5
- */
6
- class MimeModel {
7
- /**
8
- * Construct a new mime model.
9
- */
10
- constructor(options = {}) {
11
- this.trusted = !!options.trusted;
12
- this._data = options.data || {};
13
- this._metadata = options.metadata || {};
14
- this._callback = options.callback || Private.noOp;
15
- }
16
- /**
17
- * The data associated with the model.
18
- */
19
- get data() {
20
- return this._data;
21
- }
22
- /**
23
- * The metadata associated with the model.
24
- */
25
- get metadata() {
26
- return this._metadata;
27
- }
28
- /**
29
- * Set the data associated with the model.
30
- *
31
- * #### Notes
32
- * Depending on the implementation of the mime model,
33
- * this call may or may not have deferred effects,
34
- */
35
- setData(options) {
36
- this._data = options.data || this._data;
37
- this._metadata = options.metadata || this._metadata;
38
- this._callback(options);
39
- }
40
- }
41
- exports.MimeModel = MimeModel;
42
- /**
43
- * The namespace for module private data.
44
- */
45
- var Private;
46
- (function (Private) {
47
- /**
48
- * A no-op callback function.
49
- */
50
- function noOp() {
51
- /* no-op */
52
- }
53
- Private.noOp = noOp;
54
- })(Private || (Private = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * The default mime model implementation.
5
+ */
6
+ class MimeModel {
7
+ /**
8
+ * Construct a new mime model.
9
+ */
10
+ constructor(options = {}) {
11
+ this.trusted = !!options.trusted;
12
+ this._data = options.data || {};
13
+ this._metadata = options.metadata || {};
14
+ this._callback = options.callback || Private.noOp;
15
+ }
16
+ /**
17
+ * The data associated with the model.
18
+ */
19
+ get data() {
20
+ return this._data;
21
+ }
22
+ /**
23
+ * The metadata associated with the model.
24
+ */
25
+ get metadata() {
26
+ return this._metadata;
27
+ }
28
+ /**
29
+ * Set the data associated with the model.
30
+ *
31
+ * #### Notes
32
+ * Depending on the implementation of the mime model,
33
+ * this call may or may not have deferred effects,
34
+ */
35
+ setData(options) {
36
+ this._data = options.data || this._data;
37
+ this._metadata = options.metadata || this._metadata;
38
+ this._callback(options);
39
+ }
40
+ }
41
+ exports.MimeModel = MimeModel;
42
+ /**
43
+ * The namespace for module private data.
44
+ */
45
+ var Private;
46
+ (function (Private) {
47
+ /**
48
+ * A no-op callback function.
49
+ */
50
+ function noOp() {
51
+ /* no-op */
52
+ }
53
+ Private.noOp = noOp;
54
+ })(Private || (Private = {}));
@@ -1,131 +1,131 @@
1
- import { JSONObject, ReadonlyJSONObject } from '@phosphor/coreutils';
2
- import { ISignal } from '@phosphor/signaling';
3
- import { nbformat } from '@jupyterlab/coreutils';
4
- import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
5
- /**
6
- * The interface for an output model.
7
- */
8
- export interface IOutputModel extends IRenderMime.IMimeModel {
9
- /**
10
- * A signal emitted when the output model changes.
11
- */
12
- readonly changed: ISignal<this, void>;
13
- /**
14
- * The output type.
15
- */
16
- readonly type: string;
17
- /**
18
- * The execution count of the model.
19
- */
20
- readonly executionCount: nbformat.ExecutionCount;
21
- /**
22
- * Whether the output is trusted.
23
- */
24
- trusted: boolean;
25
- /**
26
- * Dispose of the resources used by the output model.
27
- */
28
- dispose(): void;
29
- /**
30
- * Serialize the model to JSON.
31
- */
32
- toJSON(): nbformat.IOutput;
33
- }
34
- /**
35
- * The namespace for IOutputModel sub-interfaces.
36
- */
37
- export declare namespace IOutputModel {
38
- /**
39
- * The options used to create a notebook output model.
40
- */
41
- interface IOptions {
42
- /**
43
- * The raw output value.
44
- */
45
- value: nbformat.IOutput;
46
- /**
47
- * Whether the output is trusted. The default is false.
48
- */
49
- trusted?: boolean;
50
- }
51
- }
52
- /**
53
- * The default implementation of a notebook output model.
54
- */
55
- export declare class OutputModel implements IOutputModel {
56
- /**
57
- * Construct a new output model.
58
- */
59
- constructor(options: IOutputModel.IOptions);
60
- /**
61
- * A signal emitted when the output model changes.
62
- */
63
- readonly changed: ISignal<this, void>;
64
- /**
65
- * The output type.
66
- */
67
- readonly type: string;
68
- /**
69
- * The execution count.
70
- */
71
- readonly executionCount: nbformat.ExecutionCount;
72
- /**
73
- * Whether the model is trusted.
74
- */
75
- readonly trusted: boolean;
76
- /**
77
- * Dispose of the resources used by the output model.
78
- */
79
- dispose(): void;
80
- /**
81
- * The data associated with the model.
82
- */
83
- readonly data: ReadonlyJSONObject;
84
- /**
85
- * The metadata associated with the model.
86
- */
87
- readonly metadata: ReadonlyJSONObject;
88
- /**
89
- * Set the data associated with the model.
90
- *
91
- * #### Notes
92
- * Depending on the implementation of the mime model,
93
- * this call may or may not have deferred effects,
94
- */
95
- setData(options: IRenderMime.IMimeModel.ISetDataOptions): void;
96
- /**
97
- * Serialize the model to JSON.
98
- */
99
- toJSON(): nbformat.IOutput;
100
- /**
101
- * Update an observable JSON object using a readonly JSON object.
102
- */
103
- private _updateObservable;
104
- private _changed;
105
- private _raw;
106
- private _rawMetadata;
107
- private _rawData;
108
- private _data;
109
- private _metadata;
110
- }
111
- /**
112
- * The namespace for OutputModel statics.
113
- */
114
- export declare namespace OutputModel {
115
- /**
116
- * Get the data for an output.
117
- *
118
- * @params output - A kernel output message payload.
119
- *
120
- * @returns - The data for the payload.
121
- */
122
- function getData(output: nbformat.IOutput): JSONObject;
123
- /**
124
- * Get the metadata from an output message.
125
- *
126
- * @params output - A kernel output message payload.
127
- *
128
- * @returns - The metadata for the payload.
129
- */
130
- function getMetadata(output: nbformat.IOutput): JSONObject;
131
- }
1
+ import { JSONObject, ReadonlyJSONObject } from '@phosphor/coreutils';
2
+ import { ISignal } from '@phosphor/signaling';
3
+ import { nbformat } from '@jupyterlab/coreutils';
4
+ import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
5
+ /**
6
+ * The interface for an output model.
7
+ */
8
+ export interface IOutputModel extends IRenderMime.IMimeModel {
9
+ /**
10
+ * A signal emitted when the output model changes.
11
+ */
12
+ readonly changed: ISignal<this, void>;
13
+ /**
14
+ * The output type.
15
+ */
16
+ readonly type: string;
17
+ /**
18
+ * The execution count of the model.
19
+ */
20
+ readonly executionCount: nbformat.ExecutionCount;
21
+ /**
22
+ * Whether the output is trusted.
23
+ */
24
+ trusted: boolean;
25
+ /**
26
+ * Dispose of the resources used by the output model.
27
+ */
28
+ dispose(): void;
29
+ /**
30
+ * Serialize the model to JSON.
31
+ */
32
+ toJSON(): nbformat.IOutput;
33
+ }
34
+ /**
35
+ * The namespace for IOutputModel sub-interfaces.
36
+ */
37
+ export declare namespace IOutputModel {
38
+ /**
39
+ * The options used to create a notebook output model.
40
+ */
41
+ interface IOptions {
42
+ /**
43
+ * The raw output value.
44
+ */
45
+ value: nbformat.IOutput;
46
+ /**
47
+ * Whether the output is trusted. The default is false.
48
+ */
49
+ trusted?: boolean;
50
+ }
51
+ }
52
+ /**
53
+ * The default implementation of a notebook output model.
54
+ */
55
+ export declare class OutputModel implements IOutputModel {
56
+ /**
57
+ * Construct a new output model.
58
+ */
59
+ constructor(options: IOutputModel.IOptions);
60
+ /**
61
+ * A signal emitted when the output model changes.
62
+ */
63
+ readonly changed: ISignal<this, void>;
64
+ /**
65
+ * The output type.
66
+ */
67
+ readonly type: string;
68
+ /**
69
+ * The execution count.
70
+ */
71
+ readonly executionCount: nbformat.ExecutionCount;
72
+ /**
73
+ * Whether the model is trusted.
74
+ */
75
+ readonly trusted: boolean;
76
+ /**
77
+ * Dispose of the resources used by the output model.
78
+ */
79
+ dispose(): void;
80
+ /**
81
+ * The data associated with the model.
82
+ */
83
+ readonly data: ReadonlyJSONObject;
84
+ /**
85
+ * The metadata associated with the model.
86
+ */
87
+ readonly metadata: ReadonlyJSONObject;
88
+ /**
89
+ * Set the data associated with the model.
90
+ *
91
+ * #### Notes
92
+ * Depending on the implementation of the mime model,
93
+ * this call may or may not have deferred effects,
94
+ */
95
+ setData(options: IRenderMime.IMimeModel.ISetDataOptions): void;
96
+ /**
97
+ * Serialize the model to JSON.
98
+ */
99
+ toJSON(): nbformat.IOutput;
100
+ /**
101
+ * Update an observable JSON object using a readonly JSON object.
102
+ */
103
+ private _updateObservable;
104
+ private _changed;
105
+ private _raw;
106
+ private _rawMetadata;
107
+ private _rawData;
108
+ private _data;
109
+ private _metadata;
110
+ }
111
+ /**
112
+ * The namespace for OutputModel statics.
113
+ */
114
+ export declare namespace OutputModel {
115
+ /**
116
+ * Get the data for an output.
117
+ *
118
+ * @params output - A kernel output message payload.
119
+ *
120
+ * @returns - The data for the payload.
121
+ */
122
+ function getData(output: nbformat.IOutput): JSONObject;
123
+ /**
124
+ * Get the metadata from an output message.
125
+ *
126
+ * @params output - A kernel output message payload.
127
+ *
128
+ * @returns - The metadata for the payload.
129
+ */
130
+ function getMetadata(output: nbformat.IOutput): JSONObject;
131
+ }