// @flow import * as React from 'react' /* Utils */ type Updater = (value: ((updater: T) => T) | T) => void /* Active */ type ActiveChange = (active: boolean) => void type ActiveRender = ({| active: boolean, bind: {| onMouseDown: () => void, onMouseUp: () => void |}, |}) => React.Node declare export var Active: React.ComponentType< | {| onChange?: ActiveChange, render: ActiveRender |} | {| onChange?: ActiveChange, children: ActiveRender |} > /* Compose */ declare export var Compose: React.ComponentType /* Counter */ type CounterChange = (count: number) => void type CounterRender = ({| count: number, inc: () => void, dec: () => void, incBy: (step: number) => void, decBy: (step: number) => void, |}) => React.Node declare export var Counter: React.ComponentType< | {| initial?: number, onChange?: CounterChange, render: CounterRender |} | {| initial?: number, onChange?: CounterChange, children: CounterRender |} > /* Focus */ type FocusChange = (focused: boolean) => void type FocusRender = ({| focused: boolean, bind: {| onFocus: () => void, onBlur: () => void |}, |}) => React.Node declare export var Focus: React.ComponentType< | {| onChange?: FocusChange, render: FocusRender |} | {| onChange?: FocusChange, children: FocusRender |} > /* FocusManager */ type FocusManagerChange = (focused: boolean) => void type FocusManagerRender = ({| focused: boolean, blur: () => void, bind: {| tabIndex: number, onFocus: () => void, onBlur: () => void, onMouseDown: () => void, onMouseUp: () => void, |}, |}) => React.Node declare export var FocusManager: React.ComponentType< | {| onChange?: FocusManagerChange, render: FocusManagerRender |} | {| onChange?: FocusManagerChange, children: FocusManagerRender |} > /* Form */ type FormChange = T => void type FormRender = ({| values: T, input: >( key: K ) => {| value: string, set: Updater, bind: {| value: string, onChange: (SyntheticInputEvent<*>) => void, |}, |}, |}) => React.Node type FormProps = | {| initial: T, onChange?: FormChange, render: FormRender |} | {| initial: T, onChange?: FormChange, children: FormRender |} declare export class Form extends React.Component< FormProps, * > {} /* Hover */ type HoverChange = (hovered: boolean) => void type HoverRender = ({| hovered: boolean, bind: {| onMouseEnter: () => void, onMouseLeave: () => void |}, |}) => React.Node declare export var Hover: React.ComponentType< | {| onChange?: HoverChange, render: HoverRender |} | {| onChange?: HoverChange, children: HoverRender |} > /* Input */ type InputChange = (value: string) => void type InputRender = ({| value: string, set: Updater, bind: {| value: string, onChange: (SyntheticInputEvent<*>) => void |}, |}) => React.Node declare export var Input: React.ComponentType< | {| initial?: string, onChange?: InputChange, render: InputRender |} | {| initial?: string, onChange?: InputChange, children: InputRender |} > /* List */ type ListChange = (list: $ReadOnlyArray) => void type ListRender = ({| list: $ReadOnlyArray, first: () => T | void, last: () => T | void, set: Updater<$ReadOnlyArray>, push: (...values: $ReadOnlyArray) => void, pull: (predicate: (T) => boolean) => void, sort: (compare: (a: T, b: T) => -1 | 0 | 1) => void, |}) => React.Node type ListProps = | {| initial: $ReadOnlyArray, onChange?: ListChange, render: ListRender, |} | {| initial: $ReadOnlyArray, onChange?: ListChange, children: ListRender, |} declare export class List extends React.Component, *> {} /* Set */ type SetChange = (values: $ReadOnlyArray) => void type SetRender = ({| values: $ReadOnlyArray, add: (key: T) => void, clear: () => void, remove: (key: T) => void, has: (key: T) => boolean, |}) => React.Node type SetProps = | {| initial: $ReadOnlyArray, onChange?: SetChange, render: SetRender, |} | {| initial: $ReadOnlyArray, onChange?: SetChange, children: SetRender, |} declare export class Set extends React.Component> {} /* Map */ type MapChange = T => void type MapRender> = ({| values: T, set: (key: K, value: $ElementType) => void, over: (key: K, fn: ($ElementType) => $ElementType) => void, get: (key: K) => $ElementType, |}) => React.Node type MapProps = | {| initial: T, onChange?: MapChange, render: MapRender |} | {| initial: T, onChange?: MapChange, children: MapRender |} declare export class Map extends React.Component, *> {} /* State */ type StateChange = T => void type StateRender = ({| state: T, setState: (updated: $Shape | (T => $Shape), cb?: () => void) => void, |}) => React.Node type StateProps = | {| initial: T, onChange?: StateChange, render: StateRender |} | {| initial: T, onChange?: StateChange, children: StateRender |} declare export class State extends React.Component> {} /* Interval */ type IntervalRender = ({| start: (delay?: number) => void, stop: () => void, toggle: () => void, |}) => React.Node type IntervalProps = | {| delay?: ?number, render: IntervalRender |} | {| delay?: ?number, children: IntervalRender |} declare export class Interval extends React.Component {} /* Toggle */ type ToggleChange = (on: boolean) => void type ToggleRender = ({| on: boolean, toggle: () => void, set: Updater, |}) => React.Node declare export var Toggle: React.ComponentType< | {| initial?: boolean, onChange?: ToggleChange, render: ToggleRender |} | {| initial?: boolean, onChange?: ToggleChange, children: ToggleRender |} > /* Touch */ type TouchChange = (touched: boolean) => void type TouchRender = ({| touched: boolean, bind: {| onTouchStart: () => void, onTouchEnd: () => void |}, |}) => React.Node declare export var Touch: React.ComponentType< | {| onChange?: TouchChange, render: TouchRender |} | {| onChange?: TouchChange, children: TouchRender |} > /* Value */ type ValueChange = (value: T) => void type ValueRender = ({| value: T, set: Updater, |}) => React.Node type ValueProps = | {| initial: T, onChange?: ValueChange, render: ValueRender |} | {| initial: T, onChange?: ValueChange, children: ValueRender |} declare export class Value extends React.Component> {} /* composeEvents */ type Events = { [name: string]: Function } declare export function composeEvents(...Array): Events