-
Notifications
You must be signed in to change notification settings - Fork 30
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
Missing type definition for bind #58
Comments
Type definitions were only added in v1.1.1. Before that they simply did not exist. 1b5bcd4 Are other type annotations found? |
If you have the time, it'd be great if you could put together a simple test demo or share your setup for a reproducible example. |
import type { SvelteComponent } from 'svelte';
import { writable } from 'svelte/store';
import { bind } from 'svelte-simple-modal'; // <-- This will error
export const modals = writable<{ resolver: Function, modal: any }[]>([]);
export function showModal<TResponse>(component: typeof SvelteComponent, props?: Record<string, any>): Promise<TResponse | undefined> {
var resolver;
var promise = new Promise<TResponse>((resolve) => resolver = resolve);
modals.update((current) => {
current.push({ modal: bind(component, props), resolver: resolver });
return current;
});
return promise;
} The above is a small example of the issue with v1.1.1. Also on a side note, I was wondering if your |
Thanks for the example. You're probably right about the type annotation. Unfortunately, the |
I've opened a ticket with Sveld to see if there's a way the type annotations can be generated properly without requiring manually creating the types. Apart from that |
@royston-c The type def issue should finally be fixed in v1.3.1 thanks to the guys who fixed |
Closing this as I believe the issue is addressed. If it's not, please reopen. Thanks for reporting the problem! |
The typescript definition is missing for the
bind
function that can be imported usingimport { bind } from 'svelte-simple-modal';
This worked in:
1.0.3
Throws error in:
1.1.1
Error:
I can't say exactly the version that is started to fail with but it did work with
1.0.3
.Workaround: downgrade to 1.0.3
The text was updated successfully, but these errors were encountered: