redux-form/redux-form

View on GitHub
src/immutable.js.flow

Summary

Maintainability
Test Coverage
// @flow
import * as React from 'react'
import type { ComponentType } from 'react'
import type { Action, GetFormState, Context, ReactContext } from './types'
import type { Params as DefaultShouldAsyncValidateParams } from './defaultShouldAsyncValidate'
import type { Params as DefaultShouldValidateParams } from './defaultShouldValidate'
import type { Params as DefaultShouldErrorParams } from './defaultShouldError'
import type { Params as DefaultShouldWarnParams } from './defaultShouldWarn'
import type { Config as ReduxFormConfig } from './createReduxForm'
import type { Props as _FormProps } from './Form'
import type { Props as _FormNameProps } from './FormName'
import type {
  DefaultProps as FormSectionDefaultProps,
  Props as _FormSectionProps
} from './FormSection'
import type {
  Props as FieldInputProps,
  FieldProps as _FieldProps
} from './FieldProps.types'
import type { Props as FieldsInputProps } from './FieldsProps.types'
import type {
  Props as FieldArrayInputProps,
  FieldArrayProps as _FieldArrayProps
} from './FieldArrayProps.types'
import type { FormValueSelectorInterface } from './formValueSelector.types'
import type { FormValuesInterface } from './formValues.types'
import type { GetFormErrorInterface } from './selectors/getFormError.types'
import type { GetFormNamesInterface } from './selectors/getFormNames.types'
import type { GetFormValuesInterface } from './selectors/getFormValues.types'
import type { GetFormInitialValuesInterface } from './selectors/getFormInitialValues.types'
import type { GetFormSyncErrorsInterface } from './selectors/getFormSyncErrors.types'
import type { GetFormMetaInterface } from './selectors/getFormMeta.types'
import type { GetFormAsyncErrorsInterface } from './selectors/getFormAsyncErrors.types'
import type { GetFormSyncWarningsInterface } from './selectors/getFormSyncWarnings.types'
import type { GetFormSubmitErrorsInterface } from './selectors/getFormSubmitErrors.types'
import type { HasSubmitSucceededInterface } from './selectors/hasSubmitSucceeded.types'
import type { HasSubmitFailedInterface } from './selectors/hasSubmitFailed.types'
import type { IsDirtyInterface } from './selectors/isDirty.types'
import type { IsInvalidInterface } from './selectors/isInvalid.types'
import type { IsPristineInterface } from './selectors/isPristine.types'
import type { IsValidInterface } from './selectors/isValid.types'
import type { IsSubmittingInterface } from './selectors/isSubmitting.types'
import type { Config as ValuesConfig } from './values.types'
import type { ActionTypes } from './actionTypes.types'
import type {
  ArrayInsert,
  ArrayMove,
  ArrayPop,
  ArrayPush,
  ArrayRemove,
  ArrayRemoveAll,
  ArrayShift,
  ArraySplice,
  ArraySwap,
  ArrayUnshift,
  Autofill,
  Blur,
  Change,
  ClearSubmitErrors,
  Destroy,
  Focus,
  Initialize,
  RegisterField,
  Reset,
  ResetSection,
  SetSubmitFailed,
  SetSubmitSucceeded,
  StartAsyncValidation,
  StartSubmit,
  StopAsyncValidation,
  StopSubmit,
  Submit,
  Touch,
  UnregisterField,
  Untouch
} from './actions.types'

type StructureMap = Object

declare export var ReduxFormContext: React.Context<Context>

export type FormProps = _FormProps
export type FormNameProps = _FormNameProps
export type FormSectionProps = _FormSectionProps
export type FieldProps = _FieldProps
export type FieldArrayProps = _FieldArrayProps

declare export var actionTypes: ActionTypes

declare export function defaultShouldAsyncValidate(
  params: DefaultShouldAsyncValidateParams
): boolean

declare export function defaultShouldValidate(
  params: DefaultShouldValidateParams
): boolean

declare export function defaultShouldError(
  params: DefaultShouldErrorParams
): boolean

declare export function defaultShouldWarn(
  params: DefaultShouldWarnParams
): boolean

declare export var propTypes: Object

declare export var fieldInputPropTypes: Object

declare export var fieldMetaPropTypes: Object

