I'm reviewing a source code for angular-ui-router
and there is the angular-ui-router.d.ts
file inside api folder with the following content:
declare module ng.ui {
interface IState {
name?: string;
template?: string;
templateUrl?: any; // string || () => string
templateProvider?: any; // () => string || IPromise<string>
}
interface ITypedState<T> extends IState {
data?: T;
}
I've read that is file is TypeScript type definitions. What is it? Why is it needed?