import type { CID } from "multiformats/cid"; import { Maybe } from "../../common/index.js"; import { Segments as Path } from "../../path/index.js"; import { PutResult } from "../../components/depot/implementation.js"; import { Tree, File, UnixTree, Links, UpdateCallback } from "../types.js"; declare abstract class BaseTree implements Tree, UnixTree { readOnly: boolean; constructor(); put(): Promise; ls(path: Path): Promise; cat(path: Path): Promise; mkdir(path: Path): Promise; mkdirRecurse(path: Path, onUpdate: Maybe): Promise; add(path: Path, content: Uint8Array): Promise; addRecurse(path: Path, content: Uint8Array, onUpdate: Maybe): Promise; rm(path: Path): Promise; rmRecurse(path: Path, onUpdate: Maybe): Promise; mv(from: Path, to: Path): Promise; exists(path: Path): Promise; read(path: Path): Promise; write(path: Path, content: Uint8Array): Promise; getOrCreateDirectChild(name: string, onUpdate: Maybe): Promise; /** * `put` is called on child (result of promise) in `updateDirectChild` * Then for the outermost parent, `put` should be called manually. */ updateChild(child: Tree | File, path: Path): Promise; abstract createChildTree(name: string, onUpdate: Maybe): Promise; abstract createOrUpdateChildFile(content: Uint8Array, name: string, onUpdate: Maybe): Promise; abstract putDetailed(): Promise; abstract updateDirectChild(child: Tree | File, name: string, onUpdate: Maybe): Promise; abstract removeDirectChild(name: string): this; abstract getDirectChild(name: string): Promise; abstract get(path: Path): Promise; abstract updateLink(name: string, result: PutResult): this; abstract getLinks(): Links; } export default BaseTree;