Module seed::dom_types

source ·
Expand description

This module contains structs and enums that represent dom types, and their parts. These are the types used internally by our virtual dom.

Structs

A thinly-wrapped HashMap holding DOM attributes
An component in our virtual DOM.
Event-handling for Elements
Handle Style separately from Attrs, since it commonly involves multiple parts, and has a different semantic meaning.

Enums

The Event enum restricts element-creation to only valid event names, as defined here: https://developer.mozilla.org/en-US/docs/Web/Events
The Tag enum restricts element-creation to only valid tags, as defined here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element

Traits

UpdateEl is used to distinguish arguments in element-creation macros, and handle each type appropriately.

Functions

Create an event that passes a String of field text, for fast input handling.
Create an event that passes a web_sys::KeyboardEvent, allowing easy access to items like key_code() and key().
Create an event that passes a web_sys::Event, allowing full control of event-handling
Create an event that passes no data, other than it occured. Foregoes using a closure, in favor of pointing to a message directly.