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

Make title and option fields optional for $toast

Open tbhaxor opened this issue 5 years ago • 3 comments

Is your feature request related to a problem? Please describe. When using this plugin with typescript, I am unable to show the toasts because of Expected 3 arguments, but got 1 error. The 3 required parameters

  1. message
  2. title
  3. options

Describe the solution you'd like Most of the time 2nd and 3rd parameter are not used, rather configured during the installation

Describe alternatives you've considered Your typing structure should look this below

import 'vue-izitoast';
import { VueIzitoastOptions } from 'vue-izitoast';
import { PluginFunction } from 'vue';

export class VueIzitoast {
	constructor(options?: VueIzitoastOptions);

	static install(): PluginFunction<any>;

	static init(Vue: Vue): void;

	public show(message: string, title?: string, options?: VueIzitoastOptions): void;

	public hide(toast: string | HTMLDivElement | null, options?: VueIzitoastOptions): void;

	public progress(toast: string | HTMLDivElement | null, options?: VueIzitoastOptions, callback?: () => void): void;

	public destroy(): void;

	public info(message: string, title?: string, options?: VueIzitoastOptions): void;

	public success(message: string, title?: string, options?: VueIzitoastOptions): void;

	public warning(message: string, title?: string, options?: VueIzitoastOptions): void;

	public error(message: string, title?: string, options?: VueIzitoastOptions): void;

	public question(message: string, title?: string, options?: VueIzitoastOptions): void;

	public on<CB>(eventName: string, callback: CB): void;

	public off<CB>(eventName: string, callback: CB): void;
}

Additional context

image

tbhaxor avatar Oct 28 '20 14:10 tbhaxor

@arthurvasconcelos any updates??

tbhaxor avatar Nov 10 '20 01:11 tbhaxor

project dead

usb248 avatar Nov 10 '20 23:11 usb248

@usb248 can you help me in using module augmentation to fix this issue on my development environment?

tbhaxor avatar Nov 11 '20 19:11 tbhaxor