/// /// import { Readable } from 'stream'; type Protocol = T extends `${infer Protocol}:${infer _}` ? Protocol : never; export type GetUriProtocol = (parsed: URL, opts?: T) => Promise; export declare const protocols: { data: GetUriProtocol; file: GetUriProtocol; ftp: GetUriProtocol; http: GetUriProtocol; https: GetUriProtocol; }; export type Protocols = typeof protocols; export type ProtocolsOptions = { [P in keyof Protocols]: NonNullable[1]>; }; export type ProtocolOpts = { [P in keyof ProtocolsOptions]: Protocol extends P ? ProtocolsOptions[P] : never; }[keyof Protocols]; export declare function isValidProtocol(p: string): p is keyof Protocols; /** * Async function that returns a `stream.Readable` instance that will output * the contents of the given URI. * * For caching purposes, you can pass in a `stream` instance from a previous * `getUri()` call as a `cache: stream` option, and if the destination has * not changed since the last time the endpoint was retreived then the callback * will be invoked with an Error object with `code` set to "ENOTMODIFIED" and * `null` for the "stream" instance argument. In this case, you can skip * retreiving the file again and continue to use the previous payload. * * @param {String} uri URI to retrieve * @param {Object} opts optional "options" object * @api public */ export declare function getUri(uri: Uri | URL, opts?: ProtocolOpts): Promise; export {};