Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

index.d.ts 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /// <reference types="node"/>
  2. import * as stream from 'stream';
  3. declare const isStream: {
  4. /**
  5. @returns Whether `stream` is a [`Stream`](https://nodejs.org/api/stream.html#stream_stream).
  6. @example
  7. ```
  8. import * as fs from 'fs';
  9. import isStream = require('is-stream');
  10. isStream(fs.createReadStream('unicorn.png'));
  11. //=> true
  12. isStream({});
  13. //=> false
  14. ```
  15. */
  16. (stream: unknown): stream is stream.Stream;
  17. /**
  18. @returns Whether `stream` is a [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable).
  19. @example
  20. ```
  21. import * as fs from 'fs';
  22. import isStream = require('is-stream');
  23. isStream.writable(fs.createWriteStrem('unicorn.txt'));
  24. //=> true
  25. ```
  26. */
  27. writable(stream: unknown): stream is stream.Writable;
  28. /**
  29. @returns Whether `stream` is a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable).
  30. @example
  31. ```
  32. import * as fs from 'fs';
  33. import isStream = require('is-stream');
  34. isStream.readable(fs.createReadStream('unicorn.png'));
  35. //=> true
  36. ```
  37. */
  38. readable(stream: unknown): stream is stream.Readable;
  39. /**
  40. @returns Whether `stream` is a [`stream.Duplex`](https://nodejs.org/api/stream.html#stream_class_stream_duplex).
  41. @example
  42. ```
  43. import {Duplex} from 'stream';
  44. import isStream = require('is-stream');
  45. isStream.duplex(new Duplex());
  46. //=> true
  47. ```
  48. */
  49. duplex(stream: unknown): stream is stream.Duplex;
  50. /**
  51. @returns Whether `stream` is a [`stream.Transform`](https://nodejs.org/api/stream.html#stream_class_stream_transform).
  52. @example
  53. ```
  54. import * as fs from 'fs';
  55. import Stringify = require('streaming-json-stringify');
  56. import isStream = require('is-stream');
  57. isStream.transform(Stringify());
  58. //=> true
  59. ```
  60. */
  61. transform(input: unknown): input is stream.Transform;
  62. };
  63. export = isStream;