I read dozens of pages trying to figure out how best to set up type definitions in TypeScript.
- I used to have a file
typings.ts
somewhere in my project and then import the types into every file they need, doing something like
import {IMyCustomType} from './typings';
and inside my sample file I would declare my types:
export interface IMyCustomType {...}
Instead of using, export interface IMyCustomType {..}
they usedeclare interface IMyCustomType {..}
This installation has one big advantage for me: I donβt need to explicitly import types in each file, and interfaces are available directly in the whole project.
Questions:
1) , **/*.d.ts
?
2) declare
?
3) , ?
, . , , ?