任何人都可以在Typescript land中工作嗎?谷歌搜索,看起來不是。Headroom.js with Typecript找不到模塊
將此庫合併到我的Browserify項目中沒有任何運氣。
我有這個分型文件headroom.js
- https://github.com/retyped/headroom-tsd-ambient/blob/master/headroom.d.ts
- 安裝爲
node_modules/headroom.js/
節點模塊(是的,它是一個文件夾的v0.9.3,我以前從未見過這樣命名爲節點模塊。 ) - headroom.js的主入口按的package.json是
node_modules/headroom.js/dist/headroom.js
當我嘗試到模塊導入我的應用程序,它不能是找到。
{ [TypeScript error: resources/assets/typescript/app.ts(12,24): Error TS2307: Cannot find module 'headroom.js'.]
message: 'resources/assets/typescript/app.ts(12,24): Error TS2307: Cannot find module \'headroom.js\'.',
fileName: 'resources/assets/typescript/app.ts',
line: 12,
column: 24,
name: 'TypeScript error' }
已經嘗試了所有這些排列:
import {Headroom} from "headroom.js"; //nope
import {Headroom} from "headroom\.js"; //nope
import {Headroom} from "Headroom\.js"; //nope
import {Headroom} from "headroomjs"; //nope
import {Headroom} from "headroomjs"; //nope
import {Headroom} from "headroom"; //nope
import {Headroom} from "Headroom"; //nope
import * as headroom from "headroom.js"; // nope
的分型文件正確使用是絕對被導入。
IDE是說,它可以找到的目錄:
我在做什麼錯?
編輯13-08-2015
1. app.ts在分型拉動從typings
DIR這樣的:
/// <reference path="../../../typings/index.d.ts" />
index.d.ts
包含這些類型/// <reference path="bootstrap/bootstrap.d.ts" /> /// <reference path="custom.d.ts" /> /// ..etc... /// <reference path="Headroom/headroom.d.ts" />
這是確定的在那裏。
感謝您的詳細解答。 – Simon