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

30 lines
1.3 KiB
Plaintext

import { AriaSwitchProps } from "@react-types/switch";
import { InputHTMLAttributes, LabelHTMLAttributes } from "react";
import { RefObject } from "@react-types/shared";
import { ToggleState } from "@react-stately/toggle";
export interface SwitchAria {
/** Props for the label wrapper element. */
labelProps: LabelHTMLAttributes<HTMLLabelElement>;
/** Props for the input element. */
inputProps: InputHTMLAttributes<HTMLInputElement>;
/** Whether the switch is selected. */
isSelected: boolean;
/** Whether the switch is in a pressed state. */
isPressed: boolean;
/** Whether the switch is disabled. */
isDisabled: boolean;
/** Whether the switch is read only. */
isReadOnly: boolean;
}
/**
* Provides the behavior and accessibility implementation for a switch component.
* A switch is similar to a checkbox, but represents on/off values as opposed to selection.
* @param props - Props for the switch.
* @param state - State for the switch, as returned by `useToggleState`.
* @param ref - Ref to the HTML input element.
*/
export function useSwitch(props: AriaSwitchProps, state: ToggleState, ref: RefObject<HTMLInputElement | null>): SwitchAria;
export type { AriaSwitchProps } from '@react-types/switch';
//# sourceMappingURL=types.d.ts.map