declare export var fieldPropTypes: Object

declare export var fieldArrayFieldsPropTypes: Object

declare export var fieldArrayMetaPropTypes: Object

declare export var fieldArrayPropTypes: Object

declare export var formPropTypes: Object

declare export var FormName: ComponentType<FormNameProps>

declare export var Field: ComponentType<FieldInputProps>

declare export var Fields: ComponentType<FieldsInputProps>

declare export var FieldArray: ComponentType<FieldArrayInputProps>

declare export var Form: ComponentType<FormProps>

declare export var FormSection: ComponentType<FormSectionProps>

declare export function formValueSelector(
  form: string,
  getFormState: ?GetFormState
): FormValueSelectorInterface

declare export function formValues(
  firstArg: string | Object,
  ...rest: string[]
): FormValuesInterface

declare export function getFormError(
  getFormState: ?GetFormState
): GetFormErrorInterface<any>

declare export function getFormNames(
  getFormState: ?GetFormState
): GetFormNamesInterface<any>

declare export function getFormValues(
  form: string,
  getFormState: ?GetFormState
): GetFormValuesInterface

declare export function getFormInitialValues(
  form: string,
  getFormState: ?GetFormState
): GetFormInitialValuesInterface

declare export function getFormSyncErrors(
  form: string,
  getFormState: ?GetFormState
): GetFormSyncErrorsInterface

declare export function getFormMeta(
  form: string,
  getFormState: ?GetFormState
): GetFormMetaInterface

declare export function getFormAsyncErrors(
  form: string,
  getFormState: ?GetFormState
): GetFormAsyncErrorsInterface

declare export function getFormSyncWarnings(
  form: string,
  getFormState: ?GetFormState
): GetFormSyncWarningsInterface

declare export function getFormSubmitErrors(
  form: string,
  getFormState: ?GetFormState
): GetFormSubmitErrorsInterface

declare export function hasSubmitSucceeded(
  form: string,
  getFormState: ?GetFormState
): HasSubmitSucceededInterface

declare export function hasSubmitFailed(
  form: string,
  getFormState: ?GetFormState
): HasSubmitFailedInterface

declare export function isDirty(
  form: string,
  getFormState: ?GetFormState
): IsDirtyInterface

declare export function isInvalid(
  form: string,
  getFormState: ?GetFormState
): IsInvalidInterface

declare export function isPristine(
  form: string,
  getFormState: ?GetFormState
): IsPristineInterface

declare export function isValid(
  form: string,
  getFormState: ?GetFormState
): IsValidInterface

declare export function isSubmitting(
  form: string,
  getFormState: ?GetFormState
): IsSubmittingInterface

declare export function reduxForm(
  config: ReduxFormConfig
): { (WrappedComponent: ComponentType<any>): ComponentType<any> }

declare export function reducer(state: any, action: Action): any

declare export class SubmissionError {
  constructor(errors: Object): void;
}

declare export function values(
  config: ValuesConfig
): { (ComponentType<any>): ComponentType<any> }

// Action creators
declare export var arrayInsert: ArrayInsert
declare export var arrayMove: ArrayMove
declare export var arrayPop: ArrayPop
declare export var arrayPush: ArrayPush
declare export var arrayRemove: ArrayRemove
declare export var arrayRemoveAll: ArrayRemoveAll
declare export var arrayShift: ArrayShift
declare export var arraySplice: ArraySplice
declare export var arraySwap: ArraySwap
declare export var arrayUnshift: ArrayUnshift
declare export var autofill: Autofill
declare export var blur: Blur
declare export var change: Change;
declare export var clearSubmitErrors: ClearSubmitErrors
declare export var destroy: Destroy
declare export var focus: Focus
declare export var initialize: Initialize
declare export var registerField: RegisterField
declare export var reset: Reset
declare export var resetSection: ResetSection
declare export var setSubmitFailed: SetSubmitFailed
declare export var setSubmitSucceeded: SetSubmitSucceeded
declare export var startAsyncValidation: StartAsyncValidation
declare export var startSubmit: StartSubmit
declare export var stopAsyncValidation: StopAsyncValidation
declare export var stopSubmit: StopSubmit
declare export var submit: Submit
declare export var touch: Touch
declare export var unregisterField: UnregisterField
declare export var untouch: Untouch