stream.d.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * Create a duplex (readable and writable) stream.
  3. *
  4. * Some of the work to parse markdown can be done streaming, but in the
  5. * end buffering is required.
  6. *
  7. * micromark does not handle errors for you, so you must handle errors on whatever
  8. * streams you pipe into it.
  9. * As markdown does not know errors, `micromark` itself does not emit errors.
  10. *
  11. * @param {Options | null | undefined} [options]
  12. * Configuration (optional).
  13. * @returns {MinimalDuplex}
  14. * Duplex stream.
  15. */
  16. export function stream(options?: Options | null | undefined): MinimalDuplex;
  17. export type Options = import("micromark-util-types").Options;
  18. /**
  19. * Function called when write was successful.
  20. */
  21. export type Callback = () => undefined;
  22. /**
  23. * Configuration for piping.
  24. */
  25. export type PipeOptions = {
  26. /**
  27. * Whether to end the destination stream when the source stream ends.
  28. */
  29. end?: boolean | null | undefined;
  30. };
  31. /**
  32. * Duplex stream.
  33. */
  34. export type MinimalDuplex = Omit<NodeJS.ReadableStream & NodeJS.WritableStream, "isPaused" | "pause" | "read" | "resume" | "setEncoding" | "unpipe" | "unshift" | "wrap">;
  35. //# sourceMappingURL=stream.d.ts.map