@r-universe/webr 2023.6.21 → 2023.8.26
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/R.bin.data +3920 -2189
- package/dist/R.bin.js +1 -6
- package/dist/repl/App.d.ts +15 -0
- package/dist/repl/components/Editor.d.ts +26 -0
- package/dist/repl/components/Files.d.ts +19 -0
- package/dist/repl/components/Plot.d.ts +7 -0
- package/dist/repl/components/Terminal.d.ts +9 -0
- package/dist/repl/components/utils.d.ts +11 -0
- package/dist/tests/webR/error.test.d.ts +1 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/ArialMT-Bold.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/ArialMT-BoldItalic.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/ArialMT-Italic.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/ArialMT.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/CM_boldx_10.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/CM_boldx_italic_10.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/CM_italic_10.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/CM_regular_10.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/CM_symbol_10.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Courier-Bold.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Courier-BoldOblique.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Courier-Oblique.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Courier.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Helvetica-Bold.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Helvetica-BoldOblique.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Helvetica-Oblique.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Helvetica.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Symbol.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Times-Bold.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Times-BoldItalic.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Times-Italic.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/Times-Roman.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/ZapfDingbats.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/a010013l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/a010015l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/a010033l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/a010035l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/agd_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/agdo____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/agw_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/agwo____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/b018012l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/b018015l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/b018032l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/b018035l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/bkd_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/bkdi____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/bkl_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/bkli____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/c059013l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/c059016l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/c059033l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/c059036l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/cmbxti10.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/cmti10.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/cob_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/cobo____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/com_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/coo_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/hv______.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/hvb_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/hvbo____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/hvn_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/hvnb____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/hvnbo___.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/hvno____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/hvo_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n019003l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n019004l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n019023l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n019024l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n019043l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n019044l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n019063l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n019064l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n021003l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n021004l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n021023l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n021024l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n022003l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n022004l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n022023l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/n022024l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/ncb_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/ncbi____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/nci_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/ncr_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/p052003l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/p052004l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/p052023l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/p052024l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/pob_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/pobi____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/poi_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/por_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/s050000l.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/sy______.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/tib_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/tibi____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/tii_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/grDevices/afm/tir_____.afm.gz +0 -0
- package/dist/vfs/usr/lib/R/library/parallel/DESCRIPTION +1 -1
- package/dist/vfs/usr/lib/R/library/parallel/Meta/package.rds +0 -0
- package/dist/vfs/usr/lib/R/library/tcltk/DESCRIPTION +1 -1
- package/dist/vfs/usr/lib/R/library/tcltk/Meta/package.rds +0 -0
- package/dist/vfs/usr/lib/R/library/tools/help/tools.rdb +0 -0
- package/dist/vfs/usr/lib/R/library/translations/Meta/package.rds +0 -0
- package/dist/webR/console.d.ts +2 -2
- package/dist/webR/error.d.ts +26 -0
- package/dist/webR/payload.d.ts +1 -1
- package/dist/webR/webr-chan.d.ts +18 -0
- package/dist/webR/webr-main.d.ts +6 -0
- package/dist/webr-serviceworker.js +14 -3
- package/dist/webr-serviceworker.js.map +3 -3
- package/dist/webr-serviceworker.mjs +14 -3
- package/dist/webr-serviceworker.mjs.map +3 -3
- package/dist/webr-worker.js +43 -24
- package/dist/webr-worker.js.map +3 -3
- package/dist/webr.cjs +3 -3
- package/dist/webr.cjs.map +4 -4
- package/dist/webr.mjs +3 -3
- package/dist/webr.mjs.map +4 -4
- package/package.json +19 -9
- package/templates/repl.html +9 -127
- package/dist/repl/fstree.d.ts +0 -57
- package/dist/repl/repl.d.ts +0 -1
- package/dist/vfs/usr/lib/R/library/grDevices/libs/grDevices.so +0 -0
- package/dist/vfs/usr/lib/R/modules/internet.so +0 -0
- package/dist/vfs/usr/lib/R/modules/lapack.so +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Readline } from 'xterm-readline';
|
|
2
|
+
import './App.css';
|
|
3
|
+
export interface TerminalInterface {
|
|
4
|
+
println: Readline['println'];
|
|
5
|
+
read: Readline['read'];
|
|
6
|
+
write: Readline['write'];
|
|
7
|
+
}
|
|
8
|
+
export interface FilesInterface {
|
|
9
|
+
refreshFilesystem: () => Promise<void>;
|
|
10
|
+
openFileInEditor: (name: string, path: string, readOnly: boolean) => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export interface PlotInterface {
|
|
13
|
+
newPlot: () => void;
|
|
14
|
+
drawImage: (img: ImageBitmap) => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WebR } from '../../webR/webr-main';
|
|
3
|
+
import { EditorState } from '@codemirror/state';
|
|
4
|
+
import { FilesInterface, TerminalInterface } from '../App';
|
|
5
|
+
import './Editor.css';
|
|
6
|
+
export type EditorFile = {
|
|
7
|
+
name: string;
|
|
8
|
+
path: string;
|
|
9
|
+
ref: {
|
|
10
|
+
editorState: EditorState;
|
|
11
|
+
scrollTop?: number;
|
|
12
|
+
scrollLeft?: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function FileTabs({ files, activeFileIdx, setActiveFileIdx, closeFile }: {
|
|
16
|
+
files: EditorFile[];
|
|
17
|
+
activeFileIdx: number;
|
|
18
|
+
setActiveFileIdx: React.Dispatch<React.SetStateAction<number>>;
|
|
19
|
+
closeFile: (e: React.SyntheticEvent, index: number) => void;
|
|
20
|
+
}): React.JSX.Element;
|
|
21
|
+
export declare function Editor({ webR, terminalInterface, filesInterface, }: {
|
|
22
|
+
webR: WebR;
|
|
23
|
+
terminalInterface: TerminalInterface;
|
|
24
|
+
filesInterface: FilesInterface;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
export default Editor;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WebR } from '../../webR/webr-main';
|
|
3
|
+
import type { FSNode } from '../../webR/webr-main';
|
|
4
|
+
import { FilesInterface } from '../App';
|
|
5
|
+
import './Files.css';
|
|
6
|
+
interface ITreeNode {
|
|
7
|
+
id: number;
|
|
8
|
+
name: string;
|
|
9
|
+
children?: ITreeNode[];
|
|
10
|
+
metadata?: {
|
|
11
|
+
[x: string]: string | number | null | undefined;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare function createTreefromFSNode(fsNode: FSNode): ITreeNode;
|
|
15
|
+
export declare function Files({ webR, filesInterface, }: {
|
|
16
|
+
webR: WebR;
|
|
17
|
+
filesInterface: FilesInterface;
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
export default Files;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TerminalInterface } from '../App';
|
|
3
|
+
import { WebR } from '../../webR/webr-main';
|
|
4
|
+
import 'xterm/css/xterm.css';
|
|
5
|
+
export declare function Terminal({ webR, terminalInterface, }: {
|
|
6
|
+
webR: WebR;
|
|
7
|
+
terminalInterface: TerminalInterface;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export default Terminal;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Text } from '@codemirror/state';
|
|
2
|
+
import { EditorView } from '@codemirror/view';
|
|
3
|
+
export type CursorPosition = {
|
|
4
|
+
line: number;
|
|
5
|
+
col: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function offsetToPosition(cmDoc: Text, offset: number): CursorPosition;
|
|
8
|
+
export declare function positionToOffset(cmDoc: Text, pos: CursorPosition): number;
|
|
9
|
+
export declare function getSelectedText(cmView: EditorView): string;
|
|
10
|
+
export declare function getCurrentLineText(cmView: EditorView): string;
|
|
11
|
+
export declare function moveCursorToNextLine(cmView: EditorView): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -9,4 +9,4 @@ Description: Interface and language bindings to Tcl/Tk GUI elements.
|
|
|
9
9
|
License: Part of R 4.3.0
|
|
10
10
|
Imports: utils
|
|
11
11
|
NeedsCompilation: yes
|
|
12
|
-
Built: R 4.3.0; x86_64-pc-linux-gnu; 2023-
|
|
12
|
+
Built: R 4.3.0; x86_64-pc-linux-gnu; 2023-08-26 20:21:20 UTC; unix
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/webR/console.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export interface ConsoleCallbacks {
|
|
|
3
3
|
stdout?: (line: string) => void;
|
|
4
4
|
stderr?: (line: string) => void;
|
|
5
5
|
prompt?: (line: string) => void;
|
|
6
|
-
|
|
6
|
+
canvasImage?: (image: ImageBitmap) => void;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Text-based Interactive Console for WebR
|
|
@@ -27,7 +27,7 @@ export interface ConsoleCallbacks {
|
|
|
27
27
|
* function. The default implementation of `prompt` shows a JavaScript prompt
|
|
28
28
|
* asking the user for input, and then sends the user input to `stdin`.
|
|
29
29
|
*
|
|
30
|
-
* The ``
|
|
30
|
+
* The ``canvasImage`` callback function is called when webR writes plots to
|
|
31
31
|
* the built-in HTML canvas graphics device.
|
|
32
32
|
*
|
|
33
33
|
* Once constructed, start the Console using the ``run`` method. The `run`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Error classes that shall be raised by webR.
|
|
3
|
+
* @module Error
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A general error raised by webR.
|
|
7
|
+
*/
|
|
8
|
+
export declare class WebRError extends Error {
|
|
9
|
+
constructor(msg: string);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Exceptions raised on the webR worker thread that have been forwarded to the
|
|
13
|
+
* main thread through the communication channel.
|
|
14
|
+
*/
|
|
15
|
+
export declare class WebRWorkerError extends WebRError {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Exceptions related to issues with the webR communication channel.
|
|
19
|
+
*/
|
|
20
|
+
export declare class WebRChannelError extends WebRError {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Exceptions related to issues with webR object payloads.
|
|
24
|
+
*/
|
|
25
|
+
export declare class WebRPayloadError extends WebRError {
|
|
26
|
+
}
|
package/dist/webR/payload.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type WebRPayloadErr = {
|
|
|
26
26
|
};
|
|
27
27
|
export type WebRPayload = WebRPayloadRaw | WebRPayloadPtr;
|
|
28
28
|
export type WebRPayloadWorker = WebRPayloadRaw | WebRPayloadPtr | WebRPayloadErr;
|
|
29
|
-
export declare function
|
|
29
|
+
export declare function webRPayloadAsError(payload: WebRPayloadErr): Error;
|
|
30
30
|
/**
|
|
31
31
|
* Test for an WebRPayload instance.
|
|
32
32
|
* @param {any} value The object to test.
|
package/dist/webR/webr-chan.d.ts
CHANGED
|
@@ -139,3 +139,21 @@ export interface ShelterDestroyMessage extends Message {
|
|
|
139
139
|
obj: WebRPayloadPtr;
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
+
export interface CanvasMessage extends Message {
|
|
143
|
+
type: 'canvas';
|
|
144
|
+
data: {
|
|
145
|
+
event: 'canvasNewPage';
|
|
146
|
+
} | {
|
|
147
|
+
event: 'canvasImage';
|
|
148
|
+
image: ImageBitmap;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export interface PagerMessage extends Message {
|
|
152
|
+
type: 'pager';
|
|
153
|
+
data: {
|
|
154
|
+
path: string;
|
|
155
|
+
header: string;
|
|
156
|
+
title: string;
|
|
157
|
+
deleteFile: boolean;
|
|
158
|
+
};
|
|
159
|
+
}
|
package/dist/webR/webr-main.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import * as RWorker from './robj-worker';
|
|
|
14
14
|
import { EvalROptions } from './webr-chan';
|
|
15
15
|
export { Console, ConsoleCallbacks } from './console';
|
|
16
16
|
export * from './robj-main';
|
|
17
|
+
export * from './error';
|
|
17
18
|
/**
|
|
18
19
|
* The webR FS API for interacting with the Emscripten Virtual File System.
|
|
19
20
|
*/
|
|
@@ -114,6 +115,11 @@ export interface WebROptions {
|
|
|
114
115
|
* Default: `channelType.Automatic`
|
|
115
116
|
*/
|
|
116
117
|
channelType?: (typeof ChannelType)[keyof typeof ChannelType];
|
|
118
|
+
/**
|
|
119
|
+
* Create the lazy virtual filesystem entries before starting R?
|
|
120
|
+
* Default: `true`.
|
|
121
|
+
*/
|
|
122
|
+
createLazyFilesystem?: boolean;
|
|
117
123
|
}
|
|
118
124
|
/**
|
|
119
125
|
* The webR class is used to initialize and interact with the webR system.
|
|
@@ -1525,6 +1525,17 @@
|
|
|
1525
1525
|
}
|
|
1526
1526
|
});
|
|
1527
1527
|
|
|
1528
|
+
// webR/error.ts
|
|
1529
|
+
var WebRError = class extends Error {
|
|
1530
|
+
constructor(msg) {
|
|
1531
|
+
super(msg);
|
|
1532
|
+
this.name = this.constructor.name;
|
|
1533
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
var WebRChannelError = class extends WebRError {
|
|
1537
|
+
};
|
|
1538
|
+
|
|
1528
1539
|
// webR/compat.ts
|
|
1529
1540
|
var IN_NODE = typeof process !== "undefined" && process.release && process.release.name === "node";
|
|
1530
1541
|
var loadScript;
|
|
@@ -1554,7 +1565,7 @@
|
|
|
1554
1565
|
await Promise.resolve().then(() => __toESM(__require(nodePathMod.resolve(url))));
|
|
1555
1566
|
};
|
|
1556
1567
|
} else {
|
|
1557
|
-
throw new
|
|
1568
|
+
throw new WebRError("Cannot determine runtime environment");
|
|
1558
1569
|
}
|
|
1559
1570
|
|
|
1560
1571
|
// webR/utils.ts
|
|
@@ -1588,7 +1599,7 @@
|
|
|
1588
1599
|
async function sendRequest(clientId, uuid) {
|
|
1589
1600
|
const client = await self.clients.get(clientId);
|
|
1590
1601
|
if (!client) {
|
|
1591
|
-
throw new
|
|
1602
|
+
throw new WebRChannelError("Service worker client not found");
|
|
1592
1603
|
}
|
|
1593
1604
|
if (!(uuid in requests)) {
|
|
1594
1605
|
requests[uuid] = promiseHandles();
|
|
@@ -1619,7 +1630,7 @@
|
|
|
1619
1630
|
const source = event.source;
|
|
1620
1631
|
self.clients.get(source.id).then((client) => {
|
|
1621
1632
|
if (!client) {
|
|
1622
|
-
throw new
|
|
1633
|
+
throw new WebRChannelError("Can't respond to client in service worker message handler");
|
|
1623
1634
|
}
|
|
1624
1635
|
client.postMessage({
|
|
1625
1636
|
type: "registration-successful",
|