arthurvasconcelos / vue-izitoast

Elegant, responsive, flexible and lightweight notification plugin implemented for Vue 2 of iziToast
https://arthurvasconcelos.com.br/vue-izitoast
Apache License 2.0
133 stars 21 forks source link

Vue.use(VueIzitoast, iziOptions) - No overloads matches this call #47

Closed newhang closed 4 years ago

newhang commented 4 years ago

In typescript, I get this error.

No overload matches this call. Overload 1 of 2, '(plugin: PluginObject | PluginFunction, options?: unknown): VueConstructor', gave the following error. Argument of type 'typeof import("/Users/fernando/Documents/Elantana/Clientes/AV-Drop/SourceCodes/saas_ts/node_modules/vue-izitoast/src/types/index")' is not assignable to parameter of type 'PluginObject | PluginFunction'. Property 'install' is missing in type 'typeof import("/Users/fernando/Documents/Elantana/Clientes/AV-Drop/SourceCodes/saas_ts/node_modules/vue-izitoast/src/types/index")' but required in type 'PluginObject'. Overload 2 of 2, '(plugin: PluginObject | PluginFunction, ...options: any[]): VueConstructor', gave the following error. Argument of type 'typeof import("/Users/fernando/Documents/Elantana/Clientes/AV-Drop/SourceCodes/saas_ts/node_modules/vue-izitoast/src/types/index")' is not assignable to parameter of type 'PluginObject | PluginFunction'. Property 'install' is missing in type 'typeof import("/Users/fernando/Documents/Elantana/Clientes/AV-Drop/SourceCodes/saas_ts/node_modules/vue-izitoast/src/types/index")' but required in type 'PluginObject'.ts(2769)

How did you solved it?

newhang commented 4 years ago

So simple: export const install: PluginFunction<{}>;

at the end of file index.d.ts