SandboxOptions
type SandboxOptions = object;
Type declaration
editor
editor: object;
Editor related options.
editor.suppressClose?
optional suppressClose: boolean;
Default value to be used when creating editor tabs.
editor.theme?
optional theme: object;
Themes to be used by codemirror.
Using callbacks to overcome the readonly nature of the options returned by useSandbox()
.
It is also to avoid the "Type instantiation is excessively deep and possibly infinite." error.
The callbacks return an array to allow passing multiple themes (e.g. base theme and a theme for overrides).
editor.theme.dark()?
optional dark: () => Extension[];
Callback that returns a list of dark codemirror themes.
Returns
Extension
editor.theme.light()?
optional light: () => Extension[];
Callback that returns a list of light codemirror themes.
Returns
Extension
explorer
explorer: object;
Path patterns to be used for matching. The matchers use .gitignore-style matching through ignore to determine whether a give path matches one of the patterns.
explorer.hidden?
optional hidden: string[];
List of patterns to determine whether an entity (directory or file) should be hidden in the file explorer.
explorer.readonly?
optional readonly: string[];
List of patterns to determine whether an entity (directory or file) should be marked as readonly in the file explorer and editor tabs.
explorer.reinstall?
optional reinstall: string[];
List of patterns to determine whether changing an entity (directory or file) should trigger the re-installation of dependencies and re-bootstrapping.
preview
preview: object;
Preview related options.
preview.suppressAddressBar?
optional suppressAddressBar: boolean;
When true, the address bar in the preview panel will not be shown.
process
process: object;
Preview / terminal related options.
process.commands
commands: object;
Predefined commands.
process.commands.devServer
devServer: string;
Command to start dev server.
Default
npm start
process.commands.install
install: string;
Dependency installation command.
Default
npm install
process.commands.terminal
terminal: string;
Command to start a terminal.
Default
jsh
process.packageManager
packageManager: "npm" | "pnpm" | "yarn";
Package manager. Setting this option adjusts the predefined commands accordingly.
process.starters?
optional starters: object;
Callbacks to spawn the processes of the predefined commands. Implemented as a sensible default and do some opinionated stuff.
If more control is needed, a process can be started using useSandbox().processTabs.open()
.
process.starters.devServer()?
optional devServer: () => Promise<void>;
Dev server process starter.
Returns
Promise
<void
>
process.starters.install()?
optional install: () => Promise<void>;
Dependency installation process starter.
Returns
Promise
<void
>
process.starters.terminal()?
optional terminal: () => Promise<void>;
Terminal process starter.
Returns
Promise
<void
>
terminal
terminal: object;
Terminal related options.
terminal.maxCount?
optional maxCount: number;
Maximum number of terminal tabs to be opened simultaneously.
Default
3
terminal.theme?
optional theme: object;
Theme to be used by xterm to output process and terminal logs.
Using callbacks to overcome the readonly nature of the options returned by useSandbox().
terminal.theme.dark()?
optional dark: () => ITheme;
Callback to return dark xterm theme.
Returns
ITheme
terminal.theme.light()?
optional light: () => ITheme;
Callback to return light xterm theme.
Returns
ITheme