import lzma from 'lzma/src/lzma_worker.js';
const { LZMA_WORKER: LZMA } = lzma;
// Importing this will create a LZMA variable. See global.d.ts
LZMA.disableEndMark = true;
export async function compress(data, mode) {
    return new Promise((resolve, reject) => {
        LZMA.compress(data, mode, (result, error) => {
            if (error) {
                reject(error);
            }
            resolve(new Uint8Array(result));
        });
    });
}
export async function decompress(data) {
    return new Promise((resolve, reject) => {
        LZMA.decompress(data, (result, error) => {
            if (error) {
                reject(error);
            }
            resolve(new Uint8Array(result));
        });
    });
}
//# sourceMappingURL=lzma.js.map