This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

View File

@@ -0,0 +1 @@
export declare function adjustSelectorSpecificity(selector: string, amount: number): string;

View File

@@ -0,0 +1,3 @@
import type { Container } from 'postcss';
export declare function removeEmptyDescendantBlocks(block: Container): void;
export declare function removeEmptyAncestorBlocks(block: Container): void;

View File

@@ -0,0 +1,8 @@
/** @constant {string} INVALID_LAYER_NAME Used to replace "layer" temporarily when an invalid layer is detected. This allows us to ignore this rule in further processing. */
export declare const INVALID_LAYER_NAME = "csstools-invalid-layer";
/** @constant {string} WITH_SELECTORS_LAYER_NAME Used to replace "layer" temporarily for any layer at rules that contain selectors. This allows us to sort these differently from other layer at rules. */
export declare const WITH_SELECTORS_LAYER_NAME = "csstools-layer-with-selector-rules";
export declare const ANONYMOUS_LAYER_SUFFIX = "6efdb677-bb05-44e5-840f-29d2175862fd";
export declare const IMPLICIT_LAYER_SUFFIX = "b147acf6-11a6-4338-a4d0-80aef4cd1a2f";
export declare const CONDITIONAL_ATRULES: string[];
export declare const ATRULES_WITH_NON_SELECTOR_BLOCK_LISTS: string[];

View File

@@ -0,0 +1,3 @@
import type { Container } from 'postcss';
import type { Model } from './model';
export declare function desugarAndParseLayerNames(root: Container, model: Model): void;

View File

@@ -0,0 +1,3 @@
import type { Container, ChildNode } from 'postcss';
import type { Model } from './model';
export declare function desugarNestedLayers(root: Container<ChildNode>, model: Model): void;

View File

@@ -0,0 +1,2 @@
import type { AtRule } from 'postcss';
export declare function getConditionalAtRuleAncestor(layerRule: AtRule): AtRule | null;

View File

@@ -0,0 +1,2 @@
import type { AtRule, Node } from 'postcss';
export declare function getLayerAtRuleAncestor(node: Node): AtRule | null;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
import type { PluginCreator } from 'postcss';
import { pluginOptions } from './options';
declare const creator: PluginCreator<pluginOptions>;
export default creator;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
import type { AtRule } from 'postcss';
export declare function isProcessableLayerRule(atRule: AtRule): boolean;

View File

@@ -0,0 +1,18 @@
import type { AtRule } from 'postcss';
export declare class Model {
anonymousLayerCount: number;
layerCount: number;
layerOrder: Map<string, number>;
layerParamsParsed: Map<string, Array<string>>;
layerNameParts: Map<string, Array<string>>;
constructor();
createAnonymousLayerName(): string;
createImplicitLayerName(layerName: string): string;
addLayerParams(key: string, parts?: string): void;
addLayerParams(key: string, parts: Array<string>): void;
addLayerNameParts(parts: string): void;
addLayerNameParts(parts: Array<string>): void;
getLayerParams(layer: AtRule): Array<string>;
getLayerNameList(layerName: string): Array<string>;
sortLayerNames(): void;
}

View File

@@ -0,0 +1,5 @@
export declare type pluginOptions = {
onRevertLayerKeyword: 'warn' | false;
onConditionalRulesChangingLayerOrder: 'warn' | false;
onImportLayerRule: 'warn' | false;
};

View File

@@ -0,0 +1,7 @@
import type { Container, Result } from 'postcss';
import type { Model } from './model';
import { pluginOptions } from './options';
export declare function recordLayerOrder(root: Container, model: Model, { result, options }: {
result: Result;
options: pluginOptions;
}): void;

View File

@@ -0,0 +1,3 @@
import type { Container, ChildNode, AtRule } from 'postcss';
export declare function someInTree(container: Container, predicate: (node: ChildNode) => boolean): boolean;
export declare function someAtRuleInTree(container: Container, predicate: (node: AtRule) => boolean): boolean;

View File

@@ -0,0 +1,3 @@
import type { Container } from 'postcss';
import type { Model } from './model';
export declare function sortRootNodes(root: Container, model: Model): void;

View File

@@ -0,0 +1,2 @@
import type { Container } from 'postcss';
export declare function splitImportantStyles(root: Container): void;