tribute icon indicating copy to clipboard operation
tribute copied to clipboard

Declaration file required for Typescript

Open TetianaP opened this issue 9 years ago • 11 comments

To use tribute withing Typescript - it is required to have a Declaration File. (tributejs.d.ts)

Can you please provide one?

TetianaP avatar Jan 23 '17 23:01 TetianaP

I don't use Typescript, so any help or direction on this would be much appreciated. This would be a great addition. Thanks!

mrsweaters avatar Jan 24 '17 17:01 mrsweaters

any update on this? :)

BorntraegerMarc avatar Apr 05 '17 09:04 BorntraegerMarc

@BorntraegerMarc Thanks for checking in! I'm not quite sure how to write a typing but it doesn't seem too complicated. I can take a stab at it.

mrsweaters avatar Apr 06 '17 21:04 mrsweaters

Thanks. Let me know if you need help

BorntraegerMarc avatar Apr 07 '17 05:04 BorntraegerMarc

Since TypeScript 1.8, it's allowed to include .js files with --allowJs flag. See https://blogs.msdn.microsoft.com/typescript/2016/01/28/announcing-typescript-1-8-beta/

Set "compilerOptions": { "allowJs": true }, depending on your project structure include tribute library: "include": ["node_modules/tributejs/dist/tribute.js"], now you can use Tribute, just add import {default as Tribute} from 'tributejs/dist/tribute';

TetianaP avatar Apr 09 '17 03:04 TetianaP

Yes @TetianaP but it would be cool to have some definitely typed support for codin :)

BorntraegerMarc avatar Apr 09 '17 06:04 BorntraegerMarc

@TetianaP @BorntraegerMarc I've added a PR that adds a typings file to the project. Let me know if I need to make any changes! https://github.com/zurb/tribute/pull/59

mrsweaters avatar Apr 13 '17 18:04 mrsweaters

@mrsweaters left my comments in the PR. Thx!

BorntraegerMarc avatar Apr 14 '17 09:04 BorntraegerMarc

Merged! https://github.com/zurb/tribute/pull/59

mrsweaters avatar Apr 14 '17 17:04 mrsweaters

Sorry to come back at you this late but wouldn't it make more sense to publish the typings here https://github.com/DefinitelyTyped/DefinitelyTyped ?

I thought this would be standard practice...

BorntraegerMarc avatar Apr 15 '17 12:04 BorntraegerMarc

@BorntraegerMarc Ah, good call. I'll be sure to add this to the DefinitelyTyped repo.

mrsweaters avatar Apr 17 '17 00:04 mrsweaters