UNPKG

2.49 kBTypeScriptView Raw
1import postcss from 'postcss';
2import { Diagnostics } from './diagnostics';
3import { SelectorAstNode } from './selector-utils';
4import { StateResult } from './state-validators';
5import { ClassSymbol, ElementSymbol, StylableMeta, StylableSymbol } from './stylable-processor';
6import { StylableResolver } from './stylable-resolver';
7import { MappedStates } from './stylable-value-parsers';
8import { StateParsedValue } from './types';
9export declare const stateMiddleDelimiter = "-";
10export declare const booleanStateDelimiter = "--";
11export declare const stateWithParamDelimiter: string;
12export declare const stateErrors: {
13 UNKNOWN_STATE_USAGE: (name: string) => string;
14 UNKNOWN_STATE_TYPE: (name: string, type: string) => string;
15 TOO_MANY_STATE_TYPES: (name: string, types: string[]) => string;
16 NO_STATE_TYPE_GIVEN: (name: string) => string;
17 TOO_MANY_ARGS_IN_VALIDATOR: (name: string, validator: string, args: string[]) => string;
18 STATE_STARTS_WITH_HYPHEN: (name: string) => string;
19};
20export declare function processPseudoStates(value: string, decl: postcss.Declaration, diagnostics: Diagnostics): MappedStates;
21export declare function validateStateDefinition(decl: postcss.Declaration, meta: StylableMeta, resolver: StylableResolver, diagnostics: Diagnostics): void;
22export declare function validateStateArgument(stateAst: StateParsedValue, meta: StylableMeta, value: string, resolver: StylableResolver, diagnostics: Diagnostics, rule?: postcss.Rule, validateDefinition?: boolean, validateValue?: boolean): StateResult;
23export declare function transformPseudoStateSelector(meta: StylableMeta, node: SelectorAstNode, name: string, symbol: StylableSymbol | null, origin: StylableMeta, originSymbol: ClassSymbol | ElementSymbol, resolver: StylableResolver, diagnostics: Diagnostics, rule?: postcss.Rule): StylableMeta;
24export declare function setStateToNode(states: MappedStates, meta: StylableMeta, name: string, node: SelectorAstNode, namespace: string, resolver: StylableResolver, diagnostics: Diagnostics, rule?: postcss.Rule): void;
25export declare function createBooleanStateClassName(stateName: string, namespace: string): string;
26export declare function createStateWithParamClassName(stateName: string, namespace: string, param: string): string;
27export declare function createAttributeState(stateName: string, namespace: string, param: string): string;
28export declare function resolveStateParam(param: string): string;
29//# sourceMappingURL=pseudo-states.d.ts.map
\No newline at end of file