// @flow
import {Component} from 'react'

type Background =
  'Announcements'
| 'Documentation'
| 'HighRisk'
| 'Information'
| 'Normal'
| 'Success'
| 'Terminal'

type TextType =
  'Body'
| 'BodyBig'
| 'BodyBigLink'
| 'BodyError'
| 'BodyPrimaryLink'
| 'BodySecondaryLink'
| 'BodySemibold'
| 'BodySemiboldLink'
| 'BodySemiboldItalic'
| 'BodySmall'
| 'BodySmallError'
| 'BodySmallInlineLink'
| 'BodySmallItalic'
| 'BodySmallPrimaryLink'
| 'BodySmallSecondaryLink'
| 'BodySmallSemibold'
| 'BodySmallSemiboldItalic'
| 'BodySmallSemiboldInlineLink'
| 'BodySmallSuccess'
| 'BodySuccess'
| 'Header'
| 'HeaderBig'
| 'HeaderLink'
| 'Terminal'
| 'TerminalComment'
| 'TerminalEmpty'
| 'TerminalInline'

type Props = {
  backgroundMode?: Background,
  children?: React$Element<*>,
  className?: string,
  lineClamp?: number,
  onClick?: ?(e: SyntheticEvent) => void,
  onClickURL?: ?string,
  onPress?: void,
  style?: Object,
  type: TextType,
  title?: ?string,
}

type MetaType = {
  fontSize: number,
  colorForBackgroundMode: {[key: Background]: ?string},
  isLink?: true,
  styleOverride?: ?Object,
  isTerminal?: true,
}

declare class Text extends Component<void, Props, void> {}
declare function getStyle (type: TextType, backgroundMode?: ?Background, lineClamp?: ?number, clickable?: ?boolean): Object

export {
  getStyle,
}

export type {
  Background,
  MetaType,
  Props,
  TextType,
}

export default Text
