import type { Call, Fn, Objects } from "hotscript"; import type { Opaque, UnwrapOpaque } from "type-fest"; import type { WithSignalProp } from "./withSignalProps"; export interface ReactifyLiteFn extends Fn { return: this["arg0"] extends ReactiveProps> ? Call, UnwrapOpaque> : never; } export type ReactiveProps> = Opaque; /** * ### Allows to provide Signal/Uncached values as props. * under the hood each prop will be converted to reactive primitive, and after it props getters will be passed to the component. * Limitations: * * you should not destruct props in the component, because it will create extra re-renders * * you should not change references of reactive props * * functions passed as props are not reactive, so you should memoize them before passing. (in most cases it is not a problem) * Because of this limitations you should mark props as `ReactiveProps` to be sure that you aware of this. * @example * ```tsx * const Component = reactifyLite((props: ReactiveProps<{ * foo: string; * bar: number; * }>) => { * return props.bar > 10}>{() => props.foo}; * }); * * const App = () => { * const bar = useSignal(0); * useEffect(() => { * setTimeout(() => { * bar.value = 20; * }, 1000); * }, []); * * return ; * } * ``` * */ export declare const reactifyLite: import("react-fast-hoc").CreateHocReturn>, import("react-fast-hoc").PropsBase>;