@jupyterlab/observables 2.1.1-alpha.0 → 2.1.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,61 +1,61 @@
1
- import { JSONObject, JSONValue } from '@phosphor/coreutils';
2
- import { Message } from '@phosphor/messaging';
3
- import { IObservableMap, ObservableMap } from './observablemap';
4
- /**
5
- * An observable JSON value.
6
- */
7
- export interface IObservableJSON extends IObservableMap<JSONValue> {
8
- /**
9
- * Serialize the model to JSON.
10
- */
11
- toJSON(): JSONObject;
12
- }
13
- /**
14
- * The namespace for IObservableJSON related interfaces.
15
- */
16
- export declare namespace IObservableJSON {
17
- /**
18
- * A type alias for observable JSON changed args.
19
- */
20
- type IChangedArgs = IObservableMap.IChangedArgs<JSONValue>;
21
- }
22
- /**
23
- * A concrete Observable map for JSON data.
24
- */
25
- export declare class ObservableJSON extends ObservableMap<JSONValue> {
26
- /**
27
- * Construct a new observable JSON object.
28
- */
29
- constructor(options?: ObservableJSON.IOptions);
30
- /**
31
- * Serialize the model to JSON.
32
- */
33
- toJSON(): JSONObject;
34
- }
35
- /**
36
- * The namespace for ObservableJSON static data.
37
- */
38
- export declare namespace ObservableJSON {
39
- /**
40
- * The options use to initialize an observable JSON object.
41
- */
42
- interface IOptions {
43
- /**
44
- * The optional intitial value for the object.
45
- */
46
- values?: JSONObject;
47
- }
48
- /**
49
- * An observable JSON change message.
50
- */
51
- class ChangeMessage extends Message {
52
- /**
53
- * Create a new metadata changed message.
54
- */
55
- constructor(args: IObservableJSON.IChangedArgs);
56
- /**
57
- * The arguments of the change.
58
- */
59
- readonly args: IObservableJSON.IChangedArgs;
60
- }
61
- }
1
+ import { JSONObject, JSONValue } from '@phosphor/coreutils';
2
+ import { Message } from '@phosphor/messaging';
3
+ import { IObservableMap, ObservableMap } from './observablemap';
4
+ /**
5
+ * An observable JSON value.
6
+ */
7
+ export interface IObservableJSON extends IObservableMap<JSONValue> {
8
+ /**
9
+ * Serialize the model to JSON.
10
+ */
11
+ toJSON(): JSONObject;
12
+ }
13
+ /**
14
+ * The namespace for IObservableJSON related interfaces.
15
+ */
16
+ export declare namespace IObservableJSON {
17
+ /**
18
+ * A type alias for observable JSON changed args.
19
+ */
20
+ type IChangedArgs = IObservableMap.IChangedArgs<JSONValue>;
21
+ }
22
+ /**
23
+ * A concrete Observable map for JSON data.
24
+ */
25
+ export declare class ObservableJSON extends ObservableMap<JSONValue> {
26
+ /**
27
+ * Construct a new observable JSON object.
28
+ */
29
+ constructor(options?: ObservableJSON.IOptions);
30
+ /**
31
+ * Serialize the model to JSON.
32
+ */
33
+ toJSON(): JSONObject;
34
+ }
35
+ /**
36
+ * The namespace for ObservableJSON static data.
37
+ */
38
+ export declare namespace ObservableJSON {
39
+ /**
40
+ * The options use to initialize an observable JSON object.
41
+ */
42
+ interface IOptions {
43
+ /**
44
+ * The optional intitial value for the object.
45
+ */
46
+ values?: JSONObject;
47
+ }
48
+ /**
49
+ * An observable JSON change message.
50
+ */
51
+ class ChangeMessage extends Message {
52
+ /**
53
+ * Create a new metadata changed message.
54
+ */
55
+ constructor(args: IObservableJSON.IChangedArgs);
56
+ /**
57
+ * The arguments of the change.
58
+ */
59
+ readonly args: IObservableJSON.IChangedArgs;
60
+ }
61
+ }
@@ -1,54 +1,54 @@
1
- "use strict";
2
- // Copyright (c) Jupyter Development Team.
3
- // Distributed under the terms of the Modified BSD License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- const coreutils_1 = require("@phosphor/coreutils");
6
- const messaging_1 = require("@phosphor/messaging");
7
- const observablemap_1 = require("./observablemap");
8
- /**
9
- * A concrete Observable map for JSON data.
10
- */
11
- class ObservableJSON extends observablemap_1.ObservableMap {
12
- /**
13
- * Construct a new observable JSON object.
14
- */
15
- constructor(options = {}) {
16
- super({
17
- itemCmp: coreutils_1.JSONExt.deepEqual,
18
- values: options.values
19
- });
20
- }
21
- /**
22
- * Serialize the model to JSON.
23
- */
24
- toJSON() {
25
- const out = Object.create(null);
26
- const keys = this.keys();
27
- for (let key of keys) {
28
- const value = this.get(key);
29
- if (value !== undefined) {
30
- out[key] = coreutils_1.JSONExt.deepCopy(value);
31
- }
32
- }
33
- return out;
34
- }
35
- }
36
- exports.ObservableJSON = ObservableJSON;
37
- /**
38
- * The namespace for ObservableJSON static data.
39
- */
40
- (function (ObservableJSON) {
41
- /**
42
- * An observable JSON change message.
43
- */
44
- class ChangeMessage extends messaging_1.Message {
45
- /**
46
- * Create a new metadata changed message.
47
- */
48
- constructor(args) {
49
- super('jsonvalue-changed');
50
- this.args = args;
51
- }
52
- }
53
- ObservableJSON.ChangeMessage = ChangeMessage;
54
- })(ObservableJSON = exports.ObservableJSON || (exports.ObservableJSON = {}));
1
+ "use strict";
2
+ // Copyright (c) Jupyter Development Team.
3
+ // Distributed under the terms of the Modified BSD License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const coreutils_1 = require("@phosphor/coreutils");
6
+ const messaging_1 = require("@phosphor/messaging");
7
+ const observablemap_1 = require("./observablemap");
8
+ /**
9
+ * A concrete Observable map for JSON data.
10
+ */
11
+ class ObservableJSON extends observablemap_1.ObservableMap {
12
+ /**
13
+ * Construct a new observable JSON object.
14
+ */
15
+ constructor(options = {}) {
16
+ super({
17
+ itemCmp: coreutils_1.JSONExt.deepEqual,
18
+ values: options.values
19
+ });
20
+ }
21
+ /**
22
+ * Serialize the model to JSON.
23
+ */
24
+ toJSON() {
25
+ const out = Object.create(null);
26
+ const keys = this.keys();
27
+ for (let key of keys) {
28
+ const value = this.get(key);
29
+ if (value !== undefined) {
30
+ out[key] = coreutils_1.JSONExt.deepCopy(value);
31
+ }
32
+ }
33
+ return out;
34
+ }
35
+ }
36
+ exports.ObservableJSON = ObservableJSON;
37
+ /**
38
+ * The namespace for ObservableJSON static data.
39
+ */
40
+ (function (ObservableJSON) {
41
+ /**
42
+ * An observable JSON change message.
43
+ */
44
+ class ChangeMessage extends messaging_1.Message {
45
+ /**
46
+ * Create a new metadata changed message.
47
+ */
48
+ constructor(args) {
49
+ super('jsonvalue-changed');
50
+ this.args = args;
51
+ }
52
+ }
53
+ ObservableJSON.ChangeMessage = ChangeMessage;
54
+ })(ObservableJSON = exports.ObservableJSON || (exports.ObservableJSON = {}));