numbl 0.4.9 → 0.4.10
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.
|
@@ -18,6 +18,10 @@ export type ToWorker = BootMessage | {
|
|
|
18
18
|
type: "writeFile";
|
|
19
19
|
path: string;
|
|
20
20
|
content: string | Uint8Array;
|
|
21
|
+
} | {
|
|
22
|
+
type: "readFile";
|
|
23
|
+
id: number;
|
|
24
|
+
path: string;
|
|
21
25
|
} | {
|
|
22
26
|
type: "dispatch";
|
|
23
27
|
id: number;
|
|
@@ -56,4 +60,10 @@ export type FromWorker = {
|
|
|
56
60
|
id: number;
|
|
57
61
|
ok: boolean;
|
|
58
62
|
message?: string;
|
|
63
|
+
} | {
|
|
64
|
+
type: "readFileResult";
|
|
65
|
+
id: number;
|
|
66
|
+
ok: boolean;
|
|
67
|
+
content?: Uint8Array;
|
|
68
|
+
message?: string;
|
|
59
69
|
};
|
|
@@ -38,6 +38,11 @@ export interface NumblSession {
|
|
|
38
38
|
readonly hasUihtmlSession: boolean;
|
|
39
39
|
/** Write a file into the session VFS (visible to later dispatched events). */
|
|
40
40
|
writeFile(path: string, content: string | Uint8Array): void;
|
|
41
|
+
/**
|
|
42
|
+
* Read a file from the session VFS (e.g. results the script wrote).
|
|
43
|
+
* Relative paths resolve under /project/. Rejects if the file is missing.
|
|
44
|
+
*/
|
|
45
|
+
readFile(path: string): Promise<Uint8Array>;
|
|
41
46
|
/**
|
|
42
47
|
* Fire the script's HTMLEventReceivedFcn (host -> MATLAB). Resolves when
|
|
43
48
|
* the callback returns; rejects if it errors (the session stays usable).
|