import type { DirBuilder, DirBuilderOptions } from './dir.ts'; import type { FileBuilder, FileBuilderOptions } from './file.ts'; import type { ChunkValidator } from './validate-chunks.ts'; import type { Chunker } from '../chunker/index.ts'; import type { ImportCandidate, ImporterProgressEvents, InProgressImportResult, WritableStorage } from '../index.ts'; import type { ProgressEvent, ProgressOptions } from 'progress-events'; /** * Passed to the onProgress callback while importing files */ export interface ImportReadProgress { /** * How many bytes we have read from this source so far */ bytesRead: bigint; /** * The size of the current chunk */ chunkSize: bigint; /** * The path of the file being imported, if one was specified */ path?: string; } export type DagBuilderProgressEvents = ProgressEvent<'unixfs:importer:progress:file:read', ImportReadProgress>; export interface DagBuilderOptions extends FileBuilderOptions, DirBuilderOptions, ProgressOptions { chunker: Chunker; chunkValidator: ChunkValidator; wrapWithDirectory: boolean; dirBuilder?: DirBuilder; fileBuilder?: FileBuilder; } export type ImporterSourceStream = AsyncIterable | Iterable; export interface DAGBuilder { (source: ImporterSourceStream, blockstore: WritableStorage): AsyncIterable<() => Promise>; } export declare function defaultDagBuilder(options: DagBuilderOptions): DAGBuilder; //# sourceMappingURL=index.d.ts.map