/// /// import type { PathLike } from "fs"; import type { CreateAndUploadOptions, Token, IrysTransactonCtor, UploadReceipt, UploadResponse } from "../common/types.js"; import Uploader from "../common/upload.js"; import type Api from "../common/api.js"; import type Utils from "../common/utils.js"; import { Readable } from "stream"; import type { DataItem } from "arbundles"; export declare const checkPath: (path: PathLike) => Promise; export declare class NodeUploader extends Uploader { constructor(api: Api, utils: Utils, token: string, tokenConfig: Token, irysTx: IrysTransactonCtor); /** * Uploads a file to the bundler * @param path to the file to be uploaded * @returns the response from the bundler */ uploadFile(path: string, opts?: CreateAndUploadOptions): Promise; walk(dir: string): AsyncGenerator; /** * Preprocessor for folder uploads, ensures the rest of the system has a correct operating environment. * @param path - path to the folder to be uploaded * @param indexFile - path to the index file (i.e index.html) * @param batchSize - number of items to upload concurrently * @param interactivePreflight - whether to interactively prompt the user for confirmation of upload (CLI ONLY) * @param keepDeleted - Whether to keep previously uploaded (but now deleted) files in the manifest * @param logFunction - for handling logging from the uploader for UX * @returns */ uploadFolder(path: string, { batchSize, keepDeleted, indexFile, interactivePreflight, logFunction, manifestTags, itemOptions, }?: { batchSize: number; keepDeleted: boolean; indexFile?: string; interactivePreflight?: boolean; logFunction?: (log: string) => Promise; manifestTags?: { name: string; value: string; }[]; itemOptions?: CreateAndUploadOptions; }): Promise<((UploadResponse | UploadReceipt) & { receipts?: Map | undefined; }) | undefined>; /** * processes an item to convert it into a DataItem, and then uploads it. * @param item can be a string value, a path to a file, a Buffer of data or a DataItem * @returns A dataItem */ protected processItem(item: string | Buffer | Readable | DataItem, opts?: CreateAndUploadOptions): Promise; /** * Stream-based CSV parser and JSON assembler * @param path base path of the upload * @param indexFile optional path to an index file * @returns the path to the generated manifest */ generateManifestFromCsv(path: string, nowRemoved?: Map, indexFile?: string): Promise; } export default NodeUploader;