From 98720a78eabba13319804ed5412f7679b3c3e904 Mon Sep 17 00:00:00 2001 From: Nuey San Waldman Date: Fri, 9 Feb 2024 14:56:05 +0100 Subject: [PATCH] Rename plural Types to singular Type and rename AsProp to PropsFromAs --- .../PolymorphicComponentProps.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/types/PolymorphicComponentProps/PolymorphicComponentProps.ts b/src/types/PolymorphicComponentProps/PolymorphicComponentProps.ts index a59ebfa..f4126b0 100644 --- a/src/types/PolymorphicComponentProps/PolymorphicComponentProps.ts +++ b/src/types/PolymorphicComponentProps/PolymorphicComponentProps.ts @@ -6,26 +6,26 @@ import type { } from 'react'; /** - * AsProp is a type based on the supplied as prop. + * PropsFromAs is a type based on the supplied as prop. */ -type AsProp = { as?: Types }; +type PropsFromAs = { as?: Type }; /** * MergeAndOverride is a type that omits type keys from BaseTypes that are also present in OverrideProps. */ -type MergeAndOverride = Omit & +type MergeAndOverride = Omit & OverrideProps; -export type PolymorphicRef = ComponentPropsWithRef['ref']; +export type PolymorphicRef = ComponentPropsWithRef['ref']; export type PolymorphicComponentProps< - BaseTypes extends ElementType, + BaseType extends ElementType, OwnProps = Record, > = PropsWithChildren< - MergeAndOverride, AsProp & OwnProps> + MergeAndOverride, PropsFromAs & OwnProps> >; export type PolymorphicComponentPropsWithRef< - BaseTypes extends ElementType, + BaseType extends ElementType, OwnProps = Record, -> = PolymorphicComponentProps & { ref?: PolymorphicRef }; +> = PolymorphicComponentProps & { ref?: PolymorphicRef };