UNPKG

@appbuckets/react-ui-smart-components

Version:

UI Extended Components that work with @appbuckets/react-client and @appbuckets/react-ui

35 lines (34 loc) 1.04 kB
import * as Yup from 'yup'; /** * A validator function that will assert a field is a valid number. * This is useful used in combination with HookedSelect to easily extract * a value from a chosen option. * * @param mapper The function used to extract data */ export declare function identity<T extends {}>( mapper: (item: T) => number | null ): Yup.NumberSchema< number | undefined, import('yup/lib/types').AnyObject, number | undefined >; /** * A validator function that will assert a field is a valid number array. * This is useful used in combination with HookedMultiSelect to easily extract * a value for each item in the array * * @param mapper The function used to extract data */ export declare function identities<T extends {}>( mapper: (item: T) => number | null ): Yup.ArraySchema< Yup.NumberSchema< number | undefined, import('yup/lib/types').AnyObject, number | undefined >, import('yup/lib/types').AnyObject, (number | undefined)[] | undefined, (number | undefined)[] | undefined >;