Flesh out docblocks#103
Merged
Merged
Conversation
This change is in preparation to add auto-generate API documentation from docblocks using [TypeDoc](https://typedoc.org/). In order to ensure this generated documentation is useful, docblocks have been added or fleshed out as needed. In the process of adding documentation, some bugs and incorrect types were discovered and corrected. Breaking Changes: * `ScreepsAPI.user.activatePtr()` no longer returns fake responses for non-PTR and unofficial servers. * Made `ScreepsAPI.socket.reset()` private to prevent users from misusing it and potentially creating a new WebSocket connection without disconnecting the previous ones * Made `ScreepsAPI.socket.auth()` private now that it triggers automatically * Made `ScreepsAPI.gz()` private * Moved `ScreepsAPI.inflate()` to `ScreepsAPI.socket.inflate()` and made it private * Made several ScreepsAPI.raw function params optional (ex: `name` in `game.createConstruction`) Improvements: * Added missing response types for a number of endpoints * Exported the `FlagColor` enum Fixes: * Fixed `Api.ServerListResponse.servers` type (was previously a scalar instead of an array) * `ScreepsApi.raw` functions no longer throw errors if shard arguments are undefined for unofficial servers, since unofficial servers seem to ignore this argument anyway * `ScreepsAPI.raw.seasons.current` can now be used on official servers instead of a fake response being returned, since it will return results from these servers as well when a seasonal competition is active * Fixed swapped `size` and `type` types on `ScreepsAPI.raw.game.createInvader` Docs: * Added more documentation for various objects, functions, and types
AlinaNova21
approved these changes
Jun 8, 2026
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.
This change is in preparation to add auto-generate API documentation from docblocks using TypeDoc.
In order to ensure this generated documentation is useful, docblocks have been added or fleshed out as needed.
In the process of adding documentation, some bugs and incorrect types were discovered and corrected.
Breaking Changes:
ScreepsAPI.user.activatePtr()no longer returns fake responses for non-PTR and unofficial servers.ScreepsAPI.socket.reset()private to prevent users from misusing it and potentially creating a new WebSocket connection without disconnecting the previous onesScreepsAPI.socket.auth()private now that it triggers automaticallyScreepsAPI.gz()privateScreepsAPI.inflate()toScreepsAPI.socket.inflate()and made it privatenameingame.createConstruction)Improvements:
FlagColorenumFixes:
Api.ServerListResponse.serverstype (was previously a scalar instead of an array)ScreepsApi.rawfunctions no longer throw errors if shard arguments are undefined for unofficial servers, since unofficial servers seem to ignore this argument anywayScreepsAPI.raw.seasons.currentcan now be used on official servers instead of a fake response being returned, since it will return results from these servers as well when a seasonal competition is activesizeandtypetypes onScreepsAPI.raw.game.createInvaderScreepsAPI.raw.user.memory.segments.setnow throws an Error if multiple segment IDs are provided to prevent accidental attempts to write multiple segments simultaneously. Otherwise, the server only updates the the first segment and ignores the rest.Docs: