@@ -34,7 +34,13 @@ export interface TransformOptions {
3434 * to be unused. These will be removed during minification. Note that these are not
3535 * selectors but individual names (without any . or # prefixes).
3636 */
37- unusedSymbols ?: string [ ]
37+ unusedSymbols ?: string [ ] ,
38+ /**
39+ * Whether to ignore invalid rules and declarations rather than erroring.
40+ * When enabled, warnings are returned, and the invalid rule or declaration is
41+ * omitted from the output code.
42+ */
43+ errorRecovery ?: boolean
3844}
3945
4046export type BundleOptions = Omit < TransformOptions , 'code' > ;
@@ -64,7 +70,16 @@ export interface TransformResult {
6470 /** CSS module references, if `dashedIdents` is enabled. */
6571 references : CSSModuleReferences ,
6672 /** `@import` and `url()` dependencies, if enabled. */
67- dependencies : Dependency [ ] | void
73+ dependencies : Dependency [ ] | void ,
74+ /** Warnings that occurred during compilation. */
75+ warnings : Warning [ ]
76+ }
77+
78+ export interface Warning {
79+ message : string ,
80+ type : string ,
81+ value ?: any ,
82+ loc : ErrorLocation
6883}
6984
7085export interface CSSModulesConfig {
@@ -155,6 +170,10 @@ export interface Location {
155170 column : number
156171}
157172
173+ export interface ErrorLocation extends Location {
174+ filename : string
175+ }
176+
158177/**
159178 * Compiles a CSS file, including optionally minifying and lowering syntax to the given
160179 * targets. A source map may also be generated, but this is not enabled by default.
0 commit comments