Socket
Socket
Sign inDemoInstall

@jupyterlab/coreutils

Package Overview
Dependencies
Maintainers
6
Versions
350
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jupyterlab/coreutils - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

11

lib/interfaces.d.ts

@@ -21,3 +21,3 @@ /**

*/
export interface IDataConnector<T, U> {
export interface IDataConnector<T, U = T> {
/**

@@ -31,6 +31,7 @@ * Retrieve a saved bundle from the data connector.

* #### Notes
* The promise returned by this method may be rejected if an error occurs in
* retrieving the data. Non-existence of an `id` will succeed with `null`.
* The promise returned by this method may be rejected if an error
* occurs in retrieving the data. Non-existence of an `id` will
* succeed with `undefined`.
*/
fetch(id: string): Promise<T | null>;
fetch(id: string): Promise<T | undefined>;
/**

@@ -53,3 +54,3 @@ * Remove a value from the data connector.

*/
save(id: string, value: U): Promise<T | void>;
save(id: string, value: U): Promise<void>;
}

@@ -330,3 +330,3 @@ import { IDisposable } from '@phosphor/disposable';

*/
createList(path: string): IObservableUndoableList<JSONValue>;
createList<T extends JSONValue>(path: string): IObservableUndoableList<T>;
/**

@@ -333,0 +333,0 @@ * Create a map and insert it in the database.

import { JSONObject, JSONValue, Token } from '@phosphor/coreutils';
import { IDisposable } from '@phosphor/disposable';
import { ISignal } from '@phosphor/signaling';
import { IDataConnector } from '.';
import { IDataConnector } from './interfaces';
/**

@@ -265,3 +265,3 @@ * The key in the schema for setting editor icon class hints.

*/
constructor(options?: SettingRegistry.IOptions);
constructor(options: SettingRegistry.IOptions);
/**

@@ -355,3 +355,3 @@ * The schema of the setting registry.

*/
upload(raw: ISettingRegistry.IPlugin): Promise<void | ISchemaValidator.IError[]>;
upload(raw: ISettingRegistry.IPlugin): Promise<void>;
/**

@@ -472,3 +472,3 @@ * Save a plugin in the registry.

*/
connector?: IDataConnector<ISettingRegistry.IPlugin, ISettingRegistry.IPlugin>;
connector: IDataConnector<ISettingRegistry.IPlugin, JSONObject>;
/**

@@ -475,0 +475,0 @@ * A function that preloads a plugin's schema in the client-side cache.

@@ -9,3 +9,2 @@ "use strict";

var signaling_1 = require("@phosphor/signaling");
var _1 = require(".");
/**

@@ -113,3 +112,2 @@ * The key in the schema for setting editor icon class hints.

function SettingRegistry(options) {
if (options === void 0) { options = {}; }
/**

@@ -119,8 +117,6 @@ * The schema of the setting registry.

this.schema = Private.SCHEMA;
this._connector = null;
this._pluginChanged = new signaling_1.Signal(this);
this._plugins = Object.create(null);
this._validator = null;
var namespace = 'jupyter.db.settings';
this._connector = options.connector || new _1.StateDB({ namespace: namespace });
this._connector = options.connector;
this._validator = options.validator || new DefaultSchemaValidator();

@@ -127,0 +123,0 @@ this._preload = options.preload || (function () { });

@@ -8,2 +8,3 @@ import { JSONObject, Token } from '@phosphor/coreutils';

/**
* An object which holds an id/value pair.
*/

@@ -23,3 +24,3 @@ export interface IStateItem {

*/
export interface IStateDB extends IDataConnector<JSONObject, JSONObject> {
export interface IStateDB extends IDataConnector<JSONObject> {
/**

@@ -33,26 +34,8 @@ * The maximum allowed length of the data after it has been serialized.

* #### Notes
* This value should be set at instantiation and will only be used internally
* by a state database. That means, for example, that an app could have
* multiple, mutually exclusive state databases.
* This value should be set at instantiation and will only be used
* internally by a state database. That means, for example, that an
* app could have multiple, mutually exclusive state databases.
*/
readonly namespace: string;
/**
* Retrieve a saved bundle from the database.
*
* @param id - The identifier used to retrieve a data bundle.
*
* @returns A promise that bears a data payload if available.
*
* #### Notes
* The `id` values of stored items in the state database are formatted:
* `'namespace:identifier'`, which is the same convention that command
* identifiers in JupyterLab use as well. While this is not a technical
* requirement for `fetch()`, `remove()`, and `save()`, it *is* necessary for
* using the `fetchNamespace()` method.
*
* The promise returned by this method may be rejected if an error occurs in
* retrieving the data. Non-existence of an `id` will succeed, however.
*/
fetch(id: string): Promise<JSONObject | null>;
/**
* Retrieve all the saved bundles for a namespace.

@@ -74,27 +57,2 @@ *

fetchNamespace(namespace: string): Promise<IStateItem[]>;
/**
* Remove a value from the database.
*
* @param id - The identifier for the data being removed.
*
* @returns A promise that is rejected if remove fails and succeeds otherwise.
*/
remove(id: string): Promise<void>;
/**
* Save a value in the database.
*
* @param id - The identifier for the data being saved.
*
* @param value - The data being saved.
*
* @returns A promise that is rejected if saving fails and succeeds otherwise.
*
* #### Notes
* The `id` values of stored items in the state database are formatted:
* `'namespace:identifier'`, which is the same convention that command
* identifiers in JupyterLab use as well. While this is not a technical
* requirement for `fetch()`, `remove()`, and `save()`, it *is* necessary for
* using the `fetchNamespace()` method.
*/
save(id: string, value: JSONObject): Promise<void>;
}

@@ -101,0 +59,0 @@ /**

@@ -126,12 +126,12 @@ import { JSONValue } from '@phosphor/coreutils';

*/
class IdentitySerializer implements ISerializer<JSONValue> {
class IdentitySerializer<T extends JSONValue> implements ISerializer<T> {
/**
* Identity serialize.
*/
toJSON(value: JSONValue): JSONValue;
toJSON(value: T): JSONValue;
/**
* Identity deserialize.
*/
fromJSON(value: JSONValue): JSONValue;
fromJSON(value: JSONValue): T;
}
}
{
"name": "@jupyterlab/coreutils",
"version": "0.8.0",
"version": "0.8.1",
"description": "JupyterLab - Core Utilities",

@@ -30,3 +30,3 @@ "main": "lib/index.js",

"rimraf": "^2.5.2",
"typescript": "~2.3.1"
"typescript": "~2.4.1"
},

@@ -33,0 +33,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc