touch_grass/harness/browser

The harness describes all the effects available in an execution environment. This is similar to the Hardware Abstraction Layer (HAL) from the rust ecosystem. Or platforms in from Roc ecosystem.

The touch grass library consists of modules that specify individual interfaces to the platform. For example Log, with definitions for types and casting values.

The browser workspace/environment is a collection of all effects available in the browser platform. The browser workspace can look very similar to the cli workspace, but might have a different implementation.

The harness specification is not shared with the cli specification because there are a few differences in effects available. Consistency accross platforms is managed by resusing touch_grass interfaces

Types

pub type Effect {
  Abort(String)
  Alert(String)
  Copy(String)
  DecodeJson(BitArray)
  Download(download.Input)
  Fetch(request.Request(BitArray))
  Flip
  Now
  Paste
  Print(String)
  Prompt(String)
  Random(Int)
  Visit(uri.Uri)
  Spotless(
    service: Service,
    operation: operation.Operation(BitArray),
  )
}

Constructors

pub type Service {
  DNSimple
  GitHub
  Vimeo
}

Constructors

  • DNSimple
  • GitHub
  • Vimeo

Values

pub fn effect_label(service: Service) -> String
pub fn effects() -> List(interface.Interface(Effect, a))
Search Document