crater

Version:
sha256:07af0c5
component
importstypes
exportsincremental,renderer,yoga

types interface

flex-direction:enum {
row
row-reverse
column
column-reverse
}
flex-wrap:enum {
no-wrap
wrap
wrap-reverse
}
justify-content:enum {
flex-start
flex-end
center
space-between
space-around
space-evenly
}
align-items:enum {
flex-start
flex-end
center
stretch
baseline
}
display:enum {
flex
none
block
grid
}

renderer interface

render-html(html:string, width:u32, height:u32)string
render-html-to-json(html:string, width:u32, height:u32)string
render-html-to-paint-tree(html:string, width:u32, height:u32)string

incremental interface

create-tree(html:string, width:u32, height:u32)u32
compute-incremental()string
compute-full()string
mark-dirty(node-id:string)bool
update-style(node-id:string, css:string)bool
resize-viewport(width:u32, height:u32)
get-cache-stats()string
reset-cache-stats()
needs-layout()bool
destroy-tree()

yoga interface

Imported Types
mizchi:crater/types.{flex-direction}
mizchi:crater/types.{flex-wrap}
mizchi:crater/types.{justify-content}
mizchi:crater/types.{align-items}
mizchi:crater/types.{display}
create-node(id:string)u32
add-child(parent-id:string, child-id:string)bool
insert-child(parent-id:string, child-id:string, index:u32)bool
remove-child(parent-id:string, index:u32)bool
get-child-count(node-id:string)u32
set-width(node-id:string, value:f64)bool
set-width-percent(node-id:string, value:f64)bool
set-width-auto(node-id:string)bool
set-height(node-id:string, value:f64)bool
set-height-percent(node-id:string, value:f64)bool
set-height-auto(node-id:string)bool
set-flex-grow(node-id:string, value:f64)bool
set-flex-shrink(node-id:string, value:f64)bool
set-flex-basis(node-id:string, value:f64)bool
set-flex-direction(node-id:string, value:flex-direction)bool
set-flex-wrap(node-id:string, value:flex-wrap)bool
set-justify-content(node-id:string, value:justify-content)bool
set-align-items(node-id:string, value:align-items)bool
set-display(node-id:string, value:display)bool
set-margin(node-id:string, value:f64)bool
set-padding(node-id:string, value:f64)bool
set-gap(node-id:string, value:f64)bool
get-computed-left(node-id:string)f64
get-computed-top(node-id:string)f64
get-computed-width(node-id:string)f64
get-computed-height(node-id:string)f64
has-new-layout(node-id:string)bool
mark-layout-seen(node-id:string)bool
calculate-layout(width:f64, height:f64)string