Anyone got this working in Typescript land? Googling around and it appears not.
Tying to incorporate this library into my Browserify project without any luck.
I have this typings file for v0.9.3 of headroom.js
- https://github.com/retyped/headroom-tsd-ambient/blob/master/headroom.d.ts
- node module installed as
node_modules/headroom.js/
(yes it's a folder; I have never seen a node module named this way before.) - headroom.js's main entry as per package.json is
node_modules/headroom.js/dist/headroom.js
When I try to import the module into my app, it can't be found.
{ [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' }
Have tried all these permutations:
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
The typings file is definitely being imported as used correctly.
IDE is saying that it can find the directory:
What am I doing wrong?
Edit 13-08-2015
1.
app.ts pulls in the typings from the typings
dir like this:
/// <reference path="../../../typings/index.d.ts" />
index.d.ts
contains these typings/// <reference path="bootstrap/bootstrap.d.ts" /> /// <reference path="custom.d.ts" /> /// ..etc... /// <reference path="Headroom/headroom.d.ts" />
It's definitely there.