@stylable/core
Version:
CSS for Components
88 lines • 3.33 kB
TypeScript
import postcss from 'postcss';
import postcssValueParser from 'postcss-value-parser';
import { Diagnostics } from './diagnostics';
import { ParsedValue, StateParsedValue } from './types';
export declare const valueParserWarnings: {
VALUE_CANNOT_BE_STRING(): string;
CSS_MIXIN_FORCE_NAMED_PARAMS(): string;
INVALID_NAMED_IMPORT_AS(name: string): string;
INVALID_NESTED_KEYFRAMES(name: string): string;
};
export interface MappedStates {
[s: string]: StateParsedValue | string | null;
}
export interface TypedClass {
'-st-root'?: boolean;
'-st-states'?: string[] | MappedStates;
'-st-extends'?: string;
}
export interface MixinValue {
type: string;
options: Array<{
value: string;
}> | Record<string, string>;
}
export interface ArgValue {
type: string;
value: string;
}
export interface ExtendsValue {
symbolName: string;
args: ArgValue[][] | null;
}
export declare type ReportWarning = (message: string, options?: {
word: string;
}) => void;
export declare const rootValueMapping: {
vars: ":vars";
import: ":import";
stScope: "st-scope";
namespace: "namespace";
};
export declare const valueMapping: {
from: "-st-from";
named: "-st-named";
default: "-st-default";
root: "-st-root";
states: "-st-states";
extends: "-st-extends";
mixin: "-st-mixin";
global: "-st-global";
};
export declare type stKeys = keyof typeof valueMapping;
export declare const stValues: string[];
export declare const stValuesMap: Record<string, boolean>;
export declare const STYLABLE_VALUE_MATCHER: RegExp;
export declare const STYLABLE_NAMED_MATCHER: RegExp;
export declare const SBTypesParsers: {
'-st-root'(value: string): boolean;
'-st-global'(decl: postcss.Declaration, _diagnostics: Diagnostics): any;
'-st-states'(value: string, decl: postcss.Declaration, diagnostics: Diagnostics): MappedStates;
'-st-extends'(value: string): {
ast: postcssValueParser.ParsedValue;
types: ExtendsValue[];
};
'-st-named'(value: string, node: postcss.Declaration, diagnostics: Diagnostics): {
namedMap: Record<string, string>;
keyframesMap: Record<string, string>;
};
'-st-mixin'(mixinNode: postcss.Declaration, strategy: (type: string) => 'named' | 'args', diagnostics?: Diagnostics | undefined): {
type: string;
options: Array<{
value: string;
}> | Record<string, string>;
}[];
};
export declare function getNamedArgs(node: ParsedValue): ParsedValue[][];
export declare function getFormatterArgs(node: ParsedValue, allowComments?: boolean, _reportWarning?: ReportWarning, perserveQuotes?: boolean): string[];
export declare function getStringValue(nodes: ParsedValue | ParsedValue[]): string;
export declare function groupValues(nodes: any[], divType?: string): any[];
export declare const strategies: {
named: (node: any, reportWarning?: ReportWarning | undefined) => Record<string, string>;
args: (node: any, reportWarning?: ReportWarning | undefined) => {
value: string;
}[];
};
export declare function listOptions(node: any): string[];
export declare function validateAllowedNodesUntil(node: ParsedValue, i: number, untilType?: string, allowed?: string[]): boolean;
//# sourceMappingURL=stylable-value-parsers.d.ts.map