@unocss/nuxt 66.5.12 → 66.6.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,1634 +1,14 @@
1
1
  import * as _nuxt_schema0 from "@nuxt/schema";
2
- import MagicString from "magic-string";
3
- import { LoadConfigResult } from "unconfig";
4
- import { CustomIconLoader, IconCustomizations, InlineCollection } from "@iconify/utils";
5
- import { IconifyJSON } from "@iconify/types";
2
+ import { UserConfig } from "@unocss/core";
3
+ import { AttributifyOptions } from "@unocss/preset-attributify";
4
+ import { IconsOptions } from "@unocss/preset-icons";
5
+ import { TagifyOptions } from "@unocss/preset-tagify";
6
+ import { TypographyOptions } from "@unocss/preset-typography";
7
+ import { WebFontsOptions } from "@unocss/preset-web-fonts";
8
+ import { PresetWind3Options } from "@unocss/preset-wind3";
9
+ import { PresetWind4Options } from "@unocss/preset-wind4";
6
10
  import { VitePluginConfig } from "@unocss/vite";
7
11
 
8
- //#region ../../packages-engine/core/src/utils/countable-set.d.ts
9
- declare class CountableSet<K$1> extends Set<K$1> {
10
- _map: Map<K$1, number>;
11
- constructor(values?: Iterable<K$1>);
12
- add(key: K$1): this;
13
- delete(key: K$1): boolean;
14
- clear(): void;
15
- getCount(key: K$1): number;
16
- setCount(key: K$1, count: number): this;
17
- }
18
- //#endregion
19
- //#region ../../packages-engine/core/src/utils/events.d.ts
20
- type EventsMap = Record<string, any>;
21
- interface DefaultEvents extends EventsMap {
22
- [event: string]: (...args: any) => void;
23
- }
24
- interface Unsubscribe {
25
- (): void;
26
- }
27
- declare class Emitter<Events extends EventsMap = DefaultEvents> {
28
- /**
29
- * Event names in keys and arrays with listeners in values.
30
- *
31
- * ```js
32
- * emitter1.events = emitter2.events
33
- * emitter2.events = { }
34
- * ```
35
- */
36
- events: Partial<{ [E in keyof Events]: Events[E][] }>;
37
- /**
38
- * Add a listener for a given event.
39
- *
40
- * ```js
41
- * const unbind = ee.on('tick', (tickType, tickDuration) => {
42
- * count += 1
43
- * })
44
- *
45
- * disable () {
46
- * unbind()
47
- * }
48
- * ```
49
- *
50
- * @param event The event name.
51
- * @param cb The listener function.
52
- * @returns Unbind listener from event.
53
- */
54
- on<K$1 extends keyof Events>(this: this, event: K$1, cb: Events[K$1]): Unsubscribe;
55
- /**
56
- * Calls each of the listeners registered for a given event.
57
- *
58
- * ```js
59
- * ee.emit('tick', tickType, tickDuration)
60
- * ```
61
- *
62
- * @param event The event name.
63
- * @param args The arguments for listeners.
64
- */
65
- emit<K$1 extends keyof Events>(this: this, event: K$1, ...args: Parameters<Events[K$1]>): void;
66
- }
67
- //#endregion
68
- //#region ../../packages-engine/core/src/utils/map.d.ts
69
- declare class BetterMap<K$1, V> extends Map<K$1, V> {
70
- getFallback(key: K$1, fallback: V): V;
71
- map<R>(mapFn: (value: V, key: K$1) => R): R[];
72
- flatMap<R extends readonly unknown[]>(mapFn: (value: V, key: K$1) => R): R[number][];
73
- }
74
- //#endregion
75
- //#region ../../packages-engine/core/src/generator.d.ts
76
- declare class UnoGeneratorInternal<Theme$1 extends object = object> {
77
- userConfig: UserConfig<Theme$1>;
78
- defaults: UserConfigDefaults<Theme$1>;
79
- readonly version: string;
80
- readonly events: Emitter<{
81
- config: (config: ResolvedConfig<Theme$1>) => void;
82
- }>;
83
- config: ResolvedConfig<Theme$1>;
84
- cache: Map<string, StringifiedUtil<Theme$1>[] | null>;
85
- blocked: Set<string>;
86
- parentOrders: Map<string, number>;
87
- activatedRules: Set<Rule<Theme$1>>;
88
- protected constructor(userConfig?: UserConfig<Theme$1>, defaults?: UserConfigDefaults<Theme$1>);
89
- static create<Theme$1 extends object = object>(userConfig?: UserConfig<Theme$1>, defaults?: UserConfigDefaults<Theme$1>): Promise<UnoGeneratorInternal<Theme$1>>;
90
- setConfig(userConfig?: UserConfig<Theme$1>, defaults?: UserConfigDefaults<Theme$1>): Promise<void>;
91
- applyExtractors(code: string, id?: string, extracted?: Set<string>): Promise<Set<string>>;
92
- applyExtractors(code: string, id?: string, extracted?: CountableSet<string>): Promise<CountableSet<string>>;
93
- makeContext(raw: string, applied: VariantMatchedResult<Theme$1>): RuleContext<Theme$1>;
94
- parseToken(raw: string, alias?: string): Promise<StringifiedUtil<Theme$1>[] | undefined | null>;
95
- generate(input: string | Set<string> | CountableSet<string> | string[], options?: GenerateOptions<false>): Promise<GenerateResult<Set<string>>>;
96
- generate(input: string | Set<string> | CountableSet<string> | string[], options?: GenerateOptions<true>): Promise<GenerateResult<Map<string, ExtendedTokenInfo<Theme$1>>>>;
97
- matchVariants(raw: string, current?: string): Promise<readonly VariantMatchedResult<Theme$1>[]>;
98
- private applyVariants;
99
- constructCustomCSS(context: Readonly<RuleContext<Theme$1>>, body: CSSObject | CSSEntries, overrideSelector?: string): string;
100
- parseUtil(input: string | VariantMatchedResult<Theme$1>, context: RuleContext<Theme$1>, internal?: boolean, shortcutPrefix?: string | string[] | undefined): Promise<(ParsedUtil | RawUtil)[] | undefined>;
101
- private resolveCSSResult;
102
- stringifyUtil(parsed?: ParsedUtil | RawUtil, context?: RuleContext<Theme$1>): StringifiedUtil<Theme$1>[] | undefined;
103
- expandShortcut(input: string, context: RuleContext<Theme$1>, depth?: number): Promise<[(string | ShortcutInlineValue)[], RuleMeta | undefined] | undefined>;
104
- stringifyShortcuts(parent: VariantMatchedResult<Theme$1>, context: RuleContext<Theme$1>, expanded: (string | ShortcutInlineValue)[], meta?: RuleMeta): Promise<StringifiedUtil<Theme$1>[] | undefined>;
105
- isBlocked(raw: string): boolean;
106
- getBlocked(raw: string): [BlocklistValue, BlocklistMeta | undefined] | undefined;
107
- }
108
- declare class UnoGenerator<Theme$1 extends object = object> extends UnoGeneratorInternal<Theme$1> {
109
- /**
110
- * @deprecated `new UnoGenerator` is deprecated, please use `createGenerator()` instead
111
- */
112
- constructor(userConfig?: UserConfig<Theme$1>, defaults?: UserConfigDefaults<Theme$1>);
113
- }
114
- //#endregion
115
- //#region ../../packages-engine/core/src/types.d.ts
116
- type Awaitable<T> = T | Promise<T>;
117
- type Arrayable<T> = T | T[];
118
- type FlatObjectTuple<T> = { [K in keyof T]: T[K] };
119
- type RequiredByKey<T, K$1 extends keyof T = keyof T> = FlatObjectTuple<Required<Pick<T, Extract<keyof T, K$1>>> & Omit<T, K$1>>;
120
- type CSSObject = Record<string, string | number | undefined>;
121
- /**
122
- * [property, value, operators?]
123
- *
124
- * - operators: Used to perform specific operations on value or property.
125
- */
126
- type CSSEntry = [string, string | number | undefined, Arrayable<string>?];
127
- type CSSEntries = CSSEntry[];
128
- type CSSObjectInput = CSSObject | Partial<ControlSymbolsValue>;
129
- type CSSEntriesInput = (CSSEntry | ControlSymbolsEntry)[];
130
- type CSSValueInput = CSSObjectInput | CSSEntriesInput | CSSValue;
131
- type PresetOptions = Record<string, any>;
132
- interface RuleContext<Theme$1 extends object = object> {
133
- /**
134
- * Unprocessed selector from user input.
135
- * Useful for generating CSS rule.
136
- */
137
- rawSelector: string;
138
- /**
139
- * Current selector for rule matching
140
- */
141
- currentSelector: string;
142
- /**
143
- * UnoCSS generator instance
144
- */
145
- generator: UnoGenerator<Theme$1>;
146
- /**
147
- * Symbols for special handling
148
- */
149
- symbols: ControlSymbols;
150
- /**
151
- * The theme object
152
- */
153
- theme: Theme$1;
154
- /**
155
- * Matched variants handlers for this rule.
156
- */
157
- variantHandlers: VariantHandler[];
158
- /**
159
- * The result of variant matching.
160
- */
161
- variantMatch: VariantMatchedResult<Theme$1>;
162
- /**
163
- * Construct a custom CSS rule.
164
- * Variants and selector escaping will be handled automatically.
165
- */
166
- constructCSS: (body: CSSEntries | CSSObject, overrideSelector?: string) => string;
167
- /**
168
- * Available only when `details` option is enabled.
169
- */
170
- rules?: Rule<Theme$1>[];
171
- /**
172
- * Available only when `details` option is enabled.
173
- */
174
- shortcuts?: Shortcut<Theme$1>[];
175
- /**
176
- * Available only when `details` option is enabled.
177
- */
178
- variants?: Variant<Theme$1>[];
179
- }
180
- declare const SymbolShortcutsNoMerge: unique symbol;
181
- declare const SymbolNoMerge: unique symbol;
182
- declare const SymbolVariants: unique symbol;
183
- declare const SymbolParent: unique symbol;
184
- declare const SymbolSelector: unique symbol;
185
- declare const SymbolLayer: unique symbol;
186
- declare const SymbolSort: unique symbol;
187
- declare const SymbolBody: unique symbol;
188
- interface ControlSymbols {
189
- /**
190
- * Prevent merging in shortcuts
191
- */
192
- shortcutsNoMerge: typeof SymbolShortcutsNoMerge;
193
- /**
194
- * Prevent merging in rules
195
- */
196
- noMerge: typeof SymbolNoMerge;
197
- /**
198
- * Additional variants applied to this rule
199
- */
200
- variants: typeof SymbolVariants;
201
- /**
202
- * Parent selector (`@media`, `@supports`, etc.)
203
- */
204
- parent: typeof SymbolParent;
205
- /**
206
- * Selector modifier
207
- */
208
- selector: typeof SymbolSelector;
209
- /**
210
- * Layer modifier
211
- */
212
- layer: typeof SymbolLayer;
213
- /**
214
- * Sort modifier
215
- */
216
- sort: typeof SymbolSort;
217
- /**
218
- * Custom css body modifier
219
- */
220
- body: typeof SymbolBody;
221
- }
222
- interface ControlSymbolsValue {
223
- [SymbolShortcutsNoMerge]: true;
224
- [SymbolNoMerge]: true;
225
- [SymbolVariants]: VariantHandler[] | ((handlers: VariantHandler[]) => VariantHandler[]);
226
- [SymbolParent]: string;
227
- [SymbolSelector]: (selector: string) => string;
228
- [SymbolLayer]: string;
229
- [SymbolSort]: number;
230
- [SymbolBody]: string;
231
- }
232
- type ObjectToEntry<T> = { [K in keyof T]: [K, T[K]] }[keyof T];
233
- type ControlSymbolsEntry = ObjectToEntry<ControlSymbolsValue>;
234
- interface VariantContext<Theme$1 extends object = object> {
235
- /**
236
- * Unprocessed selector from user input.
237
- */
238
- rawSelector: string;
239
- /**
240
- * UnoCSS generator instance
241
- */
242
- generator: UnoGenerator<Theme$1>;
243
- /**
244
- * The theme object
245
- */
246
- theme: Theme$1;
247
- }
248
- interface ExtractorContext {
249
- readonly original: string;
250
- code: string;
251
- id?: string;
252
- extracted: Set<string> | CountableSet<string>;
253
- envMode?: 'dev' | 'build';
254
- }
255
- interface BaseContext<Theme$1 extends object = object> {
256
- /**
257
- * UnoCSS generator instance
258
- */
259
- generator: UnoGenerator<Theme$1>;
260
- /**
261
- * The theme object
262
- */
263
- theme: Theme$1;
264
- }
265
- interface PreflightContext<Theme$1 extends object = object> extends BaseContext<Theme$1> {}
266
- interface SafeListContext<Theme$1 extends object = object> extends BaseContext<Theme$1> {}
267
- interface Extractor {
268
- name: string;
269
- order?: number;
270
- /**
271
- * Extract the code and return a list of selectors.
272
- *
273
- * Return `undefined` to skip this extractor.
274
- */
275
- extract?: (ctx: ExtractorContext) => Awaitable<Set<string> | CountableSet<string> | string[] | undefined | void>;
276
- }
277
- interface RuleMeta {
278
- /**
279
- * The layer name of this rule.
280
- * @default 'default'
281
- */
282
- layer?: string;
283
- /**
284
- * Option to not merge this selector even if the body are the same.
285
- * @default false
286
- */
287
- noMerge?: boolean;
288
- /**
289
- * Fine tune sort
290
- */
291
- sort?: number;
292
- /**
293
- * Templates to provide autocomplete suggestions
294
- */
295
- autocomplete?: Arrayable<AutoCompleteTemplate>;
296
- /**
297
- * Matching prefix before this util
298
- */
299
- prefix?: string | string[];
300
- /**
301
- * Internal rules will only be matched for shortcuts but not the user code.
302
- * @default false
303
- */
304
- internal?: boolean;
305
- /**
306
- * Store the hash of the rule boy
307
- *
308
- * @internal
309
- * @private
310
- */
311
- __hash?: string;
312
- /**
313
- * Internal index of the rulelist
314
- * @internal
315
- * @private
316
- */
317
- __index?: number;
318
- /**
319
- * Custom metadata
320
- */
321
- custom?: Record<string, any>;
322
- }
323
- type CSSValue = CSSObject | CSSEntries;
324
- type DynamicMatcher<Theme$1 extends object = object> = (match: RegExpMatchArray, context: Readonly<RuleContext<Theme$1>>) => Awaitable<CSSValueInput | string | (CSSValueInput | string)[] | undefined> | Generator<CSSValueInput | string | undefined> | AsyncGenerator<CSSValueInput | string | undefined>;
325
- type DynamicRule<Theme$1 extends object = object> = [RegExp, DynamicMatcher<Theme$1>, RuleMeta?];
326
- type StaticRule = [string, CSSObject | CSSEntries | (CSSValueInput | string)[], RuleMeta?];
327
- type Rule<Theme$1 extends object = object> = DynamicRule<Theme$1> | StaticRule;
328
- type DynamicShortcutMatcher<Theme$1 extends object = object> = ((match: RegExpMatchArray, context: Readonly<RuleContext<Theme$1>>) => (string | ShortcutValue[] | undefined));
329
- type StaticShortcut = [string, string | ShortcutValue[], RuleMeta?];
330
- type StaticShortcutMap = Record<string, string | ShortcutValue[]>;
331
- type DynamicShortcut<Theme$1 extends object = object> = [RegExp, DynamicShortcutMatcher<Theme$1>, RuleMeta?];
332
- type UserShortcuts<Theme$1 extends object = object> = StaticShortcutMap | (StaticShortcut | DynamicShortcut<Theme$1> | StaticShortcutMap)[];
333
- type Shortcut<Theme$1 extends object = object> = StaticShortcut | DynamicShortcut<Theme$1>;
334
- interface ShortcutInlineValue {
335
- handles: VariantHandler[];
336
- value: ShortcutValue;
337
- }
338
- type ShortcutValue = string | CSSValue;
339
- type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
340
- interface Preflight<Theme$1 extends object = object> {
341
- getCSS: (context: PreflightContext<Theme$1>) => Promise<string | undefined> | string | undefined;
342
- layer?: string;
343
- }
344
- interface BlocklistMeta {
345
- /**
346
- * Custom message to show why this selector is blocked.
347
- */
348
- message?: string | ((selector: string) => string);
349
- }
350
- type BlocklistValue = string | RegExp | ((selector: string) => boolean | null | undefined);
351
- type BlocklistRule = BlocklistValue | [BlocklistValue, BlocklistMeta];
352
- interface VariantHandlerContext {
353
- /**
354
- * Rewrite the output selector. Often be used to append parents.
355
- */
356
- prefix: string;
357
- /**
358
- * Rewrite the output selector. Often be used to append pseudo classes.
359
- */
360
- selector: string;
361
- /**
362
- * Rewrite the output selector. Often be used to append pseudo elements.
363
- */
364
- pseudo: string;
365
- /**
366
- * Rewrite the output css body. The input come in [key,value][] pairs.
367
- */
368
- entries: CSSEntries;
369
- /**
370
- * Provide a parent selector(e.g. media query) to the output css.
371
- */
372
- parent?: string;
373
- /**
374
- * Provide order to the `parent` parent selector within layer.
375
- */
376
- parentOrder?: number;
377
- /**
378
- * Override layer to the output css.
379
- */
380
- layer?: string;
381
- /**
382
- * Order in which the variant is sorted within single rule.
383
- */
384
- sort?: number;
385
- /**
386
- * Option to not merge the resulting entries even if the body are the same.
387
- * @default false
388
- */
389
- noMerge?: boolean;
390
- }
391
- interface VariantHandler {
392
- /**
393
- * Callback to process the handler.
394
- */
395
- handle?: (input: VariantHandlerContext, next: (input: VariantHandlerContext) => VariantHandlerContext) => VariantHandlerContext;
396
- /**
397
- * The result rewritten selector for the next round of matching
398
- */
399
- matcher?: string;
400
- /**
401
- * Order in which the variant is applied to selector.
402
- */
403
- order?: number;
404
- /**
405
- * Rewrite the output selector. Often be used to append pseudo classes or parents.
406
- */
407
- selector?: (input: string, body: CSSEntries) => string | undefined;
408
- /**
409
- * Rewrite the output css body. The input come in [key,value][] pairs.
410
- */
411
- body?: (body: CSSEntries) => CSSEntries | undefined;
412
- /**
413
- * Provide a parent selector(e.g. media query) to the output css.
414
- */
415
- parent?: string | [string, number] | undefined;
416
- /**
417
- * Order in which the variant is sorted within single rule.
418
- */
419
- sort?: number;
420
- /**
421
- * Override layer to the output css.
422
- */
423
- layer?: string | undefined;
424
- }
425
- type VariantFunction<Theme$1 extends object = object> = (matcher: string, context: Readonly<VariantContext<Theme$1>>) => Awaitable<string | VariantHandler | VariantHandler[] | undefined>;
426
- interface VariantObject<Theme$1 extends object = object> {
427
- /**
428
- * The name of the variant.
429
- */
430
- name?: string;
431
- /**
432
- * The entry function to match and rewrite the selector for further processing.
433
- */
434
- match: VariantFunction<Theme$1>;
435
- /**
436
- * Sort for when the match is applied.
437
- */
438
- order?: number;
439
- /**
440
- * Allows this variant to be used more than once in matching a single rule
441
- *
442
- * @default false
443
- */
444
- multiPass?: boolean;
445
- /**
446
- * Custom function for auto complete
447
- */
448
- autocomplete?: Arrayable<AutoCompleteFunction | AutoCompleteTemplate>;
449
- }
450
- type Variant<Theme$1 extends object = object> = VariantFunction<Theme$1> | VariantObject<Theme$1>;
451
- type Preprocessor = (matcher: string) => string | undefined;
452
- type Postprocessor = (util: UtilObject) => void | UtilObject | (UtilObject | null | undefined)[];
453
- type ThemeExtender<Theme$1 extends object = object> = (theme: Theme$1, config: Readonly<ResolvedConfig<Theme$1>>) => Theme$1 | void;
454
- interface ConfigBase<Theme$1 extends object = object> {
455
- /**
456
- * Rules to generate CSS utilities.
457
- *
458
- * Later entries have higher priority.
459
- */
460
- rules?: Rule<Theme$1>[];
461
- /**
462
- * Variant separator
463
- *
464
- * @default [':', '-']
465
- */
466
- separators?: Arrayable<string>;
467
- /**
468
- * Variants that preprocess the selectors,
469
- * having the ability to rewrite the CSS object.
470
- */
471
- variants?: Variant<Theme$1>[];
472
- /**
473
- * Similar to Windi CSS's shortcuts,
474
- * allows you have create new utilities by combining existing ones.
475
- *
476
- * Later entries have higher priority.
477
- */
478
- shortcuts?: UserShortcuts<Theme$1>;
479
- /**
480
- * Rules to exclude the selectors for your design system (to narrow down the possibilities).
481
- * Combining `warnExcluded` options it can also help you identify wrong usages.
482
- */
483
- blocklist?: BlocklistRule[];
484
- /**
485
- * Utilities that always been included
486
- */
487
- safelist?: (string | ((context: SafeListContext<Theme$1>) => Arrayable<string>))[];
488
- /**
489
- * Extractors to handle the source file and outputs possible classes/selectors
490
- * Can be language-aware.
491
- */
492
- extractors?: Extractor[];
493
- /**
494
- * Default extractor that are always applied.
495
- * By default it split the source code by whitespace and quotes.
496
- *
497
- * It maybe be replaced by preset or user config,
498
- * only one default extractor can be presented,
499
- * later one will override the previous one.
500
- *
501
- * Pass `null` or `false` to disable the default extractor.
502
- *
503
- * @see https://github.com/unocss/unocss/blob/main/packages-engine/core/src/extractors/split.ts
504
- * @default import('@unocss/core').defaultExtractor
505
- */
506
- extractorDefault?: Extractor | null | false;
507
- /**
508
- * Raw CSS injections.
509
- */
510
- preflights?: Preflight<Theme$1>[];
511
- /**
512
- * Theme object for shared configuration between rules
513
- */
514
- theme?: Theme$1;
515
- /**
516
- * Layer orders. Default to 0.
517
- */
518
- layers?: Record<string, number>;
519
- /**
520
- * Output the internal layers as CSS Cascade Layers.
521
- */
522
- outputToCssLayers?: boolean | OutputCssLayersOptions;
523
- /**
524
- * Custom function to sort layers.
525
- */
526
- sortLayers?: (layers: string[]) => string[];
527
- /**
528
- * Preprocess the incoming utilities, return falsy value to exclude
529
- */
530
- preprocess?: Arrayable<Preprocessor>;
531
- /**
532
- * Postprocess the generate utils object
533
- */
534
- postprocess?: Arrayable<Postprocessor>;
535
- /**
536
- * Custom functions mutate the theme object.
537
- *
538
- * It's also possible to return a new theme object to completely replace the original one.
539
- */
540
- extendTheme?: Arrayable<ThemeExtender<Theme$1>>;
541
- /**
542
- * Presets
543
- */
544
- presets?: (PresetOrFactoryAwaitable<Theme$1> | PresetOrFactoryAwaitable<Theme$1>[])[];
545
- /**
546
- * Additional options for auto complete
547
- */
548
- autocomplete?: {
549
- /**
550
- * Custom functions / templates to provide autocomplete suggestions
551
- */
552
- templates?: Arrayable<AutoCompleteFunction | AutoCompleteTemplate>;
553
- /**
554
- * Custom extractors to pickup possible classes and
555
- * transform class-name style suggestions to the correct format
556
- */
557
- extractors?: Arrayable<AutoCompleteExtractor>;
558
- /**
559
- * Custom shorthands to provide autocomplete suggestions.
560
- * if values is an array, it will be joined with `|` and wrapped with `()`
561
- */
562
- shorthands?: Record<string, string | string[]>;
563
- };
564
- /**
565
- * Hook to modify the resolved config.
566
- *
567
- * First presets runs first and the user config
568
- */
569
- configResolved?: (config: ResolvedConfig<Theme$1>) => void;
570
- /**
571
- * Expose internal details for debugging / inspecting
572
- *
573
- * Added `rules`, `shortcuts`, `variants` to the context and expose the context object in `StringifiedUtil`
574
- *
575
- * You don't usually need to set this.
576
- *
577
- * @default `true` when `envMode` is `dev`, otherwise `false`
578
- */
579
- details?: boolean;
580
- /**
581
- * Options for sources to be extracted as utilities usages.
582
- *
583
- */
584
- content?: ContentOptions;
585
- /**
586
- * Custom transformers to the source code.
587
- */
588
- transformers?: SourceCodeTransformer[];
589
- }
590
- interface OutputCssLayersOptions {
591
- /**
592
- * Specify the css layer that the internal layer should be output to.
593
- *
594
- * Return `null` to specify that the layer should not be output to any css layer.
595
- */
596
- cssLayerName?: (internalLayer: string) => string | undefined | null;
597
- }
598
- type AutoCompleteTemplate = string;
599
- type AutoCompleteFunction = (input: string) => Awaitable<string[]>;
600
- interface AutoCompleteExtractorContext {
601
- content: string;
602
- cursor: number;
603
- }
604
- interface Replacement {
605
- /**
606
- * The range of the original text
607
- */
608
- start: number;
609
- end: number;
610
- /**
611
- * The text used to replace
612
- */
613
- replacement: string;
614
- }
615
- interface AutoCompleteExtractorResult {
616
- /**
617
- * The extracted string
618
- */
619
- extracted: string;
620
- /**
621
- * The function to convert the selected suggestion back
622
- */
623
- resolveReplacement: (suggestion: string) => Replacement;
624
- /**
625
- * The function to format suggestions
626
- */
627
- transformSuggestions?: (suggestions: string[]) => string[];
628
- }
629
- interface AutoCompleteExtractor {
630
- name: string;
631
- extract: (context: AutoCompleteExtractorContext) => Awaitable<AutoCompleteExtractorResult | null>;
632
- order?: number;
633
- }
634
- interface Preset<Theme$1 extends object = object> extends ConfigBase<Theme$1> {
635
- name: string;
636
- /**
637
- * Enforce the preset to be applied before or after other presets
638
- */
639
- enforce?: 'pre' | 'post';
640
- /**
641
- * Preset options for other tools like IDE to consume
642
- */
643
- options?: PresetOptions;
644
- /**
645
- * Apply prefix to all utilities and shortcuts
646
- */
647
- prefix?: string | string[];
648
- /**
649
- * Apply layer to all utilities and shortcuts
650
- */
651
- layer?: string;
652
- /**
653
- * Custom API endpoint for cross-preset communication
654
- */
655
- api?: any;
656
- /**
657
- * Custom metadata for the preset
658
- */
659
- meta?: Record<string, any>;
660
- }
661
- type PresetFactory<Theme$1 extends object = object, PresetOptions$1 extends object | undefined = undefined> = (options?: PresetOptions$1) => Preset<Theme$1>;
662
- type PresetFactoryAwaitable<Theme$1 extends object = object, PresetOptions$1 extends object | undefined = undefined> = (options?: PresetOptions$1) => Awaitable<Preset<Theme$1>>;
663
- type PresetOrFactory<Theme$1 extends object = object> = Preset<Theme$1> | PresetFactory<Theme$1, any>;
664
- type PresetOrFactoryAwaitable<Theme$1 extends object = object> = PresetOrFactory<Theme$1> | Promise<Preset<Theme$1>> | PresetFactoryAwaitable<Theme$1>;
665
- interface GeneratorOptions {
666
- /**
667
- * Merge utilities with the exact same body to save the file size
668
- *
669
- * @default true
670
- */
671
- mergeSelectors?: boolean;
672
- /**
673
- * Emit warning when matched selectors are presented in blocklist
674
- *
675
- * @default true
676
- */
677
- warn?: boolean;
678
- }
679
- interface UserOnlyOptions<Theme$1 extends object = object> {
680
- /**
681
- * The theme object, will be merged with the theme provides by presets
682
- */
683
- theme?: Theme$1;
684
- /**
685
- * Layout name of shortcuts
686
- *
687
- * @default 'shortcuts'
688
- */
689
- shortcutsLayer?: string;
690
- /**
691
- * Environment mode
692
- *
693
- * @default 'build'
694
- */
695
- envMode?: 'dev' | 'build';
696
- /**
697
- * legacy.renderModernChunks need to be consistent with @vitejs/plugin-legacy
698
- */
699
- legacy?: {
700
- renderModernChunks: boolean;
701
- };
702
- /**
703
- * Custom prefix for virtual modules
704
- *
705
- * @default '__uno'
706
- */
707
- virtualModulePrefix?: string;
708
- }
709
- /**
710
- * For unocss-cli config
711
- */
712
- interface CliOptions {
713
- cli?: {
714
- entry?: Arrayable<CliEntryItem>;
715
- };
716
- }
717
- interface UnocssPluginContext<Config extends UserConfig = UserConfig> {
718
- /**
719
- * Singleton promise for config loading
720
- */
721
- ready: Promise<LoadConfigResult<Config>>;
722
- /**
723
- * The UnoCSS generator instance. Should be used after `ready` resolved.
724
- */
725
- uno: UnoGenerator;
726
- /**
727
- * All tokens scanned
728
- */
729
- tokens: Set<string>;
730
- /**
731
- * Map for all module's raw content
732
- */
733
- modules: BetterMap<string, string>;
734
- /**
735
- * Module IDs that been affected by UnoCSS
736
- */
737
- affectedModules: Set<string>;
738
- /**
739
- * Pending promises
740
- */
741
- tasks: Promise<any>[];
742
- /**
743
- * Await all pending tasks
744
- */
745
- flushTasks: () => Promise<any>;
746
- filter: (code: string, id: string) => boolean;
747
- extract: (code: string, id?: string) => Promise<void>;
748
- reloadConfig: () => Promise<LoadConfigResult<Config>>;
749
- getConfig: () => Promise<Config>;
750
- onReload: (fn: () => void) => void;
751
- invalidate: () => void;
752
- onInvalidate: (fn: () => void) => void;
753
- root: string;
754
- updateRoot: (root: string) => Promise<LoadConfigResult<Config>>;
755
- getConfigFileList: () => string[];
756
- /**
757
- * Get regexes to match virtual module ids
758
- */
759
- getVMPRegexes: () => Promise<{
760
- prefix: string;
761
- RESOLVED_ID_WITH_QUERY_RE: RegExp;
762
- RESOLVED_ID_RE: RegExp;
763
- }>;
764
- }
765
- interface HighlightAnnotation {
766
- offset: number;
767
- length: number;
768
- className: string;
769
- }
770
- type SourceCodeTransformerEnforce = 'pre' | 'post' | 'default';
771
- interface SourceCodeTransformer {
772
- name: string;
773
- /**
774
- * The order of transformer
775
- */
776
- enforce?: SourceCodeTransformerEnforce;
777
- /**
778
- * Custom id filter, if not provided, the extraction filter will be applied
779
- */
780
- idFilter?: (id: string) => boolean;
781
- /**
782
- * The transform function
783
- */
784
- transform: (code: MagicString, id: string, ctx: UnocssPluginContext) => Awaitable<{
785
- highlightAnnotations?: HighlightAnnotation[];
786
- } | void>;
787
- }
788
- interface ContentOptions {
789
- /**
790
- * Glob patterns to extract from the file system, in addition to other content sources.
791
- *
792
- * In dev mode, the files will be watched and trigger HMR.
793
- *
794
- * @default []
795
- */
796
- filesystem?: string[];
797
- /**
798
- * Inline text to be extracted
799
- */
800
- inline?: (string | {
801
- code: string;
802
- id?: string;
803
- } | (() => Awaitable<string | {
804
- code: string;
805
- id?: string;
806
- }>))[];
807
- /**
808
- * Filters to determine whether to extract certain modules from the build tools' transformation pipeline.
809
- *
810
- * Currently only works for Vite and Webpack integration.
811
- *
812
- * Set `false` to disable.
813
- */
814
- pipeline?: false | {
815
- /**
816
- * Patterns that filter the files being extracted.
817
- * Supports regular expressions and `picomatch` glob patterns.
818
- *
819
- * By default, `.ts` and `.js` files are NOT extracted.
820
- *
821
- * @see https://www.npmjs.com/package/picomatch
822
- * @default [/\.(vue|svelte|[jt]sx|vine.ts|mdx?|astro|elm|php|phtml|marko|html)($|\?)/]
823
- */
824
- include?: FilterPattern;
825
- /**
826
- * Patterns that filter the files NOT being extracted.
827
- * Supports regular expressions and `picomatch` glob patterns.
828
- *
829
- * By default, `node_modules` and `dist` are also extracted.
830
- *
831
- * @see https://www.npmjs.com/package/picomatch
832
- * @default [/\.(css|postcss|sass|scss|less|stylus|styl)($|\?)/]
833
- */
834
- exclude?: FilterPattern;
835
- };
836
- }
837
- /**
838
- * For other modules to aggregate the options
839
- */
840
- interface PluginOptions {
841
- /**
842
- * Load from configs files
843
- *
844
- * set `false` to disable
845
- */
846
- configFile?: string | false;
847
- /**
848
- * List of files that will also trigger config reloads
849
- */
850
- configDeps?: string[];
851
- /**
852
- * Custom transformers to the source code
853
- */
854
- transformers?: SourceCodeTransformer[];
855
- /**
856
- * Options for sources to be extracted as utilities usages
857
- *
858
- * Supported sources:
859
- * - `filesystem` - extract from file system
860
- * - `inline` - extract from plain inline text
861
- * - `pipeline` - extract from build tools' transformation pipeline, such as Vite and Webpack
862
- *
863
- * The usage extracted from each source will be **merged** together.
864
- */
865
- content?: ContentOptions;
866
- }
867
- interface UserConfig<Theme$1 extends object = object> extends ConfigBase<Theme$1>, UserOnlyOptions<Theme$1>, GeneratorOptions, PluginOptions, CliOptions {}
868
- interface UserConfigDefaults<Theme$1 extends object = object> extends ConfigBase<Theme$1>, UserOnlyOptions<Theme$1> {}
869
- interface ResolvedConfig<Theme$1 extends object = object> extends Omit<RequiredByKey<UserConfig<Theme$1>, 'mergeSelectors' | 'theme' | 'rules' | 'variants' | 'layers' | 'extractors' | 'blocklist' | 'safelist' | 'preflights' | 'sortLayers'>, 'rules' | 'shortcuts' | 'autocomplete' | 'presets'> {
870
- presets: Preset<Theme$1>[];
871
- shortcuts: Shortcut<Theme$1>[];
872
- variants: VariantObject<Theme$1>[];
873
- preprocess: Preprocessor[];
874
- postprocess: Postprocessor[];
875
- rulesSize: number;
876
- rules: readonly Rule<Theme$1>[];
877
- rulesDynamic: readonly DynamicRule<Theme$1>[];
878
- rulesStaticMap: Record<string, StaticRule | undefined>;
879
- autocomplete: {
880
- templates: (AutoCompleteFunction | AutoCompleteTemplate)[];
881
- extractors: AutoCompleteExtractor[];
882
- shorthands: Record<string, string>;
883
- };
884
- separators: string[];
885
- }
886
- interface GenerateResult<T = Set<string>> {
887
- css: string;
888
- layers: string[];
889
- getLayer: (name?: string) => string | undefined;
890
- getLayers: (includes?: string[], excludes?: string[]) => string;
891
- setLayer: (layer: string, callback: (content: string) => Promise<string>) => Promise<string>;
892
- matched: T;
893
- }
894
- type VariantMatchedResult<Theme$1 extends object = object> = [raw: string, current: string, variantHandlers: VariantHandler[], variants: Set<Variant<Theme$1>>];
895
- type ParsedUtil = readonly [index: number, raw: string, entries: CSSEntries, meta: RuleMeta | undefined, variantHandlers: VariantHandler[]];
896
- type RawUtil = readonly [index: number, rawCSS: string, meta: RuleMeta | undefined];
897
- type StringifiedUtil<Theme$1 extends object = object> = readonly [index: number, selector: string | undefined, body: string, parent: string | undefined, meta: RuleMeta | undefined, context: RuleContext<Theme$1> | undefined, noMerge: boolean | undefined];
898
- interface CliEntryItem {
899
- patterns: string[];
900
- outFile: string;
901
- }
902
- interface UtilObject {
903
- selector: string;
904
- entries: CSSEntries;
905
- parent: string | undefined;
906
- layer: string | undefined;
907
- sort: number | undefined;
908
- noMerge: boolean | undefined;
909
- }
910
- /**
911
- * Returned from `uno.generate()` when `extendedInfo` option is enabled.
912
- */
913
- interface ExtendedTokenInfo<Theme$1 extends object = object> {
914
- /**
915
- * Stringified util data
916
- */
917
- data: StringifiedUtil<Theme$1>[];
918
- /**
919
- * Return -1 if the data structure is not countable
920
- */
921
- count: number;
922
- }
923
- interface GenerateOptions<T extends boolean> {
924
- /**
925
- * Filepath of the file being processed.
926
- */
927
- id?: string;
928
- /**
929
- * Generate preflights (if defined)
930
- *
931
- * @default true
932
- */
933
- preflights?: boolean;
934
- /**
935
- * Includes safelist
936
- */
937
- safelist?: boolean;
938
- /**
939
- * Generate minified CSS
940
- * @default false
941
- */
942
- minify?: boolean;
943
- /**
944
- * @experimental
945
- */
946
- scope?: string;
947
- /**
948
- * If return extended "matched" with payload and count
949
- */
950
- extendedInfo?: T;
951
- }
952
- //#endregion
953
- //#region ../../packages-presets/preset-attributify/src/types.d.ts
954
- interface AttributifyOptions extends PresetOptions {
955
- /**
956
- * Only generate CSS for attributify or class
957
- *
958
- * @default false
959
- */
960
- strict?: boolean;
961
- /**
962
- * @default 'un-'
963
- */
964
- prefix?: string;
965
- /**
966
- * Only match for prefixed attributes
967
- *
968
- * @default false
969
- */
970
- prefixedOnly?: boolean;
971
- /**
972
- * Support matching non-valued attributes
973
- *
974
- * For example
975
- * ```html
976
- * <div mt-2 />
977
- * ```
978
- *
979
- * @default true
980
- */
981
- nonValuedAttribute?: boolean;
982
- /**
983
- * A list of attributes to be ignored from extracting.
984
- */
985
- ignoreAttributes?: string[];
986
- /**
987
- * Non-valued attributes will also match if the actual value represented in DOM is `true`.
988
- * This option exists for supporting frameworks that encodes non-valued attributes as `true`.
989
- * Enabling this option will break rules that ends with `true`.
990
- *
991
- * @default false
992
- */
993
- trueToNonValued?: boolean;
994
- }
995
- //#endregion
996
- //#region ../../packages-presets/preset-icons/src/types.d.ts
997
- interface IconMeta {
998
- collection: string;
999
- name: string;
1000
- svg: string;
1001
- mode?: IconsOptions['mode'];
1002
- /**
1003
- * @deprecated renamed to `name`
1004
- */
1005
- icon: string;
1006
- }
1007
- interface IconsOptions {
1008
- /**
1009
- * Scale related to the current font size (1em).
1010
- *
1011
- * @default 1
1012
- */
1013
- scale?: number;
1014
- /**
1015
- * Mode of generated CSS icons.
1016
- *
1017
- * - `mask` - use background color and the `mask` property for monochrome icons
1018
- * - `background-img` - use background image for the icons, colors are static
1019
- * - `auto` - smartly decide mode between `mask` and `background-img` per icon based on its style
1020
- *
1021
- * @default 'auto'
1022
- * @see https://antfu.me/posts/icons-in-pure-css
1023
- */
1024
- mode?: 'mask' | 'bg' | 'auto';
1025
- /**
1026
- * Class prefix for matching icon rules.
1027
- *
1028
- * @default `i-`
1029
- */
1030
- prefix?: string | string[];
1031
- /**
1032
- * Extra CSS properties applied to the generated CSS
1033
- *
1034
- * @default {}
1035
- */
1036
- extraProperties?: Record<string, string>;
1037
- /**
1038
- * Emit warning when missing icons are matched
1039
- *
1040
- * @default false
1041
- */
1042
- warn?: boolean;
1043
- /**
1044
- * `@iconify-json` collections to use (will be also auto installed when missing and `autoInstall` enabled).
1045
- *
1046
- * This option should be used only when there are new `@iconify-json` collections not listed in the default icons preset collection names.
1047
- *
1048
- * Adding external collections will not work, you should use `FileSystemIconLoader` from
1049
- * `@iconify/utils/lib/loader/fs` or `createExternalPackageIconLoader` from
1050
- * `@iconify/utils/lib/loader/external-pkg` instead.
1051
- *
1052
- * @see https://unocss.dev/presets/icons#filesystemiconloader
1053
- * @see https://unocss.dev/presets/icons#externalpackageiconloader
1054
- */
1055
- iconifyCollectionsNames?: string[];
1056
- /**
1057
- * In Node.js environment, the preset will search for the installed iconify dataset automatically.
1058
- * When using in the browser, this options is provided to provide dataset with custom loading mechanism.
1059
- */
1060
- collections?: Record<string, (() => Awaitable<IconifyJSON>) | undefined | CustomIconLoader | InlineCollection>;
1061
- /**
1062
- * Rule layer
1063
- *
1064
- * @default 'icons'
1065
- */
1066
- layer?: string;
1067
- /**
1068
- * Custom icon customizations.
1069
- */
1070
- customizations?: Omit<IconCustomizations, 'additionalProps' | 'trimCustomSvg'>;
1071
- /**
1072
- * Auto install icon sources package when the usages is detected
1073
- *
1074
- * Only effective in Node.js environment.
1075
- *
1076
- * @default false
1077
- */
1078
- autoInstall?: boolean;
1079
- /**
1080
- * Path to resolve the iconify collections in Node.js environment.
1081
- *
1082
- * @default process.cwd()
1083
- */
1084
- collectionsNodeResolvePath?: string | string[];
1085
- /**
1086
- * Custom icon unit.
1087
- *
1088
- * @default `em`
1089
- */
1090
- unit?: string;
1091
- /**
1092
- * Load icons from CDN. Should starts with `https://` and ends with `/`
1093
- *
1094
- * Recommends:
1095
- * - https://esm.sh/
1096
- * - https://cdn.skypack.dev/
1097
- */
1098
- cdn?: string;
1099
- /**
1100
- * Custom fetch function to provide the icon data.
1101
- */
1102
- customFetch?: (url: string) => Promise<any>;
1103
- /**
1104
- * Processor for the CSS object before stringify
1105
- */
1106
- processor?: (cssObject: CSSObject, meta: Required<IconMeta>) => void;
1107
- }
1108
- //#endregion
1109
- //#region ../../packages-presets/preset-tagify/src/types.d.ts
1110
- interface TagifyOptions {
1111
- /**
1112
- * The prefix to use for the tagify variant.
1113
- */
1114
- prefix?: string;
1115
- /**
1116
- * Tags excluded from processing.
1117
- * @default ['b', /^h\d+$/, 'table']
1118
- */
1119
- excludedTags?: (string | RegExp)[];
1120
- /**
1121
- * Extra CSS properties to apply to matched rules
1122
- */
1123
- extraProperties?: Record<string, string> | ((matched: string) => Partial<Record<string, string>>);
1124
- /**
1125
- * Enable default extractor
1126
- * @default true
1127
- */
1128
- defaultExtractor?: boolean;
1129
- }
1130
- //#endregion
1131
- //#region ../../packages-presets/preset-typography/src/types.d.ts
1132
- interface TypographyCompatibilityOptions {
1133
- noColonWhere?: boolean;
1134
- noColonIs?: boolean;
1135
- noColonNot?: boolean;
1136
- }
1137
- interface TypographyTheme {
1138
- colors?: Record<string, any>;
1139
- }
1140
- interface TypographyColorScheme {
1141
- 'body'?: Arrayable<string | number>;
1142
- 'headings'?: Arrayable<string | number>;
1143
- 'lead'?: Arrayable<string | number>;
1144
- 'links'?: Arrayable<string | number>;
1145
- 'bold'?: Arrayable<string | number>;
1146
- 'counters'?: Arrayable<string | number>;
1147
- 'bullets'?: Arrayable<string | number>;
1148
- 'hr'?: Arrayable<string | number>;
1149
- 'quotes'?: Arrayable<string | number>;
1150
- 'quote-borders'?: Arrayable<string | number>;
1151
- 'captions'?: Arrayable<string | number>;
1152
- 'kbd'?: Arrayable<string | number>;
1153
- 'kbd-shadows'?: Arrayable<string | number>;
1154
- 'code'?: Arrayable<string | number>;
1155
- 'pre-code'?: Arrayable<string | number>;
1156
- 'pre-bg'?: Arrayable<string | number>;
1157
- 'th-borders'?: Arrayable<string | number>;
1158
- 'td-borders'?: Arrayable<string | number>;
1159
- }
1160
- interface TypographyCSSObject extends Record<string, CSSObject | string | number> {}
1161
- interface TypographySizeScheme extends Record<string, TypographyCSSObject> {}
1162
- interface TypographyOptions<T extends TypographyTheme = TypographyTheme> {
1163
- /**
1164
- * The selector name to use the typographic utilities.
1165
- * To undo the styles to the elements, use it like
1166
- * `not-${selectorName}` which is by default `not-prose`.
1167
- *
1168
- * Note: `not` utility is only available in class mode.
1169
- *
1170
- * @default `prose`
1171
- */
1172
- selectorName?: string;
1173
- /**
1174
- * Extend or override CSS selectors with CSS declaration block.
1175
- *
1176
- * @default undefined
1177
- */
1178
- cssExtend?: Record<string, CSSObject> | ((theme: T) => Record<string, CSSObject>);
1179
- /**
1180
- * Compatibility option. Notice that it will affect some features.
1181
- * For more instructions, see
1182
- * [README](https://github.com/unocss/unocss/tree/main/packages-presets/preset-typography)
1183
- *
1184
- * @default undefined
1185
- */
1186
- compatibility?: TypographyCompatibilityOptions;
1187
- /**
1188
- * Control whether prose's utilities should be marked with !important.
1189
- *
1190
- * @default false
1191
- */
1192
- important?: boolean | string;
1193
- /**
1194
- * Color scheme for typography elements.
1195
- *
1196
- * Each key represents a typographic element (e.g., 'body', 'headings', 'links').
1197
- *
1198
- * Type: [light, dark] => [color, invert-color]
1199
- *
1200
- * @default
1201
- *
1202
- * {
1203
- * 'body': [700, 300],
1204
- * 'headings': [900, 'white'],
1205
- * 'lead': [600, 400],
1206
- * 'links': [900, 'white'],
1207
- * 'bold': [900, 'white'],
1208
- * 'counters': [500, 400],
1209
- * 'bullets': [300, 600],
1210
- * 'hr': [200, 700],
1211
- * 'quotes': [900, 100],
1212
- * 'quote-borders': [200, 700],
1213
- * 'captions': [500, 400],
1214
- * 'kbd': [900, 'white'],
1215
- * 'kbd-shadows': [900, 'white'],
1216
- * 'code': [900, 'white'],
1217
- * 'pre-code': [200, 300],
1218
- * 'pre-bg': [800, 'rgb(0 0 0 / 50%)'],
1219
- * 'th-borders': [300, 600],
1220
- * 'td-borders': [200, 700],
1221
- * }
1222
- */
1223
- colorScheme?: TypographyColorScheme;
1224
- /**
1225
- * Size scheme for typography elements.
1226
- *
1227
- * Allows you to customize the CSS styles of various typographic elements.
1228
- * Similar to {@link cssExtend}, but it applies granular overlays to different sizes of text.
1229
- *
1230
- * Example:
1231
- *
1232
- * {
1233
- *
1234
- * 'sm': {@link TypographyCSSObject}
1235
- *
1236
- * 'base': {@link TypographyCSSObject}
1237
- *
1238
- * 'lg': {@link TypographyCSSObject}
1239
- *
1240
- * 'xl': {@link TypographyCSSObject}
1241
- *
1242
- * '2xl': {@link TypographyCSSObject}
1243
- *
1244
- * }
1245
- *
1246
- */
1247
- sizeScheme?: TypographySizeScheme;
1248
- /**
1249
- * Prefix for generated css vars.
1250
- *
1251
- * @default '--un-prose'
1252
- */
1253
- cssVarPrefix?: string;
1254
- }
1255
- //#endregion
1256
- //#region ../../packages-presets/preset-web-fonts/src/types.d.ts
1257
- type WebFontsProviders = 'google' | 'bunny' | 'fontshare' | 'fontsource' | 'coollabs' | 'none' | Provider;
1258
- interface WebFontMeta {
1259
- /**
1260
- * The name of the font family
1261
- * @example 'Fira Code'
1262
- */
1263
- name: string;
1264
- /**
1265
- * Font weight(s) to include, and respect the weight order
1266
- * @example [400, 700]
1267
- */
1268
- weights?: (string | number)[];
1269
- /**
1270
- * Use italic style
1271
- */
1272
- italic?: boolean;
1273
- /**
1274
- * Font width(s) to include, and respect the width order
1275
- * @example [62.5, 125]
1276
- */
1277
- widths?: (string | number)[];
1278
- /**
1279
- * Variable font settings
1280
- * @example
1281
- * ```ts
1282
- * variable: {
1283
- * wght: { default: '400', min: '100', max: '900', step: '100' },
1284
- * wdth: { default: '100', min: '50', max: '200', step: '10' },
1285
- * slnt: { default: '0', min: '-20', max: '20', step: '1' },
1286
- * }
1287
- */
1288
- variable?: Record<string, Partial<Axes>>;
1289
- /**
1290
- * The font subsets to include
1291
- * @example ['latin', 'cyrillic']
1292
- */
1293
- subsets?: string[];
1294
- /**
1295
- * Prefer static font files over variable
1296
- */
1297
- preferStatic?: boolean;
1298
- /**
1299
- * Override the provider
1300
- * @default <matches root config>
1301
- */
1302
- provider?: WebFontsProviders;
1303
- }
1304
- interface WebFontProcessor {
1305
- getCSS?: (fonts: ResolvedWebFontMeta[], providers: Provider[], getCSSDefault: (fonts: ResolvedWebFontMeta[], providers: Provider[]) => Awaitable<string>) => Awaitable<string | undefined>;
1306
- transformCSS?: (css: string) => Promise<string | undefined>;
1307
- }
1308
- interface ResolvedWebFontMeta extends Omit<WebFontMeta, 'provider'> {
1309
- provider: Provider;
1310
- }
1311
- interface WebFontsOptions {
1312
- /**
1313
- * Provider service of the web fonts
1314
- * @default 'google'
1315
- */
1316
- provider?: WebFontsProviders;
1317
- /**
1318
- * The fonts
1319
- */
1320
- fonts?: Record<string, WebFontMeta | string | (WebFontMeta | string)[]>;
1321
- /**
1322
- * Extend fonts to the theme object
1323
- * @default true
1324
- */
1325
- extendTheme?: boolean;
1326
- /**
1327
- * Key for the theme object
1328
- *
1329
- * Automatically detect the key based on the preset used
1330
- *
1331
- * @default
1332
- * `preset-wind3` -> 'fontFamily'
1333
- * `preset-wind4` -> 'font'
1334
- */
1335
- themeKey?: string;
1336
- /**
1337
- * Inline CSS @import()
1338
- *
1339
- * @default true
1340
- */
1341
- inlineImports?: boolean;
1342
- /**
1343
- * Custom fetch function
1344
- *
1345
- * @default undefined
1346
- */
1347
- customFetch?: (url: string) => Promise<any>;
1348
- /**
1349
- * Custom processor for the font CSS
1350
- */
1351
- processors?: Arrayable<WebFontProcessor>;
1352
- /**
1353
- * Timeouts for fetching web fonts
1354
- */
1355
- timeouts?: false | {
1356
- /**
1357
- * Timeout for printing warning message
1358
- *
1359
- * @default 500
1360
- */
1361
- warning?: number;
1362
- /**
1363
- * Timeout for failing the fetch
1364
- *
1365
- * @default 2000
1366
- */
1367
- failure?: number;
1368
- };
1369
- }
1370
- interface Provider {
1371
- name: WebFontsProviders;
1372
- getPreflight?: (fonts: WebFontMeta[], fetcher: (url: string) => Promise<any>) => Awaitable<string | undefined>;
1373
- getImportUrl?: (fonts: WebFontMeta[]) => string | undefined;
1374
- getFontName?: (font: WebFontMeta) => string;
1375
- }
1376
- interface Axes {
1377
- default: string;
1378
- min: string;
1379
- max: string;
1380
- step: string;
1381
- }
1382
- //#endregion
1383
- //#region ../../packages-presets/preset-mini/src/index.d.ts
1384
- interface DarkModeSelectors$1 {
1385
- /**
1386
- * Selectors for light variant.
1387
- *
1388
- * @default '.light'
1389
- */
1390
- light?: string | string[];
1391
- /**
1392
- * Selectors for dark variant.
1393
- *
1394
- * @default '.dark'
1395
- */
1396
- dark?: string | string[];
1397
- }
1398
- interface PresetMiniOptions extends PresetOptions {
1399
- /**
1400
- * Dark mode options
1401
- *
1402
- * @default 'class'
1403
- */
1404
- dark?: 'class' | 'media' | DarkModeSelectors$1;
1405
- /**
1406
- * Generate tagged pseudo selector as `[group=""]` instead of `.group`
1407
- *
1408
- * @default false
1409
- */
1410
- attributifyPseudo?: boolean;
1411
- /**
1412
- * Prefix for CSS variables.
1413
- *
1414
- * @default 'un-'
1415
- */
1416
- variablePrefix?: string;
1417
- /**
1418
- * Utils prefix. When using tagged pseudo selector, only the first truthy prefix will be used.
1419
- *
1420
- * @default undefined
1421
- */
1422
- prefix?: string | string[];
1423
- /**
1424
- * Generate preflight
1425
- *
1426
- * @default true
1427
- */
1428
- preflight?: boolean | 'on-demand';
1429
- /**
1430
- * Enable arbitrary variants, for example `<div class="[&>*]:m-1 [&[open]]:p-2"></div>`.
1431
- *
1432
- * Disable this might slightly improve the performance.
1433
- *
1434
- * @default true
1435
- */
1436
- arbitraryVariants?: boolean;
1437
- }
1438
- //#endregion
1439
- //#region ../../packages-presets/preset-wind3/src/index.d.ts
1440
- interface PresetWind3Options extends PresetMiniOptions {
1441
- /**
1442
- * The important option lets you control whether UnoCSS’s utilities should be marked with `!important`.
1443
- *
1444
- * This can be really useful when using UnoCSS with existing CSS that has high specificity selectors.
1445
- *
1446
- * You can also set `important` to a selector like `#app` instead, which will generate `#app :is(.m-1) { ... }`
1447
- *
1448
- * Also check out the compatibility with [:is()](https://caniuse.com/?search=%3Ais())
1449
- *
1450
- * @default false
1451
- */
1452
- important?: boolean | string;
1453
- }
1454
- //#endregion
1455
- //#region ../../packages-presets/preset-wind4/src/theme/types.d.ts
1456
- interface Colors {
1457
- [key: string]: Colors & {
1458
- DEFAULT?: string;
1459
- } | string;
1460
- }
1461
- interface ThemeAnimation {
1462
- keyframes?: Record<string, string>;
1463
- durations?: Record<string, string>;
1464
- timingFns?: Record<string, string>;
1465
- properties?: Record<string, object>;
1466
- counts?: Record<string, string | number>;
1467
- category?: Record<string, string>;
1468
- }
1469
- interface Theme {
1470
- font?: Record<string, string>;
1471
- colors?: Colors;
1472
- spacing?: Record<string, string>;
1473
- breakpoint?: Record<string, string>;
1474
- verticalBreakpoint?: Record<string, string>;
1475
- container?: Record<string, string>;
1476
- text?: Record<string, {
1477
- fontSize?: string;
1478
- lineHeight?: string;
1479
- letterSpacing?: string;
1480
- }>;
1481
- fontWeight?: Record<string, string>;
1482
- tracking?: Record<string, string>;
1483
- leading?: Record<string, string>;
1484
- radius?: Record<string, string>;
1485
- shadow?: Record<string, string | string[]>;
1486
- insetShadow?: Record<string, string | string[]>;
1487
- dropShadow?: Record<string, string | string[]>;
1488
- textShadow?: Record<string, string | string[]>;
1489
- ease?: Record<string, string>;
1490
- animate?: Record<string, string>;
1491
- blur?: Record<string, string>;
1492
- perspective?: Record<string, string>;
1493
- textStrokeWidth?: Record<string, string>;
1494
- property?: Record<string, string>;
1495
- default?: Record<string, Record<string, string>>;
1496
- animation?: ThemeAnimation;
1497
- duration?: Record<string, string>;
1498
- containers?: {
1499
- center?: boolean;
1500
- padding?: string | Record<string, string>;
1501
- maxWidth?: Record<string, string>;
1502
- };
1503
- aria?: Record<string, string>;
1504
- data?: Record<string, string>;
1505
- media?: Record<string, string>;
1506
- supports?: Record<string, string>;
1507
- }
1508
- //#endregion
1509
- //#region ../../packages-presets/preset-wind4/src/index.d.ts
1510
- interface DarkModeSelectors {
1511
- /**
1512
- * Selector for light variant.
1513
- *
1514
- * @default '.light'
1515
- */
1516
- light?: string;
1517
- /**
1518
- * Selector for dark variant.
1519
- *
1520
- * @default '.dark'
1521
- */
1522
- dark?: string;
1523
- }
1524
- interface PreflightsTheme {
1525
- /**
1526
- * Generate theme keys as CSS variables.
1527
- *
1528
- * - `true`: Generate theme keys fully.
1529
- * - `false`: Disable theme keys. (Not recommended ⚠️)
1530
- * - `'on-demand'`: Generate theme keys only when used.
1531
- *
1532
- * @default 'on-demand'
1533
- */
1534
- mode?: boolean | 'on-demand';
1535
- /**
1536
- * Process the theme keys.
1537
- */
1538
- process?: Arrayable<(entry: CSSEntry, ctx: PreflightContext<Theme>) => void>;
1539
- }
1540
- interface PresetWind4Options extends PresetOptions {
1541
- /**
1542
- * Dark mode options
1543
- *
1544
- * @default 'class'
1545
- */
1546
- dark?: 'class' | 'media' | DarkModeSelectors;
1547
- /**
1548
- * Generate tagged pseudo selector as `[group=""]` instead of `.group`
1549
- *
1550
- * @default false
1551
- */
1552
- attributifyPseudo?: boolean;
1553
- /**
1554
- * Prefix for CSS variables.
1555
- *
1556
- * @default 'un-'
1557
- */
1558
- variablePrefix?: string;
1559
- /**
1560
- * Utils prefix. When using tagged pseudo selector, only the first truthy prefix will be used.
1561
- *
1562
- * @default undefined
1563
- */
1564
- prefix?: string | string[];
1565
- /**
1566
- * Enable arbitrary variants, for example `<div class="[&>*]:m-1 [&[open]]:p-2"></div>`.
1567
- *
1568
- * Disable this might slightly improve the performance.
1569
- *
1570
- * @default true
1571
- */
1572
- arbitraryVariants?: boolean;
1573
- /**
1574
- * The important option lets you control whether UnoCSS’s utilities should be marked with `!important`.
1575
- *
1576
- * This can be really useful when using UnoCSS with existing CSS that has high specificity selectors.
1577
- *
1578
- * You can also set `important` to a selector like `#app` instead, which will generate `#app :is(.m-1) { ... }`
1579
- *
1580
- * Also check out the compatibility with [:is()](https://caniuse.com/?search=%3Ais())
1581
- *
1582
- * @default false
1583
- */
1584
- important?: boolean | string;
1585
- /**
1586
- * Control the preflight styles.
1587
- */
1588
- preflights?: {
1589
- /**
1590
- * Reset the default preflight styles.
1591
- *
1592
- * @default true
1593
- */
1594
- reset?: boolean;
1595
- /**
1596
- * Theme configuration for preflight styles.
1597
- *
1598
- * This can either be a specific mode from `PreflightsTheme['mode']` or a full `PreflightsTheme` object.
1599
- *
1600
- * The theme defines the base styles applied to elements and can be customized
1601
- * to match the design system or requirements of your project.
1602
- */
1603
- theme?: PreflightsTheme['mode'] | PreflightsTheme;
1604
- /**
1605
- * Configuration for property preflight generation.
1606
- *
1607
- * - `false`: Disable property preflight
1608
- * - `true` or `undefined`: Enable with default configuration
1609
- * - `object`: Enable with custom configuration
1610
- */
1611
- property?: boolean | {
1612
- /**
1613
- * Custom parent selector (e.g., @supports query or @layer).
1614
- *
1615
- * - `string`: Use custom parent selector
1616
- * - `false`: No parent wrapper, apply properties directly to selector
1617
- * - `undefined`: Use default @supports query
1618
- *
1619
- * @default '@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))'
1620
- */
1621
- parent?: string | false;
1622
- /**
1623
- * Custom selector for applying properties.
1624
- *
1625
- * @default '*, ::before, ::after, ::backdrop'
1626
- */
1627
- selector?: string;
1628
- };
1629
- };
1630
- }
1631
- //#endregion
1632
12
  //#region src/types.d.ts
1633
13
  interface UnocssNuxtOptions extends UserConfig {
1634
14
  /**