@dodona/papyros 0.2.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Papyros.d.ts CHANGED
@@ -3,11 +3,12 @@ import { InputMode } from "./InputManager";
3
3
  import { ProgrammingLanguage } from "./ProgrammingLanguage";
4
4
  import { RunState, CodeRunner } from "./CodeRunner";
5
5
  import { OutputManager } from "./OutputManager";
6
+ import { AtomicsChannelOptions, ServiceWorkerChannelOptions } from "sync-message";
6
7
  import { RenderOptions, ButtonOptions, Renderable } from "./util/Rendering";
7
8
  /**
8
9
  * Configuration options for this instance of Papyros
9
10
  */
10
- interface PapyrosConfig {
11
+ export interface PapyrosConfig {
11
12
  /**
12
13
  * Whether Papyros is run in standAlone mode or embedded in an application
13
14
  */
@@ -28,11 +29,17 @@ interface PapyrosConfig {
28
29
  * The selected code example
29
30
  */
30
31
  example?: string;
32
+ /**
33
+ * Configuration for the input channel
34
+ */
35
+ channelOptions?: {
36
+ serviceWorkerName?: string;
37
+ } & AtomicsChannelOptions & ServiceWorkerChannelOptions;
31
38
  }
32
39
  /**
33
40
  * Options for rendering Papyros
34
41
  */
35
- interface PapyrosRenderOptions {
42
+ export interface PapyrosRenderOptions {
36
43
  /**
37
44
  * Options to render Papyros itself, only used in standAlone mode
38
45
  */
@@ -112,15 +119,11 @@ export declare class Papyros extends Renderable<PapyrosRenderOptions> {
112
119
  /**
113
120
  * Configure how user input is handled within Papyros
114
121
  * By default, we will try to use SharedArrayBuffers
115
- * If this option is not available, the optional arguments become relevant
122
+ * If this option is not available, the optional arguments in the channelOptions config are used
116
123
  * They are needed to register a service worker to handle communication between threads
117
- * @param {string} serviceWorkerRoot URL for the directory where the service worker lives
118
- * @param {string} serviceWorkerName The name of the file containing the script
119
- * @param {boolean} allowReload Whether we are allowed to force a reload of the page
120
- * This allows using SharedArrayBuffers without configuring the HTTP headers yourself
121
124
  * @return {Promise<boolean>} Promise of configuring input
122
125
  */
123
- configureInput(serviceWorkerRoot?: string, serviceWorkerName?: string): Promise<boolean>;
126
+ private configureInput;
124
127
  protected _render(renderOptions: PapyrosRenderOptions): void;
125
128
  /**
126
129
  * Add a button to the status panel within Papyros
@@ -140,4 +143,3 @@ export declare class Papyros extends Renderable<PapyrosRenderOptions> {
140
143
  */
141
144
  static toProgrammingLanguage(language: string): ProgrammingLanguage | undefined;
142
145
  }
143
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodona/papyros",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "homepage": ".",
6
6
  "devDependencies": {