✨ Define OneComponent con tipado restringido
This commit is contained in:
parent
dd443ca375
commit
23a6f36f62
12 changed files with 68 additions and 90 deletions
|
|
@ -12,7 +12,7 @@ pub use heading::{Heading, HeadingDisplay, HeadingType, COMPONENT_HEADING};
|
|||
mod paragraph;
|
||||
pub use paragraph::{Paragraph, ParagraphDisplay, COMPONENT_PARAGRAPH};
|
||||
mod anchor;
|
||||
pub use anchor::{Anchor, AnchorIcon, AnchorTarget, AnchorType, COMPONENT_ANCHOR};
|
||||
pub use anchor::{Anchor, AnchorTarget, AnchorType, COMPONENT_ANCHOR};
|
||||
mod block;
|
||||
pub use block::{Block, COMPONENT_BLOCK};
|
||||
mod image;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ pub enum AnchorTarget {
|
|||
Context(String),
|
||||
}
|
||||
|
||||
pub type AnchorIcon = ComponentArc;
|
||||
pub type AnchorHtml = ComponentArc;
|
||||
type AnchorIcon = OneComponent<Icon>;
|
||||
type AnchorHtml = OneComponent<L10n>;
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ pub enum ButtonType {
|
|||
Reset,
|
||||
}
|
||||
|
||||
pub type ButtonValue = ComponentArc;
|
||||
type ButtonValue = OneComponent<L10n>;
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ pub enum InputType {
|
|||
Url,
|
||||
}
|
||||
|
||||
pub type InputLabel = ComponentArc;
|
||||
pub type InputHelpText = ComponentArc;
|
||||
type InputLabel = OneComponent<L10n>;
|
||||
type InputHelpText = OneComponent<L10n>;
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pub enum HeadingDisplay {
|
|||
Subtitle,
|
||||
}
|
||||
|
||||
pub type HeadingText = ComponentArc;
|
||||
type HeadingText = OneComponent<L10n>;
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue