Closed someone1 closed 9 months ago
if anybody is curious for a shim d.ts
file:
declare module 'v-idle' {
import { PluginObject } from 'vue';
const Vidle: PluginObject<Record<string, never>>;
export default Vidle;
}
I've got it on my list, I will prioritize this issue. Thank you.
@malekim thanks for creating this package. What is the status of this issue?
declare module 'v-idle' { import { PluginObject } from 'vue'; const Vidle: PluginObject<Record<string, never>>; export default Vidle; }
I've added it to my shims-vue.d.ts file but it's giving me an error of Module '"vue"' has no exported member 'PluginObject'.ts(2305)
if anybody is curious for a shim
d.ts
file:declare module 'v-idle' { import { PluginObject } from 'vue'; const Vidle: PluginObject<Record<string, never>>; export default Vidle; }
I'm rather new to typescript, how can I use this to make the plugin work? Where do i put this snippet?
I've added a v-idle.d.ts
file to my project and referenced it in the tsconfig.json
, now it does not throw an error regarding types any more.
I do however get the following error now. The same error occurs when I try to use the require syntax without any type information:
Uncaught TypeError: Vue.extend is not a function
at eval (vidle.min.js?4639:1:1)
at Object../node_modules/v-idle/build/vidle.min.js (chunk-vendors.js:9848:1)
at __webpack_require__ (app.js:849:30)
at fn (app.js:151:20)
at eval (main.ts:13:64)
at Module../src/main.ts (app.js:2292:1)
at __webpack_require__ (app.js:849:30)
at fn (app.js:151:20)
at Object.1 (app.js:2723:18)
at __webpack_require__ (app.js:849:30)
Firstly, thank you for such a useful and well designed package!
Can this package please be updated to generate and ship with types? I see it's already coded in typescript so it should hopefully be a trivial change to the build + deploy steps?