import { grpc } from "@improbable-eng/grpc-web"; import { CancelStorageJobResponse, ListStorageJobsResponse, StorageConfigForJobResponse, StorageJob, StorageJobResponse, StorageJobsSummaryResponse } from "@textile/grpc-powergate-client/dist/powergate/user/v1/user_pb"; import { Config } from "../types"; import { ListOptions, ListSelect } from "./types"; export { ListOptions, ListSelect }; export interface StorageJobs { /** * Get the current state of a storage job. * @param jobId The job id to query. * @returns The current state of the storage job. */ get: (jobId: string) => Promise; /** * Get the storage config associated with the specified storage job id. * @param jobId The cid of the desired storage config. * @returns The storage config associated with the provided job id. */ storageConfig: (jobId: string) => Promise; /** * Lists StorageJobs according to the provided ListOptions. * @param opts Optional ListOptions to control the behavior of listing jobs. * @returns An object containing a list of storage jobs. */ list: (opts?: ListOptions) => Promise; /** * Get a summary of jobs in the user for the specified cids or all cids. * @param cid An optional cid to get a job summary for, providing no cid means all cids. * @returns An object containing a summary of jobs. */ summary: (cid?: string) => Promise; /** * Listen for job updates for the provided job ids. * @param handler The callback to receive job updates. * @param jobs A list of job ids to watch. * @returns A function that can be used to cancel watching. */ watch: (handler: (event: StorageJob.AsObject) => void, ...jobs: string[]) => () => void; /** * Cancel a job. * @param jobId The id of the job to cancel. */ cancel: (jobId: string) => Promise; } /** * @ignore */ export declare const createStorageJobs: (config: Config, getMeta: () => grpc.Metadata) => StorageJobs;