Closed mattgrayisok closed 8 years ago
Thanks for reporting. I will fix it as soon as I can, for the moment you should be able to manually point to:
/// <reference path="/node_modules/inversify/type_definitions/inversify.d.ts" />
Hi @slice-beans I just released 2.0.0-alpha.3
can you please try again. Please note that I have removed the typings
field in the package.json
because it was causing many problems. You need to reference the following file as described in the new docs:
/// <reference path="node_modules/inversify/type_definitions/inversify.d.ts" />
Hope it helps :four_leaf_clover:
Thanks @remojansen. Just tried it out and the typings referencing is working as expected now.
The process I followed this time around was:
npm install inversify
Installed ^2.0.0-alpha.3/// <reference path="../node_modules/inversify/type_definitions/inversify/inversify.d.ts" />
to the top of my inversify.config.tsimport { Kernel } from "inversify";
works as expected and compilesNote that includinginversify.d.ts
as a file: reference in a typings config results in bluebird not being included for whatever reason and consequently Promise
is undefined when target is set to es5. Might be something to look into in the future :+1:
Thanks for taking a look. I just added the type definitions to DefinitelyTyped. Once the PR has been merged into master you will be able to do:
$ npm install inversify@2.0.0-alpha.3
$ typings install inversify --ambient
I'm closing this issue but please write back if you have more problems.
The bluebird issue should be fixed now thanks to https://github.com/inversify/InversifyJS/pull/114
Expected Behavior
npm install inversify --save
import { IBinding, Kernel } from "inversify";
tsc
Current Behavior
Upon build I receive:
node_modules/inversify/type_definitions/inversify-npm.d.ts(6,1): error TS2654: Exported external package typings file cannot cont ain tripleslash references. Please contact the package author to update the package definition.
Possible Solution
Removing
/// <reference path="../typings/browser/ambient/bluebird/bluebird.d.ts" />
fromtype_definitions/inversify-npm.d.ts
solves the problem but then requires an ES6 target for Promises.Alternatively
cd node_modules/inversify && typings install
will download BlueBird into the correct directory but the filename is incorrect. It actually results in a file attypings/browser/ambient/bluebird/index.d.ts
. Also, installing things in node_modules feels a bit gack.Context
Relatively new to TypeScript so my understanding of the specifics of the typings and imports methodology is a bit fuzzy, please enlighten me if I'm doing something silly.
Just trying to get inversify up and running for use in a relatively large project.
Your Environment
TSConfig