///
export declare type IPFS = {
add(data: FileContent, options?: unknown): UnixFSFile;
cat(cid: CID): AsyncIterable;
ls(cid: CID): AsyncIterable;
dag: DagAPI;
object: ObjectAPI;
dns(domain: string): Promise;
};
export declare type DAGNode = {
Links: DAGLink[];
size: number;
toDAGLink: (opt?: {
name?: string;
}) => Promise;
addLink: (link: DAGLink) => void;
rmLink: (name: string) => void;
toJSON: () => object;
};
export declare type DAGLink = {
Name: string;
Hash: string;
Size: number;
};
export declare type RawDAGNode = {
remainderPath: string;
value: {
_data: Uint8Array;
_links: RawDAGLink[];
_size: number;
_serializedSize: number;
};
};
export declare type RawDAGLink = {
_name: string;
_cid: CIDObj;
_size: number;
};
export interface DagAPI {
put(dagNode: unknown, options: unknown): Promise;
get(cid: string | CID, path?: string, options?: unknown): Promise;
tree(cid: string | CID, path?: string, options?: unknown): Promise;
}
export interface ObjectAPI {
stat(cid: CID): Promise;
put(dagNode: unknown, options: unknown): Promise;
get(cid: CID, path?: string, options?: unknown): Promise;
tree(cid: CID, path?: string, options?: unknown): Promise;
}
export declare type CID = string;
export declare type Codec = string;
export declare type MultibaseName = string;
export declare type CIDObj = {
codec: Codec;
multibaseName: MultibaseName;
string: CID;
version: number;
};
export declare type FileContent = object | Blob | string | number | boolean;
export declare type FileContentRaw = Buffer;
export declare type FileMode = number;
export declare type UnixFSFile = {
cid: CIDObj;
path: string;
size: number;
mode?: FileMode;
mtime?: number;
name?: string;
type?: string;
};
export declare type ObjStat = {
Hash: string;
NumLinks: number;
BlockSize: number;
LinksSize: number;
DataSize: number;
CumulativeSize: number;
};
export declare type AddResult = {
cid: CID;
size: number;
};