@storacha/client
Version:
Client for the storacha.network w3up api
55 lines • 1.07 kB
TypeScript
export * from "@storacha/access/space";
/**
* @typedef {object} Model
* @property {API.SpaceDID} id
* @property {{name?:string}} [meta]
* @property {API.Agent} agent
*/
export class Space {
/**
* @param {Model} model
*/
constructor(model: Model);
usage: StorageUsage;
/**
* The given space name.
*/
get name(): string;
/**
* The DID of the space.
*/
did(): `did:key:${string}`;
/**
* User defined space metadata.
*/
meta(): {
name?: string;
} | undefined;
#private;
}
export class StorageUsage {
/**
* @param {Model} model
*/
constructor(model: Model);
/**
* Get the current usage in bytes.
*/
get(): Promise<({
ok?: undefined;
} & {
error: API.Failure;
}) | {
ok: bigint | undefined;
}>;
#private;
}
export type Model = {
id: API.SpaceDID;
meta?: {
name?: string;
} | undefined;
agent: API.Agent;
};
import * as API from './types.js';
//# sourceMappingURL=space.d.ts.map