Class ZipFileEntry<ReaderType, WriterType>

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

Type Parameters

  • ReaderType
  • WriterType

Hierarchy (View Summary)

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,
        any,
    >

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

Methods

  • Retrieves the content of the entry as a Blob instance

    Parameters

    • OptionalmimeType: string

      The MIME type of the content.

    • Optionaloptions: EntryGetDataOptions

      The options.

    Returns Promise<Blob>

    A promise resolving to a Blob instance.

  • Retrieves the content of the entry via a Writer instance

    Parameters

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

      The Writer instance.

    • Optionaloptions: EntryGetDataOptions

      The options.

    Returns Promise<unknown>

    A promise resolving to data associated to the Writer instance.

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

    Parameters

    • OptionalmimeType: string

      The MIME type of the content.

    • Optionaloptions: 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

    • Optionalencoding: string

      The encoding of the text.

    • Optionaloptions: 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<ArrayBufferLike>>

    A promise resolving to a Uint8Array instance.

  • Retrieves the content of the entry via a WritableStream instance

    Parameters

    • Optionalwritable: WritableStream<any>

      The WritableStream instance.

    • Optionaloptions: 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<ArrayBufferLike>

      The Uint8Array instance.

    Returns void