Class ZipFileEntry<ReaderType, WriterType>

Represents a file entry in the zip (Filesystem API).

Type Parameters

  • ReaderType
  • WriterType

Hierarchy (view full)

Constructors

Properties

children: ZipEntry[]

The children of the entry.

The underlying EntryMetaData instance.

directory: void

void for ZipFileEntry instances.

id: number

The ID of the instance.

name: string

The relative filename of the entry.

parent?: ZipEntry

The parent directory of the entry.

reader: ReadableStream<any> | ReadableReader | Reader<unknown>[] | ReadableReader[] | ReadableStream<any>[] | Reader<ReaderType>

The Reader instance used to read the content of the entry.

uncompressedSize: number

The uncompressed size of the content.

writer: WritableStream<any> | WritableWriter | Writer<WriterType> | AsyncGenerator<WritableStream<any> | WritableWriter | Writer<unknown>, any, unknown>

The Writer instance used to write the content of the entry.

Methods

  • Tests the password on the entry and all children if any, returns true if the entry is not password protected

    Parameters

    Returns Promise<boolean>

  • Retrieves the content of the entry as a Blob instance

    Parameters

    • Optional mimeType: string

      The MIME type of the content.

    • Optional options: EntryGetDataOptions

      The options.

    Returns Promise<Blob>

    A promise resolving to a Blob instance.

  • Retrieves the content of the entry as as a Data URI string encoded in Base64

    Parameters

    • Optional mimeType: string

      The MIME type of the content.

    • Optional options: EntryGetDataOptions

      The options.

    Returns Promise<string>

    A promise resolving to a Data URI string encoded in Base64.

  • Retrieves the text content of the entry as a string

    Parameters

    • Optional encoding: string

      The encoding of the text.

    • Optional options: EntryGetDataOptions

      The options.

    Returns Promise<string>

    A promise resolving to a string.

  • Retrieves the content of the entry as a Uint8Array instance

    Parameters

    Returns Promise<Uint8Array>

    A promise resolving to a Uint8Array instance.

  • Retrieves the content of the entry via a WritableStream instance

    Parameters

    • Optional writable: WritableStream<any>

      The WritableStream instance.

    • Optional options: EntryGetDataOptions

      The options.

    Returns Promise<WritableStream<any>>

    A promise resolving to the WritableStream instance.

  • Set the name of the entry

    Parameters

    • name: string

      The new name of the entry.

    Returns void

  • Replaces the content of the entry with a Blob instance

    Parameters

    • blob: Blob

      The Blob instance.

    Returns void

  • Replaces the content of the entry with a Data URI string encoded in Base64

    Parameters

    • dataURI: string

      The Data URI string encoded in Base64.

    Returns void

  • Replaces the content of the entry with a ReadableStream instance

    Parameters

    • readable: ReadableStream<any>

      The ReadableStream instance.

    Returns void

  • Replaces the content of the entry with a string

    Parameters

    • text: string

      The string.

    Returns void

  • Replaces the content of the entry with a Uint8Array instance

    Parameters

    • array: Uint8Array

      The Uint8Array instance.

    Returns void

Generated using TypeDoc