ratio-lock
Version:
A TypeScript library for managing n numbers with locked ratios. When the ratio is locked, changing one value automatically adjusts all other values to maintain their proportional relationships.
10 lines • 534 B
TypeScript
import type { ChangeEvent } from 'react';
import type { FieldValues, Path } from 'react-hook-form';
import type { FieldProps } from './field-props.js';
/**
* Creates the fields object with props for each field
*/
export declare function createFieldsObject<T extends FieldValues, TNames extends readonly Path<T>[]>(names: TNames, watchedValues: unknown[], createOnChange: (index: number) => (e: ChangeEvent<HTMLInputElement>) => void): {
[K in TNames[number]]: FieldProps<K>;
};
//# sourceMappingURL=create-fields-object.d.ts.map