typescript-ruby / typescript-rails

An asset pipeline wrapper for the TypeScript language
MIT License
255 stars 29 forks source link

How to include *.d.ts files? #26

Closed ghost closed 9 years ago

ghost commented 9 years ago

I'm trying to using this library, however I'm not sure how to include definitions files.

I've added 'jquery.d.ts' to assets/javascripts and referenced it in the top of my typscript *.js.ts file:

/// <reference path="jquery.d.ts" /

I then get the error: error TS2095: Could not find symbol 'JQueryStatic'.

Thank you,

justinwiley commented 9 years ago

@atteeela did you ever find a solution to this issue?

justinwiley commented 9 years ago

Never mind, I figured out the issue by checking out the example project at https://github.com/typescript-ruby/typescript-rails-example/tree/master/app/assets/javascripts/typings. I had used the definition jquery.d.ts.js ..., has to be jquery.d.ts

philbarresi commented 9 years ago

I'm having the same issue, except I know I'm pointing to the right file. Any thoughts?

leoromanovsky commented 9 years ago

+1 ?

ghost commented 9 years ago

The correct solution is what @justinwiley pointed out. Works for me.

sshaw commented 9 years ago

Being that this is typescript-rails, shouldn't jquery-rails be supported out of the box by including necessay type definitions?

sshaw commented 9 years ago

Maybe typescript-src-ruby should include tsd?