1 |
|
2 | import { ReadonlyJSONObject } from '@lumino/coreutils';
|
3 | import { AttachedProperty } from '@lumino/properties';
|
4 | import { ISignal } from '@lumino/signaling';
|
5 | import { BaseManager } from './basemanager';
|
6 | import { Contents } from './contents';
|
7 | import { Kernel, KernelMessage } from './kernel';
|
8 | import { KernelSpec } from './kernelspec';
|
9 | import { ServiceManager } from './manager';
|
10 | import { ServerConnection } from './serverconnection';
|
11 | import { Session } from './session';
|
12 | import { User, UserManager } from './user';
|
13 | export declare const DEFAULT_NAME = "python3";
|
14 | export declare const KERNELSPECS: {
|
15 | [key: string]: KernelSpec.ISpecModel;
|
16 | };
|
17 | export declare const KERNEL_MODELS: Kernel.IModel[];
|
18 | export declare const NOTEBOOK_PATHS: {
|
19 | [kernelName: string]: string[];
|
20 | };
|
21 |
|
22 |
|
23 |
|
24 | export declare function cloneKernel(kernel: Kernel.IKernelConnection): Kernel.IKernelConnection;
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export declare const KernelMock: jest.Mock<Kernel.IKernelConnection, [Private.RecursivePartial<Kernel.IKernelConnection.IOptions>], any>;
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export declare const SessionConnectionMock: jest.Mock<Session.ISessionConnection, [Private.RecursivePartial<Session.ISessionConnection.IOptions>, Kernel.IKernelConnection | null], any>;
|
38 |
|
39 |
|
40 |
|
41 | export declare const ContentsManagerMock: jest.Mock<Contents.IManager, [], any>;
|
42 |
|
43 |
|
44 |
|
45 | export declare const SessionManagerMock: jest.Mock<Session.IManager, [], any>;
|
46 |
|
47 |
|
48 |
|
49 | export declare const KernelSpecManagerMock: jest.Mock<KernelSpec.IManager, [], any>;
|
50 |
|
51 |
|
52 |
|
53 | export declare const ServiceManagerMock: jest.Mock<ServiceManager.IManager, [], any>;
|
54 |
|
55 |
|
56 |
|
57 | export declare const MockShellFuture: jest.Mock<Kernel.IShellFuture<KernelMessage.IShellMessage<KernelMessage.ShellMessageType>, KernelMessage.IShellMessage<KernelMessage.ShellMessageType>>, [KernelMessage.IShellMessage<KernelMessage.ShellMessageType>], any>;
|
58 | export declare function changeKernel(kernel: Kernel.IKernelConnection, partialModel: Partial<Kernel.IModel>): Promise<Kernel.IKernelConnection>;
|
59 |
|
60 |
|
61 |
|
62 | declare namespace Private {
|
63 | type RecursivePartial<T> = {
|
64 | [P in keyof T]?: RecursivePartial<T[P]>;
|
65 | };
|
66 | function createFile(options?: Contents.ICreateOptions): Contents.IModel;
|
67 | function fixSlash(path: string): string;
|
68 | function makeResponseError<T>(status: number): Promise<T>;
|
69 | function cloneKernel(options: RecursivePartial<Kernel.IKernelConnection.IOptions>): Kernel.IKernelConnection;
|
70 | function kernelSpecForKernelName(name: string): KernelSpec.ISpecModel;
|
71 | function getInfo(name: string): KernelMessage.IInfoReply;
|
72 | const RUNNING_KERNELS: Kernel.IKernelConnection[];
|
73 | const lastMessageProperty: AttachedProperty<Kernel.IKernelConnection, string>;
|
74 | }
|
75 |
|
76 |
|
77 |
|
78 | export declare class FakeUserManager extends BaseManager implements User.IManager {
|
79 | private _isReady;
|
80 | private _ready;
|
81 | private _identity;
|
82 | private _permissions;
|
83 | private _userChanged;
|
84 | private _connectionFailure;
|
85 | |
86 |
|
87 |
|
88 | constructor(options: UserManager.IOptions | undefined, identity: User.IIdentity, permissions: ReadonlyJSONObject);
|
89 | /**
|
90 | * The server settings for the manager.
|
91 | */
|
92 | readonly serverSettings: ServerConnection.ISettings;
|
93 | /**
|
94 | * Test whether the manager is ready.
|
95 | */
|
96 | get isReady(): boolean;
|
97 | /**
|
98 | * A promise that fulfills when the manager is ready.
|
99 | */
|
100 | get ready(): Promise<void>;
|
101 | /**
|
102 | * Get the most recently fetched identity.
|
103 | */
|
104 | get identity(): User.IIdentity | null;
|
105 | /**
|
106 | * Get the most recently fetched permissions.
|
107 | */
|
108 | get permissions(): ReadonlyJSONObject | null;
|
109 | /**
|
110 | * A signal emitted when the user changes.
|
111 | */
|
112 | get userChanged(): ISignal<this, User.IUser>;
|
113 | /**
|
114 | * A signal emitted when there is a connection failure.
|
115 | */
|
116 | get connectionFailure(): ISignal<this, Error>;
|
117 | /**
|
118 | * Dispose of the resources used by the manager.
|
119 | */
|
120 | dispose(): void;
|
121 | /**
|
122 | * Force a refresh of the specs from the server.
|
123 | *
|
124 | * @returns A promise that resolves when the specs are fetched.
|
125 | *
|
126 | * #### Notes
|
127 | * This is intended to be called only in response to a user action,
|
128 | * since the manager maintains its internal state.
|
129 | */
|
130 | refreshUser(): Promise<void>;
|
131 | }
|
132 | export {};
|