[{"name":"Matrix","comment":"\n\n\n# Matrix SDK\n\nThis first version forms a mere basis from which we will create iterative builds\nthat slowly improve the codebase.\n\nIt is generally quite unusual to regularly publish iterative beta versions on\nthe public registry, but it is also generally quite unusual to exclusively\nsupport a monolithic public registry. (:\n\n\n## Vault\n\n@docs Vault\n\n","unions":[],"aliases":[{"name":"Vault","comment":" The Vault type stores all relevant information about the Matrix API.\n\nIt currently supports no functionality and it will just stay here - for fun.\n\n","args":[],"type":"Types.Vault"}],"values":[],"binops":[]},{"name":"Matrix.Event","comment":"\n\n\n# Matrix Events\n\nThis module contains all the functions necessary to view and manipulate Matrix\nevents.\n\n\n## Event\n\n@docs Event, content, eventType, stateKey\n\n\n## Metadata\n\n@docs eventId, roomId, sender, originServerTs\n\n\n## Optional data\n\nOccasionally, the Event might bring some extra information. Given how this\ninformation isn't always applicable, it doesn't always exist.\n\n@docs previousContent, redactedBecause\n\n","unions":[],"aliases":[{"name":"Event","comment":" In Matrix, the primary form of communication is to send JSON values to one\nanother. These JSON values, together with their metadata, are bundled into Event\ntypes. They contain information like:\n\n  - Who sent the JSON value\n  - How they intend you to decode it\n  - When they sent it\n  - In what room they sent it\n\n","args":[],"type":"Types.Event"}],"values":[{"name":"content","comment":" Receive the body of an Event, as created by the user that sent it.\n","type":"Matrix.Event.Event -> Json.Encode.Value"},{"name":"eventId","comment":" Determine the globally unique identifier for an event.\n","type":"Matrix.Event.Event -> String.String"},{"name":"eventType","comment":" To give a hint what the event's [content](#content) might look like, users\ncan use this eventType value to hint at how the JSON might be decoded.\n\nStandard examples of event types are `m.room.message`, `m.room.member` and\n`me.noordstar.game.chess.move`.\n\n","type":"Matrix.Event.Event -> String.String"},{"name":"originServerTs","comment":" Determine the timestamp of at what time the event was originally received by\nthe original homeserver.\n\nGenerally, this timestamp offers a relatively accurate indicator of when a\nmessage was sent. However, this number isn't completely reliable! The timestamp\ncan be far in the past due to long network lag, and a (malicious) homeserver can\nspoof this number to make it seem like something was sent ridiculously far in\nthe past - or even in the future.\n\n","type":"Matrix.Event.Event -> Time.Posix"},{"name":"previousContent","comment":" Determine the previous `content` value for this event. This field is only a\n`Just value` if the event is a state event, and the Matrix Vault has permission\nto see the previous content.\n","type":"Matrix.Event.Event -> Maybe.Maybe Json.Encode.Value"},{"name":"redactedBecause","comment":" If the event has been redacted, the homeserver can display the event that\nredacted it here.\n","type":"Matrix.Event.Event -> Maybe.Maybe Matrix.Event.Event"},{"name":"roomId","comment":" Unique id assigned to the Matrix room. You can use this room id to reference\nor look up rooms.\n","type":"Matrix.Event.Event -> String.String"},{"name":"sender","comment":" Determine the fully-qualified ID of the user who sent an event.\n","type":"Matrix.Event.Event -> Types.User"},{"name":"stateKey","comment":" Determine an event's state key.\n\nIt is present if, and only if, the event is a _state_ event. The key makes the\npiece of state unique in the room. Note that it is often `Just \"\"`. If it is not\npresent, its value is `Nothing`.\n\nState keys starting with an `@` are reserved for referencing user IDs, such as\nroom members. With the exception of a few events, state events set with a given\nuser'd ID as the state key can only be set by that user.\n\n","type":"Matrix.Event.Event -> Maybe.Maybe String.String"}],"binops":[]},{"name":"Matrix.Room","comment":"\n\n\n# Room\n\nWhat is usually called a chat, a channel, a conversation or a group chat on\nother platforms, the term used in Matrix is a \"room\". A room is a conversation\nwhere a group of users talk to each other.\n\n@docs Room, mostRecentEvents\n\nThis module exposes various functions that help you inspect various aspects of\na room.\n\n\n## Account data\n\nAccount data is personal information that the user stores about this Matrix\nroom. This may include information like:\n\n  - What type of room this is\n  - A list of members in the room to ignore\n  - A list of currently ongoing chess matches in the room\n  - Personal notes the user may be taking\n\nYou may consider the account data as a `Dict String Json.Value` type. Account\ndata is linked to the user account: other logged in devices can see the account\ndata too, as the server synchronizes it, but the server shouldn´t show it to\nother users.\n\n@docs getAccountData\n\n","unions":[],"aliases":[{"name":"Room","comment":" The Matrix Room type representing a room that the Matrix user has joined.\n","args":[],"type":"Types.Room"}],"values":[{"name":"getAccountData","comment":" Get a piece of account data linked to a certain string key.\n","type":"String.String -> Matrix.Room.Room -> Maybe.Maybe Json.Encode.Value"},{"name":"mostRecentEvents","comment":" Get a list of the most recent events sent in the room.\n","type":"Matrix.Room.Room -> List.List Types.Event"}],"binops":[]},{"name":"Matrix.Settings","comment":" The Matrix Vault has lots of configurable variables that you rarely want to\ninteract with. Usually, you configure these variables only when creating a new\nVault, or when a user explicitly changes one of their preferred settings.\n\n\n## Device name\n\nThe default device name that is being communicated with the Matrix API.\n\nThis is mostly useful for users who are logged in with multiple sessions. They\nwill see device names like \"Element for Android\" or \"Element on iOS\". For the\nElm SDK, they will by default see the Elm SDK with its version included. If you\nare writing a custom client, however, you are free to change this to something\nmore meaningful to the user.\n\n@docs getDeviceName, setDeviceName\n\n\n## Sync time\n\nWhenever the Matrix API has nothing new to report, the Elm SDK is kept on\nhold until something new happens. The `syncTime` indicates a timeout to how long\nthe Elm SDK tolerates being held on hold.\n\n  - ↗️ A high value is good because it significantly reduces traffic between the\n    user and the homeserver.\n  - ↘️ A low value is good because it reduces the risk of\n    the connection ending abruptly or unexpectedly.\n\nNowadays, most libraries use 30 seconds as the standard, as does the Elm SDK.\nThe value is in miliseconds, so it is set at 30,000.\n\n@docs getSyncTime, setSyncTime\n\n","unions":[],"aliases":[],"values":[{"name":"getDeviceName","comment":" Determine the device name.\n","type":"Types.Vault -> String.String"},{"name":"getSyncTime","comment":" Determine the sync timeout value.\n","type":"Types.Vault -> Basics.Int"},{"name":"setDeviceName","comment":" Override the device name.\n","type":"String.String -> Types.Vault -> Types.Vault"},{"name":"setSyncTime","comment":" Override the sync timeout value.\n","type":"Basics.Int -> Types.Vault -> Types.Vault"}],"binops":[]},{"name":"Matrix.User","comment":" Matrix users are identified by their unique ID. In the Matrix API, this is a\nstring that looks as follows:\n\n    @alice:example.org\n     \\---/ \\---------/\n       |        |\n       |        |\n    localpart  domain\n\nSince it is very easy to abuse Matrix user IDs to sneak in arbitrary values,\nthe Elm SDK parses them and makes sure they are safe. As a result, you might\nneed this module to get the right information from a user!\n\n\n## User\n\n@docs User, toString\n\n\n## Info\n\nSometimes, you are more interested in the username itself. These functions can\nhelp you decipher, disambiguate and categorize users based on their username.\n\n@docs localpart, domain\n\n\n## Manipulate\n\n@docs get\n\n","unions":[],"aliases":[{"name":"User","comment":" The User type represents a Matrix user.\n\nIt contains information like:\n\n  - Their username on Matrix\n  - The server that hosts their account\n  - Access tokens needed to talk to the server\n\nIt does **NOT** contain information like:\n\n  - Their nickname\n  - Their profile picture\n  - Your private room with them\n\nYou can get all that information by looking it up in the [Vault](Matrix#Vault).\n\n**Note:** Please do not store this user type as a variable in your model! You\nshould always maintain a single source of truth in Elm, and the User type\ncontains various credentials and API tokens that might expire if you don't\nupdate them from the Vault.\n\nIf you need to remember specific users, you can best compare their identifying\nstring using [toString](Matrix-User#toString) or you can use\n[get](Matrix-User#get) with the Vault to get the user type.\n\n","args":[],"type":"Types.User"}],"values":[{"name":"domain","comment":" The domain is the name of the server that the user connects to. Server names\nare case-sensitive, so if the strings are equal, the users are on the same\nserver!\n\nAs a result, you can use the user domain for:\n\n  - When multiple users in a room have the same localpart on different servers\n  - Finding other users from a potentially malicious homeserver\n  - Counting homeservers in a room\n\nSee the following examples:\n\n    domain (get vault \"@alice:example.org\") -- \"example.org\"\n\n    domain (get vault \"@bob:127.0.0.1\") -- \"127.0.0.1\"\n\n    domain (get vault \"@charlie:[2001:db8::]\") -- \"[2001:db8::]\"\n\n","type":"Matrix.User.User -> String.String"},{"name":"get","comment":" Get a specific user by their unique identifier.\n\nThe Vault is needed as an input because the `User` type also stores various\ncredentials needed to talk to the Matrix API.\n\n    get vault \"@alice:example.org\" -- Just (User \"alice\" \"example.org\")\n\n    get vault \"@bob:127.0.0.1\" -- Just (User \"bob\" \"127.0.0.1\")\n\n    get vault \"@charlie:[2001:db8::]\" -- Just (User \"charlie\" \"2001:db8::\")\n\n    get vault \"@evil:#mp#ss#bl#.c#m\" -- Nothing\n\n    get vault \"\" -- Nothing\n\n","type":"Types.Vault -> String.String -> Maybe.Maybe Matrix.User.User"},{"name":"localpart","comment":" The localpart is the user's unique username. Every homeserver has their own\nusername registry, so you might occasionally find distinct users with the same\nlocalpart.\n\nThe localpart is often used as a user's name in a room if they haven't set up\na custom name.\n\nSee the following examples:\n\n    localpart (get vault \"@alice:example.org\") -- \"alice\"\n\n    localpart (get vault \"@bob:127.0.0.1\") -- \"bob\"\n\n    localpart (get vault \"@charlie:[2001:db8::]\") -- \"charlie\"\n\n","type":"Matrix.User.User -> String.String"},{"name":"toString","comment":" Get the uniquely identifying string for this user. Since the strings are\ncase-sensitive, you can run a simple string comparison to compare usernames.\n","type":"Matrix.User.User -> String.String"}],"binops":[]}]