import type { ComponentProps, ComponentType, JSX, VNode } from "preact";
type ElementType
= keyof JSX.IntrinsicElements | ComponentType
;
import { type Simplify, type VariantOptions, type Variants, type VariantsConfig } from "./index.js";
/**
* Utility type to infer the first argument of a variantProps function.
*/
export type VariantPropsOf = T extends (props: infer P) => any ? P : never;
/**
* Type for the variantProps() argument – consists of the VariantOptions and an optional className for chaining.
*/
type VariantProps, V extends Variants = C["variants"]> = VariantOptions & {
class?: string;
className?: string;
};
type ForwardedVariantKeys = C extends {
forwardProps?: ReadonlyArray;
variants: infer V;
} ? Extract : never;
type VariantPropKeys = C extends {
variants: infer V;
} ? keyof V : never;
type ForwardedVariantProps> = Pick, ForwardedVariantKeys>;
export declare function variantProps, V extends Variants = C["variants"]>(config: Simplify): >(props: P) => {
class: string;
} & Omit
> & ForwardedVariantProps;
type VariantsOf = T extends {
variants: infer TV;
} ? TV extends Variants ? TV : {} : {};
type AsProps = {
as?: T;
};
type CleanDefaults = Exclude;
type DefaultedKeys = Extract, keyof Props>;
type WithDefaultProps = [CleanDefaults] extends [
never
] ? Props : Omit> & Partial>>;
type PolymorphicComponentProps = AsProps & Omit, "as" | keyof V> & V;
export declare function styled, V extends Variants = VariantsOf, Defaults extends Partial> | undefined = undefined>(type: T, config: string | {
base: string;
defaultProps?: Defaults;
} | (Simplify & {
defaultProps?: Defaults;
})): (props: WithDefaultProps, As>, Defaults>) => VNode | null;
/**
* No-op function to mark template literals as tailwind strings.
*/
export declare const tw: (template: {
raw: readonly string[] | ArrayLike;
}, ...substitutions: any[]) => string;
export {};