Types should be defined in .ts files #10796
Labels
4 - verified
Issues that have been released and confirmed resolved.
ArcGIS Maps SDK for JavaScript
Issues logged by ArcGIS SDK for JavaScript team members.
bug
Bug reports for broken functionality. Issues should include a reproduction of the bug.
calcite-components
Issues specific to the @esri/calcite-components package.
estimate - 2
Small fix or update, may require updates to tests.
impact - p1 - need for current milestone
User set priority impact status of p1 - need for current milestone
p - high
Issue should be addressed in the current milestone, impacts component or core functionality
Milestone
Check existing issues
Actual Behavior
Calcite has a number of .d.ts files that include public-facing types:
https://github.com/Esri/calcite-design-system/blob/dev/packages/calcite-components/src/components/handle/interfaces.d.ts
Usually,
.d.ts
files should not be authored by hand - the only case they are authored by hand is when you need to provide types for a library that is missing them - and such types would be used for internal type checking only.To that end,
tsc
by default does not copy the hand-authored.d.ts
files to the build output. Lumina follows this behavior. It appears than in Stencil, hand-authored.d.ts
files were being copied too.This is causing errors when type-checking JS API as
interfaced.d.ts
files are missing from public typings.side note: it appears that not all Calcites interfaces files are using .d.ts - some use
.ts
and correctly appar in the build output:https://github.com/Esri/calcite-design-system/blob/dev/packages/calcite-components/src/components/accordion-item/interfaces.ts
Expected Behavior
All files that include public-facing types should use
.ts
filesReproduction Sample
npx tsc --outDir types --emitDeclarationOnly --declaration
Reproduction Steps
Run this from
packages/calcite-components
See that hand-authored
.d.ts
files don't appear in the output, but.ts
files do. Lumina has the same behavior since it's using TypeScript API behind the scenesReproduction Version
3.0.0-next.16
Relevant Info
No response
Regression?
No response
Priority impact
impact - p1 - need for current milestone
Impact
Breaks JS API type checking:
Calcite package
Esri team
ArcGIS Maps SDK for JavaScript
The text was updated successfully, but these errors were encountered: