declare module 'genetic-js' {
  interface GeneticConfig {
    size?: number
    crossover?: number
    mutation?: number
    iterations?: number
    fittestAlwaysSurvives?: boolean
    webWorkers?: boolean
    skip?: number
    maxResults?: number
  }

  interface GeneticStats {
    generation: number
    fittest: any
    fitness: number
    average: number
    worst: number
  }

  interface Genetic {
    seed: () => any
    fitness: (individual: any) => number | Promise<number>
    mutate?: (individual: any) => any
    crossover?: (mother: any, father: any) => [any, any]
    select1?: (population: any[]) => any
    select2?: (population: any[]) => [any, any]
    generation?: (population: any[], generation: number, stats: GeneticStats) => boolean | Promise<boolean>
    notification?: (population: any[], generation: number, stats: GeneticStats, isFinished: boolean) => void
    optimize: any
    evolve: () => Promise<any>
    size: number
    crossover: number
    mutation: number
    iterations: number
    fittestAlwaysSurvives: boolean
  }

  interface GeneticStatic {
    create: (config?: GeneticConfig) => Genetic
    Optimize: {
      Minimize: any
      Maximize: any
    }
    Select1: {
      Tournament2: any
      Tournament3: any
      Fittest: any
      Random: any
      RandomLinearRank: any
      Sequential: any
    }
    Select2: {
      Tournament2: any
      Tournament3: any
      Random: any
      RandomLinearRank: any
      Sequential: any
      FittestRandom: any
    }
  }

  const Genetic: GeneticStatic
  export = Genetic
} 