Pebble.Companion.Contract
Shared data contracts for the Pebble companion bridge.
These records describe the JSON envelopes exchanged between Elm and the JavaScript bridge.
Envelopes
Type Aliases
CommandEnvelope
type alias CommandEnvelope = { id : String
, api : String
, op : String
, payload : Encode.Value
}Structured command envelope sent from Elm to the JS companion bridge.
ResultEnvelope
type alias ResultEnvelope = { id : String
, ok : Bool
, payload : Maybe Decode.Value
, error : Maybe BridgeError
}Structured result envelope sent from JS companion bridge back to Elm.
BridgeError
type alias BridgeError = { type_ : String
, message : String
, retryable : Maybe Bool
}Structured bridge errors instead of plain string errors.
BridgeEvent
type alias BridgeEvent = { event : String
, payload : Decode.Value
}Pushed event envelope from JS companion bridge to Elm.