Skip to content

docs(routes): list every ProcessCallback TypeError and describe the decorator target - #105

Merged
Upd4ting merged 1 commit into
mainfrom
docs/ant-1812
Nov 10, 2026
Merged

Upd4ting merged 1 commit into
mainfrom
docs/ant-1812

Conversation

@Upd4ting

Copy link
Copy Markdown
Member

Why

Module authors read the TSDoc of ProcessCallback, SetParameterProvider and AddParameterModifier to learn what the decorators accept and when they fail. Since #67 that TSDoc lagged the code. The @throws of ProcessCallback named only the @Connection case. @param target Controller class was wrong on all three, because the target is the decorated prototype and the code reads target.constructor. docs/2.controllers.md and UPGRADING.md already describe the behaviour; this brings the published declarations in line. ANT-1812.

What changes

  • ProcessCallback lists each TypeError it throws: a descriptor with no value, a class Controller did not create (a static method lands here, since its target is the class and the constructor is Function), a symbol key with no location, and @Connection outside websocket or monitor mode.
  • @param target on the three functions describes the decorator target as the prototype whose constructor is the controller class.

Comment-only. No code, test or emitted JavaScript changes.

Proof

Each documented throw, observed against the built dist with a probe calling ProcessCallback directly (the @Connection case is already covered by the suites):

noValue:    TypeError: Route decorators apply to methods; m has no value
plainClass: TypeError: Route decorators apply to Controller classes; Plain has no location
static:     TypeError: Route decorators apply to Controller classes; Function has no location
symbol:     TypeError: Route decorators on a symbol-keyed method need a location; C[Symbol(s)] has none

antelopejs-comment-proof origin/main:

Comment proof: 2 packages, 17 entries unchanged against origin/main (committed HEAD).

Suppressions in authored code files (origin/main and committed HEAD). A lint directive counts once per rule it names; * is a directive naming none.

Suppressions base HEAD
Lint suppressions, all rules 1 1
Lint suppressions, anti-slop/no-unknown-parameters 1 1
@ts-expect-error 1 1
@ts-ignore 0 0
SAFETY: comments 0 0
Lint config rule-offs, all rules 0 0

pnpm run checks:

Checks: 9 passed, 0 failed.

@Upd4ting
Upd4ting merged commit 7d9b970 into main Nov 10, 2026
7 checks passed
@Upd4ting
Upd4ting deleted the docs/ant-1812 branch November 10, 2026 15:43
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.

1 participant