You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 2, 2024. It is now read-only.
I propose changing the file structure, so this type declaration, also supports global usage.
Benefits:
Only one package to maintain instead of two
Users do not need to create an extra types.d.ts file
Works out of the box, so potential beginning programmers are not scared away by having to write the types.d.ts file, and newcomers are not annoyed that it does not work [out of the box] (this is also the reason why I almost dropped Mithril; for example the Vnode in "mithril-global" has no default, which is annoying if you are working with explicit types)
Changes:
moved the content from index.d.ts to mithril.d.ts and created new index.d.ts
moved the declare functions at the beginning to the Static interface (so they are not exposed)
some small changes to the export statements at the end
For the new usage you can take a look at this minimal example
P.S. I am using GoLand, so some feedback on other IDEs would be appreciated, though I expect it to work anywhere.
Edit: The namespace can be renamed Mithril -> m, so you can still write m.Vnode instead of Mithril.Vnode.
I propose changing the file structure, so this type declaration, also supports global usage.
Benefits:
Changes:
For the new usage you can take a look at this minimal example
P.S. I am using GoLand, so some feedback on other IDEs would be appreciated, though I expect it to work anywhere.
Edit: The namespace can be renamed Mithril -> m, so you can still write m.Vnode instead of Mithril.Vnode.