import React from 'react'; import type { StyleReactProps } from '../interfaces'; type Mutable = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ? export type StencilReactExternalProps = PropType & Omit, 'style'> & StyleReactProps; // The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx export const mergeRefs = (...refs: React.Ref[]) => ( value: ElementType, ) => refs.forEach((ref) => { if (typeof ref === 'function') { ref(value); } else if (ref != null) { // This is typed as readonly so we need to allow for override (ref as Mutable>).current = value; } }); export const createForwardRef = ( ReactComponent: any, displayName: string, ) => { const forwardRef = ( props: StencilReactExternalProps, ref: React.Ref, ) => { return ; }; forwardRef.displayName = displayName; return React.forwardRef(forwardRef); }; export * from './attachProps'; export * from './case';