import { type PeerId } from "@libp2p/interface"; import { PublicSignKey } from "@peerbit/crypto"; import { type CanPerformOperations, type CanRead, type DocumentsLike, type Operation } from "@peerbit/document"; import { type AppendOptions } from "@peerbit/log"; import { Program } from "@peerbit/program"; import { type ReplicationOptions } from "@peerbit/shared-log"; import { FromTo, IdentityRelation } from "./identity-graph.js"; type IdentityGraphArgs = { canRead?: CanRead; replicate?: ReplicationOptions; }; export declare class IdentityGraph extends Program { relationGraph: DocumentsLike; constructor(props?: { id?: Uint8Array; relationGraph?: DocumentsLike; }); canPerform(properties: CanPerformOperations): Promise; open(options?: IdentityGraphArgs): Promise; addRelation(to: PublicSignKey | PeerId, options?: AppendOptions): Promise; } /** * Not shardeable since we can not query trusted relations, because this would lead to a recursive problem where we then need to determine whether the responder is trusted or not */ type TrustedNetworkArgs = { replicate?: ReplicationOptions; }; export declare class TrustedNetwork extends Program { rootTrust: PublicSignKey; trustGraph: DocumentsLike; private _lastWarmupAt; constructor(props: { id?: Uint8Array; rootTrust: PublicSignKey | PeerId; }); open(options?: TrustedNetworkArgs): Promise; canPerform(properties: CanPerformOperations): Promise; canRead(relation: any, publicKey?: PublicSignKey): Promise; add(trustee: PublicSignKey | PeerId, options?: AppendOptions): Promise; hasRelation(trustee: PublicSignKey | PeerId, truster?: PublicSignKey | PeerId): Promise; getRelation(trustee: PublicSignKey | PeerId, truster?: PublicSignKey | PeerId): Promise; /** * Follow trust path back to trust root. * Trust root is always trusted. * Hence if * Root trust A trust B trust C * C is trusted by Root * @param trustee * @param truster the truster "root", if undefined defaults to the root trust * @returns true, if trusted */ isTrusted(trustee: PublicSignKey | PeerId, truster?: PublicSignKey | PeerId): Promise; _isTrustedLocal(trustee: PublicSignKey, truster?: PublicSignKey): Promise; getTrusted(): Promise; hashCode(): string; } export {}; //# sourceMappingURL=controller.d.ts.map