import React, { ForwardRefExoticComponent, RefAttributes } from 'react'; import { Component, PropsWithRenderFnChildren } from './types/Component'; import register from './register'; import { CHILDREN_COMPONENT } from './enhancement/Children'; import { STATIC_COMPONENT, ROOT_COMPONENT } from './enhancement/staticChildren'; import { INHERITED_NAME } from './enhancement/inheritedName'; import { CORE_INSTANCE, CORE_COMPONENT, CREATE_COMPONENT, CONTEXT_COMPONENT } from './types/symbols'; export type PropsAndRef = PropsWithRenderFnChildren & RefAttributes; export type ForwardRefComponent = ForwardRefExoticComponent>; type ComponentOrProps = T extends [infer ParentProps, infer ChildProps] ? ComponentType : ForwardRefComponent; export type ComponentType = (FNType extends null ? ForwardRefComponent : FNType & { displayName: string; }) & { [K in keyof ChildComponentProps]: ComponentOrProps; } & { [CORE_COMPONENT]: boolean; [CREATE_COMPONENT]: () => ComponentType; }; interface ClassWithUncontrolledProps { uncontrolledProps(): unknown; } declare function assignProps(p1: any, p2: any): any; declare function createComponent(OriginComponent: any, childComponents?: any, options?: { context?: React.Context; parent?: ComponentType | ComponentType[]; enhancements?: [any]; }): ComponentType ? Props : ComponentProps, ChildComponentProps, ContextType, ComponentProps extends ClassWithUncontrolledProps ? ReturnType : { [key: string]: (arg: unknown) => void; }, FNType>; declare function createBaseComponent(OriginComponent: any): ComponentType; export * from './types/index'; export * from './styled/index'; export * from './register'; export { createBaseComponent, register, CREATE_COMPONENT, CORE_INSTANCE, CONTEXT_COMPONENT, CHILDREN_COMPONENT, INHERITED_NAME, CORE_COMPONENT, STATIC_COMPONENT, ROOT_COMPONENT, assignProps, }; export default createComponent;