[{"name":"Zip","comment":" Work with [Zip archives](https://en.wikipedia.org/wiki/ZIP_file_format).\n\n@docs Zip\n\n\n# Reading\n\n@docs fromBytes\n\n\n# Accessing Content\n\nOnce you have a `Zip`, you can use it to access its files and directories.\n\nUse the [Zip.Entry module](./Zip-Entry#Entry) to do read their content and metadata.\n\n@docs ls\n@docs byPath\n\n","unions":[{"name":"Zip","comment":" Represents a Zip archive.\n\nAn archive is comprised of [entries](./Zip-Entry#Entry) which represent (optionally) compressed files and directories.\n\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"byPath","comment":" Get an [entry](./Zip-Entry#Entry) by its absolute path.\n\n    Zip.byPath \"versions/v1.txt\"\n\n`Nothing` is returned if no entry matches the path exactly.\n\nDirectory entries are typically stored in the archive with a slash at the end:\n\n    Zip.byPath \"versions\" == Nothing\n\n    Zip.byPath \"versions/\" == Just Entry\n\n","type":"String.String -> Zip.Zip -> Maybe.Maybe Internal.Format.Entry"},{"name":"fromBytes","comment":" Read a `Zip` from `Bytes`.\n\nIf you have [an uploaded File](https://package.elm-lang.org/packages/elm/file/latest/File) of an archive, you can use [`File.toBytes`](https://package.elm-lang.org/packages/elm/file/latest/File#toBytes) to read it:\n\n    import File exposing (File)\n    import Task exposing (Task)\n    import Zip exposing (Zip)\n\n    type Msg\n        = GotZip (Maybe Zip)\n\n    readArchive : File -> Cmd Msg\n    readArchive file =\n        file\n            |> File.toBytes\n            |> Task.map Zip.fromBytes\n            |> Task.perform GotZip\n\nYou can also get `Bytes` from anywhere like [an HTTP request](https://package.elm-lang.org/packages/elm/http/latest/Http#expectBytes),\nor even from [within another archive](./Zip-Entry#toBytes).\n\n","type":"Bytes.Bytes -> Maybe.Maybe Zip.Zip"},{"name":"ls","comment":" List all [entries](./Zip-Entry#Entry) in the archive.\n\n    allEntries =\n        Zip.ls zip\n\nFiles and directories get their own entries and they are not stored in a tree format.\n\nIf you only care about one of them, you can use the [`Zip.Entry.isDirectory`](./Zip-Entry#isDirectory) function to filter them:\n\n    allFiles =\n        List.filter (not << Entry.isDirectory) zip\n\n","type":"Zip.Zip -> List.List Internal.Format.Entry"}],"binops":[]},{"name":"Zip.Entry","comment":" Work with files and directories in the archive.\n\n@docs Entry\n\n\n# Extract Content\n\n@docs toString\n@docs toBytes\n@docs ExtractError\n\n\n# Read Metadata\n\n@docs path\n@docs extractedSize\n@docs compressedSize\n@docs lastModified\n@docs isDirectory\n@docs comment\n@docs checksum\n\n\n# Other Compression Methods\n\nThis library uses the [`folkertdev/elm-flate`](https://package.elm-lang.org/packages/folkertdev/elm-flate/latest) package to support\n[Deflate](https://en.wikipedia.org/wiki/Deflate) compression. Most archives you'll find in the wild will use this method.\n\nIf you're expecting to work with archives using other methods, you can use the following function to handle them.\n\n@docs extractWith\n\n","unions":[{"name":"ExtractError","comment":" Extracting content from an entry might fail if:\n\n1.  The data is compressed through an unsupported method. See [extractWith](#extractWith) for more information.\n2.  The extracted data does not match the integrity checksum.\n3.  The entry has no data of the expected type.\n4.  The [DEFLATE](https://en.wikipedia.org/wiki/Deflate) data is corrupted.\n\n","args":[],"cases":[["UnsupportedCompression",["Basics.Int"]],["IntegrityError",[]],["DecodeError",[]],["InflateError",[]]]}],"aliases":[{"name":"Entry","comment":" Represents a file or a directory in a [`Zip`](./Zip) archive.\n\nYou can use this to [extract the content](#extract-content) and [read the metadata](#read-metadata).\n\nCheck out [Entry.path](#path) to learn more about the way these entries are stored.\n\n","args":[],"type":"Internal.Format.Entry"}],"values":[{"name":"checksum","comment":" Get the [CRC32 checksum](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) of an entry's uncompressed data.\n\nYou do not need to confirm the integrity of data manually. The extract content functions perform this check automatically for you.\n\nHowever, you might still find this checksum useful for other purposes, like quickly determining whether two files are identical.\n\n","type":"Zip.Entry.Entry -> Basics.Int"},{"name":"comment","comment":" Get the comment of an entry.\n\nDid you know files can have comments? I didn't.\n\n","type":"Zip.Entry.Entry -> String.String"},{"name":"compressedSize","comment":" Get the compressed size of an entry as stored in the archive.\n","type":"Zip.Entry.Entry -> Basics.Int"},{"name":"extractWith","comment":" Extract archives with other compression methods.\n\n    handleCompression { method, rawBytes } =\n        case method of\n            6 ->\n                -- Use raw bytes to extract the data.\n                decodeImplode rawBytes\n\n            _ ->\n                -- We don't know how to handle other methods.\n                Nothing\n\n    extracted =\n        entry |> extractWith handleCompression\n\nNote: This callback is only called if the method is not 0 (Stored) nor 8 (Deflated). You do not need to handle these yourself.\n\nYou can read more about compression methods and their corresponding numbers in section 4.4.5 of the [specification](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT).\n\n","type":"({ method : Basics.Int, rawBytes : Bytes.Bytes } -> Maybe.Maybe Bytes.Bytes) -> Zip.Entry.Entry -> Result.Result Zip.Entry.ExtractError Bytes.Bytes"},{"name":"extractedSize","comment":" Get the uncompressed size of an entry.\n\nThis is the number of bytes that you will get if you extract this entry.\n\n","type":"Zip.Entry.Entry -> Basics.Int"},{"name":"isDirectory","comment":" Determine whether an entry is a directory.\n","type":"Zip.Entry.Entry -> Basics.Bool"},{"name":"lastModified","comment":" Get the last time an entry was modified.\n\nZip time stamps are relative to the time zone they were created in.\n\nUnfortunately, this information is not stored anywhere, making them only meaningful if you know it.\n\n","type":"Time.Zone -> Zip.Entry.Entry -> Time.Posix"},{"name":"path","comment":" Get the absolute path of an entry.\n\n    path dir == \"versions/\"\n\n    path v1 == \"versions/v1\"\n\n    path v2 == \"versions/v2\"\n\nEven though Zip archives are aware of directories, they do not store entries in a tree format.\nInstead, each entry simply indicates its absolute path in the archive.\n\nDifferent applications have different needs and they may or may not care about the tree structure.\n\nSome applications might expect a certain structure and can simply use [`Zip.byPath`](./Zip#byName) to get the\nrelevant entries.\n\nOther applications might want to explore the archive, and can use [`Zip.ls`](./Zip#ls) to get a list of the entries and go from there.\n\n","type":"Zip.Entry.Entry -> String.String"},{"name":"toBytes","comment":" Extract the content of an `Entry` as `Bytes`.\n\nBytes can represent an image, a PDF, a ZIP within a ZIP, anything you can imagine.\n\nExamples of what you can do with `Bytes`:\n\n  - Use [`File.Download.bytes`](https://package.elm-lang.org/packages/elm/file/latest/File-Download#bytes) to download them as a file.\n  - Use [`Http.bytesBody`](https://package.elm-lang.org/packages/elm/http/latest/Http#bytesBody) to send them to an HTTP server.\n  - Use the [`elm/bytes`](https://package.elm-lang.org/packages/elm/bytes/latest) package to decode these bytes into any data structure.\n\n","type":"Zip.Entry.Entry -> Result.Result Zip.Entry.ExtractError Bytes.Bytes"},{"name":"toString","comment":" Extract the content of an `Entry` as a `String`.\n","type":"Zip.Entry.Entry -> Result.Result Zip.Entry.ExtractError String.String"}],"binops":[]}]