If you are trying to download TypeScript type definitions for an older version of TypeScript with tsd
, you may do the following.
If you look inside tsd.json
you will see the key "ref"
, which is set to "master"
.
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
...
}
This refers to the master
branch of borisyankov/DefinitelyTyped
.
There are other branches of borisyankov/DefinitelyTyped
such as 1.0.1
which target previous releases of TypeScript.
Simply modify tsd.json
to point to another branch, and it will retrieve type definitions specific to that version of TypeScript.
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "1.0.1",
...
}
After you have done this, you can install a type definition with --save
and inspect the commit hash in tsd.son
to confirm.