Files
NapCatQQ/.pnpm-store/v3/files/d2/3c1ff418dc31a797f17c4b537c8d823bba6c89769538e409fb8615ec60036625a7f9ef3be0554860dae7e2536958999e7c13774ce7f506b7e0b045b80283f1
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

70 lines
2.3 KiB
Plaintext

import * as react from 'react';
import { ReactNode, MouseEventHandler } from 'react';
import * as _heroui_system from '@heroui/system';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { ButtonVariantProps } from '@heroui/theme';
import { AriaButtonProps } from '@heroui/use-aria-button';
import { RippleProps } from '@heroui/ripple';
import { ReactRef } from '@heroui/react-utils';
interface Props extends HTMLHeroUIProps<"button"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLButtonElement | null>;
/**
* Whether the button should display a ripple effect on press.
* @default false
*/
disableRipple?: boolean;
/**
* The button start content.
*/
startContent?: ReactNode;
/**
* The button end content.
*/
endContent?: ReactNode;
/**
* Spinner to display when loading.
* @see https://heroui.com/components/spinner
*/
spinner?: ReactNode;
/**
* The spinner placement.
* @default "start"
*/
spinnerPlacement?: "start" | "end";
/**
* Whether the button should display a loading spinner.
* @default false
*/
isLoading?: boolean;
/**
* The native button click event handler.
* use `onPress` instead.
* @deprecated
*/
onClick?: MouseEventHandler<HTMLButtonElement>;
}
type UseButtonProps = Props & Omit<AriaButtonProps, keyof ButtonVariantProps> & Omit<ButtonVariantProps, "isInGroup">;
declare function useButton(props: UseButtonProps): {
Component: _heroui_system.As<any>;
children: ReactNode;
domRef: react.RefObject<HTMLButtonElement>;
spinner: ReactNode;
styles: string;
startContent: react.DetailedReactHTMLElement<react.HTMLAttributes<HTMLElement>, HTMLElement> | null;
endContent: react.DetailedReactHTMLElement<react.HTMLAttributes<HTMLElement>, HTMLElement> | null;
isLoading: boolean;
spinnerPlacement: "start" | "end";
spinnerSize: "sm" | "md" | "lg" | undefined;
disableRipple: boolean;
getButtonProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getRippleProps: () => RippleProps;
isIconOnly: boolean;
};
type UseButtonReturn = ReturnType<typeof useButton>;
export { UseButtonProps, UseButtonReturn, useButton };