leptos¶
In [ ]:
open rust.rust_operators
open rust
open sm'_operators
a'¶
In [ ]:
nominal a' =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::A\")>]\n#endif\ntype leptos_html_A = class end"
$'' : $'leptos_html_A'
)
event¶
In [ ]:
nominal event =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::ev::Event\")>]\n#endif\ntype leptos_ev_Event = class end"
$'' : $'leptos_ev_Event'
)
mouse_event¶
In [ ]:
nominal mouse_event =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::ev::MouseEvent\")>]\n#endif\ntype leptos_ev_MouseEvent = class end"
$'' : $'leptos_ev_MouseEvent'
)
button¶
In [ ]:
nominal button =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Button\")>]\n#endif\ntype leptos_html_Button = class end"
$'' : $'leptos_html_Button'
)
details¶
In [ ]:
nominal details =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Details\")>]\n#endif\ntype leptos_html_Details = class end"
$'' : $'leptos_html_Details'
)
dd¶
In [ ]:
nominal dd =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Dd\")>]\n#endif\ntype leptos_html_Dd = class end"
$'' : $'leptos_html_Dd'
)
div¶
In [ ]:
nominal div =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Div\")>]\n#endif\ntype leptos_html_Div = class end"
$'' : $'leptos_html_Div'
)
dl¶
In [ ]:
nominal dl =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Dl\")>]\n#endif\ntype leptos_html_Dl = class end"
$'' : $'leptos_html_Dl'
)
dt¶
In [ ]:
nominal dt =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Dt\")>]\n#endif\ntype leptos_html_Dt = class end"
$'' : $'leptos_html_Dt'
)
footer¶
In [ ]:
nominal footer =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Footer\")>]\n#endif\ntype leptos_html_Footer = class end"
$'' : $'leptos_html_Footer'
)
header¶
In [ ]:
nominal header =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Header\")>]\n#endif\ntype leptos_html_Header = class end"
$'' : $'leptos_html_Header'
)
input¶
In [ ]:
nominal input =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Input\")>]\n#endif\ntype leptos_html_Input = class end"
$'' : $'leptos_html_Input'
)
label¶
In [ ]:
nominal label =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Label\")>]\n#endif\ntype leptos_html_Label = class end"
$'' : $'leptos_html_Label'
)
main¶
In [ ]:
nominal main =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Main\")>]\n#endif\ntype leptos_html_Main = class end"
$'' : $'leptos_html_Main'
)
nav¶
In [ ]:
nominal nav =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Nav\")>]\n#endif\ntype leptos_html_Nav = class end"
$'' : $'leptos_html_Nav'
)
option'¶
In [ ]:
nominal option' =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Option_\")>]\n#endif\ntype leptos_html_Option = class end"
$'' : $'leptos_html_Option'
)
pre¶
In [ ]:
nominal pre =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Pre\")>]\n#endif\ntype leptos_html_Pre = class end"
$'' : $'leptos_html_Pre'
)
select¶
In [ ]:
nominal select =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Select\")>]\n#endif\ntype leptos_html_Select = class end"
$'' : $'leptos_html_Select'
)
span¶
In [ ]:
nominal span =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Span\")>]\n#endif\ntype leptos_html_Span = class end"
$'' : $'leptos_html_Span'
)
summary¶
In [ ]:
nominal summary =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Summary\")>]\n#endif\ntype leptos_html_Summary = class end"
$'' : $'leptos_html_Summary'
)
table¶
In [ ]:
nominal table =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Table\")>]\n#endif\ntype leptos_html_Table = class end"
$'' : $'leptos_html_Table'
)
thead¶
In [ ]:
nominal thead =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Thead\")>]\n#endif\ntype leptos_html_Thead = class end"
$'' : $'leptos_html_Thead'
)
tbody¶
In [ ]:
nominal tbody =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Tbody\")>]\n#endif\ntype leptos_html_Tbody = class end"
$'' : $'leptos_html_Tbody'
)
tr¶
In [ ]:
nominal tr =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Tr\")>]\n#endif\ntype leptos_html_Tr = class end"
$'' : $'leptos_html_Tr'
)
th¶
In [ ]:
nominal th =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Th\")>]\n#endif\ntype leptos_html_Th = class end"
$'' : $'leptos_html_Th'
)
td¶
In [ ]:
nominal td =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::Td\")>]\n#endif\ntype leptos_html_Td = class end"
$'' : $'leptos_html_Td'
)
svg¶
In [ ]:
nominal svg =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::svg::Svg\")>]\n#endif\ntype leptos_svg_Svg = class end"
$'' : $'leptos_svg_Svg'
)
path¶
In [ ]:
nominal path =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::svg::Path\")>]\n#endif\ntype leptos_svg_Path = class end"
$'' : $'leptos_svg_Path'
)
circle¶
In [ ]:
nominal circle =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::svg::Circle\")>]\n#endif\ntype leptos_svg_Circle = class end"
$'' : $'leptos_svg_Circle'
)
rect¶
In [ ]:
nominal rect =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::svg::Rect\")>]\n#endif\ntype leptos_svg_Rect = class end"
$'' : $'leptos_svg_Rect'
)
animate¶
In [ ]:
nominal animate =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::svg::Animate\")>]\n#endif\ntype leptos_svg_Animate = class end"
$'' : $'leptos_svg_Animate'
)
action¶
In [ ]:
nominal action t u =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::Action<$0, $1>\")>]\n#endif\ntype leptos_prelude_Action<'T, 'U> = class end"
$'' : $'leptos_prelude_Action<`t, `u>'
)
for¶
In [ ]:
nominal for =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::For\")>]\n#endif\ntype leptos_prelude_For = class end"
$'' : $'leptos_prelude_For'
)
show¶
In [ ]:
nominal show =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::Show\")>]\n#endif\ntype leptos_prelude_Show = class end"
$'' : $'leptos_prelude_Show'
)
fragment¶
In [ ]:
nominal fragment =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::Fragment\")>]\n#endif\ntype leptos_dom_Fragment = class end"
$'' : $'leptos_dom_Fragment'
)
interval_handle¶
In [ ]:
nominal interval_handle =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::leptos_dom::helpers::IntervalHandle\")>]\n#endif\ntype leptos_dom_IntervalHandle = class end"
$'' : $'leptos_dom_IntervalHandle'
)
text¶
In [ ]:
nominal text =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::tachys::renderer::dom::Text\")>]\n#endif\ntype leptos_dom_Text = class end"
$'' : $'leptos_dom_Text'
)
transparent¶
In [ ]:
nominal transparent =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::leptos_dom::Transparent\")>]\n#endif\ntype leptos_dom_Transparent = class end"
$'' : $'leptos_dom_Transparent'
)
route¶
In [ ]:
nominal route =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos_router::Route\")>]\n#endif\ntype leptos_router_Route = class end"
$'' : $'leptos_router_Route'
)
nested_route¶
In [ ]:
nominal nested_route =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos_router::NestedRoute<_, _, _, _>\")>]\n#endif\ntype leptos_router_NestedRoute = class end"
$'' : $'leptos_router_NestedRoute'
)
route_definition¶
In [ ]:
nominal route_definition =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos_router::RouteDefinition\")>]\n#endif\ntype leptos_router_RouteDefinition = class end"
$'' : $'leptos_router_RouteDefinition'
)
router¶
In [ ]:
nominal router =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos_router::Router\")>]\n#endif\ntype leptos_router_Router = class end"
$'' : $'leptos_router_Router'
)
routes¶
In [ ]:
nominal routes =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos_router::Routes\")>]\n#endif\ntype leptos_router_Routes = class end"
$'' : $'leptos_router_Routes'
)
html_element¶
In [ ]:
nominal html_element t =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::html::HtmlElement<$0, _, _>\")>]\n#endif\ntype leptos_dom_html_HtmlElement<'T> = class end"
$'' : $'leptos_dom_html_HtmlElement<`t>'
)
into_view¶
In [ ]:
nominal into_view =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::IntoView\")>]\n#endif\ntype leptos_IntoView = class end"
$'' : $'leptos_IntoView'
)
location¶
In [ ]:
nominal location =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos_router::location::Location\")>]\n#endif\ntype leptos_router_location_Location = class end"
$'' : $'leptos_router_location_Location'
)
navigate_options¶
In [ ]:
nominal navigate_options =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos_router::NavigateOptions\")>]\n#endif\ntype leptos_router_NavigateOptions = class end"
$'' : $'leptos_router_NavigateOptions'
)
url¶
In [ ]:
nominal url =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos_router::location::Url\")>]\n#endif\ntype leptos_router_Url = class end"
$'' : $'leptos_router_Url'
)
memo¶
In [ ]:
nominal memo t =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::Memo<$0>\")>]\n#endif\ntype leptos_prelude_Memo<'T> = class end"
$'' : $'leptos_prelude_Memo<`t>'
)
rw_signal¶
In [ ]:
nominal rw_signal t =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::RwSignal<$0>\")>]\n#endif\ntype leptos_prelude_RwSignal<'T> = class end"
$'' : $'leptos_prelude_RwSignal<`t>'
)
signal¶
In [ ]:
nominal signal t =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::Signal<$0>\")>]\n#endif\ntype leptos_prelude_Signal<'T> = class end"
$'' : $'leptos_prelude_Signal<`t>'
)
read_signal¶
In [ ]:
nominal read_signal t =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::ReadSignal<$0>\")>]\n#endif\ntype leptos_prelude_ReadSignal<'T> = class end"
$'' : $'leptos_prelude_ReadSignal<`t>'
)
write_signal¶
In [ ]:
nominal write_signal t =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::WriteSignal<$0>\")>]\n#endif\ntype leptos_prelude_WriteSignal<'T> = class end"
$'' : $'leptos_prelude_WriteSignal<`t>'
)
resource¶
In [ ]:
nominal resource t u =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::Resource<$0, $1>\")>]\n#endif\ntype leptos_prelude_Resource<'T, 'U> = class end"
$'' : $'leptos_prelude_Resource<`t, `u>'
)
any_view¶
In [ ]:
nominal any_view =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::AnyView\")>]\n#endif\ntype leptos_prelude_AnyView = class end"
$'' : $'leptos_prelude_AnyView'
)
view'¶
In [ ]:
nominal view' t =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::View<$0>\")>]\n#endif\ntype leptos_prelude_View<'T> = class end"
$'' : $'leptos_prelude_View<`t>'
)
view¶
In [ ]:
nominal view =
`(
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"leptos::prelude::AnyView\")>]\n#endif\ntype leptos_prelude_AnyView_ = class end"
$'' : $'leptos_prelude_AnyView_'
)
signal_get¶
In [ ]:
prototype signal_get signal t : signal t -> t
signal_get_untracked¶
In [ ]:
prototype signal_get_untracked signal t : signal t -> t
signal_update¶
In [ ]:
prototype signal_update signal t : (t -> t) -> signal t -> ()
signal_set¶
In [ ]:
prototype signal_set signal t : t -> signal t -> ()
log_string¶
In [ ]:
inl log_string (text : string) =
(!\($'@@"true; leptos::logging::log\!(""" + !text + @@""");"') : bool) |> ignore
log¶
In [ ]:
inl log (text : string) =
(!\\(text, $'@@$"true; leptos::logging::log\!(""{{}}"", $0)"') : bool) |> ignore
log_debug¶
In [ ]:
inl log_debug (text : string) =
(!\\(text, $'@@$"true; leptos::logging::log\!(""{{:?}}"", $0)"') : bool) |> ignore
log_pretty¶
In [ ]:
inl log_pretty (text : string) =
(!\\(text, $'@@$"true; leptos::logging::log\!(""{{:#?}}"", $0)"') : bool) |> ignore
log_format¶
In [ ]:
inl log_format fn obj =
inl obj_log = obj |> sm'.format_debug
inl text = fn obj_log |> sm'.ellipsis_end 200
log text
obj
mount_to_body¶
In [ ]:
inl mount_to_body (view_fn : () -> rust.impl into_view) : () =
(!\\(view_fn, $'"true; leptos::prelude::mount_to_body(|| $0()); //"') : bool) |> ignore
view_vec_to_fragment¶
In [ ]:
inl view_vec_to_fragment (view : am'.vec view) : fragment =
!\\(view, $'"leptos::prelude::Fragment::new($0)"')
view_list_to_fragment¶
In [ ]:
inl view_list_to_fragment (view : list view) : fragment =
view |> am'.new_vec |> view_vec_to_fragment
element_to_view¶
In [ ]:
inl element_to_view (view : view' (html_element _)) : view =
!\\(view, $'"leptos::prelude::IntoAny::into_any($0)"')
view_to_fragment¶
In [ ]:
inl view_to_fragment (view : view) : fragment =
[ view ] |> view_list_to_fragment
fragment_to_view¶
In [ ]:
inl fragment_to_view (fragment : fragment) : view =
inl fragment = join fragment
!\($'"leptos::prelude::AnyView::from(!fragment)"')
fragment_to_view'¶
In [ ]:
inl fragment_to_view' (fragment : rust.ref fragment) : view =
!\\(fragment, $'"leptos::prelude::AnyView::from(*$0.clone())"')
element_to_fragment¶
In [ ]:
inl element_to_fragment (view : view' (html_element _)) : fragment =
view
|> element_to_view
|> view_to_fragment
(~:>) fragment¶
In [ ]:
instance (~:>) fragment = fun x =>
real
typecase t with
| array_base (view' (html_element ~el)) =>
inl x = am'.to_vec `(view' (html_element el)) x
inl x = am'.vec_map' `(view' (html_element el)) `view (element_to_view `el) x
inl x : a i32 view = am'.from_vec `i32 `view x
inl x = am.toList `a `i32 `view x
view_list_to_fragment x
| list (view' (html_element ~el)) =>
inl x = listm.map `(view' (html_element el)) `view (element_to_view `el) x
view_list_to_fragment x
| list view =>
view_list_to_fragment x
| _ => x
(~:>) view¶
In [ ]:
instance (~:>) view = fun x =>
real
typecase t with
| view' (html_element _) => element_to_view x
| _ => x
view_trait_to_element¶
In [ ]:
inl view_trait_to_element (view : rust.impl into_view) : view' (html_element _) =
$'!view |> unbox'
view_trait_to_route_definition¶
In [ ]:
inl view_trait_to_route_definition (view : rust.impl into_view) : route_definition =
$'!view |> unbox'
to_element_view¶
In [ ]:
inl to_element_view (view : view' (html_element _)) : rust.impl into_view =
$'!view |> unbox'
to_view_trait¶
In [ ]:
inl to_view_trait (view : view) : rust.impl into_view =
$'!view |> unbox'
to_fragment_unbox¶
In [ ]:
inl to_fragment_unbox view : fragment =
$'!view |> unbox'
from_fragment_unbox¶
In [ ]:
inl from_fragment_unbox (fragment : fragment) =
$'!fragment |> unbox'
element_to_view_trait¶
In [ ]:
inl element_to_view_trait (macro : view' (html_element _)) : rust.impl into_view =
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::ElementChild;\n//\""
!\($'"leptos::prelude::view\! { {!macro} }"')
macro_to_view_trait¶
In [ ]:
inl macro_to_view_trait (macro : string) : rust.impl into_view =
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::ElementChild;\n//\""
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::ClassAttribute;\n//\""
!\($'"leptos::prelude::view\! { " + !macro + " }"')
macro_to_fragment¶
In [ ]:
inl macro_to_fragment (macro : string) : fragment =
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::ElementChild;\n//\""
!\($'"leptos::prelude::view\! { " + !macro + " }"')
new_transparent¶
In [ ]:
inl new_transparent x : transparent =
!\\(x, $'"leptos::leptos_dom::Transparent::new($0)"')
closure_to_view¶
In [ ]:
inl closure_to_view (closure : rust.func0 view) : view =
!\($'"leptos::prelude::IntoAny::into_any(move || !closure())"')
batch¶
In [ ]:
inl batch (fn : () -> ()) : () =
(!\\(fn, $'"true; leptos::prelude::batch(move || $0());"') : bool) |> ignore
closure_to_fragment¶
In [ ]:
inl closure_to_fragment (closure : rust.func0 fragment) : fragment =
inl closure = closure |> rust.func0_move
!\($'"leptos::prelude::IntoAny::into_any(!closure)"')
|> view_to_fragment
array_to_view¶
In [ ]:
inl array_to_view (view : a _ view) : view =
inl view = view |> am'.base
!\\(view, $'"leptos::prelude::CollectView::collect_view($0)"')
to_fragment¶
In [ ]:
inl to_fragment x : fragment =
$'!x |> unbox'
text_to_view¶
In [ ]:
inl text_to_view (text : string) : view =
inl text = text |> sm'.to_std_string
!\\(text, $'"leptos::prelude::IntoAny::into_any(leptos::prelude::IntoView::into_view($0))"')
text_to_fragment¶
In [ ]:
inl text_to_fragment (text : string) : fragment =
text
|> text_to_view
|> view_to_fragment
macro_to_view¶
In [ ]:
inl macro_to_view (macro : string) : view =
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::ElementChild;\n//\""
!\($'"leptos::prelude::IntoAny::into_any(leptos::prelude::view\! { " + !macro + " })"')
macro_to_view'¶
In [ ]:
inl macro_to_view' (macro : string) : view' infer =
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::ElementChild;\n//\""
!\($'"leptos::IntoView::into_view(leptos::prelude::view\! { " + !macro + " })"')
macro_to_view''¶
In [ ]:
inl macro_to_view'' (macro : string) : view' infer =
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::ElementChild;\n//\""
!\($'"leptos::prelude::view\! { " + !macro + " }"')
macro_to_view'''¶
In [ ]:
inl macro_to_view''' (macro : string) : view' _ =
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::ElementChild;\n//\""
!\($'"leptos::IntoView::into_view(leptos::prelude::view\! { " + !macro + " })"')
into_any_view¶
In [ ]:
inl into_any_view (view : view' _) : view =
!\\(view, $'"leptos::prelude::IntoAny::into_any($0)"')
into_any_view'¶
In [ ]:
inl into_any_view' (view : view' _) : view =
!\\(view, $'"&leptos::prelude::IntoAny::into_any($0)"')
transparent_to_view¶
In [ ]:
inl transparent_to_view (transparent : transparent) : view =
!\\(transparent, $'"leptos::prelude::IntoAny::into_any($0)"')
transparent_to_fragment¶
In [ ]:
inl transparent_to_fragment (transparent : transparent) : fragment =
transparent
|> transparent_to_view
|> view_to_fragment
macro_to_element¶
In [ ]:
inl macro_to_element (view : string) : view' (html_element _) =
view |> macro_to_view_trait |> view_trait_to_element
transparents_fragment¶
In [ ]:
inl transparents_fragment (items : array_base transparent) : fragment =
inl items = items |> am'.to_vec
!\\((items, transparent_to_view), $'"$0.iter().map(|x| $1(x.clone())).collect::<Fragment>()"')
views_to_view¶
In [ ]:
inl views_to_view (items : array_base view) : view =
inl items = join items
items
// |> fun x => a (join x) : a u64 _
|> fun x => a x : a u64 _
|> array_to_view
new_text¶
In [ ]:
inl new_text (text : string) : text =
!\\(text, $'"leptos::tachys::renderer::dom::Dom::create_text_node(&*$0)"')
text_view¶
In [ ]:
inl text_view (text : string) : view =
text
|> text_to_view
text_fragment¶
In [ ]:
inl text_fragment (text : string) : fragment =
text
|> text_view
|> view_to_fragment
provide_meta_context¶
In [ ]:
inl provide_meta_context () =
(!\($'"true; leptos_meta::provide_meta_context()"') : bool) |> ignore
provide_context¶
In [ ]:
inl provide_context forall t. (x : t) =
(!\\(x, $'$"true; leptos::context::provide_context::<std::sync::Arc<`t>>($0)"') : bool) |> ignore
create_signal¶
In [ ]:
inl create_signal forall t. (value : t) : read_signal t * write_signal t =
!\\(value, $'$"leptos::prelude::signal($0)"')
create_rw_signal¶
In [ ]:
inl create_rw_signal forall t. (value : t) : rw_signal t =
!\\(value, $'$"leptos::prelude::RwSignal::new($0)"')
read_only¶
In [ ]:
inl read_only forall t. (value : rw_signal t) : read_signal t =
!\\(value, $'$"leptos::prelude::RwSignal::read_only(&$0)"')
write_only¶
In [ ]:
inl write_only forall t. (value : rw_signal t) : write_signal t =
!\\(value, $'$"leptos::prelude::RwSignal::write_only(&$0)"')
typecheck_signal¶
In [ ]:
inl typecheck_signal forall (t : * -> *) u. (signal : t u) : () =
real
typecase t with
| signal => ()
| rw_signal => ()
| read_signal => ()
| write_signal => ()
| memo => ()
| _ => error_type `(()) ("invalid signal", ``(t u))
memo_get'¶
In [ ]:
inl memo_get' forall t. (memo : memo t) : t =
!\\(memo, $'$"$0()"')
signal_get'¶
In [ ]:
inl signal_get' forall (t : * -> *) u. (signal : t u) : u =
signal |> typecheck_signal
!\\(signal, $'$"leptos::prelude::SignalGet::get(&$0)"')
signal_get signal¶
In [ ]:
instance signal_get signal = signal_get'
signal_get rw_signal¶
In [ ]:
instance signal_get rw_signal = signal_get'
signal_get read_signal¶
In [ ]:
instance signal_get read_signal = signal_get'
signal_get memo¶
In [ ]:
instance signal_get memo = memo_get'
signal_update'¶
In [ ]:
inl signal_update' forall (t : * -> *) u. (fn : u -> u) (signal : t u) : () =
signal |> typecheck_signal
(!\\((signal, fn), $'"true; leptos::prelude::SignalUpdate::update(&$0, |x| { *x = $1(x.clone()) });"') : bool) |> ignore
signal_update rw_signal¶
In [ ]:
instance signal_update rw_signal = signal_update'
signal_update write_signal¶
In [ ]:
instance signal_update write_signal = signal_update'
signal_get_untracked'¶
In [ ]:
inl signal_get_untracked' forall (t : * -> *) u. (signal : t u) : u =
signal |> typecheck_signal
!\\(signal, $'$"leptos::prelude::SignalGetUntracked::get_untracked(&$0)"')
signal_get_untracked rw_signal¶
In [ ]:
instance signal_get_untracked rw_signal = signal_get_untracked'
signal_get_untracked read_signal¶
In [ ]:
instance signal_get_untracked read_signal = signal_get_untracked'
signal_get_untracked memo¶
In [ ]:
instance signal_get_untracked memo = signal_get_untracked'
signal_set'¶
In [ ]:
inl signal_set' forall (t : * -> *) u. (value : u) (signal : t u) =
signal |> typecheck_signal
(!\\((signal, value), $'$"true; leptos::prelude::SignalSet::set(&$0, $1);"') : bool) |> ignore
signal_set rw_signal¶
In [ ]:
instance signal_set rw_signal = signal_set'
signal_set write_signal¶
In [ ]:
instance signal_set write_signal = signal_set'
create_local_resource¶
In [ ]:
inl create_local_resource forall t u.
(source : () -> t)
(fetcher : t -> async.future_pin u)
: resource t u
=
// inl fetcher x = rust.move fun () =>
// fetcher x
// inl fetcher = join fetcher
// !\($'"leptos::create_local_resource(move || !source(), move |x| async move { !fetcher(x)().await })"')
// ---
// inl fn x = async.new_future fun () =>
// inl x' = fetcher x
// x' |> async.await
// !\\((source, fn), $'"leptos::create_local_resource(move || $0(), |x| async move { $1(x).await })"')
join
!\\(source, $'"let __create_local_resource = leptos::prelude::create_local_resource(move || $0(), |x| async move { //"')
inl x = !\($'"x"')
inl x' = fetcher x
inl x' = join x'
inl x' = x' |> async.await
inl closure_fix = 2u8, 1u8
x' |> rust.fix_closure closure_fix
!\($'"__create_local_resource"')
create_resource¶
In [ ]:
// inl create_resource forall t u. (source : () -> t) (fetcher : t -> async.future_pin u) : resource t u =
// inl source = join source
// !\\(fetcher, $'"leptos::create_resource(move || !source(), |x| async move { $0(x).await })"')
create_action¶
In [ ]:
inl create_action forall t u. (action_fn : t -> async.future_pin u) : action t u =
!\\(action_fn |> rust.box_pin, $'"leptos::prelude::Action::new(*std::sync::Arc::new(move |value: &std::sync::Arc<`t>| $0(value.clone())))"')
action_dispatch¶
In [ ]:
inl action_dispatch forall t u. (value : heap t) (action : action (heap t) u) : () =
(!\\((action, value), $'"true; leptos::prelude::Action::dispatch(&$0, $1.clone())"') : bool) |> ignore
action_input¶
In [ ]:
inl action_input forall t u. (action : action (heap t) u) : rw_signal (optionm'.option' t) =
!\\(action, $'"leptos::prelude::Action::input(&$0)"')
action_pending¶
In [ ]:
inl action_pending forall t u. (action : action (heap t) u) : read_signal bool =
!\\(action, $'"leptos::prelude::Action::pending(&$0)"')
action_value¶
In [ ]:
inl action_value forall t u. (action : action (heap t) u) : rw_signal (optionm'.option' u) =
!\\(action, $'"leptos::prelude::Action::value(&$0)"')
use_context¶
In [ ]:
inl use_context forall t. () : optionm'.option' t =
!\($'"leptos::context::use_context::<std::sync::Arc<`t>>()"')
resource_loading¶
In [ ]:
inl resource_loading forall t u. (resource : resource t u) : signal bool =
!\\(resource, $'$"leptos::prelude::loading(&$0)"')
resource_get¶
In [ ]:
inl resource_get forall t u. (resource : resource t u) : optionm'.option' u =
!\\(resource, $'$"leptos::prelude::SignalGet::get(&$0)"')
resource_with¶
In [ ]:
inl resource_with forall t u v. (resource : resource t u) (fn : optionm'.option' u -> v) : v =
!\\((resource, fn), $'$"leptos::prelude::SignalWith::with(&$0, |x| $1(x.clone()))"')
create_effect¶
In [ ]:
inl create_effect (fn : () -> ()) : () =
inl fn = fn |> rust.emit
(!\($'"true; leptos::prelude::Effect::new(move |_| { !fn(()) })"') : bool) |> ignore
create_effect'¶
In [ ]:
inl create_effect' forall t. (fn : optionm'.option' t -> t) : () =
(!\\(fn, $'"true; leptos::prelude::Effect::new(move |x| { $0(x) })"') : bool) |> ignore
interval_handle_clear¶
In [ ]:
inl interval_handle_clear (interval_handle : interval_handle) =
(!\\(interval_handle, $'$"true; leptos::leptos_dom::helpers::IntervalHandle::clear(&$0)"') : bool) |> ignore
set_interval_with_handle¶
In [ ]:
inl set_interval_with_handle
(fn : () -> ())
(interval_millis : date_time.duration)
: resultm.result' interval_handle wasm.js_value
=
!\\((fn, interval_millis), $'$"leptos::set_interval_with_handle(move || $0(), $1)"')
create_memo¶
In [ ]:
inl create_memo forall t. (fn : () -> t) : memo t =
inl fn = fn |> rust.emit
!\($'"leptos::prelude::Memo::new(move |_| { !fn(()) })"')
window¶
In [ ]:
let window () : wasm.window =
!\($'"leptos::leptos_dom::window()"')
bool_prop¶
In [ ]:
inl bool_prop (prop : string) (fn : () -> bool) : string =
inl fn = join fn
$'"" + !prop + "={move || !fn()}"'
concat_props¶
In [ ]:
inl concat_props props =
("", props)
||> listm.fold fun acc (x : string) =>
$'" " + !x + !acc + ""'
move_to_fragment¶
In [ ]:
inl move_to_fragment fn =
rust.move fn
|> closure_to_fragment
tag_raw¶
In [ ]:
inl tag_raw tag props children =
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::*;\n//\""
inl tag : string = tag
inl props = props |> concat_props
// inl children = children |> rust.move
inl children () =
children () |> rust.to_ref |> fragment_to_view'
inl children = join children
$'"<" + !tag + " " + !props + ">move || { !children() }</" + !tag + ">"'
tag_element¶
In [ ]:
inl tag_element tag props children : view' (html_element _) =
tag_raw tag props children
|> macro_to_element
tag_closed_raw¶
In [ ]:
inl tag_closed_raw tag props =
inl tag : string = tag
inl props = props |> concat_props
$'"<" + !tag + " " + !props + " />"'
tag_closed¶
In [ ]:
inl tag_closed tag props : view' (html_element _) =
tag_closed_raw tag props
|> macro_to_element
for¶
In [ ]:
inl for props : view =
tag_closed_raw "leptos::prelude::For" props
|> macro_to_view
for¶
In [ ]:
inl for forall t u (signal : * -> *).
(signal : signal (am'.vec t))
(key_fn : t -> u)
(children' : t -> fragment)
: view
=
inl signal = join signal
signal |> typecheck_signal
inl key_fn = join key_fn
inl children' = join children'
for [
$'"each=!signal"'
$'"key=move |x| !key_fn(x.to_owned())"'
$'"let:x"'
$'"children=move |x| !children'(x)"'
]
show¶
In [ ]:
inl show props : view =
tag_closed_raw "leptos::prelude::Show" props
|> macro_to_view
show¶
In [ ]:
inl show (when_fn : () -> bool) (fallback : () -> view) (children : () -> fragment) : view =
inl when_fn = join when_fn
inl when_fn = join when_fn
inl fallback = join fallback
inl children = join children
show [
$'"when=move || !when_fn()"'
$'"fallback=move || !fallback()"'
$'"children=std::rc::Rc::new(move || !children())"'
]
use_location¶
In [ ]:
inl use_location () : location =
!\($'"leptos_router::hooks::use_location()"')
use_navigate¶
In [ ]:
inl use_navigate () : string -> () =
inl navigate : threading.arc (rust.dyn' (rust.action_fn2 (rust.ref sm'.str) navigate_options)) =
!\($'"std::sync::Arc::new(leptos_router::hooks::use_navigate())"')
fun url =>
inl url = url |> sm'.as_str
!\\((navigate, url), $'"$0($1, Default::default())"')
location_hash¶
In [ ]:
inl location_hash (location : location) : memo sm'.std_string =
!\\(location, $'"$0.hash"')
location_pathname¶
In [ ]:
inl location_pathname (location : location) : memo sm'.std_string =
!\\(location, $'"$0.pathname"')
location_search¶
In [ ]:
inl location_search (location : location) : memo sm'.std_string =
!\\(location, $'"$0.search"')
url_try_from¶
In [ ]:
inl url_try_from (s : rust.ref sm'.str) : resultm.result' url sm'.std_string =
!\\(s, $'"leptos_router::location::Url::try_from($0)"')
url_pathname¶
In [ ]:
inl url_pathname (url : url) : sm'.std_string =
!\\(url, $'"$0.pathname"')
use_url¶
In [ ]:
inl use_url () =
inl location = use_location ()
create_memo fun () =>
inl url_pathname = location |> location_pathname |> signal_get |> sm'.from_std_string
inl url_search = location |> location_search |> signal_get |> sm'.from_std_string
inl url_search =
if url_search = ""
then ""
else $'$"?{!url_search}"'
url_pathname +. url_search
route¶
In [ ]:
inl route path view children : view' nested_route =
inl path = path |> sm'.to_std_string
inl path = join path
// inl view = view |> rust.move
inl view () =
view () |> fragment_to_view
inl view = join view
tag_closed_raw "leptos_router::components::ParentRoute" [
$'"path=leptos_router_macro::path\!(!path)"'
$'"view= move || !view()"'
$'"children=Box::new(move || !children())"'
]
|> macro_to_view'''
macro_to_view¶
In [ ]:
inl macro_to_view (macro : string) : view =
global "Fable.Core.RustInterop.emitRustExpr () \");\nuse leptos::prelude::ElementChild;\n//\""
!\($'"leptos::prelude::IntoAny::into_any(leptos::prelude::view\! { " + !macro + " })"')
router¶
In [ ]:
inl router children : view =
inl children : () -> fragment = join children
tag_closed_raw "leptos_router::components::Router" [
$'"children=Box::new(move || !children())"'
]
|> macro_to_view'
|> into_any_view
routes¶
In [ ]:
inl routes children : view =
inl children : () -> am'.vec (view' nested_route) = join children
inl children = join children
inl fallback = "leptos.routes / fallback" |> text_view
tag_closed_raw "leptos_router::components::Routes" [
$'"fallback=move || !fallback"'
$'"children=leptos::children::ToChildren::to_children(move || !children())"'
]
|> macro_to_view'
|> into_any_view
a'¶
In [ ]:
inl a' props children : _ (_ a') =
tag_element "a" props children
button¶
In [ ]:
inl button props children : _ (_ button) =
tag_element "button" props children
details¶
In [ ]:
inl details props children : _ (_ details) =
tag_element "details" props children
div¶
In [ ]:
inl div props children : _ (_ div) =
tag_element "div" props children
footer¶
In [ ]:
inl footer props children : _ (_ footer) =
tag_element "footer" props children
header¶
In [ ]:
inl header props children : _ (_ header) =
tag_element "header" props children
label¶
In [ ]:
inl label props children : _ (_ label) =
tag_element "label" props children
main¶
In [ ]:
inl main props children : _ (_ main) =
tag_element "main" props children
inl main' () = ()
nav¶
In [ ]:
inl nav props children : _ (_ nav) =
tag_element "nav" props children
option'¶
In [ ]:
inl option' props children : _ (_ option') =
tag_element "option" props children
option'¶
In [ ]:
inl option' selected children : _ (_ option') =
inl selected : () -> bool = join selected
option' [
$'"selected=!selected()"'
] fun () =>
children |> text_to_fragment
pre¶
In [ ]:
inl pre props children : _ (_ pre) =
tag_element "pre" props children
select¶
In [ ]:
inl select props children : _ (_ select) =
tag_element "select" props children
span¶
In [ ]:
inl span props children : _ (_ span) =
tag_element "span" props children
summary¶
In [ ]:
inl summary props children : _ (_ summary) =
tag_element "summary" props children
table¶
In [ ]:
inl table props children : _ (_ table) =
tag_element "table" props children
thead¶
In [ ]:
inl thead props children : _ (_ thead) =
tag_element "thead" props children
tbody¶
In [ ]:
inl tbody props children : _ (_ tbody) =
tag_element "tbody" props children
tr¶
In [ ]:
inl tr props children : _ (_ tr) =
tag_element "tr" props children
th¶
In [ ]:
inl th props children : _ (_ th) =
tag_element "th" props children
td¶
In [ ]:
inl td props children : _ (_ td) =
tag_element "td" props children
svg¶
In [ ]:
inl svg props children : _ (_ svg) =
tag_element "svg" props children
path¶
In [ ]:
inl path props : _ (_ path) =
tag_element "path" props (fun () => [] |> view_list_to_fragment)
circle¶
In [ ]:
inl circle props : _ (_ circle) =
tag_element "circle" props (fun () => [] |> view_list_to_fragment)
rect¶
In [ ]:
inl rect props children : _ (_ rect) =
tag_element "rect" props children
animate¶
In [ ]:
inl animate props : _ (_ animate) =
tag_element "animate" props (fun () => [] |> view_list_to_fragment)
input¶
In [ ]:
inl input props : _ (_ input) =
tag_closed "input" props
dd¶
In [ ]:
inl dd props children : _ (_ dd) =
tag_element "dd" props children
dl¶
In [ ]:
inl dl props children : _ (_ dl) =
tag_element "dl" props children
dt¶
In [ ]:
inl dt props children : _ (_ dt) =
tag_element "dt" props children