diff --git a/check-linuxcnc-opfs-source-map.sh b/check-linuxcnc-opfs-source-map.sh index 859cec5..1f07c69 100755 --- a/check-linuxcnc-opfs-source-map.sh +++ b/check-linuxcnc-opfs-source-map.sh @@ -44,6 +44,7 @@ grep -F 'must not add independent filesystem behavior or expand the temporary sm grep -F 'parseFileWithParameterFile()' docs/linuxcnc-opfs-source-map.md >/dev/null grep -F 'OPFS Coverage' docs/linuxcnc-opfs-source-map.md >/dev/null grep -F '| `web/src/wasm-core.js` |' docs/linuxcnc-opfs-source-map.md >/dev/null +grep -F '| `web/src/wasm-core.d.ts` |' docs/linuxcnc-opfs-source-map.md >/dev/null grep -F '| `web/src/app.js` |' docs/linuxcnc-opfs-source-map.md >/dev/null grep -F '| `web/test-browser-wasm-smoke-opfs-basic-sections.js` |' docs/linuxcnc-opfs-source-map.md >/dev/null grep -F '| `web/test-browser-wasm-smoke-opfs-parameter-sections.js` |' docs/linuxcnc-opfs-source-map.md >/dev/null @@ -65,6 +66,14 @@ grep -F 'OPFS path must stay inside the CNC workspace' web/src/wasm-core.js >/de grep -F 'OPFS mount point must stay inside the Emscripten filesystem' web/src/wasm-core.js >/dev/null grep -F 'async persistDirectory(path)' web/src/wasm-core.js >/dev/null grep -F 'async readDirectory(path)' web/src/wasm-core.js >/dev/null +grep -F 'export type WasmOpfsWorkspace = {' web/src/wasm-core.d.ts >/dev/null +grep -F 'readDirectory(path: string): Promise;' web/src/wasm-core.d.ts >/dev/null +grep -F 'persistDirectory(path: string): Promise;' web/src/wasm-core.d.ts >/dev/null +grep -F 'loadParameterFile(path: string): Promise;' web/src/wasm-core.d.ts >/dev/null +grep -F 'persistParameterFile(path: string): Promise;' web/src/wasm-core.d.ts >/dev/null +grep -F 'opfs?: false | {' web/src/wasm-core.d.ts >/dev/null +grep -F 'mountPoint?: string;' web/src/wasm-core.d.ts >/dev/null +grep -F 'workspacePath?: string;' web/src/wasm-core.d.ts >/dev/null grep -F 'const events = await simulator.parseFileWithParameterFile(programPath, parameterPath, "linuxcnc", parseOptions);' \ web/src/app.js >/dev/null grep -F 'OPFS workspace is required for browser program parsing' web/src/app.js >/dev/null @@ -100,6 +109,7 @@ from pathlib import Path source_map = Path("docs/linuxcnc-opfs-source-map.md").read_text(encoding="utf-8") coverage_entries = [ "web/src/wasm-core.js", + "web/src/wasm-core.d.ts", "web/src/app.js", "web/test-browser-wasm-smoke-opfs-basic-sections.js", "web/test-browser-wasm-smoke-opfs-parameter-sections.js", @@ -122,6 +132,7 @@ required_phrases = [ "OPFS/WASM mirror persistence", "OPFS directory persistence and WASM mirror refresh", "OPFS workspace and mount policy", + "OPFS-backed workspace, directory, parameter-file, and mount/workspace option types", "app-level OPFS program, parameter, backup, and reload behavior", ] for phrase in required_phrases: diff --git a/docs/linuxcnc-opfs-source-map.md b/docs/linuxcnc-opfs-source-map.md index 6ed5f89..db1d858 100644 --- a/docs/linuxcnc-opfs-source-map.md +++ b/docs/linuxcnc-opfs-source-map.md @@ -23,6 +23,7 @@ persistence. It is a policy and bridge map only; it must not add independent fil | Entry | Boundary | | --- | --- | | `web/src/wasm-core.js` | Keeps LinuxCNC parameter restore/save bridge files under the OPFS workspace and cleans WASM scratch files. | +| `web/src/wasm-core.d.ts` | Exposes only the OPFS-backed workspace, directory, parameter-file, and mount/workspace option types used by the bridge. | | `web/src/app.js` | Persists browser programs at `programs/current.ngc` and LinuxCNC parameters at `parameters/rs274ngc.var`. | | `web/test-browser-wasm-smoke-opfs-basic-sections.js` | Verifies OPFS program file reads through LinuxCNC `read_text()` and rejects unsafe paths. | | `web/test-browser-wasm-smoke-opfs-parameter-sections.js` | Verifies OPFS parameter restore, save, `.new`, `.bak`, failure, and stale-state semantics. |