tfoxy / chrome-promise

Promises for chrome JavaScript APIs used in extensions and apps.
MIT License
150 stars 14 forks source link

Error with Typescript: "Property 'tts' does not exist on type 'typeof ChromePromise'." #24

Closed wis closed 6 years ago

wis commented 6 years ago

I think you need to include/mirror and rename the chrome extensions API typescript (DefinitelyTyped) definitions, I am using them with my typescript project and I love the intelisense code suggestions. as documented I imported chromep like so import chromep from 'chrome-promise'; I didn't mind the lack of code suggestions for chromep, but it seems with out the definitions Typescript compiler shows errors and doesn't compile.

I'll try forking and fixing it now, if I do i'll submit a PR. but please don't refrain from commenting your input.

tfoxy commented 6 years ago

Hi! When I changed the api in v3, I forgot to update the typings. Here is more information about the issue:

https://github.com/tfoxy/chrome-promise/issues/19#issuecomment-388593776

If you can make a PR it would be better that way. I would gladly accept the PR.

wis commented 6 years ago

@tfoxy okay, I am happy to contribute. i've never created DefinitelyTyped definitions, what should I do? clone the Chrome definitions from DefinitelyTyped repo and change the definitions of this library to it?

tfoxy commented 6 years ago

As I was responding, I realized the fix for the typings was really easy. So I just added it in. You can try v3.0.1

wis commented 6 years ago

appreciate it Tomas, thought I'm gonna be using mozilla/webextension-polyfill, develop for FireFox and in theory get Edge, Chrome, Opera and brave support for free. thanks for recommending it in the readme.

tfoxy commented 6 years ago

Yeah, I think it's better than this library. Glad that it suits your needs better.