Repository navigation
Document the whole API with JSDoc - #3
Merged
Merged
Conversation
Every exported type, field and function in src/index.ts now has JSDoc: what it does, its parameters, what it returns and which error codes it throws or rejects with. tsc keeps the comments in dist/index.d.ts, so editors show them. The build script and the test helpers are documented too. The README said getActiveWindow could return null (it throws NO_WINDOW_ACTIVE_FOR_NOW) and listed getWindowById without its win_id. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/index.tshas JSDoc: what it does, its parameters, what it returns, and the error codes it throws (sync) or rejects with (async). The package-level comment covers what all calls share: Sync vs promise, the error message format,CAN_NOT_OPEN_DISPLAY/INTERNAL_ERROR/ argument checks, and that the window manager applies actions asynchronously.tsckeeps the comments indist/index.d.ts, the file that ships, so editors show them on hover.getWindowByIdon a missing window returns an empty window rather than throwing;windowMoveResizeplaces the frame but sizes the client;-1keeps a value.scripts/build-native.jsand the test helpers are documented too.getActiveWindowcould returnnull; it throwsNO_WINDOW_ACTIVE_FOR_NOW (28).getWindowByIdwithout itswin_idparameter.The version stays 2.0.0, since it has not been released yet. No code changed: the diff only adds comments, plus the README.
Test plan
yarn build: the JSDoc is present indist/index.d.tsnode --test dist/test/*.test.jsagainst Xvfb + openbox on two screens: 156/156 pass🤖 Generated with Claude Code