-
Notifications
You must be signed in to change notification settings - Fork 7
/
docs.json
1 lines (1 loc) · 12.8 KB
/
docs.json
1
[{"name":"Webapp.Client","comment":" The README is better for getting an understanding and for getting started. In general\nwe'd just use the code generated by `elm-webapp` cli without the need to reference here.\n\n\n# Definition\n\n@docs Ports, Protocol, Program\n\n\n# Common Helpers\n\n@docs element, document, application\n\n","unions":[],"aliases":[{"name":"Ports","comment":" Hook up ports to use websockets for passing serverMsg and clientMsg\n\n`websocketConnected` port receives an Int for time now in milliseconds. Currently `Webapp.Client` does\nnot use this information for anything.\n\n`websocketIn` port receives the raw string from websocket `event.data` which will be parsed as a\n`Result x serverMsg` (see `sendToServer`)\n\n","args":["msg"],"type":"{ websocketConnected : (Basics.Int -> Webapp.Client.FrameworkMsg msg) -> Platform.Sub.Sub (Webapp.Client.FrameworkMsg msg), websocketIn : (String.String -> Webapp.Client.FrameworkMsg msg) -> Platform.Sub.Sub (Webapp.Client.FrameworkMsg msg) }"},{"name":"Program","comment":" Exported type to enable apps to write their type signature of `main`, e.g.\n\n main : Webapp.Client.Program Flags Model Msg\n main =\n webapp.element\n\n","args":["flags","model","msg"],"type":"Platform.Program flags model (Webapp.Client.FrameworkMsg msg)"},{"name":"Protocol","comment":" A set of required protocols.\n\n - `updateFromServer` is called when `serverMsg` is received, e.g. as response of `sendToServer`\n - `clientMsgEncoder` encodes outgoing `clientMsg`, e.g. via `sendToServer`\n - `serverMsgDecoder` decodes replies from Server\n - `errorDecoder` decodes error replies from Server\n\n","args":["serverMsg","clientMsg","model","msg","x"],"type":"{ updateFromServer : serverMsg -> model -> ( model, Platform.Cmd.Cmd msg ), clientMsgEncoder : clientMsg -> Json.Encode.Value, serverMsgDecoder : Json.Decode.Decoder serverMsg, errorDecoder : Json.Decode.Decoder x, httpEndpoint : String.String }"}],"values":[{"name":"application","comment":" Returns a `Browser.application` to use as `main` in your client app\nand a `sendToServer` function to send `clientMsg` with\n\n main =\n webapp.application\n\n","type":"{ application : { init : flags -> Url.Url -> Browser.Navigation.Key -> ( model, Platform.Cmd.Cmd msg ), view : model -> Browser.Document msg, update : msg -> model -> ( model, Platform.Cmd.Cmd msg ), subscriptions : model -> Platform.Sub.Sub msg, onUrlRequest : Browser.UrlRequest -> msg, onUrlChange : Url.Url -> msg }, ports : Webapp.Client.Ports msg, protocol : Webapp.Client.Protocol serverMsg clientMsg model msg x } -> { application : Platform.Program flags model (Webapp.Client.FrameworkMsg msg), sendToServer : clientMsg -> Platform.Task Http.Error (Result.Result x serverMsg) }"},{"name":"document","comment":" Returns a `Browser.document` to use as `main` in your client app\nand a `sendToServer` function to send `clientMsg` with\n\n main =\n webapp.document\n\n","type":"{ document : { init : flags -> ( model, Platform.Cmd.Cmd msg ), view : model -> Browser.Document msg, update : msg -> model -> ( model, Platform.Cmd.Cmd msg ), subscriptions : model -> Platform.Sub.Sub msg }, ports : Webapp.Client.Ports msg, protocol : Webapp.Client.Protocol serverMsg clientMsg model msg x } -> { document : Platform.Program flags model (Webapp.Client.FrameworkMsg msg), sendToServer : clientMsg -> Platform.Task Http.Error (Result.Result x serverMsg) }"},{"name":"element","comment":" Returns a `Browser.element` to use as `main` in your client app\nand a `sendToServer` function to send `clientMsg` with\n\n main =\n webapp.element\n\n","type":"{ element : { init : flags -> ( model, Platform.Cmd.Cmd msg ), view : model -> Html.Html msg, update : msg -> model -> ( model, Platform.Cmd.Cmd msg ), subscriptions : model -> Platform.Sub.Sub msg }, ports : Webapp.Client.Ports msg, protocol : Webapp.Client.Protocol serverMsg clientMsg model msg x } -> { element : Platform.Program flags model (Webapp.Client.FrameworkMsg msg), sendToServer : clientMsg -> Platform.Task Http.Error (Result.Result x serverMsg) }"}],"binops":[]},{"name":"Webapp.Server","comment":" The README is better for getting an understanding and for getting started. In general\nwe'd just use the code generated by `elm-webapp` cli without the need to reference here.\n\nHowever, the documentation for `Webapp.Server.HTTP` is useful esp for functions available\nto work with `Request` values.\n\n\n# Definition\n\n@docs PlatformWorker, Ports, Protocol, Program\n\n\n# Common Helpers\n\n@docs worker, writeResponse, writeWebsocketMessage\n\n","unions":[],"aliases":[{"name":"PlatformWorker","comment":" This is the input to create a [`Platform.worker`](https://package.elm-lang.org/packages/elm/core/latest/Platform#worker)\n","args":["flags","model","msg"],"type":"{ init : flags -> ( model, Platform.Cmd.Cmd msg ), update : msg -> model -> ( model, Platform.Cmd.Cmd msg ), subscriptions : model -> Platform.Sub.Sub msg }"},{"name":"Ports","comment":" A set of required ports\n\n - `writeResponse` is your function created with your port `onHttpResponse`\n\n port onHttpResponse : Json.Encode.Value -> Cmd msg\n\n writeResponse =\n Webapp.Server.writeResponse onHttpResponse\n\n\n\n - `onHttpRequest` is a port defined in your `Server.elm`\n\n port onHttpRequest : (Json.Encode.Value -> msg) -> Sub msg\n\n","args":["msg","x","serverMsg"],"type":"{ writeResponse : Webapp.Server.HTTP.Request -> Webapp.Server.HTTP.Response -> Platform.Cmd.Cmd (Webapp.Server.FrameworkMsg msg x serverMsg), onHttpRequest : (Json.Encode.Value -> Webapp.Server.FrameworkMsg msg x serverMsg) -> Platform.Sub.Sub (Webapp.Server.FrameworkMsg msg x serverMsg), onWebsocketEvent : (Json.Encode.Value -> Webapp.Server.FrameworkMsg msg x serverMsg) -> Platform.Sub.Sub (Webapp.Server.FrameworkMsg msg x serverMsg), writeWebsocketMessage : Webapp.Server.Websocket.Connection -> Webapp.Server.Websocket.Key -> String.String -> Platform.Cmd.Cmd (Webapp.Server.FrameworkMsg msg x serverMsg) }"},{"name":"Program","comment":" Exported type to enable apps to write their type signature of `main`, e.g.\n\n main : Webapp.Server.Program Flags ServerState RequestContext Msg Error MsgFromServer\n main =\n Webapp.Server.worker { ... }\n\n","args":["flags","model","header","msg","x","serverMsg"],"type":"Platform.Program flags (Webapp.Server.FrameworkModel model header) (Webapp.Server.FrameworkMsg msg x serverMsg)"},{"name":"Protocol","comment":" A set of required protocols.\n\n - `headerDecoder` decoded value will be made available to `updateFromRoute` and `updateFromClient`\n - `clientMsgDecoder` decodes the request body IF request was sent from Client `sendToServer`\n - `updateFromClient` is called if `clientMsgDecoder` succeeds\n - `serverMsgEncoder` encodes the response body for a successful `clientMsgDecoder`\n - `errorEncoder` encodes the response body for a failed `clientMsgDecoder`\n - `routeDecoder` decodes a `Url.Url`; if successful, `updateFromRoute` will be called\n - `updateFromRoute` is called as long as `headerDecoder` succeeds\n - otherwise Webapp.Server will respond with error 500\n\n","args":["msg","x","serverMsg","clientMsg","route","header","model"],"type":"{ headerDecoder : Time.Posix -> model -> Json.Decode.Decoder header, clientMsgDecoder : Json.Decode.Decoder clientMsg, updateFromClient : header -> Time.Posix -> clientMsg -> model -> ( model, Platform.Task x serverMsg ), serverMsgEncoder : serverMsg -> Json.Encode.Value, errorEncoder : x -> Json.Encode.Value, routeDecoder : Url.Url -> Maybe.Maybe route, httpEndpoint : String.String, updateFromRoute : ( Webapp.Server.HTTP.Method, header, Maybe.Maybe route ) -> Time.Posix -> Webapp.Server.HTTP.Request -> model -> ( model, Platform.Cmd.Cmd msg ) }"}],"values":[{"name":"worker","comment":" Returns a Webapp.Server program, capable of communicating with Webapp.Client program\n","type":"{ worker : Webapp.Server.PlatformWorker flags model msg, ports : Webapp.Server.Ports msg x serverMsg, protocol : Webapp.Server.Protocol msg x serverMsg clientMsg endpoint header model } -> Platform.Program flags (Webapp.Server.FrameworkModel model header) (Webapp.Server.FrameworkMsg msg x serverMsg)"},{"name":"writeResponse","comment":" Use this to wire up your port in your own `Server.elm`\n\n port onHttpResponse : Json.Encode.Value -> Cmd msg\n\n writeResponse =\n Webapp.Server.writeResponse onHttpResponse\n\n","type":"(Json.Encode.Value -> Platform.Cmd.Cmd msg) -> Webapp.Server.HTTP.Request -> Webapp.Server.HTTP.Response -> Platform.Cmd.Cmd msg"},{"name":"writeWebsocketMessage","comment":" Use this to wire up your port in your own `Server.elm` via websocket\n\n port writeWs : Json.Encode.Value -> Cmd msg\n\n writeWebsocketMessage =\n Webapp.Server.writeWebsocketMessage writeWs\n\n","type":"(Json.Encode.Value -> Platform.Cmd.Cmd msg) -> Webapp.Server.Websocket.Connection -> Webapp.Server.Websocket.Key -> String.String -> Platform.Cmd.Cmd msg"}],"binops":[]},{"name":"Webapp.Server.HTTP","comment":" Data types and their helper functions to work with HTTP handlers\n\n\n# Definition\n\n@docs Body, Headers, Method, Request, Response, StatusCode, Url\n\n\n# Common Helpers\n\n@docs bodyOf, headersOf, methodFromString, methodOf, methodString, pathOf, statusInt, urlOf\n\n","unions":[{"name":"Method","comment":" Custom type representing all http methods\n","args":[],"cases":[["GET",[]],["HEAD",[]],["POST",[]],["PUT",[]],["DELETE",[]],["CONNECT",[]],["OPTIONS",[]],["TRACE",[]],["PATCH",[]]]},{"name":"StatusCode","comment":" Custom type representing all http `StatusCode`\n","args":[],"cases":[["StatusContinue",[]],["StatusSwitchingProtocols",[]],["StatusProcessing",[]],["StatusEarlyHints",[]],["StatusOK",[]],["StatusCreated",[]],["StatusAccepted",[]],["StatusNonAuthoritativeInformation",[]],["StatusNoContent",[]],["StatusResetContent",[]],["StatusPartialContent",[]],["StatusMultiStatus",[]],["StatusAlreadyReported",[]],["StatusIMUsed",[]],["StatusMultipleChoices",[]],["StatusMovedPermanently",[]],["StatusFound",[]],["StatusSeeOther",[]],["StatusNotModified",[]],["StatusUseProxy",[]],["StatusTemporaryRedirect",[]],["StatusPermanentRedirect",[]],["StatusBadRequest",[]],["StatusUnauthorized",[]],["StatusPaymentRequired",[]],["StatusForbidden",[]],["StatusNotFound",[]],["StatusMethodNotAllowed",[]],["StatusNotAcceptable",[]],["StatusProxyAuthenticationRequired",[]],["StatusRequestTimeout",[]],["StatusConflict",[]],["StatusGone",[]],["StatusLengthRequired",[]],["StatusPreconditionFailed",[]],["StatusPayloadTooLarge",[]],["StatusURITooLong",[]],["StatusUnsupportedMediaType",[]],["StatusRangeNotSatisfiable",[]],["StatusExpectationFailed",[]],["StatusMisdirectedRequest",[]],["StatusUnprocessableEntity",[]],["StatusLocked",[]],["StatusFailedDependency",[]],["StatusTooEarly",[]],["StatusUpgradeRequired",[]],["StatusPreconditionRequired",[]],["StatusTooManyRequests",[]],["StatusRequestHeaderFieldsTooLarge",[]],["StatusUnavailableForLegalReasons",[]],["StatusInternalServerError",[]],["StatusNotImplemented",[]],["StatusBadGateway",[]],["StatusServiceUnavailable",[]],["StatusGatewayTimeout",[]],["StatusHTTPVersionNotSupported",[]],["StatusVariantAlsoNegotiates",[]],["StatusInsufficientStorage",[]],["StatusLoopDetected",[]],["StatusNotExtended",[]],["StatusNetworkAuthenticationRequired",[]]]}],"aliases":[{"name":"Body","comment":" Alias for String\n","args":[],"type":"String.String"},{"name":"Headers","comment":" Alias for opaque Json.Encode.Value\n","args":[],"type":"Json.Decode.Value"},{"name":"Request","comment":" Alias for opaque Json.Encode.Value\n","args":[],"type":"Json.Decode.Value"},{"name":"Response","comment":" ","args":[],"type":"{ statusCode : Webapp.Server.HTTP.StatusCode, headers : List.List ( String.String, Json.Encode.Value ), body : String.String }"},{"name":"Url","comment":" Alias for String\n","args":[],"type":"String.String"}],"values":[{"name":"bodyOf","comment":" Returns request body from `Request`\n","type":"Webapp.Server.HTTP.Request -> String.String"},{"name":"headersOf","comment":" Returns request headers from `Request`\n","type":"Webapp.Server.HTTP.Request -> Webapp.Server.HTTP.Headers"},{"name":"methodFromString","comment":" Parse a String and return as http `Method`\n","type":"String.String -> Webapp.Server.HTTP.Method"},{"name":"methodOf","comment":" Returns http `method` from `Request`\n","type":"Webapp.Server.HTTP.Request -> Webapp.Server.HTTP.Method"},{"name":"methodString","comment":" Returns http `Method` as String\n","type":"Webapp.Server.HTTP.Method -> String.String"},{"name":"pathOf","comment":" Returns request path from `Request`\n","type":"Webapp.Server.HTTP.Request -> String.String"},{"name":"statusInt","comment":" Returns http StatusCode as integer\n","type":"Webapp.Server.HTTP.StatusCode -> Basics.Int"},{"name":"urlOf","comment":" Returns `url` from `Request`\n","type":"Webapp.Server.HTTP.Request -> String.String"}],"binops":[]}]