import React, { SetStateAction } from "react"; //#region src/utils/react.d.ts declare function componentWrapper | keyof React.JSX.IntrinsicElements, ExtraProps extends {} = {}>(displayName: string, render: React.ForwardRefRenderFunction, React.ComponentPropsWithRef & ExtraProps>): React.FC & ExtraProps & { ref?: React.Ref> | undefined; }>; type RefFromComponent | keyof React.JSX.IntrinsicElements> = NonNullable["ref"]>>; type RefFromComponentDistCond = A extends React.RefObject ? T : never; declare function use(promise: Promise): T; declare function forwardRefIfNeeded(render: React.ForwardRefRenderFunction): React.FC

; }>; declare function getNodeText(node: React.ReactNode): string; /** * Suspends the currently rendered component indefinitely. Will not unsuspend unless the component rerenders. * * You can use this to translate older query- or AsyncResult-based code to new the Suspense system, for example: `if (query.isLoading) suspend();` */ declare function suspend(): never; declare function mapRef(ref: ReadonlyRef, mapper: (value: T) => R): ReadonlyRef; type ReadonlyRef = { readonly current: T; }; type RefState = ReadonlyRef & { set: (updater: SetStateAction) => void; }; /** * Like useState, but its value is immediately available on refState.current after being set. * * Like useRef, but setting the value will cause a rerender. * * Note that useRefState returns a new object every time a rerender happens due to a value change, which is intentional * as it allows you to specify it in a dependency array like this: * * ```tsx * useEffect(() => { * // do something with refState.current * }, [refState]); // instead of refState.current * ``` * * If you don't want this, you can wrap the result in a useMemo call. */ declare function useRefState(initialValue: T | (() => T)): RefState; declare function mapRefState(refState: RefState, mapper: (value: T) => R, reverseMapper: (oldT: T, newR: R) => T): RefState; declare function useQueryState(key: string, defaultValue?: string): readonly [string | null, (next: string | null) => void]; declare function shouldRethrowRenderingError(error: unknown): boolean; declare class NoSuspenseBoundaryError extends Error { digest: string; reason: string; __noSuspenseBoundarySentinel: string; constructor(options: { caller?: string; }); } /** * Use this in a component or a hook to disable SSR. Should be wrapped in a Suspense boundary, or it will throw an error. */ declare function suspendIfSsr(caller?: string): void; //#endregion export { NoSuspenseBoundaryError, ReadonlyRef, RefState, componentWrapper, forwardRefIfNeeded, getNodeText, mapRef, mapRefState, shouldRethrowRenderingError, suspend, suspendIfSsr, use, useQueryState, useRefState }; //# sourceMappingURL=react.d.ts.map