@shopify/react-form
Version:
Manage react forms tersely and safely-typed with no magic using React hooks.
8 lines (7 loc) • 573 B
TypeScript
import { ChangeEvent } from 'react';
import { Validates, FieldOutput, Field, Validator } from './types';
export declare function isField<T extends object>(input: FieldOutput<T>): input is Field<T>;
export declare function mapObject<Output>(input: any, mapper: (value: any, key: any) => any): Output;
export declare function normalizeValidation<Value, Context extends object = {}>(input: Validates<Value, Context>): Validator<Value, Context>[];
export declare function isChangeEvent(value: any): value is ChangeEvent<HTMLInputElement>;
export declare function noop(): void;