gossamer/file

Types

pub type File
pub type FileOption {
  Type(String)
  LastModified(Int)
}

Constructors

  • Type(String)
  • LastModified(Int)

Values

pub fn array_buffer(
  of file: File,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))
pub fn bytes(
  of file: File,
) -> promise.Promise(Result(uint8_array.Uint8Array, String))
pub fn from_blob(blob: blob.Blob, named name: String) -> File
pub fn from_blob_with(
  blob: blob.Blob,
  named name: String,
  with options: List(FileOption),
) -> File
pub fn from_strings(
  parts: List(String),
  named name: String,
) -> File
pub fn from_strings_with(
  parts: List(String),
  named name: String,
  with options: List(FileOption),
) -> File
pub fn last_modified(of file: File) -> Int
pub fn name(of file: File) -> String
pub fn size(of file: File) -> Int
pub fn slice(
  file: File,
  from start: Int,
  to end: Int,
) -> blob.Blob
pub fn slice_with_type(
  file: File,
  from start: Int,
  to end: Int,
  content_type content_type: String,
) -> blob.Blob
pub fn text(
  of file: File,
) -> promise.Promise(Result(String, String))
pub fn to_blob(file: File) -> blob.Blob
pub fn type_(of file: File) -> String
Search Document