-
-
Notifications
You must be signed in to change notification settings - Fork 550
/
remote-jupyter.ts
42 lines (37 loc) · 1.1 KB
/
remote-jupyter.ts
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
import * as Immutable from "immutable";
import { AjaxRequest } from "rxjs/ajax";
import { BaseHostProps } from "./base";
export interface ServerConfig {
endpoint: string;
url?: string;
crossDomain?: boolean;
token?: string;
xsrfToken?: string;
ajaxOptions?: Partial<AjaxRequest>;
wsProtocol?: string | string[];
}
export type JupyterHostRecordProps = BaseHostProps & {
type: "jupyter";
token?: string | null;
origin: string;
basePath: string;
bookstoreEnabled: boolean;
showHeaderEditor: boolean;
crossDomain?: boolean | null;
ajaxOptions?: Partial<AjaxRequest>;
wsProtocol?: string | string[];
};
export const makeJupyterHostRecord = Immutable.Record<JupyterHostRecordProps>({
type: "jupyter",
id: null,
defaultKernelName: "python",
token: null,
origin: typeof location === "undefined" ? "" : location.origin,
basePath: "/",
crossDomain: false,
ajaxOptions: undefined,
wsProtocol: undefined,
bookstoreEnabled: false,
showHeaderEditor: false
});
export type JupyterHostRecord = Immutable.RecordOf<JupyterHostRecordProps>;