import type { MutableRef } from './Renderer'; /** * React/Preact hook and HOC primitives, supplied by the flavor wrapper. * * Used in components that need them as `Pick`. */ export type Hooks = { useState: UseState; useEffect: UseEffect; useRef: UseRef; useMemo: UseMemo; useCallback: UseCallback; useId: UseId; memo: Memo; }; export type UseState = (initialState: TState) => [TState, (value: TState | ((prev: TState) => TState)) => void]; export type UseEffect = (effect: () => void | (() => void), deps?: readonly unknown[]) => void; export type UseRef = (initialValue: TValue) => MutableRef; export type UseMemo = (factory: () => TValue, deps: readonly unknown[]) => TValue; export type UseCallback = any>(callback: TCallback, deps: readonly unknown[]) => TCallback; export type UseId = () => string; export type Memo = (component: (props: TProps) => JSX.Element, propsAreEqual?: (prevProps: Readonly, nextProps: Readonly) => boolean) => (props: TProps) => JSX.Element;