/* @flow */ import React, {Component} from 'react' import defaultFormatter from './defaultFormatter' import dateParser from './dateParser' export type Unit = | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' export type Suffix = | 'ago' | 'from now' export type Formatter = ( value: number, unit: Unit, suffix: Suffix, epochSeconds: number, nextFormatter?: Formatter ) => string | React$Element export type Props = { /** If the component should update itself over time */ +live: boolean, /** minimum amount of time in seceonds between re-renders */ +minPeriod: number, /** Maximum time between re-renders in seconds. * The component should update at least once every `x` seconds */ +maxPeriod: number, /** The container to render the string into. * You could use a string like `span` or a custom component */ +component: string | ReactClass, /** * A title used for setting the title attribute if a