0
votes

I have a TypeScript typings project containing several *.d.ts files. This is a set of 'global' declarations (i.e. named modules). I use typings to pull the declaration files from that typings project into a TypeScript project.

typings install github:phreed/typed-npm-webgme -SG

The resulting typings/globals/index.d.ts only contains the file identified as the "main" in typings.json. I expect it to include (concatenate) all of content of the "files" appearing in the tsconfig.json.

How do I cause typings/globals/index.d.ts to contain the concatenation of the *.d.ts files?

1

1 Answers

0
votes

There is a 'files' field where additional declaration files can be indicated. Here is an example of the 'typings.json' file. json { "name": "foo", "main": "foo.d.ts", "files": [ "./bar.d.ts", "./baz.d.ts", "./froz.d.ts", "./fig.d.ts"], "global": true, "dependencies": { }, "devDependencies": {}, "globalDependencies": { "q": "registry:dt/q#0.0.0+20160613154756" }, "globalDevDependencies": { } } The git repository (assume github) holds these *.d.ts files separately. When installed, using typings install github:foo/foo --save --global

  • retrieves and concatenates the '*.d.ts' files into 'typings/globals/foo/index.d.ts'.
  • updates 'typings/globals/foo/typings.json' with the package typings information.
  • updates 'typings/index.d.ts' with '/// <reference path="globals/foo/index.d.ts" />
  • updates 'globalDependencies' in 'typings.json' with "foo": "github:foo/foo"