@tbela99/css-parser 0.0.1-alpha4 → 0.0.1-alpha5

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 CHANGED
@@ -272,9 +272,20 @@ interface AstDeclaration extends Node {
272
272
 
273
273
  interface AstRule extends Node {
274
274
 
275
- typ: 'Rule',
276
- sel: string,
277
- chi: Array<AstDeclaration | AstComment | AstRuleList>
275
+ typ: 'Rule';
276
+ sel: string;
277
+ chi: Array<AstDeclaration | AstComment | AstRuleList>;
278
+ optimized?: OptimizedSelector;
279
+ raw?: RawSelectorTokens;
280
+ }
281
+
282
+ declare type RawSelectorTokens = string[][];
283
+
284
+ interface OptimizedSelector {
285
+ match: boolean;
286
+ optimized: string[];
287
+ selector: string[][],
288
+ reducible: boolean;
278
289
  }
279
290
 
280
291
  interface AstAtRule extends Node {
@@ -303,14 +314,14 @@ type AstNode =
303
314
  | AstDeclaration;
304
315
 
305
316
  declare function deduplicate(ast: AstNode, options?: ParserOptions, recursive?: boolean): AstNode;
306
- declare function hasDeclaration(node: AstAtRule | AstRule | AstRuleList): boolean;
307
- declare function deduplicateRule(ast: AstNode, options?: ParserOptions): AstNode;
308
- declare function reduceSelector(selector: string[][]): null | {
317
+ declare function hasDeclaration(node: AstRule): boolean;
318
+ declare function deduplicateRule(ast: AstRule | AstAtRule): AstRule | AstAtRule;
319
+ declare function reduceSelector(selector: string[][]): {
309
320
  match: boolean;
310
321
  optimized: string[];
311
322
  selector: string[][];
312
323
  reducible: boolean;
313
- };
324
+ } | null;
314
325
 
315
326
  declare function render(data: AstNode, opt?: RenderOptions): RenderResult;
316
327
  declare function renderToken(token: Token, options?: RenderOptions): string;