2023-02-17 05:50:50 +00:00
|
|
|
type MapToInputType = Pick<MapToType, 'boolean' | 'number' | 'string'>;
|
2022-11-26 02:56:50 +00:00
|
|
|
|
|
|
|
type InputOnChangeParameters = Parameters<
|
|
|
|
Exclude<import('@mui/material').InputBaseProps['onChange'], undefined>
|
|
|
|
>;
|
|
|
|
|
|
|
|
type StateSetter = (value: unknown) => void;
|
|
|
|
|
|
|
|
type CreateInputOnChangeHandlerOptions<TypeName extends keyof MapToInputType> =
|
|
|
|
{
|
|
|
|
postSet?: (...args: InputOnChangeParameters) => void;
|
|
|
|
preSet?: (...args: InputOnChangeParameters) => void;
|
|
|
|
set?: StateSetter;
|
|
|
|
setType?: TypeName;
|
2023-02-17 05:50:50 +00:00
|
|
|
valueKey?: Extract<
|
|
|
|
keyof import('react').ChangeEvent<HTMLInputElement>['target'],
|
|
|
|
'checked' | 'value'
|
|
|
|
>;
|
2022-11-26 02:56:50 +00:00
|
|
|
};
|