Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
contentFactory
}).initializeState();
return cell;
}
getCell(msgId: string) {
return this._cells.get(msgId);
}
private _cells = new Map();
}
class TestHandler extends ForeignHandler {
injected = new Signal(this);
received = new Signal(this);
rejected = new Signal(this);
methods: string[] = [];
protected onIOPubMessage(
sender: IClientSession,
msg: KernelMessage.IIOPubMessage
): boolean {
const injected = super.onIOPubMessage(sender, msg);
this.received.emit(msg);
if (injected) {
this.injected.emit(msg);
} else {
// If the message was not injected but otherwise would have been, emit
// a rejected signal. This should only happen if `enabled` is `false`.
dispose() {
if (this.isDisposed) {
return;
}
this._isDisposed = true;
// If a query hasn't been executed yet, no need to call endSearch
if (this._displayState.query) {
void this._activeProvider.endSearch();
}
this._searchWidget.dispose();
this._disposed.emit(undefined);
Signal.clearData(this);
}
dispose(): void {
// Do nothing if the tracker is already disposed.
if (this._counter < 0) {
return;
}
// Mark the tracker as disposed.
this._counter = -1;
// Clear the connections for the tracker.
Signal.clearData(this);
// Remove all event listeners.
each(this._widgets, w => {
w.node.removeEventListener('focus', this, true);
w.node.removeEventListener('blur', this, true);
});
// Clear the internal data structures.
this._activeWidget = null;
this._currentWidget = null;
this._nodes.clear();
this._numbers.clear();
this._widgets.length = 0;
}
dispose(): void {
if (this.isDisposed) {
return;
}
this._isDisposed = true;
// Clear any listeners for our signals.
Signal.clearData(this);
// Close all the widgets for our contexts and dispose the widget manager.
this._contexts.forEach(context => {
return this._widgetManager.closeWidgets(context);
});
this._widgetManager.dispose();
// Clear the context list.
this._contexts.length = 0;
}
signal.connect((sender: T, args: U) => {
if (!options.find || options.find(sender, args)) {
try {
Signal.disconnectReceiver(object);
if (options.test) {
options.test(sender, args);
}
} catch (e) {
done.reject(e);
}
done.resolve(options.value || undefined);
}
}, object);
return done.promise;
dispose() {
Signal.disconnectAll(this);
}
args: ARGS[] = [];
dispose() {
Signal.disconnectAll(this);
}
args: ARGS[] = [];
dispose() {
Signal.disconnectAll(this);
}
args: ARGS[] = [];
defaultSession.kernelChanged.connect((s, args) => {
called = args;
Signal.disconnectReceiver(object);
}, object);
const previous = defaultSession.kernel;
const result = await commands.execute(command, current);
if (result === stop) {
queue.length = 0;
console.log(`Routing ${request} was short-circuited by ${command}`);
}
} catch (reason) {
console.warn(`Routing ${request} to ${command} failed`, reason);
}
void next();
};
void next();
return done.promise;
}
private _routed = new Signal(this);
private _rules = new Map();
}
/**
* A namespace for `Router` class statics.
*/
export namespace Router {
/**
* The options for instantiating a JupyterLab URL router.
*/
export interface IOptions {
/**
* The fully qualified base URL for the router.
*/
base: string;