import type { Config, PluginAPI, PluginCreator, ValueType } from './tailwind-types.js'; /** A flat structure of possible variant values, either list or key-value form. */ type KeyValuePairOrList = Record | string[] | ReadonlyArray; /** Anything that is legal on the right-hand side of a CSS-in-JS object. */ type CSSStatic = string | number | string[] | Record | null | undefined; /** * A single “property” entry in Tailwind’s `createUtilityPlugin` spec. * * - `string`: dynamic property — Tailwind will call `transformValue(value)` * - `[prop, V]` static — fixed value copied as-is * - `[prop, fn]` computed — your own transformer `(v) => {…}` */ type PropertyEntry CSSStatic)> = string | [string, V]; /** `[classPrefix, properties]` */ type UtilityEntry = [string, PropertyEntry[]]; /** A “group” of rules that share the same `matchUtilities` call. */ type UtilityGroup = UtilityEntry | UtilityEntry[]; /** Everything Tailwind accepts as the second parameter. */ type UtilityVariations = UtilityGroup | UtilityGroup[]; interface UtilityPluginOptions { type?: ValueType | ValueType[]; supportsNegativeValues?: boolean; filterDefault?: boolean; } /** * Type helper: binds all function-valued properties in T. */ type Bound = { [K in keyof T]: T[K] extends (...args: infer _A) => infer _R ? OmitThisParameter : T[K]; }; type BoundedPluginCreator = (api: Bound) => void; interface PluginWithConfig { handler: PluginCreator; config?: Partial | undefined; } interface PluginWithOptions { (options?: T): PluginWithConfig; __isOptionsFunction: true; } interface CreatePluginFunction { (pluginFn: BoundedPluginCreator, cfg?: Partial): PluginWithConfig; withOptions(pluginFn: (options?: T) => BoundedPluginCreator, configFn?: (options?: T) => Partial): PluginWithOptions; } export type { CSSStatic, KeyValuePairOrList, PropertyEntry, UtilityEntry, UtilityGroup, UtilityVariations, UtilityPluginOptions, BoundedPluginCreator, Bound, CreatePluginFunction, PluginWithConfig, PluginWithOptions, };