file.d.ts 614 B

1234567891011121314151617
  1. /// <reference types="node" />
  2. import { Readable } from 'stream';
  3. import { UrlWithStringQuery } from 'url';
  4. import { Stats, createReadStream } from 'fs';
  5. import { GetUriOptions } from '.';
  6. declare type ReadStreamOptions = Exclude<Parameters<typeof createReadStream>[1], string>;
  7. interface FileReadable extends Readable {
  8. stat?: Stats;
  9. }
  10. declare type FileOptions = GetUriOptions & ReadStreamOptions & {
  11. cache?: FileReadable;
  12. };
  13. /**
  14. * Returns a `fs.ReadStream` instance from a "file:" URI.
  15. */
  16. export default function get({ href: uri }: UrlWithStringQuery, opts: FileOptions): Promise<Readable>;
  17. export {};