Dala.Renderer (dala v0.0.11)

Copy Markdown View Source

Public API for rendering operations.

This module delegates to Dala.Ui.Renderer for rendering UI trees.

Summary

Functions

Get available colors from theme.

Encode patches to binary frame format for the native side.

Get text sizes from theme.

Functions

colors()

@spec colors() :: map()

Get available colors from theme.

encode_frame(patches)

@spec encode_frame([Dala.Diff.patch()]) :: binary()

Encode patches to binary frame format for the native side.

render(tree, platform, nif \\ Dala.Platform.Native, transition \\ :none)

@spec render(Dala.Node.t() | map(), atom(), term(), atom()) ::
  {:ok, :binary_tree} | {:error, term()}

Render a UI tree for the given platform.

render_fast(tree, platform, nif \\ Dala.Platform.Native, transition \\ :none)

@spec render_fast(Dala.Node.t() | map(), atom(), term(), atom()) ::
  {:ok, :binary_tree} | {:error, term()}

Fast render path for simple updates.

render_patches(old_tree, new_tree, platform, nif \\ Dala.Platform.Native, transition \\ :none)

@spec render_patches(
  Dala.Node.t() | map() | nil,
  Dala.Node.t() | map(),
  atom(),
  term(),
  atom()
) ::
  {:ok, [Dala.Diff.patch()]} | {:error, term()}

Compute patches between old and new trees.

text_sizes()

@spec text_sizes() :: map()

Get text sizes from theme.