Skip to content

Instantly share code, notes, and snippets.

@vvakame

vvakame/README.md Secret

Last active Aug 29, 2015
Embed
What would you like to do?

dtsmでgistの型定義ファイルを読む

$ dtsm init
$ dtsm --remote https://gist.github.com/e9342d0798b48623ae8b.git install swagger.d.ts --save
$ cat dtsm.json
{
  "repos": [
    {
      "url": "https://github.com/borisyankov/DefinitelyTyped.git",
      "ref": "master"
    }
  ],
  "path": "typings",
  "bundle": "typings/bundle.d.ts",
  "dependencies": {
    "swagger.d.ts": {
      "repo": "https://gist.github.com/e9342d0798b48623ae8b.git",
      "ref": "a5992d66c2068b4255b2fd8c217e10249d7942c4"
    }
  }
}

reposを直接書き換えれば普通のdtsm searchで指定した奴だけから検索されるようにできたりする。 なお、このままだとtypings/swagger.d.tsに入っちゃってDefinitelyTypedから入れたやつと構造があわなくなるので、添付のように書き換えると良い。

{
"repos": [
{
"url": "https://github.com/borisyankov/DefinitelyTyped.git",
"ref": "master"
}
],
"path": "typings",
"bundle": "typings/bundle.d.ts",
"dependencies": {
"swagger/swagger.d.ts": {
"repo": "https://gist.github.com/e9342d0798b48623ae8b.git",
"ref": "a5992d66c2068b4255b2fd8c217e10249d7942c4",
"path": "swagger.d.ts"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment