Module

Web.DownloadJs

Package
purescript-downloadjs
Repository
chekoopa/purescript-downloadjs

#download Source

download :: forall a. Downloadable a => a -> Filename -> MimeType -> Effect Boolean

Sets provided payload to be downloaded by browser, using the particular filename and MIME type.

Example: download "hello world" "hello.txt" "text/plain"

#Downloadable Source

class Downloadable a  where

A class to represent types which can be downloaded using this library.

You can extend it, adding an instance for your type and casting it to either String (possibly, with data URL), Blob, ArrayBuffer or a typed array. However, you'll have to use unsafeToForeign to finally cast your value. Hope we'll fix that.

Members

Instances

#Filename Source

#MimeType Source