Add documentation

4-compiler-bug
Bram 2024-05-17 18:00:33 +02:00
parent 2e8185841a
commit e49a0e3dc3
3 changed files with 24 additions and 2 deletions

View File

@ -1,4 +1,4 @@
module Internal.Api.Api exposing (..)
module Internal.Api.Api exposing (TaskChain, request)
{-|
@ -7,6 +7,11 @@ module Internal.Api.Api exposing (..)
The API module is a front-end for implementing API endpoints according to spec.
This module is imported by various API endpoint implementations to keep the
implementation simple and understandable.
@docs TaskChain, request
-}
import Internal.Api.Chain as C
@ -23,6 +28,8 @@ type alias TaskChain ph1 ph2 =
C.TaskChain R.Error V.VaultUpdate { ph1 | baseUrl : () } { ph2 | baseUrl : () }
{-| Make an HTTP request that adheres to the Matrix spec rules.
-}
request :
{ attributes : List (R.Attribute { ph1 | baseUrl : () })
, coder : Json.Coder V.VaultUpdate

View File

@ -500,6 +500,8 @@ queryString key value _ =
QueryParam <| UrlBuilder.string key value
{-| Configure the HTTP request to time out after a given expiry time.
-}
timeout : Float -> Attribute a
timeout f _ =
Timeout f

View File

@ -1,4 +1,17 @@
module Internal.Api.Task exposing (..)
module Internal.Api.Task exposing (Task, run)
{-| # Task module
This module is used to define how API calls are made. These completed API tasks
can be directly converted to Cmd types that the end user of the SDK can access.
These tasks do not affect the `Vault` directly, but instead, return a
`VaultUpdate` type that the user can apply to keep their `Vault` type
up-to-date.
## Use
@docs Task, run
-}
import Internal.Api.Chain as C
import Internal.Api.Request as Request