numbl 0.4.12 → 0.4.13
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-browser/browser.js +1 -1
- package/dist-browser/numbl-core/fileIOAdapter.d.ts +4 -0
- package/dist-browser/numbl-core/native/lapack-bridge.d.ts +1 -1
- package/dist-browser/numbl-core/native/wasm-lapack-bridge.d.ts +114 -0
- package/dist-browser/numbl-core/native/wasm-lapack-browser.d.ts +34 -0
- package/dist-browser/numbl-core/runtime/datetime-format.d.ts +10 -0
- package/dist-browser/numbl-core/runtime/display.d.ts +5 -1
- package/dist-browser/numbl-core/runtime/index.d.ts +1 -1
- package/dist-browser/numbl-core/version.d.ts +1 -1
- package/dist-browser/vfs/BrowserFileIOAdapter.d.ts +1 -0
- package/dist-cli/cli.js +433 -130
- package/dist-lib/cli-fileio.d.ts +62 -0
- package/dist-lib/cli-scan.d.ts +6 -0
- package/dist-lib/cli-system.d.ts +13 -0
- package/dist-lib/lib.js +367 -72
- package/dist-lib/node.d.ts +30 -0
- package/dist-lib/node.js +829 -0
- package/dist-lib/numbl-core/fileIOAdapter.d.ts +4 -0
- package/dist-lib/numbl-core/native/lapack-bridge.d.ts +1 -1
- package/dist-lib/numbl-core/native/wasm-lapack-bridge.d.ts +114 -0
- package/dist-lib/numbl-core/native/wasm-lapack-browser.d.ts +34 -0
- package/dist-lib/numbl-core/runtime/datetime-format.d.ts +10 -0
- package/dist-lib/numbl-core/runtime/display.d.ts +5 -1
- package/dist-lib/numbl-core/runtime/index.d.ts +1 -1
- package/dist-lib/numbl-core/version.d.ts +1 -1
- package/dist-lib/vfs/BrowserFileIOAdapter.d.ts +1 -0
- package/dist-site-viewer/assets/{index-CGE1_vZ-.js → index-C2ItFYSf.js} +322 -322
- package/dist-site-viewer/assets/{numbl-worker-DddtCPW_.js → numbl-worker-CtfdLxJh.js} +114 -102
- package/dist-site-viewer/index.html +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js implementation of FileIOAdapter using synchronous fs operations.
|
|
3
|
+
*/
|
|
4
|
+
import type { FileIOAdapter, WebOptions } from "./numbl-core/fileIOAdapter.js";
|
|
5
|
+
export declare class NodeFileIOAdapter implements FileIOAdapter {
|
|
6
|
+
private nextFid;
|
|
7
|
+
private openFiles;
|
|
8
|
+
fopen(filename: string, permission: string): number;
|
|
9
|
+
fclose(fidOrAll: number | "all"): number;
|
|
10
|
+
fgetl(fid: number): string | number;
|
|
11
|
+
fgets(fid: number): string | number;
|
|
12
|
+
fileread(filename: string): string;
|
|
13
|
+
feof(fid: number): number;
|
|
14
|
+
ferror(fid: number): string;
|
|
15
|
+
fwrite(fid: number, text: string): void;
|
|
16
|
+
freadBytes(fid: number, count: number): Uint8Array;
|
|
17
|
+
fwriteBytes(fid: number, data: Uint8Array): number;
|
|
18
|
+
fseek(fid: number, offset: number, origin: number): number;
|
|
19
|
+
ftell(fid: number): number;
|
|
20
|
+
scanDirectory(dirPath: string): import("./lib.js").WorkspaceFile[];
|
|
21
|
+
resolvePath(dirPath: string): string;
|
|
22
|
+
existsPath(path: string): "file" | "dir" | null;
|
|
23
|
+
mkdir(dirPath: string): boolean;
|
|
24
|
+
tempdir(): string;
|
|
25
|
+
userpath(): string;
|
|
26
|
+
websave(url: string, filename: string, options?: WebOptions): void;
|
|
27
|
+
webread(url: string, options?: WebOptions): string;
|
|
28
|
+
rmdir(dirPath: string, recursive: boolean): boolean;
|
|
29
|
+
movefile(source: string, destination: string, force: boolean): boolean;
|
|
30
|
+
copyfile(source: string, destination: string, force: boolean): boolean;
|
|
31
|
+
fileattrib(path: string): {
|
|
32
|
+
Name: string;
|
|
33
|
+
directory: boolean;
|
|
34
|
+
UserRead: boolean;
|
|
35
|
+
UserWrite: boolean;
|
|
36
|
+
UserExecute: boolean;
|
|
37
|
+
} | null;
|
|
38
|
+
deleteFile(pattern: string): void;
|
|
39
|
+
unzip(zipfilename: string, outputfolder: string): string[];
|
|
40
|
+
zip(zipfilename: string, filenames: string[], rootDir: string): string[];
|
|
41
|
+
listDir(dirPath: string): {
|
|
42
|
+
name: string;
|
|
43
|
+
folder: string;
|
|
44
|
+
bytes: number;
|
|
45
|
+
isdir: boolean;
|
|
46
|
+
mtimeMs: number;
|
|
47
|
+
}[];
|
|
48
|
+
private listDirGlob;
|
|
49
|
+
private listDirRecursive;
|
|
50
|
+
private getEntry;
|
|
51
|
+
/**
|
|
52
|
+
* Read one line from the file's buffer, refilling from the fd as needed.
|
|
53
|
+
*
|
|
54
|
+
* All reads are positional so `entry.pos` stays the single source of truth
|
|
55
|
+
* for the logical file position: the buffer always holds the bytes starting
|
|
56
|
+
* at `entry.pos`, and consuming a line advances `entry.pos` by its byte
|
|
57
|
+
* length. This keeps text I/O (fgetl/fgets) coherent with binary I/O and
|
|
58
|
+
* fscanf (freadBytes/fseek/ftell).
|
|
59
|
+
* @param keepNewline - if true, keep the trailing newline (fgets); if false, strip it (fgetl)
|
|
60
|
+
*/
|
|
61
|
+
private readLine;
|
|
62
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility for scanning directories for .m/.numbl.js/.wasm workspace files.
|
|
3
|
+
* Extracted from cli.ts to avoid circular imports (cli-fileio → cli → main()).
|
|
4
|
+
*/
|
|
5
|
+
import type { WorkspaceFile } from "./numbl-core/workspace/types.js";
|
|
6
|
+
export declare function scanMFiles(dirPath: string, excludeFile?: string): WorkspaceFile[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js implementation of SystemAdapter using process.*.
|
|
3
|
+
*/
|
|
4
|
+
import type { SystemAdapter } from "./numbl-core/systemAdapter.js";
|
|
5
|
+
export declare class NodeSystemAdapter implements SystemAdapter {
|
|
6
|
+
getEnv(name: string): string | undefined;
|
|
7
|
+
getAllEnv(): Record<string, string>;
|
|
8
|
+
setEnv(name: string, value: string): void;
|
|
9
|
+
cwd(): string;
|
|
10
|
+
chdir(dir: string): void;
|
|
11
|
+
platform(): string;
|
|
12
|
+
arch(): string;
|
|
13
|
+
}
|