-
Notifications
You must be signed in to change notification settings - Fork 18
/
types.d.ts
93 lines (74 loc) · 2.71 KB
/
types.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
declare module '*.css' {
const css: string;
export default css;
}
declare module 'tailwindcss/tailwindconfig.faketype' {
import { Config } from 'tailwindcss';
// This way we Omit `content`, somehow, Omit<> doesnt work.
export interface TailwindConfig {
important?: Config['important'];
prefix?: Config['prefix'];
separator?: Config['separator'];
safelist?: Config['safelist'];
presets?: Config['presets'];
future?: Config['future'];
experimental?: Config['experimental'];
darkMode?: Config['darkMode'];
theme?: Config['theme'];
corePlugins?: Config['corePlugins'];
plugins?: Config['plugins'];
}
}
declare module 'tailwindcss/src/lib/expandApplyAtRules.js' {
export default function expandApplyAtRules(): void;
}
declare module 'tailwindcss/src/lib/generateRules.js' {
export function generateRules(): void;
}
declare module 'tailwindcss/src/lib/setupContextUtils.js' {
import { Container } from 'postcss';
import { TailwindConfig } from 'tailwindcss/tailwindconfig.faketype';
interface ChangedContent {
content: string;
extension?: string;
}
interface Api {
container: Container;
separator: string;
format: (def: string) => void;
wrap: (rule: Container) => void;
}
type VariantPreview = string;
type VariantFn = [number, (api: Api) => VariantPreview | undefined];
type VariantName = string;
export interface JitContext {
changedContent: ChangedContent[];
getClassList: () => string[];
getClassOrder: (classList: string[]) => Array<[string, bigint | null]>;
tailwindConfig: TailwindConfig;
variantMap: Map<VariantName, VariantFn[]>;
}
export function createContext(
config: TailwindConfig,
changedContent?: ChangedContent[],
): JitContext;
}
declare module 'tailwindcss/src/processTailwindFeatures.js' {
import { AtRule, Plugin, Result, Root } from 'postcss';
import { ChangedContent, JitContext } from 'tailwindcss/src/lib/setupContextUtils.js';
import { TailwindConfig } from 'tailwindcss/tailwindconfig.faketype';
type SetupContext = (root: Root, result: Result) => JitContext;
interface ProcessTailwindFeaturesCallbackOptions {
applyDirectives: Set<AtRule>;
createContext: (config: TailwindConfig, changedContent: ChangedContent[]) => JitContext;
registerDependency: () => unknown;
tailwindDirectives: Set<string>;
}
export default function processTailwindFeatures(
callback: (options: ProcessTailwindFeaturesCallbackOptions) => SetupContext,
): Plugin;
}
declare module 'tailwindcss/src/public/resolve-config.js' {
import { TailwindConfig } from 'tailwindcss/tailwindconfig.faketype';
export default function resolveConfig(tailwindConfig: TailwindConfig): TailwindConfig;
}