UNPKG

filecoin-pin

Version:

Bridge IPFS content to Filecoin Onchain Cloud using familiar tools

40 lines 1.23 kB
/** * UnixFS to CAR conversion functionality * * This module provides utilities to create CAR files from files and directories * using @helia/unixfs and CARWritingBlockstore. */ import { CID } from 'multiformats/cid'; import type { Logger } from 'pino'; type Spinner = { start(msg: string): void; stop(msg: string): void; message(msg: string): void; }; export interface CreateCarOptions { logger?: Logger; bare?: boolean; spinner?: Spinner; isDirectory?: boolean; } export interface CreateCarResult { carPath: string; rootCid: CID; } /** * Create a CAR file from a file or directory using UnixFS encoding * * @param path - Path to the file or directory to encode * @param options - Optional logger, bare flag, and directory flag * @returns Path to temporary CAR file, root CID, and entry count */ export declare function createCarFromPath(path: string, options?: CreateCarOptions): Promise<CreateCarResult>; /** * Clean up temporary CAR file * * @param carPath - Path to the temporary CAR file to delete * @param logger - Optional logger */ export declare function cleanupTempCar(carPath: string, logger?: Logger): Promise<void>; export {}; //# sourceMappingURL=unixfs-car.d.ts.map