import { CID } from "multiformats/cid"; import * as Depot from "../../components/depot/implementation.js"; import * as Path from "../../path/index.js"; import * as Reference from "../../components/reference/implementation.js"; import { Link, Links, NonEmptyPath, SoftLink, UpdateCallback } from "../types.js"; import { Maybe } from "../../common/index.js"; import { DistinctivePath } from "../../path/index.js"; import { Skeleton, SkeletonInfo, TreeInfo, TreeHeader, PutDetails } from "../protocol/public/types.js"; import BaseTree from "../base/tree.js"; import BareTree from "../bare/tree.js"; import PublicFile from "./PublicFile.js"; import PublicHistory from "./PublicHistory.js"; declare type ConstructorParams = { depot: Depot.Implementation; reference: Reference.Implementation; cid: Maybe; links: Links; header: TreeHeader; }; declare type Child = PublicFile | PublicTree | BareTree; export declare class PublicTree extends BaseTree { depot: Depot.Implementation; reference: Reference.Implementation; children: { [name: string]: Child; }; cid: Maybe; links: Links; header: TreeHeader; history: PublicHistory; constructor({ depot, reference, links, header, cid }: ConstructorParams); static empty(depot: Depot.Implementation, reference: Reference.Implementation): Promise; static fromCID(depot: Depot.Implementation, reference: Reference.Implementation, cid: CID): Promise; static fromInfo(depot: Depot.Implementation, reference: Reference.Implementation, info: TreeInfo, cid: CID): Promise; static instanceOf(obj: unknown): obj is PublicTree; createChildTree(name: string, onUpdate: Maybe): Promise; createOrUpdateChildFile(content: Uint8Array, name: string, onUpdate: Maybe): Promise; putDetailed(): Promise; updateDirectChild(child: PublicTree | PublicFile, name: string, onUpdate: Maybe): Promise; removeDirectChild(name: string): this; getDirectChild(name: string): Promise; get(path: Path.Segments): Promise; getRecurse(skel: Skeleton, path: NonEmptyPath): Promise; assignLink({ name, link, skeleton }: { name: string; link: Link; skeleton: SkeletonInfo | SoftLink; }): void; static resolveSoftLink(depot: Depot.Implementation, reference: Reference.Implementation, link: SoftLink): Promise; getLinks(): Links; updateLink(name: string, result: PutDetails): this; insertSoftLink({ name, path, username }: { name: string; path: DistinctivePath; username: string; }): this; } export default PublicTree;