/// import { Readable } from "stream"; export type IPFSCLIENT = { add: IPFSAdd; addAll: IPFSAddAll; refs: IPFSRefs; }; export type FileObject = { content: Readable; path: string; }; export interface IPFSAddAll { (values: FileObject[], options?: IPFSAddOptions): Promise; } export interface IPFSAdd { (value: Readable, options: IPFSAddOptions): Promise; } export interface IPFSRefs { (ipfsPath: string, options?: IPFSRefsOptions): Promise; } export type AddReturnType = { Name: string; Hash: string; Size: string; }; export type RefsReturnType = { Err: string; Ref: string; }[]; export type IPFSAddOptions = { wrapWithDirectory?: boolean; cidVersion?: number; onlyHash?: boolean; chunker?: string; hash?: string; pin?: boolean; progress?: (percentCompleteOrBytesUploaded: number | string) => void; }; export type IPFSRefsOptions = { recursive?: boolean; }; export interface CreateIPFS { (ipfsOptions: { url: string; }): IPFSCLIENT; }