-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Component and option type definitions + code docs #390
Component and option type definitions + code docs #390
Conversation
- Added type definition for generic component (base class); - Added type definition for static and virtual class methods; - Added type definitions for object options; - Added overload definitions to "init" methods; - Added initial version for code docs (props); - Dropped support to jQuery selector in "getInstance" method; - Fixed "Collapsible" destructor.
- Added type definition for generic component (base class); - Added type definition for static and virtual class methods; - Added type definitions for object options; - Added overload definitions to "init" methods; - Added initial version for code docs (props); - Dropped support to jQuery selector in "getInstance" method; - Fixed "Collapsible" destructor.
- Finished removing native jQuery support; - Migrated global constants and utilitary functions to "Utils" module; - Added type definitions and docs to "Utils" module; - Exposed "Utils" module in global namespace ("M"); - Components no longer need to import global namespace; - Removed unnecessary throttle wrapper function on components; - Updated type definition for toast function + added docs; - Fix touch event when target does not have a close carousel item; - Fixed incorrect event instance check; - Fixed type definitions using "Boolean" object as type.
Great work! The reason is that querySelectorAll returns a
instead of the
What do you think? |
Well, I haven't noticed it. Thanks for reporting. UPDATE From what I've seen, this issue only applies to "NodeList". Therefore, I'm just updating the " |
- New "MElement" type (HTMLElement | Element); - "init" overloads which supports nodelist must support "MElement" type; - Made "options" an optional attribute in "init" functions; - Update "init" types for input elements; - Removed unnecessary imports.
@danice, I've made some changes to the initialization overloads which allows "Element" type to be considered as well 😄. The following snippets illustrates a picker being initialized either by a single element (even though it is typed as I've also updated component initializers so as to allow "empty" options 😃. |
Haha good work! That will take some time to review 😆 I will check locally... |
Merge 'v2-dev' into component-types-docs
I've just had to merge v2-dev into this branch, since #387 has been already merged, thus, requiring a small refactor, as mentioned in the topic. |
Awesome! Great work 👍 |
It is JSDoc as well. |
Proposed changes
Apply type definition for every Materialize component (I have taken some from DefinitelyTyped, since I'm the maintainer of
@materializecss/materialize
types).Toast
) inherit fromComponent
and their respective options fromBaseOptions
;options
is no longer "protected" (the user should be able to check the initialization options as well, just as mentioned in the docs);Breaking changes
M::objectSelectorString
, have been removed;M.Utils
" (this is an important change, since it removes circular dependency from the component sources 😃).Affected PRs:
Types of changes
Checklist: