a zip code crypto-currency system good for red ONLY

windowCount.d.ts 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { Observable } from '../Observable';
  2. /**
  3. * Branch out the source Observable values as a nested Observable with each
  4. * nested Observable emitting at most `windowSize` values.
  5. *
  6. * <span class="informal">It's like {@link bufferCount}, but emits a nested
  7. * Observable instead of an array.</span>
  8. *
  9. * <img src="./img/windowCount.png" width="100%">
  10. *
  11. * Returns an Observable that emits windows of items it collects from the source
  12. * Observable. The output Observable emits windows every `startWindowEvery`
  13. * items, each containing no more than `windowSize` items. When the source
  14. * Observable completes or encounters an error, the output Observable emits
  15. * the current window and propagates the notification from the source
  16. * Observable. If `startWindowEvery` is not provided, then new windows are
  17. * started immediately at the start of the source and when each window completes
  18. * with size `windowSize`.
  19. *
  20. * @example <caption>Ignore every 3rd click event, starting from the first one</caption>
  21. * var clicks = Rx.Observable.fromEvent(document, 'click');
  22. * var result = clicks.windowCount(3)
  23. * .map(win => win.skip(1)) // skip first of every 3 clicks
  24. * .mergeAll(); // flatten the Observable-of-Observables
  25. * result.subscribe(x => console.log(x));
  26. *
  27. * @example <caption>Ignore every 3rd click event, starting from the third one</caption>
  28. * var clicks = Rx.Observable.fromEvent(document, 'click');
  29. * var result = clicks.windowCount(2, 3)
  30. * .mergeAll(); // flatten the Observable-of-Observables
  31. * result.subscribe(x => console.log(x));
  32. *
  33. * @see {@link window}
  34. * @see {@link windowTime}
  35. * @see {@link windowToggle}
  36. * @see {@link windowWhen}
  37. * @see {@link bufferCount}
  38. *
  39. * @param {number} windowSize The maximum number of values emitted by each
  40. * window.
  41. * @param {number} [startWindowEvery] Interval at which to start a new window.
  42. * For example if `startWindowEvery` is `2`, then a new window will be started
  43. * on every other value from the source. A new window is started at the
  44. * beginning of the source by default.
  45. * @return {Observable<Observable<T>>} An Observable of windows, which in turn
  46. * are Observable of values.
  47. * @method windowCount
  48. * @owner Observable
  49. */
  50. export declare function windowCount<T>(this: Observable<T>, windowSize: number, startWindowEvery?: number): Observable<Observable<T>>;