Skip to main content

How to generate a .d.ts file from a .ts file?

tsc --declaration --emitDeclarationOnly index.ts

or in tsconfig.json

{
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true
}
}

refer to typescript-2