react-native-zip-archive
Version:
A TurboModule wrapper on ZipArchive for React Native's New Architecture
41 lines (32 loc) • 1.3 kB
TypeScript
import { NativeEventSubscription } from "react-native";
declare module "react-native-zip-archive" {
export enum EncryptionMethods {
STANDARD = "STANDARD",
AES_128 = "AES-128",
AES_256 = "AES-256",
}
export const DEFAULT_COMPRESSION: number;
export const NO_COMPRESSION: number;
export const BEST_SPEED: number;
export const BEST_COMPRESSION: number;
export function isPasswordProtected(source: string): Promise<boolean>;
export function zip(
source: string | string[],
target: string,
compressionLevel?: number
): Promise<string>;
export function zipWithPassword(
source: string | string[],
target: string,
password: string,
encryptionMethod?: EncryptionMethods,
compressionLevel?: number
): Promise<string>;
export function unzip(source: string, target: string, charset?: string): Promise<string>;
export function unzipWithPassword(source: string, target: string, password: string): Promise<string>;
export function unzipAssets(assetPath: string, target: string): Promise<string>;
export function subscribe(
callback: ({ progress, filePath }: { progress: number; filePath: string }) => void
): NativeEventSubscription;
export function getUncompressedSize(source: string, charset?: string): Promise<number>;
}