UNPKG

3.03 kBTypeScriptView Raw
1import postcss from 'postcss';
2import { Diagnostics } from './diagnostics';
3import { ParsedValue, StateParsedValue } from './types';
4export declare const valueParserWarnings: {
5 VALUE_CANNOT_BE_STRING(): string;
6 CSS_MIXIN_FORCE_NAMED_PARAMS(): string;
7};
8export interface MappedStates {
9 [s: string]: StateParsedValue | string | null;
10}
11export interface TypedClass {
12 '-st-root'?: boolean;
13 '-st-states'?: string[] | MappedStates;
14 '-st-extends'?: string;
15}
16export interface MixinValue {
17 type: string;
18 options: Array<{
19 value: string;
20 }> | Record<string, string>;
21}
22export interface ArgValue {
23 type: string;
24 value: string;
25}
26export interface ExtendsValue {
27 symbolName: string;
28 args: ArgValue[][] | null;
29}
30export declare type ReportWarning = (message: string, options?: {
31 word: string;
32}) => void;
33export declare const rootValueMapping: {
34 vars: ":vars";
35 import: ":import";
36 stScope: "st-scope";
37 namespace: "namespace";
38};
39export declare const valueMapping: {
40 from: "-st-from";
41 named: "-st-named";
42 default: "-st-default";
43 root: "-st-root";
44 states: "-st-states";
45 extends: "-st-extends";
46 mixin: "-st-mixin";
47 global: "-st-global";
48};
49export declare type stKeys = keyof typeof valueMapping;
50export declare const stValues: string[];
51export declare const stValuesMap: Record<string, boolean>;
52export declare const STYLABLE_VALUE_MATCHER: RegExp;
53export declare const STYLABLE_NAMED_MATCHER: RegExp;
54export declare const SBTypesParsers: {
55 '-st-root'(value: string): boolean;
56 '-st-global'(decl: postcss.Declaration, _diagnostics: Diagnostics): any;
57 '-st-states'(value: string, decl: postcss.Declaration, diagnostics: Diagnostics): MappedStates;
58 '-st-extends'(value: string): {
59 ast: any;
60 types: ExtendsValue[];
61 };
62 '-st-named'(value: string): {
63 [key: string]: string;
64 };
65 '-st-mixin'(mixinNode: postcss.Declaration, strategy: (type: string) => 'named' | 'args', diagnostics?: Diagnostics | undefined): {
66 type: string;
67 options: Array<{
68 value: string;
69 }> | Record<string, string>;
70 }[];
71};
72export declare function getNamedArgs(node: ParsedValue): ParsedValue[][];
73export declare function getFormatterArgs(node: ParsedValue, allowComments?: boolean, _reportWarning?: ReportWarning, perserveQuotes?: boolean): string[];
74export declare function getStringValue(nodes: ParsedValue | ParsedValue[]): string;
75export declare function groupValues(nodes: any[], divType?: string): any[];
76export declare const strategies: {
77 named: (node: any, reportWarning?: ReportWarning | undefined) => Record<string, string>;
78 args: (node: any, reportWarning?: ReportWarning | undefined) => {
79 value: string;
80 }[];
81};
82export declare function listOptions(node: any): any[];
83export declare function validateAllowedNodesUntil(node: ParsedValue, i: number, untilType?: string, allowed?: string[]): boolean;
84//# sourceMappingURL=stylable-value-parsers.d.ts.map
\No newline at end of file