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

feat: Export missing type definitions #62

Closed
ieedan opened this issue Sep 19, 2024 · 5 comments
Closed

feat: Export missing type definitions #62

ieedan opened this issue Sep 19, 2024 · 5 comments

Comments

@ieedan
Copy link

ieedan commented Sep 19, 2024

Right now its not possible to do something like this in svelte.

let swapy: SwapyApi; // SwapyApi is not exported

onMount(() => {
  swapy = createSwapy(dashboardLayoutContainer);

  swapy.onSwap(({ data }) => {
	  currentLayout = data.object;
  });

  return () => {
	swapy.destroy();
  };
});

Export SwapyApi interface to allow consumers to store the variable at a different closure.

Happy to open a PR for this one later!

@TahaSh
Copy link
Owner

TahaSh commented Sep 19, 2024

Hey @ieedan! It's exported as Swapy.

@ieedan
Copy link
Author

ieedan commented Sep 19, 2024

Ah I see that now I was looking at the function signature...

What about SwapEventObject?

@ieedan
Copy link
Author

ieedan commented Sep 19, 2024

It is missing but its not as critical

// dist/swapy.d.ts 38
declare type SwapEventObject = Record<string, string | null>;

@ieedan ieedan changed the title feat: Export SwapyApi interface or type feat: Export missing type definitions Sep 19, 2024
@TahaSh
Copy link
Owner

TahaSh commented Sep 21, 2024

@ieedan thanks for pointing this out. I'll add it in upcoming releases :)

@TahaSh
Copy link
Owner

TahaSh commented Sep 21, 2024

@ieedan all swap event types are now exported in v0.3.0.

@ieedan ieedan closed this as completed Sep 23, 2024
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

Successfully merging a pull request may close this issue.

2 participants