declare const COLOR_PICKER_FORMATS: readonly ["hex", "rgb", "hsl", "hsb"]; type ColorPickerFormat = (typeof COLOR_PICKER_FORMATS)[number]; type ColorPickerStringFormat = ColorPickerFormat | "hexa" | "rgba" | "hsla" | "hsba"; interface ColorPickerRgbChannels { readonly alpha: number; readonly blue: number; readonly green: number; readonly red: number; } interface ColorPickerHslChannels { readonly alpha: number; readonly hue: number; readonly lightness: number; readonly saturation: number; } interface ColorPickerHsbChannels { readonly alpha: number; readonly brightness: number; readonly hue: number; readonly saturation: number; } type ColorPickerRgbChannelUpdates = Partial; type ColorPickerHslChannelUpdates = Partial; type ColorPickerHsbChannelUpdates = Partial; interface ColorPickerColor { readonly alpha: number; readonly hsb: ColorPickerHsbChannels; readonly hsl: ColorPickerHslChannels; readonly rgb: ColorPickerRgbChannels; equals(other: ColorPickerColor): boolean; toString(format?: ColorPickerStringFormat): string; withChannels(format: "hex" | "rgb", updates: ColorPickerRgbChannelUpdates): ColorPickerColor; withChannels(format: "hsl", updates: ColorPickerHslChannelUpdates): ColorPickerColor; withChannels(format: "hsb", updates: ColorPickerHsbChannelUpdates): ColorPickerColor; } /** Parses the intentionally restricted first-version Color Picker syntax without throwing. */ declare function parseColor(input: string): ColorPickerColor | null; type ColorPickerValue = string | ColorPickerColor | null; type ColorPickerDirection = "ltr" | "rtl"; type ColorPickerChannel = "hue" | "saturation" | "brightness" | "lightness" | "red" | "green" | "blue" | "alpha"; type ColorPickerValueChangeReason = "area-drag" | "channel-drag" | "channel-input" | "value-input" | "swatch-press" | "eye-dropper" | "clear-press" | "keyboard" | "imperative-action"; type ColorPickerValueChangeDetails = { readonly value: ColorPickerColor | null; readonly valueAsString: string; readonly previousValue: ColorPickerColor | null; readonly previousValueAsString: string; readonly format: ColorPickerFormat; readonly reason: ColorPickerValueChangeReason; readonly trigger?: Element; readonly event?: Event; readonly isCanceled: boolean; readonly isPropagationAllowed: boolean; cancel(): void; allowPropagation(): void; }; type ColorPickerValueCommitDetails = Omit; type ColorPickerFormatChangeDetails = { readonly previousFormat: ColorPickerFormat; readonly format: ColorPickerFormat; readonly reason: "imperative-action"; readonly trigger?: Element; readonly event?: Event; }; type ColorPickerOptions = { value?: ColorPickerValue; defaultValue?: ColorPickerValue; format?: ColorPickerFormat; alpha?: boolean; allowEmpty?: boolean; disabled?: boolean; readOnly?: boolean; name?: string; form?: string; required?: boolean; locale?: string; dir?: ColorPickerDirection; getAriaValueText?: (channel: ColorPickerChannel, value: number, color: ColorPickerColor) => string; getAreaRoleDescription?: (locale?: string) => string; getColorDescription?: (color: ColorPickerColor | null) => string; onValueChange?: (value: ColorPickerColor | null, details: ColorPickerValueChangeDetails) => void; onValueCommitted?: (value: ColorPickerColor | null, details: ColorPickerValueCommitDetails) => void; onFormatChange?: (format: ColorPickerFormat, details: ColorPickerFormatChangeDetails) => void; }; type ColorPickerSetValueOptions = { emit?: boolean; commit?: boolean; event?: Event; trigger?: Element; reason?: ColorPickerValueChangeReason; }; type ColorPickerSetOptions = Omit>, "dir" | "form" | "locale"> & { dir?: ColorPickerDirection | null; form?: string | null; locale?: string | null; }; type ColorPickerInstance = { readonly root: HTMLElement; destroy(): void; refresh(options?: { preserveState?: boolean; }): void; getValue(): ColorPickerColor | null; getValueAsString(): string; getFormat(): ColorPickerFormat; setValue(value: ColorPickerValue, options?: ColorPickerSetValueOptions): void; setFormat(format: ColorPickerFormat, options?: { emit?: boolean; event?: Event; trigger?: Element; }): void; setDisabled(disabled: boolean): void; setReadOnly(readOnly: boolean): void; setName(name?: string | null): void; setOptions(options: ColorPickerSetOptions): void; subscribe(event: "valueChange", callback: (details: ColorPickerValueChangeDetails) => void): () => void; subscribe(event: "valueCommitted", callback: (details: ColorPickerValueCommitDetails) => void): () => void; subscribe(event: "formatChange", callback: (details: ColorPickerFormatChangeDetails) => void): () => void; }; declare function createColorPicker(root: HTMLElement, options?: ColorPickerOptions): ColorPickerInstance; declare const COLOR_PICKER_INITIAL_PARTS: readonly ["root", "label", "control", "valueInput", "valueSwatch", "valueText", "area", "areaBackground", "areaThumb", "areaInput", "channelSlider", "channelSliderTrack", "channelSliderThumb", "channelSliderInput", "channelInput", "formatControl", "formatSelect", "transparencyGrid", "swatchGroup", "swatch", "eyeDropperTrigger", "clear", "hiddenInput"]; type ColorPickerInitialPartName = (typeof COLOR_PICKER_INITIAL_PARTS)[number]; type ColorPickerInitialDirection = "ltr" | "rtl"; type ColorPickerInitialValue = string | ColorPickerColor | null; type ColorPickerInitialChannel = "hue" | "saturation" | "brightness" | "lightness" | "red" | "green" | "blue" | "alpha"; type ColorPickerInitialAxis = "x" | "y"; type ColorPickerInitialOrientation = "horizontal" | "vertical"; type ColorPickerInitialStateOptions = { value?: ColorPickerInitialValue; defaultValue?: ColorPickerInitialValue; format?: ColorPickerFormat; alpha?: boolean; allowEmpty?: boolean; disabled?: boolean; readOnly?: boolean; required?: boolean; name?: string; form?: string; locale?: string; dir?: ColorPickerInitialDirection; getAriaValueText?: (channel: ColorPickerInitialChannel, value: number, color: ColorPickerColor) => string; getAreaRoleDescription?: (locale?: string) => string; getColorDescription?: (color: ColorPickerColor | null) => string; }; type ColorPickerInitialState = Readonly<{ value: ColorPickerColor | null; valueAsString: string; defaultValueAsString: string; cssColor: string; colorDescription: string; format: ColorPickerFormat; alpha: boolean; allowEmpty: boolean; disabled: boolean; readOnly: boolean; required: boolean; invalid: boolean; name?: string; form?: string; locale?: string; dir?: ColorPickerInitialDirection; getAriaValueText?: ColorPickerInitialStateOptions["getAriaValueText"]; getAreaRoleDescription?: ColorPickerInitialStateOptions["getAreaRoleDescription"]; }>; type EmptyPartRequest = { part: Exclude; }; type ContextPartName = "area" | "areaBackground" | "areaThumb" | "areaInput" | "channelSlider" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderInput" | "channelInput" | "swatch"; type AreaContext = { xChannel?: ColorPickerInitialChannel; yChannel?: ColorPickerInitialChannel; xStep?: number; yStep?: number; }; type SliderContext = { channel: ColorPickerInitialChannel; orientation?: ColorPickerInitialOrientation; step?: number; }; type ColorPickerInitialPartRequest = EmptyPartRequest | ({ part: "area" | "areaBackground" | "areaThumb"; } & AreaContext) | ({ part: "areaInput"; axis: ColorPickerInitialAxis; ariaLabel?: string; ariaLabelledBy?: string; ariaRoleDescription?: string; } & AreaContext) | ({ part: "channelSlider" | "channelSliderTrack" | "channelSliderThumb"; } & SliderContext) | ({ part: "channelSliderInput"; ariaLabel?: string; } & SliderContext) | { part: "channelInput"; channel: ColorPickerInitialChannel; } | { part: "swatch"; value: ColorPickerInitialValue; disabled?: boolean; }; type ColorPickerInitialPartProjection = Readonly<{ part: ColorPickerInitialPartName; attributes: Readonly>; properties: Readonly<{ value?: string | number; defaultValue?: string; disabled?: boolean; readOnly?: boolean; hidden?: boolean; }>; styles: Readonly>; ownership: Readonly<{ attributes: readonly string[]; properties: readonly string[]; }>; text?: string; }>; declare function createColorPickerInitialState(options?: ColorPickerInitialStateOptions): ColorPickerInitialState; declare function projectColorPickerInitialPart(state: ColorPickerInitialState, request: ColorPickerInitialPartRequest): ColorPickerInitialPartProjection; export { COLOR_PICKER_FORMATS, type ColorPickerChannel, type ColorPickerColor, type ColorPickerDirection, type ColorPickerFormat, type ColorPickerFormatChangeDetails, type ColorPickerHsbChannelUpdates, type ColorPickerHsbChannels, type ColorPickerHslChannelUpdates, type ColorPickerHslChannels, type ColorPickerInitialAxis, type ColorPickerInitialChannel, type ColorPickerInitialDirection, type ColorPickerInitialOrientation, type ColorPickerInitialPartName, type ColorPickerInitialPartProjection, type ColorPickerInitialPartRequest, type ColorPickerInitialState, type ColorPickerInitialStateOptions, type ColorPickerInitialValue, type ColorPickerInstance, type ColorPickerOptions, type ColorPickerRgbChannelUpdates, type ColorPickerRgbChannels, type ColorPickerSetOptions, type ColorPickerSetValueOptions, type ColorPickerStringFormat, type ColorPickerValue, type ColorPickerValueChangeDetails, type ColorPickerValueChangeReason, type ColorPickerValueCommitDetails, createColorPicker, createColorPickerInitialState, parseColor, projectColorPickerInitialPart };