[docs-utils] 4️⃣ Handle multiple call signature declarations#252643
Merged
clintandrewhall merged 2 commits intoelastic:mainfrom Feb 24, 2026
Merged
[docs-utils] 4️⃣ Handle multiple call signature declarations#252643clintandrewhall merged 2 commits intoelastic:mainfrom
clintandrewhall merged 2 commits intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/kibana-operations (Team:Operations) |
1b8fe3a to
d7f01f1
Compare
13 tasks
16f8097 to
15f37b8
Compare
- Handle interfaces with multiple call signatures. - Extract parameter documentation from first overload signature. - Add test cases for overloaded functions. Co-authored-by: Cursor <cursoragent@cursor.com>
13511b0 to
b39cf54
Compare
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Any counts in public APIs
Public APIs missing exports
Unknown metric groupsAPI count
History
|
nreese
pushed a commit
to nreese/kibana
that referenced
this pull request
Feb 25, 2026
…#252643) Co-authored-by: Cursor <cursoragent@cursor.com>
qn895
pushed a commit
to qn895/kibana
that referenced
this pull request
Mar 11, 2026
…#252643) Co-authored-by: Cursor <cursoragent@cursor.com>
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
Adds support for interfaces and variables with multiple call signatures (function overloads) in
kbn-docs-utilsAPI documentation generation. Previously, these declarations were either silently dropped or incorrectly typed, resulting in missing documentation for overloaded functions.Note
This PR is a subset of #247688 for ease of review.
This PR was written with Cursor and
claude-4.5-opus-high.Before / After Example
Given this TypeScript code:
Before this PR:
The
OverloadedFunctioninterface was exported but its call signatures were lost. TheoverloadedFnvariable was typed asObjectKindinstead ofFunctionKind, with no parameter documentation:{ "label": "overloadedFn", "type": "Object", "children": [], "signature": [] } // Call signatures silently dropped! No parameter docs!After this PR:
The new
buildMultipleCallSignaturesDec()handler detects multiple call signatures, extracts parameter docs from the first signature, and produces a proper function declaration:{ "label": "overloadedFn", "type": "Function", "children": [ { "label": "input", "type": "CompoundType", "description": [], "signature": [{ "text": "string" }, " | ", { "text": "number" }, " | ", "boolean"] } ], "signature": [ "(input: string | number | boolean) => ", { "pluginId": "pluginA", "section": "def-public.OverloadedFunction", "text": "OverloadedFunction" } ] } // ✅ Typed as Function, parameters extracted, signature links to interfaceHow It Works
ObjectKind, no paramsFunctionKind, params from first signatureChanges
buildMultipleCallSignaturesDec()inbuild_multiple_call_signatures_dec.ts-- handles nodes whose resolved type has multiple call signaturesbuildVariableDec()-- detects when a variable's type has multiple call signatures and delegates to the new handlerbuildFunctionDec()-- extracts parameter source from the first call signature when the node itself has noneOverloadedFunctioninterface andoverloadedFnvariable to the plugin_a test fixtureImpact
apiCountincreases from 136 to 145 (new fixture entries)Made with Cursor