@tbela99/css-parser 0.2.0 → 0.3.0

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.ts DELETED
@@ -1,862 +0,0 @@
1
- declare enum EnumToken {
2
- CommentTokenType = 0,
3
- CDOCOMMTokenType = 1,
4
- StyleSheetNodeType = 2,
5
- AtRuleNodeType = 3,
6
- RuleNodeType = 4,
7
- DeclarationNodeType = 5,
8
- LiteralTokenType = 6,
9
- IdenTokenType = 7,
10
- DashedIdenTokenType = 8,
11
- CommaTokenType = 9,
12
- ColonTokenType = 10,
13
- SemiColonTokenType = 11,
14
- NumberTokenType = 12,
15
- AtRuleTokenType = 13,
16
- PercentageTokenType = 14,
17
- FunctionTokenType = 15,
18
- TimelineFunctionTokenType = 16,
19
- TimingFunctionTokenType = 17,
20
- UrlFunctionTokenType = 18,
21
- ImageFunctionTokenType = 19,
22
- StringTokenType = 20,
23
- UnclosedStringTokenType = 21,
24
- DimensionTokenType = 22,
25
- LengthTokenType = 23,
26
- AngleTokenType = 24,
27
- TimeTokenType = 25,
28
- FrequencyTokenType = 26,
29
- ResolutionTokenType = 27,
30
- HashTokenType = 28,
31
- BlockStartTokenType = 29,
32
- BlockEndTokenType = 30,
33
- AttrStartTokenType = 31,
34
- AttrEndTokenType = 32,
35
- StartParensTokenType = 33,
36
- EndParensTokenType = 34,
37
- ParensTokenType = 35,
38
- WhitespaceTokenType = 36,
39
- IncludeMatchTokenType = 37,
40
- DashMatchTokenType = 38,
41
- LtTokenType = 39,
42
- LteTokenType = 40,
43
- GtTokenType = 41,
44
- GteTokenType = 42,
45
- PseudoClassTokenType = 43,
46
- PseudoClassFuncTokenType = 44,
47
- DelimTokenType = 45,
48
- UrlTokenTokenType = 46,
49
- EOFTokenType = 47,
50
- ImportantTokenType = 48,
51
- ColorTokenType = 49,
52
- AttrTokenType = 50,
53
- BadCommentTokenType = 51,
54
- BadCdoTokenType = 52,
55
- BadUrlTokenType = 53,
56
- BadStringTokenType = 54,
57
- BinaryExpressionTokenType = 55,
58
- UnaryExpressionTokenType = 56,
59
- ListToken = 57,
60
- Add = 58,
61
- Mul = 59,
62
- Div = 60,
63
- Sub = 61,
64
- ColumnCombinatorTokenType = 62,
65
- ContainMatchTokenType = 63,
66
- StartMatchTokenType = 64,
67
- EndMatchTokenType = 65,
68
- MatchExpressionTokenType = 66,
69
- NameSpaceAttributeTokenType = 67,
70
- FractionTokenType = 68,
71
- Time = 25,
72
- Iden = 7,
73
- Hash = 28,
74
- Angle = 24,
75
- Color = 49,
76
- Comma = 9,
77
- String = 20,
78
- Length = 23,
79
- Number = 12,
80
- Perc = 14,
81
- Literal = 6,
82
- Comment = 0,
83
- UrlFunc = 18,
84
- Dimension = 22,
85
- Frequency = 26,
86
- Resolution = 27,
87
- Whitespace = 36,
88
- DashedIden = 8,
89
- ImageFunc = 19,
90
- CommentNodeType = 0,
91
- CDOCOMMNodeType = 1,
92
- TimingFunction = 17,
93
- TimelineFunction = 16
94
- }
95
-
96
- declare function minify(ast: AstNode, options?: ParserOptions | MinifyOptions, recursive?: boolean, errors?: ErrorDescription[], nestingContent?: boolean, context?: {
97
- [key: string]: any;
98
- }): AstNode;
99
-
100
- declare function walk(node: AstNode, filter?: WalkerFilter): Generator<WalkResult>;
101
- declare function walkValues(values: Token[]): Generator<WalkAttributesResult>;
102
-
103
- declare function expand(ast: AstNode): AstNode;
104
-
105
- declare function renderToken(token: Token, options?: RenderOptions, cache?: {
106
- [key: string]: any;
107
- }, reducer?: (acc: string, curr: Token) => string, errors?: ErrorDescription[]): string;
108
-
109
- declare function parseString(src: string, options?: {
110
- location: boolean;
111
- }): Token[];
112
- declare function parseTokens(tokens: Token[], options?: ParseTokenOptions): Token[];
113
-
114
- export declare interface BaseToken {
115
-
116
- typ: EnumToken;
117
- loc?: Location;
118
- }
119
-
120
- export declare interface LiteralToken extends BaseToken {
121
-
122
- typ: EnumToken.LiteralTokenType;
123
- val: string;
124
- }
125
-
126
- export declare interface IdentToken extends BaseToken {
127
-
128
- typ: EnumToken.IdenTokenType,
129
- val: string;
130
- }
131
-
132
- export declare interface DashedIdentToken extends BaseToken {
133
-
134
- typ: EnumToken.DashedIdenTokenType,
135
- val: string;
136
- }
137
-
138
- export declare interface CommaToken extends BaseToken {
139
-
140
- typ: EnumToken.CommaTokenType
141
- }
142
-
143
- export declare interface ColonToken extends BaseToken {
144
-
145
- typ: EnumToken.ColonTokenType
146
- }
147
-
148
- export declare interface SemiColonToken extends BaseToken {
149
-
150
- typ: EnumToken.SemiColonTokenType
151
- }
152
-
153
- export declare interface NumberToken extends BaseToken {
154
-
155
- typ: EnumToken.NumberTokenType,
156
- val: string | FractionToken;
157
- }
158
-
159
- export declare interface AtRuleToken extends BaseToken {
160
-
161
- typ: EnumToken.AtRuleTokenType,
162
- val: string;
163
- }
164
-
165
- export declare interface PercentageToken extends BaseToken {
166
-
167
- typ: EnumToken.PercentageTokenType,
168
- val: string | FractionToken;
169
- }
170
-
171
- export declare interface FunctionToken extends BaseToken {
172
-
173
- typ: EnumToken.FunctionTokenType,
174
- val: string;
175
- chi: Token[];
176
- }
177
-
178
- export declare interface FunctionURLToken extends BaseToken {
179
-
180
- typ: EnumToken.UrlFunctionTokenType,
181
- val: 'url';
182
- chi: Array<UrlToken | CommentToken>;
183
- }
184
-
185
- export declare interface FunctionImageToken extends BaseToken {
186
-
187
- typ: EnumToken.ImageFunctionTokenType,
188
- val: 'linear-gradient' | 'radial-gradient' | 'repeating-linear-gradient' | 'repeating-radial-gradient' | 'conic-gradient' | 'image' | 'image-set' | 'element' | 'cross-fade';
189
- chi: Array<UrlToken | CommentToken>;
190
- }
191
-
192
- export declare interface TimingFunctionToken extends BaseToken {
193
-
194
- typ: EnumToken.TimingFunctionTokenType;
195
- val: string;
196
- chi: Token[];
197
- }
198
- export declare interface TimelineFunctionToken extends BaseToken {
199
-
200
- typ: EnumToken.TimelineFunctionTokenType;
201
- val: string;
202
- chi: Token[];
203
- }
204
-
205
- export declare interface StringToken extends BaseToken {
206
-
207
- typ: EnumToken.StringTokenType;
208
- val: string;
209
- }
210
-
211
- export declare interface BadStringToken extends BaseToken {
212
-
213
- typ: EnumToken.BadStringTokenType;
214
- val: string;
215
- }
216
-
217
- export declare interface UnclosedStringToken extends BaseToken {
218
-
219
- typ: EnumToken.UnclosedStringTokenType;
220
- val: string;
221
- }
222
-
223
- export declare interface DimensionToken extends BaseToken {
224
-
225
- typ: EnumToken.DimensionTokenType;
226
- val: string | FractionToken;
227
- unit: string;
228
- }
229
-
230
- export declare interface LengthToken extends BaseToken {
231
-
232
- typ: EnumToken.LengthTokenType;
233
- val: string | FractionToken;
234
- unit: string;
235
- }
236
-
237
- export declare interface AngleToken extends BaseToken {
238
-
239
- typ: EnumToken.AngleTokenType;
240
- val: string | FractionToken;
241
- unit: string;
242
- }
243
-
244
- export declare interface TimeToken extends BaseToken {
245
-
246
- typ: EnumToken.TimeTokenType;
247
- val: string | FractionToken;
248
- unit: 'ms' | 's';
249
- }
250
-
251
- export declare interface FrequencyToken extends BaseToken {
252
-
253
- typ: EnumToken.FrequencyTokenType;
254
- val: string | FractionToken;
255
- unit: 'Hz' | 'Khz';
256
- }
257
-
258
- export declare interface ResolutionToken extends BaseToken {
259
-
260
- typ: EnumToken.ResolutionTokenType;
261
- val: string | FractionToken;
262
- unit: 'dpi' | 'dpcm' | 'dppx' | 'x';
263
- }
264
-
265
- export declare interface HashToken extends BaseToken {
266
-
267
- typ: EnumToken.HashTokenType;
268
- val: string;
269
- }
270
-
271
- export declare interface BlockStartToken extends BaseToken {
272
-
273
- typ: EnumToken.BlockStartTokenType
274
- }
275
-
276
- export declare interface BlockEndToken extends BaseToken {
277
-
278
- typ: EnumToken.BlockEndTokenType
279
- }
280
-
281
- export declare interface AttrStartToken extends BaseToken {
282
-
283
- typ: EnumToken.AttrStartTokenType;
284
- chi?: Token[];
285
- }
286
-
287
- export declare interface AttrEndToken extends BaseToken {
288
-
289
- typ: EnumToken.AttrEndTokenType
290
- }
291
-
292
- export declare interface ParensStartToken extends BaseToken {
293
-
294
- typ: EnumToken.StartParensTokenType;
295
- }
296
-
297
- export declare interface ParensEndToken extends BaseToken {
298
-
299
- typ: EnumToken.EndParensTokenType
300
- }
301
-
302
- export declare interface ParensToken extends BaseToken {
303
-
304
- typ: EnumToken.ParensTokenType;
305
- chi: Token[];
306
- }
307
-
308
- export declare interface WhitespaceToken extends BaseToken {
309
-
310
- typ: EnumToken.WhitespaceTokenType
311
- }
312
-
313
- export declare interface CommentToken extends BaseToken {
314
-
315
- typ: EnumToken.CommentTokenType;
316
- val: string;
317
- }
318
-
319
- export declare interface BadCommentToken extends BaseToken {
320
-
321
- typ: EnumToken.BadCommentTokenType;
322
- val: string;
323
- }
324
-
325
- export declare interface CDOCommentToken extends BaseToken {
326
-
327
- typ: EnumToken.CDOCOMMTokenType;
328
- val: string;
329
- }
330
-
331
- export declare interface BadCDOCommentToken extends BaseToken {
332
-
333
- typ: EnumToken.BadCdoTokenType;
334
- val: string;
335
- }
336
-
337
- export declare interface IncludeMatchToken extends BaseToken {
338
-
339
- typ: EnumToken.IncludeMatchTokenType;
340
- // val: '~=';
341
- }
342
-
343
- export declare interface DashMatchToken extends BaseToken {
344
-
345
- typ: EnumToken.DashMatchTokenType;
346
- // val: '|=';
347
- }
348
-
349
- export declare interface StartMatchToken extends BaseToken {
350
-
351
- typ: EnumToken.StartMatchTokenType;
352
- // val: '^=';
353
- }
354
-
355
- export declare interface EndMatchToken extends BaseToken {
356
-
357
- typ: EnumToken.EndMatchTokenType;
358
- // val: '|=';
359
- }
360
-
361
- export declare interface ContainMatchToken extends BaseToken {
362
-
363
- typ: EnumToken.ContainMatchTokenType;
364
- // val: '|=';
365
- }
366
-
367
- export declare interface LessThanToken extends BaseToken {
368
-
369
- typ: EnumToken.LtTokenType;
370
- }
371
-
372
- export declare interface LessThanOrEqualToken extends BaseToken {
373
-
374
- typ: EnumToken.LteTokenType;
375
- }
376
-
377
- export declare interface GreaterThanToken extends BaseToken {
378
-
379
- typ: EnumToken.GtTokenType;
380
- }
381
-
382
- export declare interface GreaterThanOrEqualToken extends BaseToken {
383
-
384
- typ: EnumToken.GteTokenType;
385
- }
386
-
387
- export declare interface ColumnCombinatorToken extends BaseToken {
388
-
389
- typ: EnumToken.ColumnCombinatorTokenType;
390
- }
391
-
392
- export declare interface PseudoClassToken extends BaseToken {
393
-
394
- typ: EnumToken.PseudoClassTokenType;
395
- val: string;
396
- }
397
-
398
- export declare interface PseudoClassFunctionToken extends BaseToken {
399
-
400
- typ: EnumToken.PseudoClassFuncTokenType;
401
- val: string;
402
- chi: Token[];
403
- }
404
-
405
- export declare interface DelimToken extends BaseToken {
406
-
407
- typ: EnumToken.DelimTokenType;
408
- val: '=';
409
- }
410
-
411
- export declare interface BadUrlToken extends BaseToken {
412
-
413
- typ: EnumToken.BadUrlTokenType,
414
- val: string;
415
- }
416
-
417
- export declare interface UrlToken extends BaseToken {
418
-
419
- typ: EnumToken.UrlTokenTokenType,
420
- val: string;
421
- }
422
-
423
- export declare interface EOFToken extends BaseToken {
424
-
425
- typ: EnumToken.EOFTokenType;
426
- }
427
-
428
- export declare interface ImportantToken extends BaseToken {
429
-
430
- typ: EnumToken.ImportantTokenType;
431
- }
432
-
433
- export declare interface ColorToken extends BaseToken {
434
-
435
- typ: EnumToken.ColorTokenType;
436
- val: string;
437
- kin: 'lit' | 'hex' | 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'hwb' | 'device-cmyk';
438
- chi?: Token[];
439
- }
440
-
441
- export declare interface AttrToken extends BaseToken {
442
-
443
- typ: EnumToken.AttrTokenType,
444
- chi: Token[]
445
- }
446
-
447
- export declare interface AddToken extends BaseToken {
448
-
449
- typ: EnumToken.Add;
450
- }
451
-
452
- export declare interface SubToken extends BaseToken {
453
-
454
- typ: EnumToken.Sub;
455
- }
456
-
457
- export declare interface DivToken extends BaseToken {
458
-
459
- typ: EnumToken.Div;
460
- }
461
-
462
- export declare interface MulToken extends BaseToken {
463
-
464
- typ: EnumToken.Mul;
465
- }
466
-
467
- export declare interface UnaryExpression extends BaseToken {
468
-
469
- typ: EnumToken.UnaryExpressionTokenType
470
- sign: EnumToken.Add | EnumToken.Sub;
471
- val: UnaryExpressionNode;
472
- }
473
-
474
- export declare interface FractionToken extends BaseToken {
475
-
476
- typ: EnumToken.FractionTokenType;
477
- l: NumberToken;
478
- r: NumberToken;
479
- }
480
-
481
- export declare interface BinaryExpressionToken extends BaseToken {
482
-
483
- typ: EnumToken.BinaryExpressionTokenType
484
- op: EnumToken.Add | EnumToken.Sub | EnumToken.Div | EnumToken.Mul;
485
- l: BinaryExpressionNode | Token;
486
- r: BinaryExpressionNode | Token;
487
- }
488
-
489
- export declare interface MatchExpressionToken extends BaseToken {
490
-
491
- typ: EnumToken.MatchExpressionTokenType
492
- op: EnumToken.DashMatchTokenType | EnumToken.StartMatchTokenType | EnumToken.ContainMatchTokenType | EnumToken.EndMatchTokenType | EnumToken.IncludeMatchTokenType;
493
- l: Token;
494
- r: Token;
495
- attr?: 'i' | 's';
496
- }
497
-
498
- export declare interface NameSpaceAttributeToken extends BaseToken {
499
-
500
- typ: EnumToken.NameSpaceAttributeTokenType
501
- l?: Token;
502
- r: Token;
503
- }
504
-
505
- export declare interface ListToken extends BaseToken {
506
-
507
- typ: EnumToken.ListToken
508
- chi: Token[];
509
- }
510
-
511
- export declare type UnaryExpressionNode =
512
- BinaryExpressionNode
513
- | NumberToken
514
- | DimensionToken
515
- | TimeToken
516
- | LengthToken
517
- | AngleToken
518
- | FrequencyToken;
519
-
520
- export declare type BinaryExpressionNode = NumberToken | DimensionToken | PercentageToken | FractionToken |
521
- AngleToken | LengthToken | FrequencyToken | BinaryExpressionToken | FunctionToken | ParensToken;
522
- export declare type Token =
523
- LiteralToken
524
- | IdentToken
525
- | DashedIdentToken
526
- | CommaToken
527
- | ColonToken
528
- | SemiColonToken
529
- |
530
- NumberToken
531
- | AtRuleToken
532
- | PercentageToken
533
- | FunctionURLToken
534
- | FunctionImageToken
535
- | TimingFunctionToken
536
- | TimelineFunctionToken
537
- | FunctionToken
538
- | DimensionToken
539
- | LengthToken
540
- |
541
- AngleToken
542
- | StringToken
543
- | TimeToken
544
- | FrequencyToken
545
- | ResolutionToken
546
- |
547
- UnclosedStringToken
548
- | HashToken
549
- | BadStringToken
550
- | BlockStartToken
551
- | BlockEndToken
552
- |
553
- AttrStartToken
554
- | AttrEndToken
555
- | ParensStartToken
556
- | ParensEndToken
557
- | ParensToken
558
- | CDOCommentToken
559
- |
560
- BadCDOCommentToken
561
- | CommentToken
562
- | BadCommentToken
563
- | WhitespaceToken
564
- | IncludeMatchToken
565
- | StartMatchToken
566
- | EndMatchToken
567
- | ContainMatchToken | MatchExpressionToken | NameSpaceAttributeToken
568
- |
569
- DashMatchToken
570
- | LessThanToken
571
- | LessThanOrEqualToken
572
- | GreaterThanToken
573
- | GreaterThanOrEqualToken
574
- | ColumnCombinatorToken
575
- |
576
- ListToken
577
- | PseudoClassToken
578
- | PseudoClassFunctionToken
579
- | DelimToken
580
- | BinaryExpressionToken
581
- | UnaryExpression
582
- | FractionToken
583
- |
584
- AddToken
585
- | SubToken
586
- | DivToken
587
- | MulToken
588
- |
589
- BadUrlToken
590
- | UrlToken
591
- | ImportantToken
592
- | ColorToken
593
- | AttrToken
594
- | EOFToken;
595
-
596
- export declare interface Position {
597
-
598
- ind: number;
599
- lin: number;
600
- col: number;
601
- }
602
-
603
- export declare interface Location {
604
-
605
- sta: Position;
606
- // end: Position;
607
- src: string;
608
- }
609
-
610
- export declare interface Node {
611
-
612
- typ: EnumToken;
613
- loc?: Location;
614
- }
615
-
616
- export declare interface AstComment extends Node {
617
-
618
- typ: EnumToken.CommentNodeType | EnumToken.CDOCOMMNodeType,
619
- val: string;
620
- }
621
-
622
- export declare interface AstDeclaration extends Node {
623
-
624
- nam: string,
625
- val: Token[];
626
- typ: EnumToken.DeclarationNodeType
627
- }
628
-
629
- export declare interface AstRule$1 extends Node {
630
-
631
- typ: EnumToken.RuleNodeType;
632
- sel: string;
633
- chi: Array<AstDeclaration | AstComment | AstRuleList>;
634
- optimized?: OptimizedSelector;
635
- raw?: RawSelectorTokens;
636
- }
637
-
638
- export declare type RawSelectorTokens = string[][];
639
-
640
- export declare interface OptimizedSelector {
641
- match: boolean;
642
- optimized: string[];
643
- selector: string[][],
644
- reducible: boolean;
645
- }
646
-
647
- export declare interface AstAtRule$1 extends Node {
648
-
649
- typ: AtRuleNodeType,
650
- nam: string;
651
- val: string;
652
- chi?: Array<AstDeclaration | AstComment> | Array<AstRule$1 | AstComment>
653
- }
654
-
655
- export declare interface AstRuleList extends Node {
656
-
657
- typ: StyleSheetNodeType | RuleNodeType | AtRuleNodeType,
658
- chi: Array<Node | AstComment>
659
- }
660
-
661
- export declare interface AstRuleStyleSheet$1 extends AstRuleList {
662
- typ: StyleSheetNodeType,
663
- chi: Array<AstRuleList | AstComment>
664
- }
665
-
666
- export declare type AstNode =
667
- AstRuleStyleSheet$1
668
- | AstRuleList
669
- | AstComment
670
- | AstAtRule$1
671
- | AstRule$1
672
- | AstDeclaration;
673
-
674
- /**
675
- * Declaration visitor handler
676
- */
677
- export declare type DeclarationVisitorHandler = (node: AstDeclaration) => AstDeclaration | AstDeclaration[] | null;
678
- /**
679
- * Rule visitor handler
680
- */
681
- export declare type RuleVisitorHandler = (node: AstRule$1) => AstRule$1 | AstRule$1[] | null;
682
-
683
- /**
684
- * AtRule visitor handler
685
- */
686
- export declare type AtRuleVisitorHandler = (node: AstAtRule$1) => AstAtRule$1 | AstAtRule$1[] | null;
687
-
688
- /**
689
- * Value visitor handler
690
- */
691
- export declare type ValueVisitorHandler = (node: Token) => Token | Token[] | null;
692
-
693
-
694
- export declare interface VisitorNodeMap {
695
-
696
- AtRule?: Record<string, AtRuleVisitorHandler> | AtRuleVisitorHandler;
697
- Declaration?: Record<string, DeclarationVisitorHandler> | DeclarationVisitorHandler;
698
- Rule?: RuleVisitorHandler;
699
- Value?: Record<EnumToken, ValueVisitorHandler> | ValueVisitorHandler;
700
- }
701
-
702
- export declare type WalkerOption = 'ignore' | 'stop' | 'children' | 'ignore-children' | null;
703
- /**
704
- * return value:
705
- * - 'ignore': ignore this node and its children
706
- * - 'stop': stop walking the tree
707
- * - 'children': walk the children and ignore the node itself
708
- * - 'ignore-children': walk the node and ignore children
709
- */
710
- export declare type WalkerFilter = (node: AstNode) => WalkerOption;
711
-
712
- export declare interface WalkResult {
713
- node: AstNode;
714
- parent?: AstRuleList;
715
- root?: AstRuleList;
716
- }
717
-
718
- export declare interface WalkAttributesResult {
719
- value: Token;
720
- parent: FunctionToken | ParensToken | null;
721
- }
722
-
723
- export declare interface ErrorDescription {
724
-
725
- // drop rule or declaration | fix rule or declaration
726
- action: 'drop' | 'ignore';
727
- message: string;
728
- location?: {
729
- src: string,
730
- lin: number,
731
- col: number;
732
- };
733
- error?: Error;
734
- }
735
-
736
- export declare interface MinifyFeature {
737
-
738
- ordering: number;
739
-
740
- register: (options: MinifyOptions | ParserOptions) => void;
741
- run: (ast: AstRule | AstAtRule, options: ParserOptions = {}, parent: AstRule | AstAtRule | AstRuleStyleSheet, context: {
742
- [key: string]: any
743
- }) => void;
744
- cleanup?: (ast: AstRuleStyleSheet, options: ParserOptions = {}, context: { [key: string]: any }) => void;
745
- }
746
-
747
- export declare interface ParserOptions extends PropertyListOptions {
748
-
749
- minify?: boolean;
750
- src?: string;
751
- sourcemap?: boolean;
752
- nestingRules?: boolean;
753
- expandNestingRules?: boolean;
754
- removeCharset?: boolean;
755
- removeEmpty?: boolean;
756
- resolveUrls?: boolean;
757
- resolveImport?: boolean;
758
- cwd?: string;
759
- removeDuplicateDeclarations?: boolean;
760
- computeShorthand?: boolean;
761
- inlineCssVariables?: boolean;
762
- computeCalcExpression?: boolean;
763
- load?: (url: string, currentUrl: string) => Promise<string>;
764
- dirname?: (path: string) => string;
765
- resolve?: (url: string, currentUrl: string, currentWorkingDirectory?: string) => {
766
- absolute: string;
767
- relative: string;
768
- };
769
- visitor?: VisitorNodeMap;
770
- signal?: AbortSignal;
771
- }
772
-
773
- export declare interface MinifyOptions extends ParserOptions {
774
-
775
- features: MinifyFeature[];
776
- }
777
-
778
- export declare interface ResolvedPath {
779
- absolute: string;
780
- relative: string;
781
- }
782
-
783
- export declare interface RenderOptions {
784
-
785
- minify?: boolean;
786
- expandNestingRules?: boolean;
787
- preserveLicense?: boolean;
788
- sourcemap?: boolean;
789
- indent?: string;
790
- newLine?: string;
791
- removeComments?: boolean;
792
- colorConvert?: boolean;
793
- output?: string;
794
- cwd?: string;
795
- load?: (url: string, currentUrl: string) => Promise<string>;
796
- resolve?: (url: string, currentUrl: string, currentWorkingDirectory?: string) => ResolvedPath;
797
-
798
- }
799
-
800
- export declare interface TransformOptions extends ParserOptions, RenderOptions {
801
-
802
- }
803
-
804
- export declare interface ParseResult {
805
- ast: AstRuleStyleSheet;
806
- errors: ErrorDescription[];
807
- stats: {
808
- bytesIn: number;
809
- parse: string;
810
- minify: string;
811
- total: string;
812
- }
813
- }
814
-
815
- export declare interface RenderResult {
816
- code: string;
817
- errors: ErrorDescription[];
818
- stats: {
819
- total: string;
820
- },
821
- map?: SourceMapObject
822
- }
823
-
824
- export declare interface TransformResult extends ParseResult, RenderResult {
825
-
826
- stats: {
827
- bytesIn: number;
828
- bytesOut: number;
829
- parse: string;
830
- minify: string;
831
- render: string;
832
- total: string;
833
- }
834
- }
835
-
836
- export declare interface ParseTokenOptions extends ParserOptions {
837
- parseColor?: boolean;
838
- }
839
-
840
- export declare interface SourceMapObject {
841
- version: number;
842
- file?: string;
843
- sourceRoot?: string;
844
- sources?: string[];
845
- sourcesContent?: Array<string | null>;
846
- names?: string[];
847
- mappings: string;
848
- }
849
-
850
- declare function dirname(path: string): string;
851
- declare function resolve(url: string, currentDirectory: string, cwd?: string): {
852
- absolute: string;
853
- relative: string;
854
- };
855
-
856
- declare function load(url: string, currentFile: string): Promise<string>;
857
-
858
- declare function render(data: AstNode, options?: RenderOptions): RenderResult;
859
- declare function parse(iterator: string, opt?: ParserOptions): Promise<ParseResult>;
860
- declare function transform(css: string, options?: TransformOptions): Promise<TransformResult>;
861
-
862
- export { EnumToken, dirname, expand, load, minify, parse, parseString, parseTokens, render, renderToken, resolve, transform, walk, walkValues };