import { ComponentType } from "react"; import { IntersectionFn, ToSchema } from "../types/Fn"; import { Hoc } from "../types/Hoc"; export interface WithWrapperHoc { (Wrapper: ComponentType, options?: { /** * @example * const NewComponent = withWrapper(Wrapper, { pickProps: ['a', 'b'] })(Component) * * // is equivalent to * * * */ pickProps: PickOptions; omitProps?: undefined; } | { /** * @example * const NewComponent = withWrapper(Wrapper, { omitProps: ['a', 'b'] })(Component) * * // is equivalent to * * * */ omitProps: OmitOptions; pickProps?: undefined; }): PickOptions extends [never] ? OmitOptions extends [never] ? Hoc<[]> : Hoc<[ IntersectionFn, [ OmitOptions[number] | "children", any ]>> ]> : Hoc<[ IntersectionFn, ["children", any]>, [ PickOptions[number], any ]>> ]>; } /** * Wraps the component with the provided Component Wrapper * * @example * const NewComponent = withWrapper(Wrapper)(Component) * * // is equivalent to * // by default, it does not bring any prop * * * * @example * const NewComponent = withWrapper(Wrapper, { pickProps: ['a', 'b'] })(Component) * * // is equivalent to * * * * * @example * const NewComponent = withWrapper(Wrapper, { omitProps: ['a', 'b'] })(Component) * * // is equivalent to * * * * * @example * // to carry all props, use omitProps with empty array * const NewComponent = withWrapper(Wrapper, { omitProps: [] })(Component) * * // is equivalent to * * * */ export declare const withWrapper: WithWrapperHoc; //# sourceMappingURL=withWrapper.d.ts.map