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

Make title and option fields optional for $toast #55

Open tbhaxor opened 4 years ago

tbhaxor commented 4 years ago

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 commented 4 years ago

@arthurvasconcelos any updates??

usb248 commented 4 years ago

project dead

tbhaxor commented 4 years ago

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