UNPKG

@assistant-ui/react

Version:

React components for AI chat.

13 lines 1.29 kB
import { ElementRef, ComponentPropsWithoutRef } from "react"; import { Primitive } from "@radix-ui/react-primitive"; type ActionButtonCallback<TProps> = (props: TProps) => null | (() => void); type PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>; export type ActionButtonProps<THook> = PrimitiveButtonProps & (THook extends (props: infer TProps) => unknown ? TProps : never); export type ActionButtonElement = ElementRef<typeof Primitive.button>; export declare const createActionButton: <TProps>(displayName: string, useActionButton: ActionButtonCallback<TProps>, forwardProps?: (keyof NonNullable<TProps>)[]) => import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & { ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined; } & { asChild?: boolean; }, "ref"> & TProps> & import("react").RefAttributes<HTMLButtonElement>>; export {}; //# sourceMappingURL=createActionButton.d.ts.map