UNPKG

2.48 kBTypeScriptView Raw
1import postcss from 'postcss';
2import { Diagnostics } from './diagnostics';
3import { SelectorAstNode } from './selector-utils';
4import { MappedStates, MixinValue } from './stylable-value-parsers';
5export declare const RESERVED_ROOT_NAME = "root";
6export declare class StylableMeta {
7 ast: postcss.Root;
8 diagnostics: Diagnostics;
9 rawAst: postcss.Root;
10 root: 'root';
11 source: string;
12 namespace: string;
13 imports: Imported[];
14 vars: VarSymbol[];
15 cssVars: Record<string, CSSVarSymbol>;
16 keyframes: postcss.AtRule[];
17 classes: Record<string, ClassSymbol>;
18 elements: Record<string, ElementSymbol>;
19 mappedSymbols: Record<string, StylableSymbol>;
20 customSelectors: Record<string, string>;
21 urls: string[];
22 parent?: StylableMeta;
23 transformDiagnostics: Diagnostics | null;
24 scopes: postcss.AtRule[];
25 simpleSelectors: Record<string, SimpleSelector>;
26 mixins: RefedMixin[];
27 outputAst?: postcss.Root;
28 globals: Record<string, boolean>;
29 constructor(ast: postcss.Root, diagnostics: Diagnostics);
30}
31export interface Imported {
32 from: string;
33 defaultExport: string;
34 named: Record<string, string>;
35 rule: postcss.Rule;
36 fromRelative: string;
37 context: string;
38}
39export interface StylableDirectives {
40 '-st-root'?: boolean;
41 '-st-states'?: MappedStates;
42 '-st-extends'?: ImportSymbol | ClassSymbol | ElementSymbol;
43 '-st-global'?: SelectorAstNode[];
44}
45export interface ClassSymbol extends StylableDirectives {
46 _kind: 'class';
47 name: string;
48 alias?: ImportSymbol;
49 scoped?: string;
50}
51export interface ElementSymbol extends StylableDirectives {
52 _kind: 'element';
53 name: string;
54 alias?: ImportSymbol;
55}
56export interface ImportSymbol {
57 _kind: 'import';
58 type: 'named' | 'default';
59 name: string;
60 import: Imported;
61 context: string;
62}
63export interface VarSymbol {
64 _kind: 'var';
65 name: string;
66 value: string;
67 text: string;
68 valueType: string | null;
69 node: postcss.Node;
70}
71export interface CSSVarSymbol {
72 _kind: 'cssVar';
73 name: string;
74 global?: boolean;
75}
76export declare type StylableSymbol = ImportSymbol | VarSymbol | ClassSymbol | ElementSymbol | CSSVarSymbol;
77export interface RefedMixin {
78 mixin: MixinValue;
79 ref: ImportSymbol | ClassSymbol;
80}
81export interface SimpleSelector {
82 symbol: ClassSymbol | ElementSymbol;
83 node: postcss.Rule | postcss.Root;
84}
85//# sourceMappingURL=stylable-meta.d.ts.map
\No newline at end of file