forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentContext.ts
More file actions
95 lines (90 loc) · 3.71 KB
/
documentContext.ts
File metadata and controls
95 lines (90 loc) · 3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { IClientSession } from '@jupyterlab/apputils';
import { DocumentRegistry } from '@jupyterlab/docregistry';
import { INotebookModel, NotebookModel } from '@jupyterlab/notebook/lib';
import { IRenderMime } from '@jupyterlab/rendermime';
import { Contents, Kernel, KernelMessage, Session } from '@jupyterlab/services';
import { Widget } from '@phosphor/widgets';
import { Signal } from './signal';
// tslint:disable: no-any
export class DocumentContext implements DocumentRegistry.IContext<INotebookModel>, IClientSession {
public pathChanged = new Signal<this, string>();
public fileChanged = new Signal<this, Contents.IModel>();
public saveState = new Signal<this, DocumentRegistry.SaveState>();
public disposed = new Signal<this, void>();
public model: INotebookModel;
public session: IClientSession = this;
public path: string;
public localPath: string;
public contentsModel: Contents.IModel;
public urlResolver: IRenderMime.IResolver;
public isReady: boolean;
public ready: Promise<void>;
public isDisposed: boolean;
public terminated = new Signal<this, void>();
public kernelChanged = new Signal<this, Session.IKernelChangedArgs>();
public statusChanged = new Signal<this, Kernel.Status>();
public iopubMessage = new Signal<this, KernelMessage.IMessage>();
public unhandledMessage = new Signal<this, KernelMessage.IMessage>();
public propertyChanged = new Signal<this, 'path' | 'name' | 'type'>();
public name: string;
public type: string;
public status: Kernel.Status;
public kernelPreference: IClientSession.IKernelPreference;
public kernelDisplayName: string;
constructor(public kernel: Kernel.IKernelConnection) {
// We are the session.
// Generate a dummy notebook model
this.model = new NotebookModel();
}
public changeKernel(_options: Partial<Kernel.IModel>): Promise<Kernel.IKernelConnection> {
throw new Error('Method not implemented.');
}
public shutdown(): Promise<void> {
throw new Error('Method not implemented.');
}
public selectKernel(): Promise<void> {
throw new Error('Method not implemented.');
}
public restart(): Promise<boolean> {
throw new Error('Method not implemented.');
}
public setPath(_path: string): Promise<void> {
throw new Error('Method not implemented.');
}
public setName(_name: string): Promise<void> {
throw new Error('Method not implemented.');
}
public setType(_type: string): Promise<void> {
throw new Error('Method not implemented.');
}
public addSibling(_widget: Widget, _options?: any): any {
throw new Error('Method not implemented.');
}
public save(): Promise<void> {
throw new Error('Method not implemented.');
}
public saveAs(): Promise<void> {
throw new Error('Method not implemented.');
}
public revert(): Promise<void> {
throw new Error('Method not implemented.');
}
public createCheckpoint(): Promise<import('@jupyterlab/services').Contents.ICheckpointModel> {
throw new Error('Method not implemented.');
}
public deleteCheckpoint(_checkpointID: string): Promise<void> {
throw new Error('Method not implemented.');
}
public restoreCheckpoint(_checkpointID?: string): Promise<void> {
throw new Error('Method not implemented.');
}
public listCheckpoints(): Promise<import('@jupyterlab/services').Contents.ICheckpointModel[]> {
throw new Error('Method not implemented.');
}
public dispose(): void {
throw new Error('Method not implemented.');
}
}