dashboard/src/Port.elm

63 lines
1.2 KiB
Elm
Raw Normal View History

2020-11-23 14:27:33 +03:00
port module Port exposing (..)
2020-11-26 21:47:37 +03:00
import Blueprints.Model exposing (Blueprint)
2020-11-23 14:27:33 +03:00
import Dict exposing (Dict)
import Json.Encode exposing (Value)
2020-12-01 14:03:25 +03:00
import Modules.Model exposing (Module)
2020-11-26 21:47:37 +03:00
import Nodes.Model exposing (Identify)
2020-12-01 17:47:52 +03:00
import Service.Model exposing (Service)
2020-11-23 14:27:33 +03:00
2021-06-17 23:16:17 +03:00
type alias CollectPeerInfo =
{ peerId : String
, identify : Maybe Identify
, services : Maybe (List Service)
, modules : Maybe (List Module)
, blueprints : Maybe (List Blueprint)
}
port collectPeerInfo : (CollectPeerInfo -> msg) -> Sub msg
type alias FunctionSignature =
{ arguments : List String
, name : String
, output_types : List String
}
type alias RecordType =
{ fields : List String
, id : Int
, name : String
}
type alias ServiceInterface =
{ function_signatures : List FunctionSignature
, record_types : List RecordType
}
type alias CollectServiceInterface =
{ blueprint_id : String
, service_id : String
, interface : ServiceInterface
}
2020-11-23 14:27:33 +03:00
2021-06-17 23:16:17 +03:00
port collectServiceInterface : (CollectServiceInterface -> msg) -> Sub msg
2020-11-23 15:44:45 +03:00
port relayChanged : (String -> msg) -> Sub msg
type alias GetAll =
{ relayPeerId : String
, knownPeers : List String
}
port getAll : GetAll -> Cmd msg