source: node_modules/tailwindcss/dist/types-CJYAW1ql.d.mts

Last change on this file was 2058e5c, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Working / before login

  • Property mode set to 100644
File size: 4.1 KB
Line 
1import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-QUZ9b-Gn.mjs';
2
3/**
4 * The source code for one or more nodes in the AST
5 *
6 * This generally corresponds to a stylesheet
7 */
8interface Source {
9 /**
10 * The path to the file that contains the referenced source code
11 *
12 * If this references the *output* source code, this is `null`.
13 */
14 file: string | null;
15 /**
16 * The referenced source code
17 */
18 code: string;
19}
20/**
21 * The file and offsets within it that this node covers
22 *
23 * This can represent either:
24 * - A location in the original CSS which caused this node to be created
25 * - A location in the output CSS where this node resides
26 */
27type SourceLocation = [source: Source, start: number, end: number];
28
29type Config = UserConfig;
30type PluginFn = (api: PluginAPI) => void;
31type PluginWithConfig = {
32 handler: PluginFn;
33 config?: UserConfig;
34 /** @internal */
35 reference?: boolean;
36 src?: SourceLocation | undefined;
37};
38type PluginWithOptions<T> = {
39 (options?: T): PluginWithConfig;
40 __isOptionsFunction: true;
41};
42type Plugin = PluginFn | PluginWithConfig | PluginWithOptions<any>;
43type PluginAPI = {
44 addBase(base: CssInJs): void;
45 addVariant(name: string, variant: string | string[] | CssInJs): void;
46 matchVariant<T = string>(name: string, cb: (value: T | string, extra: {
47 modifier: string | null;
48 }) => string | string[], options?: {
49 values?: Record<string, T>;
50 sort?(a: {
51 value: T | string;
52 modifier: string | null;
53 }, b: {
54 value: T | string;
55 modifier: string | null;
56 }): number;
57 }): void;
58 addUtilities(utilities: Record<string, CssInJs | CssInJs[]> | Record<string, CssInJs | CssInJs[]>[], options?: {}): void;
59 matchUtilities(utilities: Record<string, (value: string, extra: {
60 modifier: string | null;
61 }) => CssInJs | CssInJs[]>, options?: Partial<{
62 type: string | string[];
63 supportsNegativeValues: boolean;
64 values: Record<string, string> & {
65 __BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined;
66 };
67 modifiers: 'any' | Record<string, string>;
68 }>): void;
69 addComponents(utilities: Record<string, CssInJs> | Record<string, CssInJs>[], options?: {}): void;
70 matchComponents(utilities: Record<string, (value: string, extra: {
71 modifier: string | null;
72 }) => CssInJs>, options?: Partial<{
73 type: string | string[];
74 supportsNegativeValues: boolean;
75 values: Record<string, string> & {
76 __BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined;
77 };
78 modifiers: 'any' | Record<string, string>;
79 }>): void;
80 theme(path: string, defaultValue?: any): any;
81 config(path?: string, defaultValue?: any): any;
82 prefix(className: string): string;
83};
84type CssInJs = {
85 [key: string]: string | string[] | CssInJs | CssInJs[];
86};
87
88type ResolvableTo<T> = T | ((utils: PluginUtils) => T);
89type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
90type ThemeConfig = Record<string, ThemeValue> & {
91 extend?: Record<string, ThemeValue>;
92};
93type ContentFile = string | {
94 raw: string;
95 extension?: string;
96};
97type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]];
98interface UserConfig {
99 presets?: UserConfig[];
100 theme?: ThemeConfig;
101 plugins?: Plugin[];
102}
103interface UserConfig {
104 content?: ContentFile[] | {
105 relative?: boolean;
106 files: ContentFile[];
107 };
108}
109interface UserConfig {
110 darkMode?: DarkModeStrategy;
111}
112interface UserConfig {
113 prefix?: string;
114}
115interface UserConfig {
116 blocklist?: string[];
117}
118interface UserConfig {
119 important?: boolean | string;
120}
121interface UserConfig {
122 future?: 'all' | Record<string, boolean>;
123}
124interface UserConfig {
125 experimental?: 'all' | Record<string, boolean>;
126}
127
128export type { Config as C, Plugin as P, SourceLocation as S, ThemeConfig as T, UserConfig as U, PluginFn as a, PluginWithConfig as b, PluginWithOptions as c, PluginAPI as d };
Note: See TracBrowser for help on using the repository browser.