import { CustomStatesSetSupported } from "./support"; /** * Inference type for a CSS custom state selector. * @public */ export type StateSelector = S extends string ? `:state(${S})` | `[state--${S}]` : never; export { CustomStatesSetSupported }; /** * Returns a string that represents a CSS custom state selector. * * @param state - the state value. * @returns a string that represents a CSS state selector, or a custom attribute selector if the browser does not * support Custom States. * * @public */ export declare function stateSelector(state: S): StateSelector; /** * This function is used to toggle a state on the control. If the browser supports Custom States, the state is toggled * on the `ElementInternals.states` set. If the browser does not support Custom States, the state is toggled on the host * element as an attribute with the format `state--{state}`. * * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet | CustomStateSet} interface * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | ElementInternals} interface * @see The CSS {@link https://developer.mozilla.org/en-US/docs/Web/CSS/:state | `:state()`} pseudo-class * * @param elementInternals - the `ElementInternals` instance for the component * @param state - the state to toggle * @param force - force the state to be toggled on or off * @internal */ export declare function toggleState(elementInternals: ElementInternals | undefined, state: string | undefined, force?: boolean): void; /** * Check if a given attribute value is a valid state. Attribute values are often kebab-cased, so this function converts * the kebab-cased `state` to camelCase and checks if it exists in as a key in the `States` object. * * @param States - the object containing valid states for the attribute * @param state - the state to check * @returns true if the state is in the States object * @internal */ export declare function hasMatchingState(States: Record | undefined, state: string | undefined): boolean; /** * Swap an old state for a new state. * * @param elementInternals - the `ElementInternals` instance for the component * @param prev - the previous state to remove * @param next - the new state to add * @param States - the object containing valid states for the attribute * @param prefix - an optional prefix to add to the state * * @internal */ export declare function swapStates(elementInternals: ElementInternals, prev?: string | undefined, next?: string | undefined, States?: Record, prefix?: string): void; /** * A generic helper function to handle attribute changes. * @param elementInternals - The internals of the element. * @param prev - The previous value of the attribute. * @param next - The new value of the attribute. * @param toggleFn - A function that performs the toggle action for a given attribute value. */ export declare function handleAttributeChange(elementInternals: ElementInternals, prev: T | undefined, next: T | undefined, toggleFn: (elementInternals: ElementInternals, value: T, state: boolean) => void): void; //# sourceMappingURL=element-internals.d.ts.map