Skip to content

Flesh out docblocks#103

Merged
DocDvorak merged 1 commit into
screepers:masterfrom
DocDvorak:docs
Jun 8, 2026
Merged

Flesh out docblocks#103
DocDvorak merged 1 commit into
screepers:masterfrom
DocDvorak:docs

Conversation

@DocDvorak

@DocDvorak DocDvorak commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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.
  • 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
  • ScreepsAPI.raw.user.memory.segments.set now 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:

  • Added more documentation for various objects, functions, and types
  • Added more documentation

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
@DocDvorak DocDvorak merged commit 80945ee into screepers:master Jun 8, 2026
2 checks passed
@DocDvorak DocDvorak deleted the docs branch June 11, 2026 04:07
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