import type { ThirdwebClient } from "../client/client.js"; import type { FileOrBufferOrString } from "../storage/upload/types.js"; export type ResolveSchemeOptions = { client: ThirdwebClient; uri: string; }; /** * Resolves the scheme of a given URI and returns the corresponding URL. * If the URI starts with "ipfs://", it constructs a URL using the IPFS client ID and the IPFS gateway. * If the URI starts with "http", it returns the URI as is. * Otherwise, it throws an error indicating an invalid URI scheme. * @param options - The options object containing the URI and the IPFS client. * @returns The resolved URL. * @throws Error if the URI scheme is invalid. * @example * ```ts * import { resolveScheme } from "thirdweb/storage"; * const url = resolveScheme({ * client, * uri: "ipfs://Qm...", * }); * ``` * @storage */ export declare function resolveScheme(options: ResolveSchemeOptions): string; /** * @internal */ export declare function findIPFSCidFromUri(uri: string): string; /** * Uploads or extracts URIs from the given files. * @template T - The type of the files (File, Buffer, String). * @param files - The files to upload or extract URIs from. * @param client - The Thirdweb client. * @param [startNumber] - The starting number for rewriting file names. * @returns - A promise that resolves to an array of URIs. * @throws {Error} - If the files are not all of the same type (all URI or all FileOrBufferOrString). * @internal * */ export declare function uploadOrExtractURIs>(files: T[], client: ThirdwebClient, startNumber?: number): Promise; /** * Retrieves the base URI from a batch of URIs. * * @param uris - An array of URIs. * @returns The base URI shared by all URIs in the batch. * @throws If the batch contains URIs with different base URIs or if no base URI is found. * @internal */ export declare function getBaseUriFromBatch(uris: string | string[]): string; //# sourceMappingURL=ipfs.d.ts.map