import React from "react"; type AsProp = { as?: T; }; export type PolymorphicRef = React.ComponentPropsWithRef["ref"]; export type PolymorphicComponentProps = AsProp & Omit & { ref?: PolymorphicRef; }, keyof Props> & Props; export type PolymorphicComponentPropsWithOutRef = AsProp & Omit, keyof Props> & Props; /** * React18 버전부터 ReactElement가 아닌 ReactNode로 변경됨. * 이에 따른 컨디셔널하게 타입추론이 가능하도록 더미 Type 정의 */ export interface OldReactExoticComponent

{ (props: P): React.ReactElement | null; readonly $$typeof: symbol; } export type CompatibleReactElement = React.ExoticComponent extends OldReactExoticComponent ? React.ReactElement : React.ReactNode; /** * Obtain the parameters of a function type in a tuple */ export type _Parameters = T extends (...args: infer P) => unknown ? P : never; export {};