import fsPromises from 'fs/promises';
import { SnapshotNode } from '@joinezco/memfs/snapshot';
import { CborEncoder } from '@jsonjoy.com/json-pack/lib/cbor/CborEncoder';
import { CborDecoder } from '@jsonjoy.com/json-pack/lib/cbor/CborDecoder';
import { Writer } from '@jsonjoy.com/util/lib/buffers/Writer';
import { CborUint8Array } from '@jsonjoy.com/json-pack/lib/cbor/types';
import { FsApi } from '@joinezco/memfs/node/types';
export declare const writer: Writer;
export declare const encoder: CborEncoder<Writer>;
export declare const decoder: CborDecoder<import("@jsonjoy.com/util/lib/buffers").IReader & import("@jsonjoy.com/util/lib/buffers").IReaderResettable>;
/**
 * Compress data using gzip compression.
 * Uses Node.js zlib in Node.js environment, browser CompressionStream in browser.
 */
export declare const compress: (data: Uint8Array) => Promise<Uint8Array>;
export declare const decompress: (data: Uint8Array) => Promise<Uint8Array>;
export type BuildPathFilterArgs = {
    include?: string[];
    exclude?: string[];
};
export declare const buildFilter: ({ include, exclude }: BuildPathFilterArgs) => (path: string) => boolean;
export type IgnoreArgs = {
    fs: typeof fsPromises;
    root: string;
    exclude: string[];
    gitignore: string | null;
};
export declare const getGitignored: (path: string, fs?: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function") => Promise<any>;
export type TakeSnapshotProps = {
    root: string;
    filter: (path: string) => (Promise<boolean> | boolean);
};
export declare const snapshotDefaults: TakeSnapshotProps;
/**
 * Takes a snapshot of the file system based on the provided properties.
 * The snapshot is encoded with CBOR and compressed with gzip.
 *
 * @param props - The properties to configure the snapshot.
 */
export declare const takeSnapshot: (props?: Partial<TakeSnapshotProps>) => Promise<Uint8Array<ArrayBufferLike>>;
export type SnapshotOptions = {
    fs: FsApi;
    path?: string;
    separator?: string;
};
export declare namespace Snapshot {
    const take: ({ fs, path, filter, separator }: {
        fs: typeof fsPromises;
        path: TakeSnapshotProps["root"];
        filter?: TakeSnapshotProps["filter"];
        separator?: string;
    }) => Promise<SnapshotNode>;
    const mount: (buffer: CborUint8Array<SnapshotNode>, { fs, path, separator }: SnapshotOptions) => Promise<void>;
    /**
     * Load and mount a snapshot directly from a URL in a web worker environment.
     * This is more efficient for large snapshots as it avoids transferring data through the main thread.
     */
    const loadAndMount: (url: string, { fs, path, separator }: SnapshotOptions) => Promise<void>;
}
export declare const fromSnapshot: (snapshot: SnapshotNode, { fs, path, separator }: SnapshotOptions) => Promise<void>;
