ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>
type ArgsFn<T> = {
target: T;
}
function handleChange(event: ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>)
fn(arg: ArgsFn<Arg | Arg2 | Arg3>)
fn(arg: Arg | Arg2 | Arg3)
interface Arg {
target: string;
value: string;
}
interface Arg2 {
target: string;
value: string;
state: boolean;
}
interface Arg3 {
target: string;
checked: boolean;
state: boolean;
}
type ArgsFn<T> = {
(arg: T): T
}
const arg = {
target: 'hello world'
}
function fn(arg: ArgsFn<Arg | Arg2 | Arg3>) {
const { target } = arg
console.log('target', target)
}
npm run dev
process.pid
, то тогда process.kill(process.pid)
interface BasicFormValues {
name: string;
description: string;
car: string;
active: boolean;
}
type BasicFormTypeValues = BasicFormValues[keyof BasicFormValues];
let value: BasicFormTypeValues = event.target.value;