1 |
|
2 | import { ISessionContext, SessionContext } from '@jupyterlab/apputils';
|
3 | import { Kernel, KernelMessage, ServiceManager, Session } from '@jupyterlab/services';
|
4 | import { AttachedProperty } from '@lumino/properties';
|
5 | import { ISignal } from '@lumino/signaling';
|
6 | import { Context } from './context';
|
7 | import { TextModelFactory } from './default';
|
8 | import { DocumentRegistry, IDocumentWidget } from './registry';
|
9 |
|
10 |
|
11 |
|
12 | export declare function createFileContext(path?: string, manager?: ServiceManager.IManager): Context<DocumentRegistry.IModel>;
|
13 | export declare function createFileContextWithKernel(path?: string, manager?: ServiceManager.IManager): Promise<Context>;
|
14 | export declare function createFileContextWithMockedServices(startKernel?: boolean, manager?: ServiceManager.IManager): Promise<Context>;
|
15 |
|
16 |
|
17 |
|
18 | export declare function createSession(options: Session.ISessionOptions): Promise<Session.ISessionConnection>;
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export declare function createSimpleSessionContext(model?: Private.RecursivePartial<Session.IModel>): ISessionContext;
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | export declare function emitIopubMessage(context: ISessionContext, msg: KernelMessage.IIOPubMessage): void;
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | export declare function updateKernelStatus(sessionContext: ISessionContext, newStatus: KernelMessage.Status): void;
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export declare const SessionContextMock: jest.Mock<ISessionContext, [Partial<SessionContext.IOptions>, Session.ISessionConnection | null], any>;
|
46 |
|
47 |
|
48 |
|
49 | declare namespace Private {
|
50 | type RecursivePartial<T> = {
|
51 | [P in keyof T]?: RecursivePartial<T[P]>;
|
52 | };
|
53 | const textFactory: TextModelFactory;
|
54 | |
55 |
|
56 |
|
57 | function getManager(): ServiceManager;
|
58 | const lastMessageProperty: AttachedProperty<Kernel.IKernelConnection, string>;
|
59 | const RUNNING_KERNELS: Kernel.IKernelConnection[];
|
60 | }
|
61 |
|
62 |
|
63 |
|
64 | export declare class DocumentWidgetOpenerMock {
|
65 | get opened(): ISignal<DocumentWidgetOpenerMock, IDocumentWidget>;
|
66 | open(widget: IDocumentWidget): void;
|
67 | private _opened;
|
68 | }
|
69 | export {};
|