[{"name":"Webnative","comment":" Generic types across all ports, and general [webnative](https://github.com/fission-suite/webnative#readme) functions.\n\n\n# 🚀\n\n@docs init, InitOptions, initWithOptions, initialise, initialize\n\n\n# Authentication\n\n@docs isAuthenticated, State, AuthSucceededState, AuthCancelledState, ContinuationState\n\n\n# Authorisation\n\n@docs redirectToLobby, RedirectTo, AppPermissions, FileSystemPermissions, Permissions\n\n\n# Ports\n\nData passing through the ports.\n\n@docs decodeResponse, Artifact, Request, Response\n\n\n# Filesystem\n\n@docs loadFilesystem\n\n\n# Miscellaneous\n\n@docs contextToString, contextFromString, Context\n\n","unions":[{"name":"Artifact","comment":" Artifact we receive in the response.\n","args":[],"cases":[["NoArtifact",[]],["Initialisation",["Webnative.State"]],["Boolean",["Basics.Bool"]],["CID",["String.String"]],["DirectoryContent",["List.List Wnfs.Directory.Entry"]],["FileContent",["Bytes.Bytes"]],["Utf8Content",["String.String"]]]},{"name":"Context","comment":" Request, or response, context.\n","args":[],"cases":[["Webnative",[]],["Wnfs",[]]]},{"name":"RedirectTo","comment":" Where the authorisation lobby should redirect to after authorisation.\n","args":[],"cases":[["CurrentUrl",[]],["RedirectTo",["Url.Url"]]]},{"name":"State","comment":" Initialisation state, result from `init`.\n","args":[],"cases":[["NotAuthorised",[]],["AuthSucceeded",["Webnative.AuthSucceededState"]],["AuthCancelled",["Webnative.AuthCancelledState"]],["Continuation",["Webnative.ContinuationState"]]]}],"aliases":[{"name":"AppPermissions","comment":" Application permissions.\n","args":[],"type":"{ creator : String.String, name : String.String }"},{"name":"AuthCancelledState","comment":" State attributes when auth was cancelled.\n","args":[],"type":"{ cancellationReason : String.String, throughLobby : Basics.Bool }"},{"name":"AuthSucceededState","comment":" State attributes when auth has succeeded.\n","args":[],"type":"{ newUser : Basics.Bool, throughLobby : Basics.Bool, username : String.String }"},{"name":"ContinuationState","comment":" State attributes when continueing a session.\n","args":[],"type":"{ newUser : Basics.Bool, throughLobby : Basics.Bool, username : String.String }"},{"name":"FileSystemPermissions","comment":" Filesystem permissions.\n","args":[],"type":"{ privatePaths : List.List String.String, publicPaths : List.List String.String }"},{"name":"InitOptions","comment":" Options for `initWithOptions`.\n","args":[],"type":"{ autoRemoveUrlParams : Basics.Bool, loadFilesystem : Basics.Bool }"},{"name":"Permissions","comment":" Permissions to ask the user.\n","args":[],"type":"{ app : Maybe.Maybe Webnative.AppPermissions, fs : Maybe.Maybe Webnative.FileSystemPermissions }"},{"name":"Request","comment":" Request from webnative.\n","args":[],"type":"{ context : String.String, tag : String.String, method : String.String, arguments : List.List Json.Encode.Value }"},{"name":"Response","comment":" Response from webnative.\n","args":[],"type":"{ context : String.String, error : Maybe.Maybe String.String, tag : String.String, method : String.String, data : Json.Encode.Value }"}],"values":[{"name":"contextFromString","comment":" Derive a Context from a String.\n","type":"String.String -> Maybe.Maybe Webnative.Context"},{"name":"contextToString","comment":" Cast a Context to a String.\n","type":"Webnative.Context -> String.String"},{"name":"decodeResponse","comment":" Function to be used to decode the response from webnative we got through our port.\n\n    GotWebnativeResponse response ->\n        case Webnative.decodeResponse tagFromString response of\n            Ok ( Webnative, Initialise, Initialisation state ) ->\n                if Webnative.isAuthenticated state then\n                    loadUserData\n                else\n                    welcome\n\n            Ok ( Wnfs, ReadHelloTxt, Wnfs.Utf8Content helloContents ) ->\n                -- Do something with content from hello.txt\n\n            Ok ( Wnfs, Mutation, _ ) ->\n                ( model\n                , Ports.wnfsRequest Wnfs.publish\n                )\n\n            Err ( maybeContext, errString ) ->\n                -- Decoding, or tag parse, error.\n\nSee the [README](../) for the full example.\n\n","type":"(String.String -> Result.Result String.String tag) -> Webnative.Response -> Result.Result ( Maybe.Maybe Webnative.Context, String.String ) ( Webnative.Context, Maybe.Maybe tag, Webnative.Artifact )"},{"name":"init","comment":" Check if we're authenticated, process any lobby query-parameters present in the URL, and initiate the user's filesystem if authenticated (can be disabled using `initWithOptions`).\n\nSee `loadFileSystem` if you want to load the user's filesystem yourself.\nNOTE: Only works on the main/ui thread, as it uses `window.location`.\n\n","type":"Webnative.Permissions -> Webnative.Request"},{"name":"initWithOptions","comment":" Initialise webnative, with options.\n","type":"Webnative.InitOptions -> Webnative.Permissions -> Webnative.Request"},{"name":"initialise","comment":" Alias for `init`.\n","type":"Webnative.Permissions -> Webnative.Request"},{"name":"initialize","comment":" Alias for `init`.\n","type":"Webnative.Permissions -> Webnative.Request"},{"name":"isAuthenticated","comment":" Are we authenticated?\n","type":"Webnative.State -> Basics.Bool"},{"name":"loadFilesystem","comment":" Load in the filesystem manually.\n","type":"Webnative.Permissions -> Webnative.Request"},{"name":"redirectToLobby","comment":" Redirect to the authorisation lobby.\n","type":"Webnative.RedirectTo -> Webnative.Permissions -> Webnative.Request"}],"binops":[]},{"name":"Wnfs","comment":" Interact with your [filesystem](https://guide.fission.codes/developers/webnative#file-system).\n\n\n# Actions\n\n@docs publish\n\n\n## Mutations\n\n@docs mkdir, mv, rm, write, writeUtf8\n\n\n## Queries\n\n@docs exists, ls, read, readUtf8\n\n\n## Aliases\n\n@docs add, cat\n\n\n# Types\n\n@docs Base, Attributes\n\n","unions":[{"name":"Base","comment":" Base of the WNFS action.\n","args":[],"cases":[["AppData",["Webnative.AppPermissions"]],["Private",[]],["Public",[]]]}],"aliases":[{"name":"Attributes","comment":" WNFS action attributes.\n","args":[],"type":"{ path : List.List String.String, tag : String.String }"}],"values":[{"name":"add","comment":" Alias for `write`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Bytes.Bytes -> Webnative.Request"},{"name":"cat","comment":" Alias for `read`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Webnative.Request"},{"name":"exists","comment":" Check if something exists in the filesystem.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Webnative.Request"},{"name":"ls","comment":" List a directory.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Webnative.Request"},{"name":"mkdir","comment":" Create a directory.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Webnative.Request"},{"name":"mv","comment":" Move.\n","type":"Wnfs.Base -> { from : List.List String.String, to : List.List String.String, tag : String.String } -> Webnative.Request"},{"name":"publish","comment":" Publish your changes to your filesystem.\n**📢 You should run this after doing mutations.**\nSee [README](../) examples for more info.\n","type":"Webnative.Request"},{"name":"read","comment":" Read something from the filesystem in the form of `Bytes`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Webnative.Request"},{"name":"readUtf8","comment":" Read something from the filesystem in the form of a `String`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Webnative.Request"},{"name":"rm","comment":" Remove.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Webnative.Request"},{"name":"write","comment":" Write to the filesystem using `Bytes`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Bytes.Bytes -> Webnative.Request"},{"name":"writeUtf8","comment":" Write to the filesystem using a `String`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> String.String -> Webnative.Request"}],"binops":[]}]