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

export type URLMap = {
  '200': string,
  '360': string,
  '40': string,
}

export type AvatarSize = 176 | 112 | 80 | 64 | 48 | 40 | 32 | 24 | 16
export type UserPictureSize = 360 | 200 | 40
export type AvatarLookupCallback = (username: string, urlMap: ?URLMap) => void
export type AvatarLookup = (username: string) => ?URLMap
export type AvatarLoad = (username: string, callback: AvatarLookupCallback) => void
export type URLType = ?(string | Array<{height: number, width: number, uri: string}>)

export type Props = {
  borderColor?: string,
  children?: any,
  following?: ?boolean,
  followsYou?: ?boolean,
  loadingColor?: string,
  onAvatarLoaded?: () => void,
  onClick?: ?(() => void),
  opacity?: number,
  size: AvatarSize,
  style?: ?Object,
  // TODO flow type to allow one or the other, not both url and username etc
  url?: ?string,
  username?: ?string,
}

export default class Avatar extends Component<void, Props, void> { }

export function initLookup (lookup: AvatarLookup) { }
export function initLoad (load: AvatarLoad) { }
