import { type ComponentProps, type ComponentType, type ElementType, type MouseEvent, type ReactElement, type ReactNode } from 'react';
import { type RenderFn } from './Render.tsx';
interface LinkComponentObject {
    component: ElementType;
    /** @default false */
    useForDisabledLinks?: boolean | undefined;
    props?: (props: ComponentProps<'a'>) => Record<string, unknown>;
}
type LinkComponent = ComponentType<ComponentProps<'a'>> | ComponentType<{
    href: string;
}> | ReactElement | LinkComponentObject | null;
export type ButtonOrLinkState = {
    category: 'button' | 'link';
    role: NonNullable<InternalButtonOrLinkProps['role']>;
    disabled: NonNullable<InternalButtonOrLinkProps['disabled']>;
    type?: InternalButtonOrLinkProps['type'];
    checked?: InternalButtonOrLinkProps['checked'];
    href?: InternalButtonOrLinkProps['href'];
    target?: InternalButtonOrLinkProps['target'];
};
export type ButtonOrLinkRenderState = ButtonOrLinkState & {
    Element: ElementType<ButtonOrLinkRenderElementProps>;
    elementProps: ButtonOrLinkRenderElementProps;
};
interface ButtonOrLinkRenderElementProps {
    buttonOrLinkState: ButtonOrLinkState;
    [key: string]: unknown;
}
export declare namespace InternalButtonOrLinkProps {
    interface DisableableProps {
        disabled?: boolean | 'focusable' | undefined;
    }
    interface CommonProps {
        /**
         * Whether to render the element inline instead of block-level. For buttons, renders a `span`
         * that behaves like an accessible button. For links, this prop has no effect as anchor elements
         * are already inline. This may not be necessary when `button` elements are allowed to be truly
         * inline (see https://github.com/w3c/csswg-drafts/issues/3226).
         *
         * @default false
         */
        inline?: boolean | undefined;
        /** Custom render function to control the rendered element. */
        render?: RenderFn<ButtonOrLinkRenderState> | undefined;
        /** Custom component to use for rendering links (e.g. Next.js Link) */
        linkComponent?: LinkComponent | undefined;
    }
    interface ButtonProps extends CommonProps, DisableableProps, Omit<ComponentProps<'button'>, 'defaultValue' | 'disabled'> {
        href?: undefined;
        target?: undefined;
        checked?: undefined;
        defaultChecked?: undefined;
    }
    interface ToggleButtonProps extends Omit<ButtonProps, 'checked' | 'defaultChecked'> {
        /** Whether the button is in a pressed/selected state. */
        checked?: boolean | undefined;
        defaultChecked?: boolean | undefined;
    }
    interface LinkProps extends CommonProps, DisableableProps, Omit<ComponentProps<'a'>, 'defaultValue'> {
        href: string;
        type?: undefined;
        checked?: undefined;
        defaultChecked?: undefined;
    }
}
export type InternalButtonOrLinkProps = InternalButtonOrLinkProps.ButtonProps | InternalButtonOrLinkProps.ToggleButtonProps | InternalButtonOrLinkProps.LinkProps;
export type OmitInternalButtonOrLinkProps<T> = Omit<T, 'disabled' | 'inline' | 'render'>;
export declare namespace ButtonOrLinkProps {
    type DisableableProps = InternalButtonOrLinkProps.DisableableProps;
    type ButtonProps = OmitInternalButtonOrLinkProps<InternalButtonOrLinkProps.ButtonProps>;
    type ToggleButtonProps = OmitInternalButtonOrLinkProps<InternalButtonOrLinkProps.ToggleButtonProps>;
    type LinkProps = OmitInternalButtonOrLinkProps<InternalButtonOrLinkProps.LinkProps>;
}
export type ButtonOrLinkProps = ButtonOrLinkProps.ButtonProps | ButtonOrLinkProps.ToggleButtonProps | ButtonOrLinkProps.LinkProps;
export declare function useAncestorButtonOrLink(): ButtonOrLinkState | null;
interface ButtonOrLinkConfigContextValue {
    onClick: ((event: MouseEvent<HTMLButtonElement & HTMLAnchorElement>, props: InternalButtonOrLinkProps) => void) | undefined;
    transformProps: ((props: InternalButtonOrLinkProps) => InternalButtonOrLinkProps) | undefined;
}
/**
 * Renders a link (`a` or custom `linkComponent`) if `href` is passed. Otherwise, renders a `button`
 * (or a `span` that behaves like a button if `inline` is true).
 */
export declare const ButtonOrLinkRoot: {
    (passedProps: InternalButtonOrLinkProps): import("react/jsx-runtime").JSX.Element;
    displayName: string;
};
export interface ButtonOrLinkConfigProps {
    onClick?: ButtonOrLinkConfigContextValue['onClick'];
    transformProps?: ButtonOrLinkConfigContextValue['transformProps'];
    children: ReactNode;
}
export declare const ButtonOrLinkConfig: {
    ({ onClick: passedOnClick, transformProps: passedTransformProps, children, }: ButtonOrLinkConfigProps): import("react/jsx-runtime").JSX.Element;
    displayName: string;
};
export interface ButtonOrLinkConsumerProps {
    render: (state: ButtonOrLinkState | null) => ReactNode;
}
export declare function ButtonOrLinkConsumer({ render }: ButtonOrLinkConsumerProps): ReactNode;
export declare namespace ButtonOrLinkConsumer {
    var displayName: string;
}
export {};
//# sourceMappingURL=ButtonOrLink.parts.d.ts.map