Skip to content

Viz: add explicit return types where TypeScript infers a concrete type - #36380

Merged
pharret31 merged 3 commits into
DevExpress:26_2from
EugeniyKiyashko:viz-return-type-26_2
Nov 18, 2026
Merged

pharret31 merged 3 commits into
DevExpress:26_2from
EugeniyKiyashko:viz-return-type-26_2

Conversation

@EugeniyKiyashko

Copy link
Copy Markdown
Contributor

No description provided.

pharret31
pharret31 previously approved these changes Nov 18, 2026
EugeniyKiyashko and others added 3 commits November 18, 2026 12:35
Writes out the inferred return type (void, primitives, named and object
types) of 880 functions in js/__internal/viz. Functions whose inferred
type is any, never[], {} or unknown are left for typing by hand.

Removes the explicit-function-return-type disable from the 13 files that
are now clean, and four explicit-module-boundary-types disables that
became unused. Exports the DatesDifferences and SvgDomElement interfaces
for the new annotations. Emitted JS is unchanged.
TypeScript inferred these from an `any` that flows into the result, so
the written-out types were narrower than the runtime values:
- tick_generator addInterval: Date and number overloads, like dateUtils.addInterval;
- parse_utils string/numeric parsers: also null and undefined;
- sankey data_validator validate: the 'E2006' error code or null;
- range_series getSeriesPairCoord: the found coordinate or null.
@pharret31
pharret31 merged commit ac2df83 into DevExpress:26_2 Nov 18, 2026
275 of 282 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants