import { ComponentType } from 'react'; /** * 目的:使得默认属性在类型定义中是可选的 * 但我们在组件实现中是必选的 */ export declare const withDefaultProps:

= Partial

>(defaultProps: DP, Cmp: ComponentType

) => ComponentType & Required>>>; /** * 默认属性不报错的另外一种实现方式 * 把可选的defaultProps的类型剔除后,加入必选的defaultProps的类型,从而形成一个新的Props类型, * 这个Props类型中的defaultProps相关属性就变成了必选的 * @param defaultProps 默认属性对象 */ export declare const createPropsGetter: (defaultProps: DP) =>

>(props: P) => DP & Pick>;