import type { Readable as NodeReadableStream } from 'stream' import type { MtimeLike } from 'ipfs-unixfs' interface ProgressStatus { total: number loaded: number lengthComputable: boolean } export interface ProgressFn { (status: ProgressStatus): void } type Override = Omit & R export type FetchOptions = Override export interface HTTPOptions extends FetchOptions { json?: any /** * The base URL to use in case url is a relative URL */ base?: string /** * Throw not ok responses as Errors */ throwHttpErrors?: boolean /** * Transform search params */ transformSearchParams?: (params: URLSearchParams) => URLSearchParams /** * When iterating the response body, transform each chunk with this function. */ transform?: (chunk: any) => any /** * Handle errors */ handleError?: (rsp: Response) => Promise } export interface ExtendedResponse extends Response { iterator: () => AsyncGenerator ndjson: () => AsyncGenerator } export interface GlobSourceOptions { /** * Include .dot files in matched paths */ hidden?: boolean /** * follow symlinks */ followSymlinks?: boolean /** * Preserve mode */ preserveMode?: boolean /** * Preserve mtime */ preserveMtime?: boolean /** * mode to use - if preserveMode is true this will be ignored */ mode?: number /** * mtime to use - if preserveMtime is true this will be ignored */ mtime?: MtimeLike } export interface GlobSourceResult { path: string content: AsyncIterable | undefined mode: number | undefined mtime: MtimeLike | undefined }