KanHarI / vue3-cookies

A simple Vue.js plugin for handling browser cookies
MIT License
23 stars 4 forks source link

Typescript generics for cookies.get(key) #15

Open AzimAkhmedov opened 5 months ago

AzimAkhmedov commented 5 months ago

Im trying to use it with typescript but the return type of get function is always string, but in reality it can return other kind of structures, as ex Object, there is no some kind of generic params to avoid typescript errors

const { cookies } = useCookies(); cookies.get('me'); // Return type is string, when it return object

Can you add generic params, so i can do cookies.get(key)?