# Expected TypeScript-facing bindings
This directory is a committed copy of the generated, gitignored TypeScript API
surface of the Rust code:
- `ts-rs/` mirrors `rust/kcl-lib/bindings/` (ts-rs bindings, generated by
`cargo test -p kcl-lib --features artifact-graph export_bindings`; imported
by the frontend via the `@rust/kcl-lib/bindings/*` alias).
- `wasm-bindgen/` was intended to mirror the `.d.ts` declarations from
`rust/kcl-wasm-lib/pkg/`, generated by `wasm-pack build`. But it contains
hashes that aren't stable. So this was removed.
Because the generated directories are gitignored, changes to the TypeScript
API would otherwise be invisible in review. CI (`build-wasm.yml`) regenerates
the bindings, copies them here, and fails if the result differs from what is
committed.
- If CI fails and the API change is **unintentional**, fix the Rust code.
- If the API change is **intentional**, run `npm run bindings:update` and
commit the updated files in this directory.
`npm run bindings:check` runs the same regenerate-copy-diff locally.