Repository navigation
Hide underscore-prefixed APIs from the reference - #2
Merged
Kheartz merged 1 commit intoOct 9, 2026
Merged
Conversation
The Mod publishes its QA and diagnostic hooks in the scripting contract under underscore-prefixed names (Game._openMap, HousePoints._probe, LocalPlayer._ragdoll, the _Beasts global and 57 others). The reference rendered all of them as public API, including a standalone page for _Beasts that TypeDoc names "Beasts". The build now copies the downloaded contract and drops every underscore-prefixed declaration, together with the doc comment above it, before handing the typings to services-cli. Removed declarations are replaced by blank lines so each remaining "Defined in: api.d.ts:N" still points at the published contract. The contract itself, its cache, and the Mod are untouched; the hooks remain callable.
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
The Mod publishes its QA and diagnostic hooks in the scripting contract under underscore-prefixed names, and the reference rendered all of them as public API. Contract 1.7.1 has 61 of them, all in the Client API: 15 on
Game, 10 onLocalPlayer, 3 onHousePoints, others onHud,Spells,World,Doorsand more, plus the_Beastsglobal, which gets its own page at/reference/client/variables/beasts/.This PR adds
scripts/public_contract.mjs. The build now copies the downloaded contract and removes every underscore-prefixed declaration from that copy, along with the doc comment above it, before passing the typings to services-cli.Known leftovers (Mod-side text)
LocalPlayerStateInfo.isInvulnerable()still mentions_setInvulnerable(seconds)in its description.LocalPlayerRagdollinterface is still documented, butLocalPlayer._ragdollwas the only way to reach it.Verification
testingcontract, with and without the filter. Both runs had 0 errors and 0 warnings. With the filter there are 175 pages instead of 176 (the Beasts page is gone), and the diff contains only removed lines, all from underscore members' sections./reference/client/variables/beasts/returns 404. Public members keep the same line numbers as the live site (for example, HousePoints is atapi.d.ts:4146on both).Local builds on Windows don't currently work: Node can't spawn
pnpm, and services-cli passes backslash paths that TypeDoc rejects. Both problems predate this change. The local check above used a patched throwaway copy of the CLI, so the Linux build in this PR's CI is the first unmodified full build.