import * as React from "react";
import type { Component, HTMLProps, Hook, Options, Props } from "./types.js";
/**
 * The same as `React.forwardRef` but passes the `ref` as a prop and returns a
 * component with the same generic type.
 */
export declare function forwardRef<T extends React.FC>(render: T): T;
/**
 * The same as `React.memo` but returns a component with the same generic type.
 */
export declare function memo<P, T extends React.FC<P>>(Component: T, propsAreEqual?: (prevProps: Readonly<P>, nextProps: Readonly<P>) => boolean): T;
/**
 * Creates a type-safe component with the `as` prop and `React.forwardRef`.
 *
 * @example
 * import { createComponent } from "@ariakit/react-core/utils/system";
 *
 * type Props = {
 *   as?: "div";
 *   customProp?: boolean;
 * };
 *
 * const Component = createComponent<Props>(({ customProp, ...props }) => {
 *   return <div {...props} />;
 * });
 *
 * <Component customProp render={<button />} />
 */
export declare function createComponent<O extends Options>(render: (props: Props<O>) => React.ReactElement): Component<O>;
/**
 * Creates a type-safe component with the `as` prop, `React.forwardRef` and
 * `React.memo`.
 *
 * @example
 * import { createMemoComponent } from "@ariakit/react-core/utils/system";
 *
 * type Props = {
 *   as?: "div";
 *   customProp?: boolean;
 * };
 *
 * const Component = createMemoComponent<Props>(({ customProp, ...props }) => {
 *   return <div {...props} />;
 * });
 *
 * <Component customProp render={<button />} />
 */
export declare function createMemoComponent<O extends Options>(render: (props: Props<O>) => React.ReactElement): Component<O>;
/**
 * Creates a React element that supports the `render` and `wrapElement` props.
 * @example
 * import { createElement } from "@ariakit/react-core/utils/system";
 *
 * function Component() {
 *   const props = {
 *     render: (htmlProps) => <button {...htmlProps} />,
 *     wrapElement: (element) => <div>{element}</div>,
 *   };
 *   return createElement("div", props);
 * }
 */
export declare function createElement(Type: React.ElementType, props: HTMLProps<Options>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
/**
 * Creates a component hook that accepts props and returns props so they can be
 * passed to a React element.
 *
 * @example
 * import { Options, createHook } from "@ariakit/react-core/utils/system";
 *
 * type Props = Options<"div"> & {
 *   customProp?: boolean;
 * };
 *
 * const useComponent = createHook<Props>(({ customProp, ...props }) => {
 *   return props;
 * });
 *
 * const props = useComponent({ as: "button", customProp: true });
 */
export declare function createHook<O extends Options>(useProps: (props: Props<O>) => HTMLProps<O>): Hook<O>;
