@stylable/core
Version:
CSS for Components
85 lines • 2.48 kB
TypeScript
import postcss from 'postcss';
import { Diagnostics } from './diagnostics';
import { SelectorAstNode } from './selector-utils';
import { MappedStates, MixinValue } from './stylable-value-parsers';
export declare const RESERVED_ROOT_NAME = "root";
export declare class StylableMeta {
ast: postcss.Root;
diagnostics: Diagnostics;
rawAst: postcss.Root;
root: 'root';
source: string;
namespace: string;
imports: Imported[];
vars: VarSymbol[];
cssVars: Record<string, CSSVarSymbol>;
keyframes: postcss.AtRule[];
classes: Record<string, ClassSymbol>;
elements: Record<string, ElementSymbol>;
mappedSymbols: Record<string, StylableSymbol>;
customSelectors: Record<string, string>;
urls: string[];
parent?: StylableMeta;
transformDiagnostics: Diagnostics | null;
scopes: postcss.AtRule[];
simpleSelectors: Record<string, SimpleSelector>;
mixins: RefedMixin[];
outputAst?: postcss.Root;
globals: Record<string, boolean>;
constructor(ast: postcss.Root, diagnostics: Diagnostics);
}
export interface Imported {
from: string;
defaultExport: string;
named: Record<string, string>;
rule: postcss.Rule;
fromRelative: string;
context: string;
}
export interface StylableDirectives {
'-st-root'?: boolean;
'-st-states'?: MappedStates;
'-st-extends'?: ImportSymbol | ClassSymbol | ElementSymbol;
'-st-global'?: SelectorAstNode[];
}
export interface ClassSymbol extends StylableDirectives {
_kind: 'class';
name: string;
alias?: ImportSymbol;
scoped?: string;
}
export interface ElementSymbol extends StylableDirectives {
_kind: 'element';
name: string;
alias?: ImportSymbol;
}
export interface ImportSymbol {
_kind: 'import';
type: 'named' | 'default';
name: string;
import: Imported;
context: string;
}
export interface VarSymbol {
_kind: 'var';
name: string;
value: string;
text: string;
valueType: string | null;
node: postcss.Node;
}
export interface CSSVarSymbol {
_kind: 'cssVar';
name: string;
global?: boolean;
}
export declare type StylableSymbol = ImportSymbol | VarSymbol | ClassSymbol | ElementSymbol | CSSVarSymbol;
export interface RefedMixin {
mixin: MixinValue;
ref: ImportSymbol | ClassSymbol;
}
export interface SimpleSelector {
symbol: ClassSymbol | ElementSymbol;
node: postcss.Rule | postcss.Root;
}
//# sourceMappingURL=stylable-meta.d.ts.map