Hierarchy

  • ZipDocumentContainer

Implements

Properties

compressionLevel: number

Level of compression, 0 means no compression. (range: [0, 9])

Methods

  • Adds a binary or text file to the container.

    Parameters

    • pData: string | ArrayBuffer | Blob

      The data of the file.

    • pFilename: string

      Name of the file to add. May include a path. e.g. "textures/123.jpg". Has to be lowercase.

    • Optional pCompress: boolean

      If true the file should be compressed (if supported by the implementation) otherwise the file should not be compressed. (Default: true)

    • Optional pCacheable: boolean

      If true the file may be cached. The filename should be used as cache id in this case. (Default: false)

    Returns Promise<void>

  • Adds an already cached file to the container. True should be returned if the file was added, otherwise false (e.g. if the file was not found inside the cache).

    Parameters

    • pFilename: string

      Name of the file to add. May include a path. e.g. "textures/123.jpg". Has to be lowercase.

    • Optional pCompress: boolean

      If true the file should be compressed (if supported by the implementation) otherwise the file should not be compressed. (Default: true)

    Returns Promise<boolean>

  • Adds a binary or text file to the container using an url.

    Parameters

    • pUrl: string

      The file url.

    • pFilename: string

      Name of the file to add. May include a path. e.g. "textures/123.jpg". Has to be lowercase.

    • pBinary: boolean

      If true the file containes binary data.

    • Optional pCompress: boolean

      If true the file should be compressed (if supported by the implementation) otherwise the file should not be compressed. (Default: true)

    • Optional pCacheable: boolean

      If true the file may be cached. The filename should be used as cache id in this case. (Default: false)

    Returns Promise<void>

  • Retrieves a binary or text file from the container. If the file doesn't exist the promise has to be rejected with an FileNotFoundError.

    Parameters

    • pFilename: string

      Name of the file. May include a path. e.g. "textures/123.jpg".

    • pBinary: false

      If true the file containes binary data and is returned as ArrayBuffer otherwise as string.

    Returns Promise<string>

  • Parameters

    • pFilename: string
    • pBinary: true

    Returns Promise<ArrayBuffer>

  • Returns a list of files which are part of the given folder and its sub folders. The files are returned as a relative path including the file name. If the folder doesn't exist the promise has to be rejected with an FileNotFoundError.

    Parameters

    • Optional pFolderPath: string

      Path of the folder.

    Returns Promise<string[]>

Generated using TypeDoc