All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ducks.form.Actions.d.ts Maven / Gradle / Ivy

The newest version!
import { Action, Meta } from '../Action'

import { Field, Form } from './types'

export interface FormPayload {
    formName: string
}

export type Tooltip = string | null

export type FormAction<
    TPayload extends FormPayload,
    TMeta extends Meta = Meta,
> = Action

export type RegisterAction = FormAction<{
    formName: string
    initState: Partial
}> export type RemoveAction = FormAction<{ formName: string }> export type FieldAction = FormAction export type RegisterFieldAction = FieldAction<{ initialState: Partial }> export type UnregisterFieldAction = FieldAction export type FocusFieldAction = FieldAction export type BlurFieldAction = FieldAction export type SetFieldDisabledAction = FieldAction<{ disabled: boolean }> export type SetFieldLoadingAction = FieldAction<{ loading: boolean }> export type SetFieldRequiredAction = FieldAction<{ required: boolean }> export type SetFieldVisibleAction = FieldAction<{ visible: boolean }> export type SetFieldTooltipAction = FieldAction<{ tooltip: Tooltip }> export type DangerouslySetFieldValue = FieldAction<{ key: string value: unknown }> export type FieldsAction = FormAction export type TouchFieldsAction = FieldsAction export type SetMultiFieldDisabledAction = FieldsAction<{ disabled: boolean }> export type SetMultiFieldVisibleAction = FieldsAction<{ visible: boolean }> export type SetDirtyPayload = FormAction<{ formName: string data: boolean }>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy