UNPKG

thebe-core

Version:

Typescript based core functionality for Thebe

45 lines 1.89 kB
import { makeBinderOptions, makeKernelOptions, makeSavedSessionOptions, makeServerSettings, } from './options'; import { ThebeEvents } from './events'; export class Config { constructor(opts = {}, extraConfig) { var _a, _b, _c, _d, _e, _f, _g; this._events = (_a = extraConfig === null || extraConfig === void 0 ? void 0 : extraConfig.events) !== null && _a !== void 0 ? _a : new ThebeEvents(); this._options = { mathjaxUrl: (_b = opts.mathjaxUrl) !== null && _b !== void 0 ? _b : 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js', mathjaxConfig: (_c = opts.mathjaxConfig) !== null && _c !== void 0 ? _c : 'TeX-AMS_CHTML-full,Safe', }; this._binderOptions = makeBinderOptions((_d = opts.binderOptions) !== null && _d !== void 0 ? _d : {}); this._savedSessions = makeSavedSessionOptions((_e = opts.savedSessionOptions) !== null && _e !== void 0 ? _e : {}); this._kernelOptions = makeKernelOptions((_f = opts.kernelOptions) !== null && _f !== void 0 ? _f : {}); this._serverSettings = makeServerSettings((_g = opts.serverSettings) !== null && _g !== void 0 ? _g : {}); console.debug('thebe:config:constructor', this); } get events() { return this._events; } get base() { return this._options; } get mathjax() { return { mathjaxUrl: this._options.mathjaxUrl, mathjaxConfig: this._options.mathjaxConfig, }; } get binder() { return this._binderOptions; } get savedSessions() { return this._savedSessions; } get kernels() { return this._kernelOptions; } get serverSettings() { return this._serverSettings; } set serverSettings(newSettings) { this._serverSettings = newSettings; } } //# sourceMappingURL=config.js.map