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

Missing Dialog and Snackbar type exports #47

Closed
endigo9740 opened this issue Aug 3, 2022 · 4 comments · Fixed by #51 or #89
Closed

Missing Dialog and Snackbar type exports #47

endigo9740 opened this issue Aug 3, 2022 · 4 comments · Fixed by #51 or #89
Labels
help wanted Extra attention is needed

Comments

@endigo9740
Copy link
Contributor

endigo9740 commented Aug 3, 2022

The following need to included as exports in /src/lib/index.js

// Dialog Types
import { type DialogAlert, type DialogConfirm, type DialogPrompt } from '@brainandbones/skeleton';
// Toast Types
import { type Toast } from '@brainandbones/skeleton';

This does not match the expectations provided in the current documentation instructions.

@endigo9740 endigo9740 added the bug Something isn't working label Aug 3, 2022
@endigo9740 endigo9740 self-assigned this Aug 3, 2022
@endigo9740 endigo9740 changed the title Missing Dialog and Snackbar type exports for the package Missing Dialog and Snackbar type exports Aug 3, 2022
@endigo9740 endigo9740 linked a pull request Aug 4, 2022 that will close this issue
@endigo9740 endigo9740 reopened this Aug 5, 2022
@endigo9740 endigo9740 added enhancement New feature or request and removed bug Something isn't working labels Aug 5, 2022
@endigo9740
Copy link
Contributor Author

endigo9740 commented Aug 7, 2022

I created a message regarding this issue on the Svelte Discord. I figured I'd shared here as well, just in case:
https://discord.com/channels/457912077277855764/1004975444459790356

Long story short, I need to know the best means to export custom Typescript interfaces as part of the package. Trying to do this in index.js, similar to a component, does not work. I figure there's a simple syntax to do so that I'm missing.

End goal is for end users to be able to import the type like this:

import type { DialogAlert } from '@brainandbones/skeleton';

Rather than having to point to the the full source like so:

import type { DialogAlert } from '@brainandbones/skeleton/Notifications/Stores';

I'll research and test a bit more soon, however, I welcome any support in the meantime!

@endigo9740 endigo9740 added help wanted Extra attention is needed and removed enhancement New feature or request labels Aug 10, 2022
@endigo9740 endigo9740 removed their assignment Aug 10, 2022
@niktek
Copy link
Contributor

niktek commented Aug 11, 2022

#72

The types have to be exported in a .ts file, doing this in src/lib/index.d.ts will block the autogenerated component exports that are created by svelte-kit package, so this is a quick little workaround to get custom types added to the root @brainandbones/skeleton namespace in the exported package

@endigo9740
Copy link
Contributor Author

This is great, looks like it'll do exactly what is needed, but I'll need to request a couple other small changes. I'll reject the PR and post comments there to make it obvious. Check there shortly.

@endigo9740
Copy link
Contributor Author

endigo9740 commented Aug 13, 2022

We appear to have a fix for this. See my latest comment here: #73

Long story short, we just need to rename index.js -> index.ts and then we can drop our Type exports right in! This should come alongside updates to the Dialog/Toast docs import snippets of course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
2 participants