Use the Typings tool with a typings.json
file to manage TypeScript definition dependencies.
See that project's FAQ
Start by creating a new typings.json
file, then add dependencies as
normal. When you publish to GitHub, locally, alongside your package
(NPM or Bower) or even to your own website, someone else can reference
it and use it.
{
"name": "typings",
"main": "path/to/definition.d.ts",
"author": "Blake Embrey <[email protected]>",
"description": "The TypeScript definition dependency manager",
"dependencies": {}
}
- main The entry point to the definition (canonical to "main" in NPM's package.json)
- browser A string or map of paths to override when
resolving (following the browser field specification)
- ambient Denote that this definition must be installed as ambient
- name The name of this definition
- postmessage A message to emit to users after installation
- version The semver range this definition is typed for
- dependencies A map of dependencies that need installing
- devDependencies A map of development dependencies that need installing
- ambientDependencies A map of environment dependencies that may need installing
- ambientDevDependencies A map of environment dev dependencies that may need installing
use node module as parameter
Are you refering to import definitions from another.d.ts
file? – Gwyngwynethfunction(emitter)
when I want to write a d.ts file for this library, I don't know how to import EventEmitter from node.d.ts, even I can import the events.EventEmtter from node.d.ts, how can I ask user to download the node.d.ts automatically? – Eelworm