vue-pouch icon indicating copy to clipboard operation
vue-pouch copied to clipboard

Add TypeScript support and examples

Open rominf opened this issue 6 years ago • 11 comments

I couldn't get it to work in Vue.js TypeScript project.

rominf avatar Jan 07 '19 15:01 rominf

Nor could I. I'm digging into this issue now. I'm trying to use pouch in a Vue.js PWA/TypeScript project using the new Vue CLI 3.

I'll come back with some more details.

assemblethis avatar Jan 14 '19 21:01 assemblethis

I've added a TypeScript example that's working for me. It's probably not great, but it's a start:

https://github.com/assemblethis/pouch-vue/blob/master/README.md

assemblethis avatar Jan 16 '19 05:01 assemblethis

Nice, thank you! But ignoring tslint errors is not very good...

rominf avatar Jan 16 '19 12:01 rominf

Are you referring to the @ts-ignore syntax:? I read the following article "Don’t let TypeScript slow you down" (https://medium.com/@vitalyb/dont-let-typescript-slow-you-down-92d394ec8c9f) and it suggested using the @ts-ignore syntax with third party libraries that don't natively support typescript since add-on packages can get out of date and cause further problems. It made an argument that: "If you’re using a library that natively supports TypeScript this shouldn’t concern you. If the library doesn’t, then just use it without types."

assemblethis avatar Jan 16 '19 17:01 assemblethis

Yes, I'm referring to the @ts-ignore. I think I will use it as you wrote, but I'm waiting for TypeScript support :)

rominf avatar Jan 16 '19 17:01 rominf

If you improve upon the example, please share. I'm new to TypeScript.

assemblethis avatar Jan 16 '19 17:01 assemblethis

I'm new to TypeScript too :)

rominf avatar Jan 16 '19 17:01 rominf

I switched over to the recommended fork of this project at https://github.com/MDSLKTR/pouch-vue

My TypeScript example still works with the fork. Some reason called pouch-vue now instead of vue-pouch.

I'm going to test out authentication this week. I'll let you know how it goes.

assemblethis avatar Jan 20 '19 22:01 assemblethis

Two auth issues uncovered with the fork at https://github.com/MDSLKTR/pouch-vue

  1. Closed: https://github.com/MDSLKTR/pouch-vue/issues/3
  2. Open: https://github.com/MDSLKTR/pouch-vue/issues/4

So far so good, outlook is hopeful that auth will work as needed for my PWA project.

assemblethis avatar Feb 02 '19 18:02 assemblethis

I'm contemplating creating an ES6 module for the fork and including typings for TS.

assemblethis avatar Feb 02 '19 18:02 assemblethis

I've got a pull request to include typescript support for the pouch-vue project which is the successor to this project: https://github.com/MDSLKTR/pouch-vue/pull/9

It might have what you need.

assemblethis avatar Apr 03 '19 17:04 assemblethis