-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
45 lines (38 loc) · 1005 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import type { Variant as TailwindVariant } from "tailwindcss/tailwind-config";
type Screen = "sm" | "md" | "lg" | "xl" | "2xl";
type Camel<S extends string> = S extends `${infer S1}-${infer S2}`
? `${Camel<S1>}${Capitalize<Camel<S2>>}`
: S;
type RawVariant =
| TailwindVariant
| "motion-safe"
| "motion-reduce"
| "before"
| "after"
| "first-letter"
| "first-line"
| "selection"
| "marker"
| "only"
| "first-of-type"
| "last-of-type"
| "target"
| "default"
| "indeterminate"
| "placeholder-shown"
| "autofill"
| "required"
| "valid"
| "invalid"
| "in-range"
| "out-of-range";
type Variant = RawVariant | `peer-${RawVariant}`;
interface TailwindVariantFnBase
extends Readonly<
Record<Screen | Variant | Camel<Variant>, TailwindVariantFn>
> {
(...args: string[]): string;
(template: TemplateStringsArray, ...params: string[]): string;
}
export interface TailwindVariantFn extends TailwindVariantFnBase {}
export const tw: TailwindVariantFn;