UNPKG

1.35 kBTypeScriptView Raw
1import { ServerConnection } from '../serverconnection';
2import { Session } from '.';
3type DeepPartial<T> = {
4 [P in keyof T]?: DeepPartial<T[P]>;
5};
6/**
7 * The url for the session service.
8 */
9export declare const SESSION_SERVICE_URL = "api/sessions";
10/**
11 * List the running sessions.
12 */
13export declare function listRunning(settings?: ServerConnection.ISettings): Promise<Session.IModel[]>;
14/**
15 * Get a session url.
16 */
17export declare function getSessionUrl(baseUrl: string, id: string): string;
18/**
19 * Shut down a session by id.
20 */
21export declare function shutdownSession(id: string, settings?: ServerConnection.ISettings): Promise<void>;
22/**
23 * Get a full session model from the server by session id string.
24 */
25export declare function getSessionModel(id: string, settings?: ServerConnection.ISettings): Promise<Session.IModel>;
26/**
27 * Create a new session, or return an existing session if the session path
28 * already exists.
29 */
30export declare function startSession(options: Session.ISessionOptions, settings?: ServerConnection.ISettings): Promise<Session.IModel>;
31/**
32 * Send a PATCH to the server, updating the session path or the kernel.
33 */
34export declare function updateSession(model: Pick<Session.IModel, 'id'> & DeepPartial<Omit<Session.IModel, 'id'>>, settings?: ServerConnection.ISettings): Promise<Session.IModel>;
35export {};