【发布时间】:2022-12-03 14:55:38
【问题描述】:
How to extend generic type generics of type to function? Is it possible to reuse generics without copy paste?
type T<FormType extends \'edit\' | \'create\' = \'create\', RecordType extends Record = Record> = {
type: FormType,
record: RecordType
}
const func = <FormType extends \'edit\' | \'create\' = \'create\', RecordType extends Record = Record>(props: T<FormType, RecordType>) => ...
How to extend this <FormType extends \'edit\' | \'create\' = \'create\', RecordType extends Record = Record> from type generics to function generics without copy paste?
标签: typescript generics typescript-typings typescript-generics
\'edit\' | \'create\'.