ts1 / flipbook-vue

3D page flip effect for Vue.js
https://ts1.github.io/flipbook-vue/
614 stars 158 forks source link

chore: add types for typescript users #80

Closed MaikoTan closed 1 year ago

MaikoTan commented 1 year ago

Hello, I created types by reading your coffeescript. I didn't know coffeescript before, so there might be errors or bugs. Feel free to point it out if I am wrong. Also, I am only familiar with vue3, not sure whether the vue3 type can be used on vue2.

ts1 commented 1 year ago

Thank you very much for your contribution! I'm not very familiar with TypeScript, but I found many (internal) methods are declared. Most of those methods are intended to be private, not open to public. Is it a right thing to declare private methods in there?

MaikoTan commented 1 year ago

Yes, it is intended. As far as I learnt, since you are using options API to declare methods, those are usually exposed to outside by default. If you want to hide some of those methods (make them private), you should explicitly declare an expose field with methods you want to expose in the component. Ref: https://vuejs.org/api/options-state.html#expose

ts1 commented 1 year ago

I did not know about expose. I will have to add it in the future. At this point, this is fine, so I merge this. Thanks again.