UNPKG

2.8 kBTypeScriptView Raw
1import * as postcss from 'postcss';
2import { Diagnostics } from './diagnostics';
3import { SelectorAstNode, SelectorChunk2 } 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 mappedKeyframes: Record<string, KeyframesSymbol>;
21 customSelectors: Record<string, string>;
22 urls: string[];
23 parent?: StylableMeta;
24 transformDiagnostics: Diagnostics | null;
25 transformedScopes: Record<string, SelectorChunk2[][]> | null;
26 scopes: postcss.AtRule[];
27 simpleSelectors: Record<string, SimpleSelector>;
28 mixins: RefedMixin[];
29 outputAst?: postcss.Root;
30 globals: Record<string, boolean>;
31 constructor(ast: postcss.Root, diagnostics: Diagnostics);
32}
33export interface Imported {
34 from: string;
35 defaultExport: string;
36 named: Record<string, string>;
37 keyframes: Record<string, string>;
38 rule: postcss.Rule;
39 fromRelative: string;
40 context: string;
41}
42export interface StylableDirectives {
43 '-st-root'?: boolean;
44 '-st-states'?: MappedStates;
45 '-st-extends'?: ImportSymbol | ClassSymbol | ElementSymbol;
46 '-st-global'?: SelectorAstNode[];
47}
48export interface ClassSymbol extends StylableDirectives {
49 _kind: 'class';
50 name: string;
51 alias?: ImportSymbol;
52 scoped?: string;
53}
54export interface ElementSymbol extends StylableDirectives {
55 _kind: 'element';
56 name: string;
57 alias?: ImportSymbol;
58}
59export interface ImportSymbol {
60 _kind: 'import';
61 type: 'named' | 'default';
62 name: string;
63 import: Imported;
64 context: string;
65}
66export interface VarSymbol {
67 _kind: 'var';
68 name: string;
69 value: string;
70 text: string;
71 valueType: string | null;
72 node: postcss.Node;
73}
74export interface KeyframesSymbol {
75 _kind: 'keyframes';
76 alias: string;
77 name: string;
78 import?: Imported;
79}
80export interface CSSVarSymbol {
81 _kind: 'cssVar';
82 name: string;
83 global?: boolean;
84}
85export declare type StylableSymbol = ImportSymbol | VarSymbol | ClassSymbol | ElementSymbol | CSSVarSymbol | KeyframesSymbol;
86export interface RefedMixin {
87 mixin: MixinValue;
88 ref: ImportSymbol | ClassSymbol;
89}
90export interface SimpleSelector {
91 symbol: ClassSymbol | ElementSymbol;
92 node: postcss.Rule | postcss.Root;
93}
94//# sourceMappingURL=stylable-meta.d.ts.map
\No newline at end of file