notiwind
notiwind copied to clipboard
Added typescript definitions
Compared to #20, these definitions does not declare fixed fields.
Notiwind itself only expect a field group
and this is optional.
Can be found here: https://github.com/emmanuelsw/notiwind/blob/main/src/notify.js#L11
All other fields are optional and UI implementation specific.
That's the reason why Notification
is a map type, in this definition.
At least I added the types
entry in the package.json
, otherwise typescript or build tools may not resolve the .d.ts
automatically.
Thanks for the PR!
I have a script that generates the ESM and CommonJS modules and it deletes the dist
folder in the process, maybe we can do something like this so it doesn't remove the types file:
rm dist/index* && rollup -c
Maybe not the best solution but it can work well for now, the rest is good!
Or using the rollup copy plugin, to copy the .d.ts
file from src/
into dist/
?
Definitely better.