@@ -422,6 +422,10 @@ declare enum EnumToken {
422422 * invalid declaration node type
423423 */
424424<
B875
/code> InvalidDeclarationNodeType = 94 ,
425+ /**
426+ * composes token node type
427+ */
428+ ComposesSelectorNodeType = 95 ,
425429 /**
426430 * alias for time token type
427431 */
@@ -1693,6 +1697,16 @@ export declare interface ListToken extends BaseToken {
16931697 chi : Token$1 [ ] ;
16941698}
16951699
1700+ /**
1701+ * Composes selector token
1702+ */
1703+ export declare interface ComposesSelectorToken extends BaseToken {
1704+
1705+ typ : EnumToken . ComposesSelectorTokenType ;
1706+ l : Token$1 [ ] ;
1707+ r : Token$1 | null ;
1708+ }
1709+
16961710/**
16971711 * Unary expression node
16981712 */
@@ -1784,6 +1798,7 @@ export declare type Token$1 =
17841798 | ContainMatchToken
17851799 | MatchExpressionToken
17861800 | NameSpaceAttributeToken
1801+ | ComposesSelectorToken
17871802 |
17881803 DashMatchToken
17891804 | EqualMatchToken
@@ -2502,7 +2517,7 @@ export declare interface VisitorNodeMap {
25022517 * // body {color:#f3fff0}
25032518 * ```
25042519 */
2505- [ key : keyof typeof EnumToken ] : GenericVisitorAstNodeHandlerMap < Token > | GenericVisitorAstNodeHandlerMap < AstNode > ;
2520+ [ key : keyof typeof EnumToken ] : GenericVisitorAstNodeHandlerMap < Token > | GenericVisitorAstNodeHandlerMap < AstNode > ;
25062521}
25072522
25082523export declare interface PropertyListOptions {
@@ -3074,9 +3089,9 @@ export declare type WalkerOption = WalkerOptionEnum | AstNode$1 | Token$1 | null
30743089export declare type WalkerFilter = ( node : AstNode$1 ) => WalkerOption ;
30753090
30763091/**
3077- * filter nod
3092+ * filter nodes
30783093 */
3079- export declare type WalkerValueFilter = ( node : AstNode$1 | Token$1 , parent ?: AstNode$1 | Token$1 | null , event ?: WalkerEvent ) => WalkerOption | null ;
3094+ export declare type WalkerValueFilter = ( node : AstNode$1 | Token$1 , parent ?: AstNode$1 | Token$1 | AstNode$1 [ ] | Token$1 [ ] | null , event ?: WalkerEvent ) => WalkerOption | null ;
30803095
30813096export declare interface WalkResult {
30823097 node : AstNode$1 ;
@@ -3268,6 +3283,61 @@ export declare type LoadResult =
32683283 | string
32693284 | Promise < string > ;
32703285
3286+ export declare interface ModuleOptions {
3287+
3288+
3289+ /**
3290+ * use local scope vs global scope
3291+ */
3292+ scoped ?: boolean ;
3293+
3294+ /**
3295+ * module output file path
3296+ */
3297+ filePath ?: string ;
3298+
3299+ /**
3300+ * module hash length
3301+ */
3302+ hashLength ?: number ;
3303+
3304+ /**
3305+ * scoped name pattern. the supported placeholders are:
3306+ * - name: the file base name without the extension
3307+ * - hash: the file path hash
3308+ * - local: the local name
3309+ * - path: the file path
3310+ * - folder: the file folder
3311+ * - ext: the file extension
3312+ *
3313+ * pattern can optionally have a maximum number of characters: `pattern: '[name:2]-[hash:5]'`.
3314+ * the hash pattern can take an algorithm, a maximum number of characters or both: `pattern: '[name]-[hash:base64:5]'` or `pattern: '[name]-[hash:5]'` or `pattern: '[name]-[hash:sha1]'`.
3315+ * supported hash algorithms are:
3316+ * - base64
3317+ * - hex
3318+ * - base64url
3319+ * - sha1
3320+ * - sha256
3321+ * - sha384
3322+ * - sha512
3323+ */
3324+ pattern ?: string ;
3325+
3326+ /**
3327+ * optional function to generate scoped name
3328+ * @param localName
3329+ * @param filePath
3330+ * @param hashLength
3331+ * @param pattern see {@link ParserOptions.module.pattern}
3332+ */
3333+ generateScopedName ?: (
3334+ localName : string ,
3335+ filePath : string ,
3336+ pattern : string ,
3337+ hashLength ?: number
3338+ ) => string | Promise < string > ;
3339+ }
3340+
32713341/**
32723342 * parser options
32733343 */
@@ -3306,7 +3376,7 @@ export declare interface ParserOptions extends MinifyOptions, MinifyFeatureOptio
33063376 * @param asStream
33073377 *
33083378 */
3309- load ?: ( url : string , currentUrl : string , asStream ?: boolean ) => LoadResult ;
3379+ load ?: ( url : string , currentUrl ? : string , asStream ?: boolean ) => LoadResult ;
33103380 /**
33113381 * get directory name
33123382 * @param path
@@ -3360,6 +3430,11 @@ export declare interface ParserOptions extends MinifyOptions, MinifyFeatureOptio
33603430 * @private
33613431 */
33623432 cache ?: WeakMap < AstNode$1 , string > ;
3433+
3434+ /**
3435+ * css modules options
3436+ */
3437+ module ?: boolean | ModuleOptions
33633438}
33643439
33653440/**
@@ -3536,13 +3611,17 @@ export declare interface ParseResultStats {
35363611 */
35373612 importedBytesIn : number ;
35383613 /**
3539- * parse time
3614+ * parse processing time
35403615 */
35413616 parse : string ;
35423617 /**
3543- * minify time
3618+ * minify processing time
35443619 */
35453620 minify : string ;
3621+ /**
3622+ * module processing time
3623+ */
3624+ module ?: string ;
35463625 /**
35473626 * total time
35483627 */
@@ -3578,7 +3657,18 @@ export declare interface ParseResult {
35783657 /**
35793658 * parse stats
35803659 */
3581- stats : ParseResultStats
3660+ stats : ParseResultStats ;
3661+
3662+ /**
3663+ * css module mapping
3664+ */
3665+ mapping ?: Record < string , string > ;
3666+
3667+ /**
3668+ * css module reverse mapping
3669+ * @private
3670+ */
3671+ revMapping ?: Record < string , string > ;
35823672}
35833673
35843674/**
@@ -3958,4 +4048,4 @@ declare function transformFile(file: string, options?: TransformOptions, asStrea
39584048declare function transform ( css : string | ReadableStream < Uint8Array > , options ?: TransformOptions ) : Promise < TransformResult > ;
39594049
39604050export { ColorType , EnumToken , FeatureWalkMode , SourceMap , ValidationLevel , WalkerEvent , WalkerOptionEnum , convertColor , dirname , expand , isOkLabClose , load , mathFuncs , minify , okLabDistance , parse , parseDeclarations , parseFile , parseString , parseTokens , render , renderToken , resolve , transform , transformFile , transformFunctions , walk , walkValues } ;
3961- export type { AddToken , AngleToken , AstAtRule , AstComment , AstDeclaration , AstInvalidAtRule , AstInvalidDeclaration , AstInvalidRule , AstKeyFrameRule , AstKeyframesAtRule , AstKeyframesRule , AstNode$1 as AstNode , AstRule , AstRuleList , AstStyleSheet , AtRuleToken , AtRuleVisitorHandler , AttrEndToken , AttrStartToken , AttrToken , Background , BackgroundAttachmentMapping , BackgroundPosition , BackgroundPositionClass , BackgroundPositionConstraints , BackgroundPositionMapping , BackgroundProperties , BackgroundRepeat , BackgroundRepeatMapping , BackgroundSize , BackgroundSizeMapping , BadCDOCommentToken , BadCommentToken , BadStringToken , BadUrlToken , BaseToken , BinaryExpressionNode , BinaryExpressionToken , BlockEndToken , BlockStartToken , Border , BorderColor , BorderColorClass , BorderProperties , BorderRadius , CDOCommentToken , ChildCombinatorToken , ClassSelectorToken , ColonToken , ColorToken , ColumnCombinatorToken , CommaToken , CommentToken , ConstraintsMapping , ContainMatchToken , Context , DashMatchToken , DashedIdentToken , DeclarationVisitorHandler , DelimToken , DescendantCombinatorToken , DimensionToken , DivToken , EOFToken , EndMatchToken , EqualMatchToken , ErrorDescription , FlexToken , Font , FontFamily , FontProperties , FontWeight , FontWeightConstraints , FontWeightMapping , FractionToken , FrequencyToken , FunctionImageToken , FunctionToken , FunctionURLToken , GenericVisitorAstNodeHandlerMap , GenericVisitorHandler , GenericVisitorResult , GreaterThanOrEqualToken , GreaterThanToken , GridTemplateFuncToken , HashToken , IdentListToken , IdentToken , ImportantToken , IncludeMatchToken , InvalidAttrToken , InvalidClassSelectorToken , LengthToken , LessThanOrEqualToken , LessThanToken , LineHeight , ListToken , LiteralToken , LoadResult , Location , Map$1 as Map , MatchExpressionToken , MatchedSelector , MediaFeatureAndToken , MediaFeatureNotToken , MediaFeatureOnlyToken , MediaFeatureOrToken , MediaFeatureToken , MediaQueryConditionToken , MinifyFeature , MinifyFeatureOptions , MinifyOptions , MulToken , NameSpaceAttributeToken , NestingSelectorToken , NextSiblingCombinatorToken , NumberToken , OptimizedSelector , OptimizedSelectorToken , Outline , OutlineProperties , ParensEndToken , ParensStartToken , ParensToken , ParseInfo , ParseResult , ParseResultStats , ParseTokenOptions , ParserOptions , PercentageToken , Position , Prefix , PropertiesConfig , PropertiesConfigProperties , PropertyListOptions , PropertyMapType , PropertySetType , PropertyType , PseudoClassFunctionToken , PseudoClassToken , PseudoElementToken , PseudoPageToken , PurpleBackgroundAttachment , RawSelectorTokens , RenderOptions , RenderResult , ResolutionToken , ResolvedPath , RuleVisitorHandler , SemiColonToken , Separator , ShorthandDef , ShorthandMapType , ShorthandProperties , ShorthandPropertyType , ShorthandType , SourceMapObject , StartMatchToken , StringToken , SubToken , SubsequentCombinatorToken , TimeToken , TimelineFunctionToken , TimingFunctionToken , Token$1 as Token , TokenizeResult , TransformOptions , TransformResult , UnaryExpression , UnaryExpressionNode , UnclosedStringToken , UniversalSelectorToken , UrlToken , ValidationConfiguration , ValidationOptions , ValidationResult , ValidationSelectorOptions , ValidationSyntaxNode , ValidationSyntaxResult , Value , ValueVisitorHandler , VariableScopeInfo , VisitorNodeMap , WalkAttributesResult , WalkResult , WalkerFilter , WalkerOption , WalkerValueFilter , WhitespaceToken } ;
4051+ export type { AddToken , AngleToken , AstAtRule , AstComment , AstDeclaration , AstInvalidAtRule , AstInvalidDeclaration , AstInvalidRule , AstKeyFrameRule , AstKeyframesAtRule , AstKeyframesRule , AstNode$1 as AstNode , AstRule , AstRuleList , AstStyleSheet , AtRuleToken , AtRuleVisitorHandler , AttrEndToken , AttrStartToken , AttrToken , Background , BackgroundAttachmentMapping , BackgroundPosition , BackgroundPositionClass , BackgroundPositionConstraints , BackgroundPositionMapping , BackgroundProperties , BackgroundRepeat , BackgroundRepeatMapping , BackgroundSize , BackgroundSizeMapping , BadCDOCommentToken , BadCommentToken , BadStringToken , BadUrlToken , BaseToken , BinaryExpressionNode , BinaryExpressionToken , BlockEndToken , BlockStartToken , Border , BorderColor , BorderColorClass , BorderProperties , BorderRadius , CDOCommentToken , ChildCombinatorToken , ClassSelectorToken , ColonToken , ColorToken , ColumnCombinatorToken , CommaToken , CommentToken , ComposesSelectorToken , ConstraintsMapping , ContainMatchToken , Context , DashMatchToken , DashedIdentToken , DeclarationVisitorHandler , DelimToken , DescendantCombinatorToken , DimensionToken , DivToken , EOFToken , EndMatchToken , EqualMatchToken , ErrorDescription , FlexToken , Font , FontFamily , FontProperties , FontWeight , FontWeightConstraints , FontWeightMapping , FractionToken , FrequencyToken , FunctionImageToken , FunctionToken , FunctionURLToken , GenericVisitorAstNodeHandlerMap , GenericVisitorHandler , GenericVisitorResult , GreaterThanOrEqualToken , GreaterThanToken , GridTemplateFuncToken , HashToken , IdentListToken , IdentToken , ImportantToken , IncludeMatchToken , InvalidAttrToken , InvalidClassSelectorToken , LengthToken , LessThanOrEqualToken , LessThanToken , LineHeight , ListToken , LiteralToken , LoadResult , Location , Map$1 as Map , MatchExpressionToken , MatchedSelector , MediaFeatureAndToken , MediaFeatureNotToken , MediaFeatureOnlyToken , MediaFeatureOrToken , MediaFeatureToken , MediaQueryConditionToken , MinifyFeature , MinifyFeatureOptions , MinifyOptions , ModuleOptions , MulToken , NameSpaceAttributeToken , NestingSelectorToken , NextSiblingCombinatorToken , NumberToken , OptimizedSelector , OptimizedSelectorToken , Outline , OutlineProperties , ParensEndToken , ParensStartToken , ParensToken , ParseInfo , ParseResult , ParseResultStats , ParseTokenOptions , ParserOptions , PercentageToken , Position , Prefix , PropertiesConfig , PropertiesConfigProperties , PropertyListOptions , PropertyMapType , PropertySetType , PropertyType , PseudoClassFunctionToken , PseudoClassToken , PseudoElementToken , PseudoPageToken , PurpleBackgroundAttachment , RawSelectorTokens , RenderOptions , RenderResult , ResolutionToken , ResolvedPath , RuleVisitorHandler , SemiColonToken , Separator , ShorthandDef , ShorthandMapType , ShorthandProperties , ShorthandPropertyType , ShorthandType , SourceMapObject , StartMatchToken , StringToken , SubToken , SubsequentCombinatorToken , TimeToken , TimelineFunctionToken , TimingFunctionToken , Token$1 as Token , TokenizeResult , TransformOptions , TransformResult , UnaryExpression , UnaryExpressionNode , UnclosedStringToken , UniversalSelectorToken , UrlToken , ValidationConfiguration , ValidationOptions , ValidationResult , ValidationSelectorOptions , ValidationSyntaxNode , ValidationSyntaxResult , Value , ValueVisitorHandler , VariableScopeInfo , VisitorNodeMap , WalkAttributesResult , WalkResult , WalkerFilter , WalkerOption , WalkerValueFilter , WhitespaceToken } ;
0 commit comments