UNPKG

29.6 kBTypeScriptView Raw
1import { PropertiesFallback, PropertiesHyphenFallback, AtRule, SimplePseudos } from 'csstype';
2
3interface CSSCustomProperties {
4 '--tw-bg-opacity'?: string;
5 '--tw-text-opacity'?: string;
6 '--tw-border-opacity'?: string;
7 '--tw-divide-opacity'?: string;
8 '--tw-placeholder-opacity'?: string;
9 '--tw-shadow'?: string;
10 '--tw-ring-inset'?: string;
11 '--tw-ring-color'?: string;
12 '--tw-ring-opacity'?: string;
13 '--tw-ring-shadow'?: string;
14 '--tw-ring-offset-color'?: string;
15 '--tw-ring-offset-shadow'?: string;
16 '--tw-ring-offset-width'?: string;
17 '--tw-gradient-from'?: string;
18 '--tw-gradient-to'?: string;
19 '--tw-gradient-stops'?: string;
20 '--tw-divide-y-reverse'?: string;
21 '--tw-divide-x-reverse'?: string;
22 '--tw-space-y-reverse'?: string;
23 '--tw-space-x-reverse'?: string;
24 '--tw-translate-x'?: string;
25 '--tw-translate-y'?: string;
26 '--tw-rotate'?: string;
27 '--tw-skew-x'?: string;
28 '--tw-skew-y'?: string;
29 '--tw-scale-x'?: string;
30 '--tw-scale-y'?: string;
31 '--tw-ordinal'?: string;
32 '--tw-slashed-zero'?: string;
33 '--tw-numeric-figure'?: string;
34 '--tw-numeric-spacing'?: string;
35 '--tw-numeric-fraction'?: string;
36}
37interface CSSProperties extends PropertiesFallback<string, string>, PropertiesHyphenFallback<string, string>, CSSCustomProperties {
38}
39interface FontFace extends AtRule.FontFaceFallback<string, string>, AtRule.FontFaceHyphenFallback<string, string> {
40}
41interface CounterStyle extends AtRule.CounterStyleFallback<string, string>, AtRule.CounterStyleHyphenFallback<string, string> {
42}
43
44declare type Falsy = '' | 0 | -0 | false | null | undefined | void;
45declare type MaybeArray<T> = T | readonly T[];
46
47interface TWCallable {
48 (strings: TemplateStringsArray, ...interpolations: Token[]): string;
49 (...tokens: Token[]): string;
50}
51interface TW extends TWCallable {
52 theme: ThemeResolver;
53}
54interface Context {
55 /** Allow composition */
56 readonly tw: TWCallable;
57 /** Access to theme values */
58 readonly theme: ThemeResolver;
59 /** Create unique identifier (group, custom properties) */
60 readonly tag: (key: string) => string;
61 readonly css: (rule: Rule[] | string) => CSSRules;
62}
63interface Instance {
64 readonly tw: TW;
65 readonly setup: (options?: Configuration) => void;
66}
67declare type MaybeThunk<T> = T | ((context: Context) => T);
68interface Preflight {
69 (preflight: CSSRules, context: Context): MaybeThunk<CSSRules | undefined | void>;
70}
71interface ThemeConfiguration extends Partial<Theme> {
72 extend?: Partial<Theme>;
73}
74interface SheetConfig<T = unknown> {
75 /**
76 * Sets a cryptographic nonce (number used once) on the enclosing `<style>` tag when generating a page on demand.
77 *
78 * Useful for enforcing a [Content Security Policy (CSP)](https://developer.mozilla.org/docs/Web/HTTP/CSP).
79 */
80 nonce?: string;
81 /** Target to insert rules into. */
82 target?: T;
83}
84interface Sheet<T = unknown> {
85 readonly target: T;
86 insert: (rule: string, index: number) => void;
87 init?: SheetInit;
88}
89declare type SheetInitCallback<T = unknown> = (value?: T | undefined) => T;
90interface SheetInit {
91 /**
92 * Register a function that should be called to use a snapshot state or create a new state.
93 */
94 <T>(callback: SheetInitCallback<T>): T;
95}
96declare type Prefixer = (property: string, value: string, important?: boolean) => string;
97declare type Hasher = (value: string) => string;
98declare type DarkMode = 'media' | 'class' | false;
99interface Configuration {
100 /**
101 * Determines the dark mode strategy (default: `"media"`).
102 */
103 darkMode?: DarkMode;
104 theme?: ThemeConfiguration;
105 plugins?: Record<string, Plugin | undefined>;
106 /**
107 * ```js
108 * {
109 * ':new-variant': '& .selector',
110 * }
111 * ```
112 */
113 variants?: Record<string, string>;
114 /**
115 * Sets a cryptographic nonce (number used once) on the enclosing `<style>` tag when generating a page on demand.
116 *
117 * Useful for enforcing a [Content Security Policy (CSP)](https://developer.mozilla.org/docs/Web/HTTP/CSP).
118 */
119 nonce?: string;
120 /** Style insertion methodology to be used. */
121 sheet?: Sheet;
122 /** Called right before the first rule is injected. */
123 preflight?: Preflight | boolean | CSSRules;
124 /** Auto-prefixer method for CSS property–value pairs. */
125 prefix?: Prefixer | boolean;
126 hash?: Hasher | boolean;
127 mode?: Mode | 'strict' | 'warn' | 'silent';
128 /**
129 * Control whether or not utilities should be marked with `!important`
130 */
131 important?: boolean;
132}
133declare type ReportInfo = {
134 id: 'LATE_SETUP_CALL';
135} | {
136 id: 'UNKNOWN_DIRECTIVE';
137 rule: string;
138} | {
139 id: 'UNKNOWN_THEME_VALUE';
140 key: string | undefined;
141} | {
142 id: 'INJECT_CSS_ERROR';
143 error: Error;
144 css: string;
145};
146interface Mode {
147 /** Called for unknown theme values */
148 unknown: <Section extends keyof Theme>(section: Section, key: string[] | undefined, optional: boolean, context: Context) => ThemeSectionType<Theme[Section]> | undefined | void;
149 /**
150 * Notify error (missing plugin, duplicate directives? )
151 *
152 * Why id?
153 * - can generate an url with more info
154 * - reduce bundle size by omitting large error messages
155 */
156 report(info: ReportInfo, context: Context): void;
157}
158declare type Plugin = string | CSSRules | DirectiveHandler;
159interface DirectiveHandler {
160 /**
161 * Creates CSSRules based on `parameters`
162 */
163 (parameters: string[], context: Context, id: string): InlineDirective | CSSRules | string | Falsy;
164}
165interface Rule {
166 /**
167 * The variants: `[":sm", ":dark", ":hover"]`
168 */
169 v: string[];
170 /**
171 * The directive: `"text-sm"`, `"rotate-45"`
172 */
173 d: string | InlineDirective;
174 /** Is this rule negated: `"-rotate-45"` =\> `true` */
175 n: boolean | undefined;
176 /** Is this rule marked as important: `"!stroke-4"` =\> `true` */
177 i: boolean | undefined;
178 /**
179 * The id is the tailwind rule including variants, negate and directive
180 *
181 * Initialy this is set to an empty string.
182 *
183 * This is used to cache the id of static rules (from template literals).
184 */
185 $: string;
186}
187interface Directive<T> {
188 /** Can be used as a inline directive */
189 (context: Context): T;
190 /** Can be used as a plugin */
191 (params: string[], context: Context): T;
192}
193interface InlineDirective {
194 (context: Context): CSSRules | string | Falsy | TypescriptCompat;
195}
196interface TokenGrouping extends Record<string, Token> {
197}
198declare type TypescriptCompat = boolean | number;
199declare type Token = string | TokenGrouping | InlineDirective | Token[] | Falsy | TypescriptCompat;
200/**
201 * Pseudo class
202 * watch out for ':root' - that could use '*' instead
203 */
204declare type CSSSimplePseudos = {
205 [K in SimplePseudos as `&${string & K}`]?: CSSRulesThunk | MaybeArray<CSSRules>;
206};
207interface CSSPseudos extends CSSSimplePseudos {
208 '&:nth-child(2n)'?: CSSRules;
209 '&:nth-child(odd)'?: CSSRules;
210}
211declare type CSSAtMedia = Record<string, MaybeArray<CSSRules>>;
212declare type CSSAtSupports = Record<string, MaybeArray<CSSRules>>;
213declare type CSSAtKeyframes = Record<string, CSSProperties | ((context: Context) => CSSProperties)>;
214/**
215 * See: https://drafts.csswg.org/css-nesting/#nest-selector
216 *
217 * ```
218 * "& > * + *": {
219 * marginLeft: 16
220 * },
221 *
222 * // In a comma-separated list, each individual selector shall start with "&"
223 * "&:focus, &:active": {
224 * outline: "solid"
225 * },
226 *
227 * // Self-references are also supported
228 * "& + &": {
229 * color: "green"
230 * }
231 * ```
232 */
233interface CSSRules {
234 '@import'?: CSSRulesThunk<MaybeArray<string>> | MaybeArray<string>;
235 '@font-face'?: CSSRulesThunk<MaybeArray<FontFace>> | MaybeArray<FontFace>;
236 '@keyframes'?: CSSRulesThunk<CSSAtKeyframes> | CSSAtKeyframes;
237 '@apply'?: MaybeArray<string | Falsy | TypescriptCompat>;
238 '@global'?: CSSRulesThunk<MaybeArray<CSSRules>> | MaybeArray<CSSRules>;
239 ':global'?: CSSRulesThunk<MaybeArray<CSSRules>> | MaybeArray<CSSRules>;
240 /** Global defaults */
241 [key: string]: CSSRuleValue;
242}
243declare type CSSRuleValue = CSSAtMedia | CSSAtSupports | CSSAtKeyframes | CSSRulesThunk | MaybeArray<CSSProperties | CSSRules | FontFace | string | Falsy | TypescriptCompat>;
244interface CSSRulesThunk<Value = CSSRuleValue> {
245 (context: Context): Value;
246}
247
248interface ThemeResolver {
249 <Section extends keyof Theme>(section: Section): Record<string, ThemeSectionType<Theme[Section]>>;
250 <Section extends keyof Theme>(keypath: `${Section}.${string}`): ThemeSectionType<Theme[Section]> | undefined;
251 <Section extends keyof Theme>(keypath: `${Section}.${string}`, defaultValue: NonNullable<ThemeSectionType<Theme[Section]>>): NonNullable<ThemeSectionType<Theme[Section]>>;
252 <Section extends keyof Theme>(section: Section, key: string | string[]): ThemeSectionType<Theme[Section]> | undefined;
253 <Section extends keyof Theme>(section: Section, key: string | string[], defaultValue: NonNullable<ThemeSectionType<Theme[Section]>>): NonNullable<ThemeSectionType<Theme[Section]>>;
254}
255interface ThemeHelper {
256 <Section extends keyof Theme>(section: Section): (context: Context) => Record<string, ThemeSectionType<Theme[Section]>>;
257 <Section extends keyof Theme>(keypath: `${Section}.${string}`): (context: Context) => ThemeSectionType<Theme[Section]> | undefined;
258 <Section extends keyof Theme>(keypath: `${Section}.${string}`, defaultValue: NonNullable<ThemeSectionType<Theme[Section]>>): (context: Context) => NonNullable<ThemeSectionType<Theme[Section]>>;
259 <Section extends keyof Theme>(section: Section, key: string | string[]): (context: Context) => ThemeSectionType<Theme[Section]> | undefined;
260 <Section extends keyof Theme>(section: Section, key: string | string[], defaultValue: NonNullable<ThemeSectionType<Theme[Section]>>): (context: Context) => NonNullable<ThemeSectionType<Theme[Section]>>;
261}
262declare type Unwrap<T> = T extends string[] ? string : T extends Record<string, infer R> ? R : T;
263declare type ThemeSectionType<T> = T extends ThemeSection<infer R> ? Unwrap<R> : Exclude<T, ThemeSectionResolver<T>>;
264interface ThemeSectionResolverContext {
265 /**
266 * No-op function as negated values are automatically infered and do _not_ not to be in the theme.
267 */
268 readonly negative: (records: Record<string, string | undefined>) => Record<string, string | undefined>;
269 readonly breakpoints: (records: Record<string, ThemeScreen | undefined>) => Record<string, string | undefined>;
270}
271declare type ThemeSectionRecord<T = string> = Record<string, T | undefined>;
272declare type ThemeSectionResolver<T = string> = (theme: ThemeResolver, context: ThemeSectionResolverContext) => ThemeSectionRecord<T>;
273declare type ThemeSection<T = string> = ThemeSectionRecord<T> | ThemeSectionResolver<T>;
274interface ThemeContainer {
275 screens?: Record<string, string | undefined>;
276 center?: boolean;
277 padding?: string | Record<string, string | undefined>;
278}
279declare type ThemeScreenValue = string | {
280 raw: string;
281} | {
282 min: string;
283 max?: string;
284} | {
285 min?: string;
286 max: string;
287};
288declare type ThemeScreen = MaybeArray<ThemeScreenValue>;
289interface ThemeColorObject extends Record<string, ThemeColor> {
290}
291declare type ThemeColor = string | ThemeColorObject;
292declare type ThemeFontSize = string | [size: string, lineHeight: string] | [size: string, options: {
293 lineHeight?: string;
294 letterSpacing?: string;
295}];
296declare type ThemeOutline = [outline: string, offset: string] | string[];
297interface Theme {
298 colors: ThemeSection<ThemeColor>;
299 spacing: ThemeSection;
300 durations: ThemeSection<string | string[]>;
301 screens: ThemeSection<ThemeScreen>;
302 animation: ThemeSection<string | string[]>;
303 backdropBlur: ThemeSection;
304 backdropBrightness: ThemeSection;
305 backdropContrast: ThemeSection;
306 backdropGrayscale: ThemeSection;
307 backdropHueRotate: ThemeSection;
308 backdropInvert: ThemeSection;
309 backdropOpacity: ThemeSection;
310 backdropSaturate: ThemeSection;
311 backdropSepia: ThemeSection;
312 backgroundColor: ThemeSection<ThemeColor>;
313 backgroundImage: ThemeSection<string | string[]>;
314 backgroundOpacity: ThemeSection;
315 backgroundPosition: ThemeSection;
316 backgroundSize: ThemeSection;
317 blur: ThemeSection;
318 borderColor: ThemeSection<ThemeColor>;
319 borderOpacity: ThemeSection;
320 borderRadius: ThemeSection;
321 borderWidth: ThemeSection;
322 boxShadow: ThemeSection<string | string[]>;
323 brightness: ThemeSection;
324 container: ThemeContainer | ThemeSectionResolver<ThemeContainer>;
325 contrast: ThemeSection;
326 cursor: ThemeSection;
327 divideColor: ThemeSection<ThemeColor>;
328 divideOpacity: ThemeSection;
329 divideWidth: ThemeSection;
330 dropShadow: ThemeSection<string | string[]>;
331 fill: ThemeSection<ThemeColor>;
332 flex: ThemeSection;
333 flexGrow: ThemeSection<number>;
334 flexShrink: ThemeSection<number>;
335 fontFamily: ThemeSection<string | string[]>;
336 fontSize: ThemeSection<ThemeFontSize>;
337 fontWeight: ThemeSection;
338 gap: ThemeSection;
339 gradientColorStops: ThemeSection<ThemeColor>;
340 grayscale: ThemeSection;
341 gridAutoColumns: ThemeSection;
342 gridAutoRows: ThemeSection;
343 gridColumn: ThemeSection;
344 gridColumnEnd: ThemeSection;
345 gridColumnStart: ThemeSection;
346 gridRow: ThemeSection;
347 gridRowEnd: ThemeSection;
348 gridRowStart: ThemeSection;
349 gridTemplateColumns: ThemeSection;
350 gridTemplateRows: ThemeSection;
351 height: ThemeSection;
352 hueRotate: ThemeSection;
353 inset: ThemeSection;
354 invert: ThemeSection;
355 keyframes: ThemeSection<Record<string, CSSProperties>>;
356 letterSpacing: ThemeSection;
357 lineHeight: ThemeSection;
358 listStyleType: ThemeSection;
359 margin: ThemeSection;
360 maxHeight: ThemeSection;
361 maxWidth: ThemeSection;
362 minHeight: ThemeSection;
363 minWidth: ThemeSection;
364 objectPosition: ThemeSection;
365 opacity: ThemeSection;
366 order: ThemeSection;
367 outline: ThemeSection<ThemeOutline>;
368 padding: ThemeSection;
369 placeholderColor: ThemeSection<ThemeColor>;
370 placeholderOpacity: ThemeSection;
371 ringColor: ThemeSection<ThemeColor>;
372 ringOffsetColor: ThemeSection<ThemeColor>;
373 ringOffsetWidth: ThemeSection;
374 ringOpacity: ThemeSection;
375 ringWidth: ThemeSection;
376 rotate: ThemeSection;
377 saturate: ThemeSection;
378 scale: ThemeSection;
379 sepia: ThemeSection;
380 skew: ThemeSection;
381 space: ThemeSection;
382 stroke: ThemeSection<ThemeColor>;
383 strokeWidth: ThemeSection;
384 textColor: ThemeSection<ThemeColor>;
385 textOpacity: ThemeSection;
386 transformOrigin: ThemeSection;
387 transitionDelay: ThemeSection<string | string[]>;
388 transitionDuration: ThemeSection<string | string[]>;
389 transitionProperty: ThemeSection<string | string[]>;
390 transitionTimingFunction: ThemeSection<string | string[]>;
391 translate: ThemeSection;
392 width: ThemeSection;
393 zIndex: ThemeSection;
394}
395
396declare type InterpolateKind = `theme(${keyof Theme})` | `range(${number},${number},${number})` | `string` | `number` | `nonzero`;
397declare type Interpolate<Kind extends InterpolateKind> = `{{${Kind}}}`;
398declare type FromTheme<Section extends keyof Theme> = Interpolate<`theme(${Section})`>;
399declare type NonEmptyString = Interpolate<'string'>;
400declare type Range<From extends number, To extends number, Step extends number = 1> = Interpolate<`range(${From},${To},${Step})`>;
401declare type Negatable<Value extends string> = Value | `-${Value}`;
402declare type SimplePseudoClasses = 'active' | 'any-link' | 'autofill' | 'checked' | 'default' | 'disabled' | 'empty' | 'enabled' | 'first-child' | 'first-of-type' | 'focus' | 'focus-visible' | 'focus-within' | 'future' | 'hover' | 'in-range' | 'indeterminate' | 'invalid' | 'last-child' | 'last-of-type' | 'link' | 'local-link' | 'only-child' | 'only-of-type' | 'optional' | 'out-of-range' | 'past' | 'paused' | 'placeholder-shown' | 'playing' | 'read-only' | 'read-write' | 'required' | 'target' | 'target-within' | 'user-invalid' | 'valid' | 'visited';
403declare type SimplePseudoElements = 'after' | 'before' | 'cue' | 'cue-region' | 'file-selector-button' | 'first-letter' | 'first-line' | 'marker' | 'placeholder' | 'selection' | 'target-text';
404declare type CoreVariants = 'dark' | 'sticky' | 'motion-reduce' | 'motion-safe' | 'first' | 'last' | 'even' | 'odd' | 'children' | 'siblings' | 'sibling' | 'override';
405declare type Empty = never | '' | 'DEFAULT';
406declare type Join<Prefix extends string | never, Suffix extends string | never, Separator extends string = '-'> = Suffix extends Empty ? Prefix extends Empty ? never : Prefix : Prefix extends Empty ? Suffix : Prefix extends Suffix ? never : Suffix extends `-${infer S}` ? `-${Prefix}${Separator}${S}` : `${Prefix}${Separator}${Suffix}`;
407declare type Corners = 't' | 'r' | 'b' | 'l' | 'tl' | 'tr' | 'bl' | 'br';
408declare type Edges = 'x' | 'y' | 't' | 'r' | 'b' | 'l' | 'tl' | 'tr' | 'tb' | 'bl' | 'br' | 'lr';
409declare type BorderStyle = 'solid' | 'dashed' | 'dotted' | 'double' | 'none';
410declare type GlobalValue = 'inherit' | 'initial' | 'unset';
411declare type BlendMode = 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity';
412interface CorePlugins {
413 group: '' | NonEmptyString;
414 container: '';
415 decoration: 'slice' | 'clone' | GlobalValue;
416 box: 'border' | 'content';
417 block: '';
418 inline: '' | 'block' | 'flex' | 'grid' | 'table';
419 flow: 'root';
420 contents: '';
421 hidden: '';
422 float: 'right' | 'left' | 'none';
423 clear: 'right' | 'left' | 'both' | 'none';
424 isolate: '';
425 isolation: 'auto' | 'isolate' | GlobalValue;
426 object: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down' | Join<'' | 'left' | 'right' | 'center', '' | 'bottom' | 'top' | 'center'> | FromTheme<'objectPosition'>;
427 overflow: Join<'' | 'x' | 'y', 'auto' | 'hidden' | 'visible' | 'scroll'> | 'ellipsis' | 'clip';
428 overscroll: Join<'' | 'x' | 'y', 'auto' | 'contain' | 'none'>;
429 static: '';
430 fixed: '';
431 absolute: '';
432 relative: '';
433 sticky: '';
434 inset: Negatable<Join<'' | 'x' | 'y', FromTheme<'inset'>>>;
435 top: Negatable<FromTheme<'inset'>>;
436 right: Negatable<FromTheme<'inset'>>;
437 bottom: Negatable<FromTheme<'inset'>>;
438 left: Negatable<FromTheme<'inset'>>;
439 visible: '';
440 invisible: '';
441 z: Negatable<FromTheme<'zIndex'>>;
442 flex: '' | 'nowrap' | Join<'row' | 'col' | 'wrap', '' | 'reverse'> | Join<'grow', '' | '0' | FromTheme<'flexGrow'> | Interpolate<'number'>> | Join<'shrink', '' | '0' | FromTheme<'flexShrink'> | Interpolate<'number'>> | FromTheme<'flex'>;
443 order: FromTheme<'order'>;
444 grid: '' | Join<'cols', 'none' | Range<1, 12> | Interpolate<'nonzero'> | FromTheme<'gridTemplateColumns'>> | Join<'rows', 'none' | Range<1, 6> | Interpolate<'nonzero'> | FromTheme<'gridTemplateRows'>> | Join<'flow', Join<'row' | 'col', '' | 'dense'> | 'dense'>;
445 col: Join<'span', Range<1, 12> | Interpolate<'nonzero'>> | Join<'start', 'auto' | Range<1, 13> | Interpolate<'nonzero'> | FromTheme<'gridColumnStart'>> | Join<'end', 'auto' | Range<1, 13> | Interpolate<'nonzero'> | FromTheme<'gridColumnEnd'>> | FromTheme<'gridColumn'>;
446 row: Join<'span', Range<1, 12> | Interpolate<'nonzero'>> | Join<'start', 'auto' | Range<1, 13> | Interpolate<'nonzero'> | FromTheme<'gridRowStart'>> | Join<'end', 'auto' | Range<1, 13> | Interpolate<'nonzero'> | FromTheme<'gridRowEnd'>> | FromTheme<'gridRow'>;
447 auto: Join<'cols', 'auto' | FromTheme<'gridAutoColumns'>> | Join<'rows', 'auto' | FromTheme<'gridAutoRows'>>;
448 gap: Join<'' | 'x' | 'y', FromTheme<'gap'>>;
449 justify: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | Join<'items' | 'self', 'auto' | 'start' | 'end' | 'center' | 'stretch'>;
450 content: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
451 items: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
452 self: 'auto' | 'start' | 'end' | 'center' | 'stretch';
453 place: Join<'content', 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch'> | Join<'items' | 'self', 'auto' | 'start' | 'end' | 'center' | 'stretch'>;
454 p: FromTheme<'padding'>;
455 py: FromTheme<'padding'>;
456 px: FromTheme<'padding'>;
457 pt: FromTheme<'padding'>;
458 pr: FromTheme<'padding'>;
459 pb: FromTheme<'padding'>;
460 pl: FromTheme<'padding'>;
461 m: Negatable<FromTheme<'margin'>>;
462 my: Negatable<FromTheme<'margin'>>;
463 mx: Negatable<FromTheme<'margin'>>;
464 mt: Negatable<FromTheme<'margin'>>;
465 mr: Negatable<FromTheme<'margin'>>;
466 mb: Negatable<FromTheme<'margin'>>;
467 ml: Negatable<FromTheme<'margin'>>;
468 space: Negatable<Join<'x' | 'y', FromTheme<'space'>>> | Join<'x' | 'y', 'reverse'>;
469 w: FromTheme<'width'>;
470 min: Join<'w', FromTheme<'minWidth'>> | Join<'h', FromTheme<'minHeight'>>;
471 max: Join<'w', FromTheme<'maxWidth'>> | Join<'h', FromTheme<'maxHeight'>>;
472 h: FromTheme<'height'>;
473 font: FromTheme<'fontFamily'> | FromTheme<'fontWeight'> | 'italic' | 'not-italic';
474 text: FromTheme<'fontSize'> | 'left' | 'right' | 'center' | 'justify' | FromTheme<'textColor'> | Join<'opacity', FromTheme<'textOpacity'>> | 'underline' | 'no-underline' | 'line-through' | 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
475 antialiased: '';
476 'subpixel-antialiased': '';
477 italic: '';
478 'not-italic': '';
479 'normal-nums': '';
480 ordinal: '';
481 'slashed-zero': '';
482 'lining-nums': '';
483 'oldstyle-nums': '';
484 'proportional-nums': '';
485 'tabular-nums': '';
486 'diagonal-fractions': '';
487 'stacked-fractions': '';
488 tracking: FromTheme<'letterSpacing'>;
489 leading: FromTheme<'lineHeight'>;
490 list: 'item' | 'inside' | 'outside' | 'none' | 'disc' | 'circle' | 'sqaure' | 'decimal' | 'decimal-leading-zero' | Join<'lower' | 'upper', 'roman' | 'greek' | 'alpha' | 'latin'> | FromTheme<'listStyleType'>;
491 placeholder: FromTheme<'placeholderColor'> | Join<'opacity', FromTheme<'placeholderOpacity'>>;
492 underline: '';
493 'no-underline': '';
494 'line-through': '';
495 uppercase: '';
496 lowercase: '';
497 capitalize: '';
498 'normal-case': '';
499 truncate: '';
500 align: 'baseline' | 'top' | 'middle' | 'bottom' | 'text-top' | 'text-bottom' | 'sub' | 'super';
501 whitespace: 'normal' | 'nowrap' | 'pre' | 'pre-wrap' | 'pre-line' | 'break-spaces';
502 break: 'normal' | 'words' | 'all';
503 bg: 'fixed' | 'local' | 'scroll' | Join<'clip', 'border' | 'padding' | 'content' | 'text'> | FromTheme<'backgroundColor'> | Join<'opacity', FromTheme<'backgroundOpacity'>> | Join<'' | 'left' | 'right' | 'center', '' | 'bottom' | 'top' | 'center'> | FromTheme<'backgroundPosition'> | 'no-repeat' | Join<'repeat', '' | 'x' | 'y' | 'round' | 'space'> | Join<'gradient-to', Corners> | FromTheme<'backgroundImage'> | FromTheme<'backgroundSize'>;
504 from: FromTheme<'gradientColorStops'>;
505 via: FromTheme<'gradientColorStops'>;
506 to: FromTheme<'gradientColorStops'>;
507 rounded: Join<'' | Corners, FromTheme<'borderRadius'>>;
508 border: Join<'' | Edges, FromTheme<'borderWidth'>> | FromTheme<'borderColor'> | Join<'opacity', FromTheme<'borderOpacity'>> | BorderStyle | 'collapse' | 'separate';
509 divide: Join<'x' | 'y', 'reverse' | FromTheme<'divideWidth'>> | FromTheme<'divideColor'> | Join<'opacity', FromTheme<'divideOpacity'>> | BorderStyle;
510 ring: 'inset' | FromTheme<'ringWidth'> | FromTheme<'ringColor'> | Join<'opacity', FromTheme<'ringOpacity'>> | Join<'offset', FromTheme<'ringOffsetWidth'> | FromTheme<'ringOffsetColor'>>;
511 shadow: FromTheme<'boxShadow'>;
512 opacity: FromTheme<'opacity'>;
513 table: '' | 'caption' | 'cell' | 'column' | Join<'column' | 'footer' | 'header' | 'row', 'group'> | 'row' | 'auto' | 'fixed';
514 transition: FromTheme<'transitionProperty'>;
515 duration: FromTheme<'durations'>;
516 ease: FromTheme<'transitionTimingFunction'>;
517 delay: FromTheme<'transitionDelay'>;
518 animate: FromTheme<'animation'>;
519 transform: '' | 'gpu' | 'none';
520 origin: 'center' | Join<'' | 'top' | 'bottom', '' | 'right' | 'left'>;
521 rotate: Negatable<FromTheme<'rotate'>>;
522 scale: Join<'' | 'x' | 'y', FromTheme<'scale'>>;
523 skew: Negatable<Join<'' | 'x' | 'y', FromTheme<'skew'>>>;
524 translate: Negatable<Join<'' | 'x' | 'y', FromTheme<'translate'>>>;
525 appearance: 'none' | 'auto' | 'menulist-button' | 'textfield';
526 cursor: FromTheme<'cursor'> | 'auto' | 'default' | 'pointer' | 'wait' | 'text' | 'move' | 'help' | 'not-allowed' | 'none' | 'context-menu' | 'progress' | 'cell' | 'crosshair' | 'vertical-text' | 'alias' | 'copy' | 'no-drop' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'all-scroll' | 'zoom-in' | 'zoom-out' | 'grab' | 'grabbing';
527 outline: FromTheme<'outline'>;
528 'pointer-events': 'auto' | 'none';
529 resize: 'none' | 'x' | 'y' | '';
530 select: 'none' | 'auto' | 'text' | 'contain' | 'all';
531 fill: FromTheme<'fill'>;
532 stroke: FromTheme<'stroke'> | FromTheme<'strokeWidth'>;
533 'sr-only': '';
534 'not-sr-only': '';
535 filter: '' | 'none';
536 blur: FromTheme<'blur'>;
537 brightness: FromTheme<'brightness'>;
538 contrast: FromTheme<'contrast'>;
539 grayscale: FromTheme<'grayscale'>;
540 'hue-rotate': Negatable<FromTheme<'hueRotate'>>;
541 invert: FromTheme<'invert'>;
542 saturate: FromTheme<'saturate'>;
543 sepia: FromTheme<'sepia'>;
544 'drop-shadow': FromTheme<'dropShadow'>;
545 backdrop: Join<'filter', '' | 'none'> | Join<'blur', FromTheme<'backdropBlur'>> | Join<'brightness', FromTheme<'backdropBrightness'>> | Join<'contrast', FromTheme<'backdropContrast'>> | Join<'grayscale', FromTheme<'backdropGrayscale'>> | Join<'hue-rotate', Negatable<FromTheme<'backdropHueRotate'>>> | Join<'invert', FromTheme<'backdropInvert'>> | Join<'opacity', FromTheme<'backdropOpacity'>> | Join<'saturate', FromTheme<'backdropSaturate'>> | Join<'sepia', FromTheme<'backdropSepia'>>;
546 'mix-blend': BlendMode;
547 'bg-blend': BlendMode;
548}
549declare type ToString<T> = T extends string ? T : T extends number ? `${T}` : never;
550declare type JoinFromObject<T, Separator extends string = '-'> = {
551 [P in keyof T]: Join<ToString<P>, ToString<T[P]>, Separator>;
552}[keyof T];
553/** For adding additional variants */
554interface Variants {
555}
556/** For adding additional plugins */
557interface Plugins {
558}
559declare type CoreCompletionTokens = `${FromTheme<'screens'>}:` | `${'' | 'not-'}${SimplePseudoClasses}:` | `${Join<'group', '' | Interpolate<'string'>>}-${SimplePseudoClasses}:` | `${SimplePseudoElements}::` | `${CoreVariants}:` | JoinFromObject<CorePlugins>;
560declare type UserCompletionTokens = {
561 [K in keyof Variants]: `${ToString<K>}:`;
562}[keyof Variants] | JoinFromObject<Plugins>;
563declare type CompletionTokens = CoreCompletionTokens | UserCompletionTokens;
564
565interface Apply {
566 (strings: TemplateStringsArray, ...interpolations: Token[]): Directive<CSSRules>;
567 (...tokens: Token[]): Directive<CSSRules>;
568}
569declare const apply: Apply;
570
571declare const tw: TW;
572declare const setup: (options?: Configuration | undefined) => void;
573
574/**
575 * Returns an optimized and cached function for use with `tw`.
576 *
577 * `tw` caches rules based on the function identity. This helper caches
578 * the function based on the data.
579 *
580 * @param factory to use when the directive is invoked
581 * @param data to use
582 */
583declare const directive: <Data, T>(factory: (data: Data, context: Context) => MaybeThunk<T>, data: Data) => Directive<T>;
584
585declare const create: (config?: Configuration | undefined) => Instance;
586
587declare const mode: (report: (message: string) => void) => Mode;
588declare const warn: Mode;
589declare const strict: Mode;
590declare const silent: Mode;
591
592declare const noprefix: Prefixer;
593declare const autoprefix: Prefixer;
594
595/**
596 * Creates an sheet which inserts style rules through the CSS Object Model.
597 */
598declare const cssomSheet: ({ nonce, target, }?: SheetConfig<CSSStyleSheet>) => Sheet<CSSStyleSheet>;
599/**
600 * An sheet placeholder which performs no operations. Useful for avoiding errors in a non-browser environment.
601 */
602declare const voidSheet: () => Sheet<null>;
603
604declare const theme: ThemeHelper;
605
606declare const cyrb32: Hasher;
607
608export { Apply, BlendMode, BorderStyle, CSSAtKeyframes, CSSAtMedia, CSSAtSupports, CSSCustomProperties, CSSProperties, CSSPseudos, CSSRuleValue, CSSRules, CSSRulesThunk, CSSSimplePseudos, CompletionTokens, Configuration, Context, CoreCompletionTokens, CorePlugins, CoreVariants, Corners, CounterStyle, DarkMode, Directive, DirectiveHandler, Edges, Empty, Falsy, FontFace, FromTheme, GlobalValue, Hasher, InlineDirective, Instance, Interpolate, InterpolateKind, Join, JoinFromObject, MaybeArray, MaybeThunk, Mode, Negatable, NonEmptyString, Plugin, Plugins, Prefixer, Preflight, Range, ReportInfo, Rule, Sheet, SheetConfig, SheetInit, SheetInitCallback, SimplePseudoClasses, SimplePseudoElements, TW, TWCallable, Theme, ThemeColor, ThemeColorObject, ThemeConfiguration, ThemeContainer, ThemeFontSize, ThemeHelper, ThemeOutline, ThemeResolver, ThemeScreen, ThemeScreenValue, ThemeSection, ThemeSectionRecord, ThemeSectionResolver, ThemeSectionResolverContext, ThemeSectionType, ToString, Token, TokenGrouping, TypescriptCompat, Unwrap, UserCompletionTokens, Variants, apply, autoprefix, create, cssomSheet, directive, cyrb32 as hash, mode, noprefix, setup, silent, strict, theme, tw, voidSheet, warn };
609//# sourceMappingURL=twind.d.ts.map
610
\No newline at end of file