kubo-rpc-client
Version:
A client library for the Kubo RPC API
41 lines • 1.19 kB
TypeScript
import type { HTTPRPCOptions } from '../index.js';
import type { HTTPRPCClient } from '../lib/core.js';
import type { CID } from 'multiformats/cid';
export interface RepoAPI {
/**
* Perform garbage collection on the repo
*
* Any unpinned blocks will be deleted
*/
gc(options?: RepoGCOptions): AsyncIterable<RepoGCResult>;
/**
* Return stats about the repo
*/
stat(options?: HTTPRPCOptions): Promise<RepoStatResult>;
/**
* If the repo has been initialized, report the current version,
* otherwise report the version that would be initialized
*/
version(options?: HTTPRPCOptions): Promise<number>;
}
export interface RepoGCOptions extends HTTPRPCOptions {
quiet?: boolean;
}
export interface RepoGCError {
err: Error;
cid?: never;
}
export interface RepoGCSuccess {
err?: never;
cid: CID;
}
export type RepoGCResult = RepoGCSuccess | RepoGCError;
export interface RepoStatResult {
numObjects: bigint;
repoPath: string;
repoSize: bigint;
version: string;
storageMax: bigint;
}
export declare function createRepo(client: HTTPRPCClient): RepoAPI;
//# sourceMappingURL=index.d.ts.map