pub struct ComponentSpec {
pub name: &'static str,
pub export: String,
pub doc: &'static str,
pub props: Vec<PropSpec>,
pub events: Vec<EventSpec>,
pub methods: Vec<MethodSpec>,
pub types: TsTypes,
pub lazy_children: bool,
pub generic: bool,
}Expand description
What a component is to JS: its glue and declarations are generated
from it (declarations).
Fields§
§name: &'static strIts registered name: its type’s full path (std::any::type_name),
unique within one binary.
export: StringIts JS export: the type’s own name, the last segment of its path.
doc: &'static strDocumentation.
props: Vec<PropSpec>Its props, slots and children.
events: Vec<EventSpec>Its events.
methods: Vec<MethodSpec>The methods of its ref.
types: TsTypesThe named TypeScript types they use.
lazy_children: boolJS makes the children only while the view places them
(#[prop(lazy)] on its Children): the core tells it with a
$children event on the host.
generic: boolIts props are generic over T, the type of the rows one takes
(#[props(generic)]), as a component with super::Items is.
Implementations§
Source§impl ComponentSpec
impl ComponentSpec
Sourcepub fn host_props(&self) -> impl Iterator<Item = &'static str> + '_
pub fn host_props(&self) -> impl Iterator<Item = &'static str> + '_
The HOST_PROPS JS sets on its host: those it does not declare
itself. Its own prop or event of a host prop’s name is the one apps
get (DataTable’s onContextMenu reports a row and column).
Sourcepub fn renderers(&self) -> impl Iterator<Item = &'static str> + '_
pub fn renderers(&self) -> impl Iterator<Item = &'static str> + '_
Its render functions (PropKind::Renderer).
Sourcepub fn takes_children(&self) -> bool
pub fn takes_children(&self) -> bool
Whether it takes JSX children.
Sourcepub fn items(&self) -> Option<&'static str>
pub fn items(&self) -> Option<&'static str>
Its PropKind::Items prop (one at most).