/** * [WHO]: Public exports from this file (see implementation below). * [FROM]: See the import block immediately after this header. * [TO]: sparkdesign package consumers; output of CLI `add` when applicable. * [HERE]: src/components/basic/Switch/index.tsx — Spark Design source; keep aligned with the main library. * * [PROTOCOL]: * 1. Keep this P3 header in sync when the public contract changes. * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change. * 3. Follow design tokens and explicit type exports. */ import * as React from 'react'; import type { SwitchProps as RegistrySwitchProps } from '../../../../registry/basic/switch'; export type FunctionSwitchValue = 'code' | 'preview'; export type FunctionSwitchSize = 'sm' | 'md'; export interface SegmentOption { value: string; icon?: React.ReactNode; label: string; } export interface SwitchProps extends Omit { variant?: 'toggle' | 'segment'; size?: 'md' | 'lg'; options?: SegmentOption[]; value?: string; defaultValue?: string; onValueChange?: (value: string) => void; segmentSize?: FunctionSwitchSize; } declare const Switch: React.ForwardRefExoticComponent>; /** @deprecated 使用 替代 */ export interface FunctionSwitchProps extends Omit, 'onChange'> { size?: FunctionSwitchSize; value?: FunctionSwitchValue; defaultValue?: FunctionSwitchValue; onValueChange?: (value: FunctionSwitchValue) => void; disabled?: boolean; } /** @deprecated 使用 替代 */ declare function FunctionSwitch({ size, value, defaultValue, onValueChange, disabled, className, ...rest }: FunctionSwitchProps): import("react/jsx-runtime").JSX.Element; export { Switch, FunctionSwitch };