/** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * A class that allows loading of a zip file to extract the relevant data we need from a zip. */ export declare class Zip { private zip; private entries; private signedFile; private previouslySigned; /** * * @param zip - A JSZip object of our project so we can load the zip entries. */ private constructor(); /** * * @returns An array of bundle entries contained within the zip file. */ private getManifestEntries; /** * This statically generates a Zip class so we can analyze the data within the class. This method * is the only way to generate a Zip object. * * @param zipBlob - A zip blob. * @returns The Zip class. */ static loadAsync(zipBlob: Blob): Promise; /** * Generates a signed files class * * @param creator - Specifies the creator of the signed files. * @returns SignedFiles class. */ private getSignedFiles; /** * * @returns An array of bundle entries within the zip. */ private getEntries; /** * * @param creator - The entity used to generate the signed files class. * @returns The manifest file as a string. */ generateManifest(creator: string): Promise; /** * * @param creator - The entity used to generate the signed files class. * @returns The signature file as a string. */ generateSignatureFile(creator: string): Promise; /** * Adds a file to the zip filewithout any additional decompression and does not generate missing * folders. * * @param fileContents - The file contents to be added to the zip. These contents can either be * base64 encoded string or a blob. * @param path - The path to the file contents. * @param isbase64 - Specifiying whether the data to be stored is a base 64 encoded string or not */ addFileToZip(fileContents: Blob | string, path: string, isbase64?: boolean): void; /** * * @returns The zip file as a base64 encoded string for easy downloading. */ exportZipAsBase64(): Promise; /** * This zip aligns a zip file that is in the form of an arraybuffer. This * zip aligns to the 32 bit page boundary by default. * @param zipBuffer - ArrayBuffer representing a zip file * @returns a zip Blob. */ private alignZip; isPreviouslySigned(): boolean; }