import { Diff } from '../types';
/**
* @private
*/
declare type GetDefaultProps
= Partial
> = DP & Diff
;
/**
* Identity function helper to properly resolve default and required props type annotation within Component
*
* @param defaultProps
*
* @example
*
* ```tsx
* type Props = {
* onClick: (e: MouseEvent) => void
* children: ReactNode
* } & DefaultProps
*
* const defaultProps = DefaultProps({
* color: 'blue' as 'blue' | 'green' | 'red',
* type: 'button' as 'button' | 'submit',
* })
* const getProps = createPropsGetter(defaultProps)
*
* class Button extends Component {
* static readonly defaultProps = defaultProps
* render() {
* const {
* // $ExpectType (e: MouseEvent) => void
* onClick: handleClick,
* // $ExpectType 'blue' | 'green' | 'red'
* color,
* // $ExpectType 'button' | 'submit'
* type,
* // $ExpectType ReactNode
* children,
* } = getProps(this.props)
*
* return (
*
* )
* }
* }
* ```
*/
export declare const createPropsGetter: (_defaultProps: DP) => >(props: P) => GetDefaultProps
;
/**
* Helper to create Readonly default props
*
* @param props - default props object that's gonna be frozen
*
* @example
*
* ```tsx
* // $ExpectType Readonly<{color:'blue' | 'green' | 'red', type: 'button' | 'submit'}>
* const defaultProps = DefaultProps({
* color: 'blue' as 'blue' | 'green' | 'red',
* type: 'button' as 'button' | 'submit',
* })
* ```
*/
export declare const DefaultProps: (props: T) => Readonly;
/**
* Type alias to define defaultProps within Props intersection
*
* @param props default props object type annotation
*
* @example
*
* ```ts
* // $ExpectType {onClick: (e: MouseEvent) => void, children: ReactNode, color?:'blue' | 'green' | 'red', type?: 'button' | 'submit'}
* type Props = {
* onClick: (e: MouseEvent) => void
* children: ReactNode
* } & DefaultProps
* ```
*/
export declare type DefaultProps> = Partial;
export {};
//# sourceMappingURL=default-props.d.ts.map