bits-ui
Version:
The headless components for Svelte.
19 lines (18 loc) • 811 B
TypeScript
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
import type { WithoutChildren } from "svelte-toolbelt";
import type { WithChildren } from "../../shared/index.js";
export type ButtonRootPropsWithoutHTML = WithChildren<{
ref?: HTMLElement | null;
}>;
type AnchorElement = ButtonRootPropsWithoutHTML & WithoutChildren<Omit<HTMLAnchorAttributes, "href" | "type">> & {
href: HTMLAnchorAttributes["href"];
type?: never;
disabled?: HTMLButtonAttributes["disabled"];
};
type ButtonElement = ButtonRootPropsWithoutHTML & WithoutChildren<Omit<HTMLButtonAttributes, "type" | "href">> & {
type?: HTMLButtonAttributes["type"];
href?: never;
disabled?: HTMLButtonAttributes["disabled"];
};
export type ButtonRootProps = AnchorElement | ButtonElement;
export {};