UNPKG

yarfl

Version:

Yet Another Redux Forms Library

30 lines (29 loc) 2.53 kB
import { CompleteConfig, FieldState, FormState, Model } from '../typings'; export declare const firstDefined: (...args: any[]) => any; export declare const capitalize: (str: string) => string; export declare const titleCase: (str: string) => string; export declare const kebabCase: (str: string) => string; export declare const camelCase: (str: string) => string; export declare const isNonEmptyArray: (test: any) => boolean; export declare const parseKey: (key: string, endWith?: string | string[] | undefined) => any[]; export declare const removeAt: <T>(arr: T[], index: number, count?: number) => any; export declare const append: <T>(arr: T[], value: T) => any; export declare const getIn: <T>(obj: object | any[], path: (string | number)[]) => any; export declare const setInWithKey: <T>(state: T, key: string, target: string, value: any) => any; export declare const setInWithPath: <T>(obj: T, path: (string | number)[], value: any) => any; export declare const mergeIn: <T extends object>(state: T, key: string, value: object) => T; export declare const mergeDeep: any; export declare const mergeDeepIn: <T extends object>(state: T, key: string, value: object) => any; export declare const mergeUp: <T extends object>(state: T, key: string, value: object) => any; export declare const selectField: <T extends FormState<any> | CompleteConfig<any>>(target: T, key: string, graceful?: boolean) => any; export declare const extract: <S extends object>(fields: Model<S, FieldState>, key: "extra" | "name" | "showErrors" | "fieldType" | "errors" | "initial" | "options" | "changed" | "touched" | "focused" | "constructor" | "toString" | "toLocaleString" | "valueOf" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable" | "key" | "rules" | "value" | "default" | "id" | "className" | "type" | "label" | "placeholder" | "multiple" | "checked" | "disabled" | "autoFocus" | "autoComplete", options?: { ignoreEmptyStrings?: boolean | undefined; flatten?: boolean | undefined; } | undefined) => object; export declare const throwError: (...errorMessage: string[]) => never; export declare const logError: (...errorMessage: string[]) => void; export declare const logWarning: (...errorMessage: string[]) => void; export declare const flatten: (target: object | any[]) => any; export declare const pick: <T extends object>(target: T, props: (keyof T & string)[]) => any; export declare const omit: <T extends object>(target: T, props: (keyof T & string)[]) => any; export declare const isPromise: (target: any) => boolean;