import { CachingMechanismInterface } from "../../interfaces"; import { Struct } from "superstruct"; import winston from "winston"; /** * A client for interacting with the IPFS. This is a wrapper around the IPFS API. * This client also is a part of the caching mechanism interface. * @see https://docs.ipfs.io/reference/http/api/ */ export declare class PinataIPFSClient implements CachingMechanismInterface { /** * The IPFS client instance */ private client; /** * Public IPFS gateway URL to retrieve the content from */ private publicGatewayURL; /** * An optional logger for logging messages */ private logger?; constructor(projectId: string, projectSecret: string, publicGatewayURL: string, logger?: winston.Logger); /** * Calls to a public IPFS gateway to retrieve a value. * @param key The key to retrieve. * @param _structValidator An optional struct validator to validate the retrieved value. If the value does not match the struct, null is returned. * @returns The value if it exists, otherwise null. */ get(key?: string, _structValidator?: Struct): Promise; /** * Stores a value in the IPFS and returns the CID of the value stored. * @param key An optional key to store the value with. This is purely in the metadata of the CID. * @param value The value to store. * @returns The CID of the value stored. */ set(key: string, value: T): Promise; }