fcs
2025-04-10 0163870d662dc5b7d69ceff977490ede594f7d82
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/// <reference types="node" />
import { Readable } from 'stream';
import { UrlWithStringQuery } from 'url';
/**
 * Async function that returns a `stream.Readable` instance to the
 * callback function 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
 * @param {Function} fn callback function
 * @api public
 */
declare function getUri(uri: string, fn: getUri.GetUriCallback): void;
declare function getUri(uri: string, opts: getUri.GetUriOptions, fn: getUri.GetUriCallback): void;
declare function getUri(uri: string, opts?: getUri.GetUriOptions): Promise<Readable>;
declare namespace getUri {
    interface GetUriOptions {
        cache?: Readable;
    }
    type GetUriCallback = (err?: Error | null, res?: Readable) => void;
    type GetUriProtocol = (parsed: UrlWithStringQuery, opts: getUri.GetUriOptions) => Promise<Readable>;
    const protocols: {
        [key: string]: getUri.GetUriProtocol;
    };
}
export = getUri;