Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
TypeScript
/
Declaration files
A package exports both "." and "./reports". What must its declarations cover?
from Declaration files
TypeScript 6
intermediate
1 min
A package exports both "." and "./reports". What must its declarations cover?
Only the package root, because TypeScript always reuses its index.d.ts for subpaths.
Each public subpath, with types matching that subpath’s runtime target and module format.
Only ./reports, because exports disables the package root.
No declarations when the JavaScript files use ESM syntax.
Check
Ask AI about this kata
Report an error
previous kata
What does declare function loadConfig(): Config do in a declaration file?
Quiz
next kata
What does this program print after TypeScript erases its type-only declarations?
Predict the output
A new version is available
Reload