File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -492,14 +492,18 @@ export type IntrospectedInputGuesserProps = Partial<InputProps> &
492492 'filter' | 'page' | 'perPage' | 'sort' | 'enableGetChoices'
493493 > ;
494494
495- export type InputGuesserProps = Omit <
495+ // Thanks Tkdodo!
496+ // https://tkdodo.eu/blog/omit-for-discriminated-unions-in-type-script#distributive-omit
497+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
498+ export type DistributiveOmit < T , K extends keyof T > = T extends any
499+ ? Omit < T , K >
500+ : never ;
501+
502+ export type InputGuesserProps = DistributiveOmit <
496503 InputProps & Omit < BaseIntrospecterProps , 'resource' > ,
497504 'component'
498505> & {
499506 transformEnum ?: ( value : string | number ) => string | number ;
500- // due to the union type some TextInputProps don't surface in the final type, re-adding them here
501- multiline ?: boolean ;
502- readOnly ?: boolean ;
503507} & Pick <
504508 ReferenceInputProps | ReferenceArrayInputProps ,
505509 'filter' | 'page' | 'perPage' | 'sort' | 'enableGetChoices'
You can’t perform that action at this time.
0 commit comments