Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript returns a type error about ToastOptions.icon #132

Open
sr-eric-park opened this issue May 30, 2019 · 6 comments
Open

TypeScript returns a type error about ToastOptions.icon #132

sr-eric-park opened this issue May 30, 2019 · 6 comments

Comments

@sr-eric-park
Copy link

sr-eric-park commented May 30, 2019

Type Script returns a type error in following codes:

const toast = Vue.toasted.error(msg, {
    ...
    icon: 'mdi mdi-alert'
    ...
});

Error message: Types of property 'icon' are incompatible.

It seems that definitions need to be changed as below:

(-) icon?: (ToastIcon: HTMLElement) => HTMLElement | string | { name: string, after: boolean }, 
(+) icon?: ((ToastIcon: HTMLElement) => HTMLElement) | string | { name: string, after: boolean }, 

Please check changes of the commit a03cc40

Thanks

@shtouff
Copy link

shtouff commented Aug 12, 2019

Thanks @shakee93 for your time.
Code is already OK in the repo, but not in the current release (1.1.27). When do you plan to push a new release ?

@CLFPosthumus
Copy link

Any news regarding this issue?

@OssiPesonen
Copy link

OssiPesonen commented Nov 14, 2019

I happen to experience the same issue. Usage:

 Vue.toasted.success(response, { icon: 'times-circle' })

TypeScript error:

Argument of type '{ icon: string; }' is not assignable to parameter of type 'ToastOptions'.
Types of property 'icon' are incompatible.
Type 'string' is not assignable to type '((ToastIcon: HTMLElement) => string | HTMLElement | { name: string; after: boolean; }) | undefined'.

Using the fix mentioned above you can get rid of this issue.

@ptomaszewski
Copy link

@shakee93 Can you release changes ?

@rcheung9
Copy link

rcheung9 commented Jan 5, 2020

Will someone please merge the PR? Is the author still active?

@SachsKaylee
Copy link

We've gone ahead and just installed the git repo directly for the meantime. (The compiled code is included in the GitHub repo.)

npm i git+https://github.com/shakee93/vue-toasted.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants