@dodona/papyros 0.2.2 → 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/Library.js +1 -1
- package/dist/Papyros.d.ts +11 -9
- package/dist/util/Rendering.d.ts +7 -0
- package/package.json +1 -1
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
|
|
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
|
|
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/dist/util/Rendering.d.ts
CHANGED
|
@@ -75,6 +75,13 @@ export declare function renderButton(options: ButtonOptions): string;
|
|
|
75
75
|
* @return {string} The string representation of the select options
|
|
76
76
|
*/
|
|
77
77
|
export declare function renderSelectOptions<T>(options: Array<T>, optionText: (option: T) => string, selected?: T): string;
|
|
78
|
+
/**
|
|
79
|
+
* Build a string representation of an HTML label element
|
|
80
|
+
* @param {string} labelText Optional text to display in a label
|
|
81
|
+
* If not provided, no label is created
|
|
82
|
+
* @param {string} forElement The id of the element this label is for
|
|
83
|
+
* @return {string} The HTML string of the label
|
|
84
|
+
*/
|
|
78
85
|
export declare function renderLabel(labelText: string | undefined, forElement: string): string;
|
|
79
86
|
/**
|
|
80
87
|
* Constructs an HTML select element
|