<commit_before>// @flow

declare module "redux-saga" {
  import typeof * as _effects from "redux-saga/effects";
  declare export var effects: _effects;

  declare export interface Channel {
    take: (cb: (msg: mixed) => void) => void;
    put: (msg: mixed) => void;
    flush: (cb: (msgs: mixed) => void) => void;
    close: () => void;
  }

  declare export interface Task<T> {
    isRunning: () => boolean;
    isCancelled: () => boolean;
    result: () => T | void;
    error: () => Error | void;
    cancel: () => void;
    done: Promise<T>;
  }

  declare export interface Buffer {
    isEmpty: () => boolean;
    put: (msg: mixed) => void;
    take(): mixed;
  }

  declare export interface SagaMonitor {
    effectTriggered: (options: {
      +effectId: number,
      +parentEffectId: number,
      +label: string,
      +effect: Effect
    }) => void;
    effectResolved: (effectId: number, result: mixed) => void;
    effectRejected: (effectId: number, error: Error) => void;
    effectCancelled: (effectId: number) => void;
    actionDispatched: (action: mixed) => void;
  }

  declare export type Saga<T> = Generator<Effect, T, any>;

  declare export var eventChannel: (
    sub: (emit: (msg: any) => void) => () => void,
    buffer?: Buffer,
    matcher?: (msg: mixed) => boolean
  ) => Channel;

  declare export var buffers: {
    +none: () => Buffer,
    +fixed: (limit?: number) => Buffer,
    +dropping: (limit?: number) => Buffer,
    +sliding: (limit?: number) => Buffer,
    +expanding: (initialSize?: number) => Buffer
  };

  declare export var channel: (buffer?: Buffer) => Channel;
  declare export var END: { +type: "@@redux-saga/CHANNEL_END" };
  declare export var CANCEL: Symbol;
  declare export var delay: (timeout: number) => Promise<void>;

  declare type RunSagaOptions = {
    +subscribe?: (emit: (input: any) => any) => () => void,
    +dispatch?: (output: any) => any,
    +getState?: () => any,
    +sagaMonitor?: SagaMonitor,
    +logger?: (
      level: "info" | "warning" | "error",
      ...args: Array<any>
    ) => void,
    +onError?: (error: Error) => void
  };

  declare export var runSaga: {
    <R, Fn: () => Saga<R>>(options: RunSagaOptions, saga: Fn): Task<R>,
    <R, T1, Fn: (t1: T1) => Saga<R>>(
      options: RunSagaOptions,<commit_msg>Redux saga update delay signature (#2502)<commit_after>// @flow

declare module "redux-saga" {
  import typeof * as _effects from "redux-saga/effects";
  declare export var effects: _effects;

  declare export interface Channel {
    take: (cb: (msg: mixed) => void) => void;
    put: (msg: mixed) => void;
    flush: (cb: (msgs: mixed) => void) => void;
    close: () => void;
  }

  declare export interface Task<T> {
    isRunning: () => boolean;
    isCancelled: () => boolean;
    result: () => T | void;
    error: () => Error | void;
    cancel: () => void;
    done: Promise<T>;
  }

  declare export interface Buffer {
    isEmpty: () => boolean;
    put: (msg: mixed) => void;
    take(): mixed;
  }

  declare export interface SagaMonitor {
    effectTriggered: (options: {
      +effectId: number,
      +parentEffectId: number,
      +label: string,
      +effect: Effect
    }) => void;
    effectResolved: (effectId: number, result: mixed) => void;
    effectRejected: (effectId: number, error: Error) => void;
    effectCancelled: (effectId: number) => void;
    actionDispatched: (action: mixed) => void;
  }

  declare export type Saga<T> = Generator<Effect, T, any>;

  declare export var eventChannel: (
    sub: (emit: (msg: any) => void) => () => void,
    buffer?: Buffer,
    matcher?: (msg: mixed) => boolean
  ) => Channel;

  declare export var buffers: {
    +none: () => Buffer,
    +fixed: (limit?: number) => Buffer,
    +dropping: (limit?: number) => Buffer,
    +sliding: (limit?: number) => Buffer,
    +expanding: (initialSize?: number) => Buffer
  };

  declare export var channel: (buffer?: Buffer) => Channel;
  declare export var END: { +type: "@@redux-saga/CHANNEL_END" };
  declare export var CANCEL: Symbol;
  declare export var delay: (timeout: number, val?: any) => Promise<any>;

  declare type RunSagaOptions = {
    +subscribe?: (emit: (input: any) => any) => () => void,
    +dispatch?: (output: any) => any,
    +getState?: () => any,
    +sagaMonitor?: SagaMonitor,
    +logger?: (
      level: "info" | "warning" | "error",
      ...args: Array<any>
    ) => void,
    +onError?: (error: Error) => void
  };

  declare export var runSaga: {
    <R, Fn: () => Saga<R>>(options: RunSagaOptions, saga: Fn): Task<R>,
    <R, T1, Fn: (t1: T1) => Saga<R>>(
      options: RunSagaOptions,
{'fraction_non_alphanumeric': 0.1733679204496325, 'fraction_numerical': 0.00216169476869866, 'mean_word_length': 3.160971223021583, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 103, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '983106', 'n_tokens_mistral': 1568, 'n_tokens_neox': 1530, 'n_words': 450}