question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript returns a type error about ToastOptions.icon

See original GitHub issue

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 a03cc406b1a75acbcb14c3ee0ed9d3da25c68a0a

Thanks

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:14
  • Comments:6

github_iconTop GitHub Comments

6reactions
ptomaszewskicommented, Dec 11, 2019

@shakee93 Can you release changes ?

0reactions
PatrickSachscommented, Feb 4, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript returns a type error about ToastOptions.icon -
Type Script returns a type error in following codes: const toast = Vue.toasted.error(msg, { ... icon: 'mdi mdi-alert' ... }); Error message: Types...
Read more >
How do you access and declare the types of a react component?
You can declare a type for what the function returns, a ReturnType . it looks like this const yourFunction = (props: PropType): ReturnType ......
Read more >
Documentation - Do's and Don'ts - TypeScript
Don't ever use the types Number , String , Boolean , Symbol , or Object These ... doSomething(); // error, but would be...
Read more >
@types/native-toast - npm
@types/native-toast. TypeScript icon, indicating that this package has built-in type declarations. 2.0.2 • Public • Published a year ago.
Read more >
toast() API
You can provide ToastOptions as the second argument. ... Creates a notification with an animated error icon. ... Each toast call returns a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found