UNPKG

2.18 kBTypeScriptView Raw
1import * as postcss from 'postcss';
2import { Diagnostics } from './diagnostics';
3import { DeclStylableProps, Imported, SDecl, StylableMeta, StylableSymbol } from './stylable-processor';
4import { SelectorAstNode } from './selector-utils';
5import { ImportSymbol } from './stylable-meta';
6import { StylableResolver } from './stylable-resolver';
7export declare const CUSTOM_SELECTOR_RE: RegExp;
8export declare function isValidDeclaration(decl: postcss.Declaration): boolean;
9export declare function expandCustomSelectors(rule: postcss.Rule, customSelectors: Record<string, string>, diagnostics?: Diagnostics): string;
10export declare function transformMatchesOnRule(rule: postcss.Rule, lineBreak: boolean): string;
11export declare function scopeSelector(scopeSelectorRule: string, targetSelectorRule: string, rootScopeLevel?: boolean): {
12 selector: string;
13 selectorAst: SelectorAstNode;
14};
15export declare function mergeRules(mixinAst: postcss.Root, rule: postcss.Rule): postcss.Rule;
16export declare function createSubsetAst<T extends postcss.Root | postcss.AtRule>(root: postcss.Root | postcss.AtRule, selectorPrefix: string, mixinTarget?: T, isRoot?: boolean): T;
17export declare function removeUnusedRules(ast: postcss.Root, meta: StylableMeta, _import: Imported, usedFiles: string[], resolvePath: (ctx: string, path: string) => string): void;
18export declare function findDeclaration(importNode: Imported, test: any): postcss.Declaration;
19export declare function findRule(root: postcss.Root, selector: string, test?: any): null | postcss.Declaration;
20export declare function getDeclStylable(decl: SDecl): DeclStylableProps;
21export declare function getSourcePath(root: postcss.Root, diagnostics: Diagnostics): string;
22export declare function getAlias(symbol: StylableSymbol): ImportSymbol | undefined;
23export declare function generateScopedCSSVar(namespace: string, varName: string): string;
24export declare function isCSSVarProp(value: string): boolean;
25export declare function scopeCSSVar(resolver: StylableResolver, meta: StylableMeta, symbolName: string): string;
26export declare function isValidClassName(className: string): boolean;
27//# sourceMappingURL=stylable-utils.d.ts.map
\No newline at end of file