UNPKG

@dodona/papyros

Version:

Scratchpad for multiple programming languages in the browser.

41 lines (40 loc) 1.63 kB
import { State } from "@dodona/lit-state"; import { Debugger } from "./Debugger"; import { Runner } from "./Runner"; import { InputOutput } from "./InputOutput"; import { Constants } from "./Constants"; import { Examples } from "./Examples"; import { I18n } from "./I18n"; import { Test } from "./Test"; export declare class Papyros extends State { readonly debugger: Debugger; readonly runner: Runner; readonly io: InputOutput; readonly constants: Constants; readonly examples: Examples; readonly i18n: I18n; readonly test: Test; errorHandler: (error: Error) => void; serviceWorkerName: string; /** * Launch this instance of Papyros, making it ready to run code * @return {Promise<Papyros>} Promise of launching, chainable */ launch(): Promise<Papyros>; /** * Set an error handler in papyros. Papyros will pass any errors to this handler that should be investigated but don't bubble up naturally. * * @param handler An error handler (e.g. something that passes the error on to sentry) */ setErrorHandler(handler: (error: Error) => void): void; /** * Configure how user input is handled within Papyros * By default, we will try to use SharedArrayBuffers * If this option is not available, the optional arguments in the channelOptions config are used * They are needed to register a service worker to handle communication between threads * @return {Promise<boolean>} Promise of configuring input */ private configureInput; private waitForActiveRegistration; } export declare const papyros: Papyros;