Typescript error
See original GitHub issueDescribe the bug
When using typescript, addNotification()
definition does not take argument. so on VSCode, it shows errors.
To Reproduce
<script lang="ts">
import { getNotificationsContext } from 'svelte-notifications'
const { addNotification } = getNotificationsContext()
// VScode shows errors: Expected 0 arguments, but got 1.ts(2554)
addNotification({
text: 'TestCase created',
type: 'success',
position: 'top-right',
removeAfter: 2000
})
Expected behavior Should be no error
Screenshots
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Documentation - Understanding Errors - TypeScript
Whenever TypeScript finds an error, it tries to explain what went wrong in as much detail as possible. Because its type system is...
Read more >Get a catch block error message with TypeScript - Kent C. Dodds
TypeScript forces you to acknowledge you can't know what was thrown making getting the error message a pain. Here's how you can manage...
Read more >Error - JavaScript - MDN Web Docs - Mozilla
Error objects are thrown when runtime errors occur. The Error object can also be used as a base object for user-defined exceptions.
Read more >Exception Handling - TypeScript Deep Dive - Gitbook
Creates an instance representing an error that occurs when a numeric variable or parameter is outside of its valid range.
Read more >TypeScript errors and how to fix them
TypeScript errors and how to fix them. Common Errors. Below you find a list of common TypeScript errors along with the buggy code...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
pull request: https://github.com/keenethics/svelte-notifications/pull/49
@apirogov @shaozi I released a new version. If everything was fixed, please let me know so that I can close the issue