Skip to content

Initial fix for the vars issue for #378#381

Open
hoijnet wants to merge 1 commit into
mainfrom
fix-vars-issue-378
Open

Initial fix for the vars issue for #378#381
hoijnet wants to merge 1 commit into
mainfrom
fix-vars-issue-378

Conversation

@hoijnet
Copy link
Copy Markdown
Collaborator

@hoijnet hoijnet commented Apr 27, 2026

fix(types): accept Var in WOQL document and list functions (#378)

Several WOQL functions — read_document, delete_document, insert_document, update_document, length, sub, idgen_random, and random_idgen — had TypeScript signatures that only accepted string for parameters that the runtime has always accepted as either a string variable reference ("v:foo") or a Var object (from WOQL.vars()). This made the two styles inconsistent at the type level despite being equivalent at runtime, forcing users to add @ts-ignore workarounds.

The root cause was incorrect JSDoc @param annotations in lib/woql.js and lib/query/woqlQuery.js. The .d.ts is auto-generated from those annotations via npm run generate-types — editing the declaration file directly would be overwritten on the next build.

This PR corrects the annotations for the affected functions, regenerates the type declarations, and adds integration tests covering the Var-as-argument pattern for read_document and length. A broader sweep of all ~144 exported functions is included to catch any remaining cases where binding-slot parameters were incorrectly typed as plain string.

@hoijnet hoijnet self-assigned this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants