import { Styles } from '../styles/types'; export declare type StyleValue = T | boolean | number | null | undefined; export declare type StyleValueStateMap = { [key: string]: StyleValue; }; export declare type ResponsiveStyleValue = StyleValue | StyleValue[] | StyleValueStateMap | StyleValueStateMap[]; export declare type ComputeModel = string | number; export declare type CSSMap = { $?: string | string[]; } & { [key: string]: string | string[]; }; export declare type StyleHandlerResult = CSSMap | CSSMap[] | void; export declare type RawStyleHandler = (value: StyleValueStateMap, suffix?: string) => StyleHandlerResult; export declare type StyleHandler = RawStyleHandler & { __lookupStyles: string[]; }; export interface StyleStateData { model?: ComputeModel; tokens?: string[]; value: ResponsiveStyleValue; /** The list of mods to apply */ mods: string[]; /** The list of **not** mods to apply (e.g. `:not(:hover)`) */ notMods: string[]; } export interface ParsedStyle { value: ResponsiveStyleValue; values: string[]; all: string[]; color?: string; /** The list of mods to apply */ mods: string[]; } export interface ParsedColor { color?: string; name?: string; opacity?: number; } export declare type StyleStateDataList = StyleStateData[]; export declare type StyleStateDataListMap = { [key: string]: StyleStateDataList; }; /** An object that describes a relation between specific modifiers and style value. **/ export interface StyleState { /** The list of mods to apply */ mods: string[]; /** The list of **not** mods to apply (e.g. `:not(:hover)`) */ notMods: string[]; /** The value to apply */ value: StyleMap; } export interface RenderedStyleState { /** The list of mods to apply */ mods: string[]; /** The list of **not** mods to apply (e.g. `:not(:hover)`) */ notMods: string[]; /** The value to apply */ value: string; } export declare type ComputeUnit = string | (string | string[])[]; export declare type StyleStateList = StyleState[]; export declare type RenderedStyleStateList = RenderedStyleState[]; export declare type StyleMap = { [key: string]: ResponsiveStyleValue; }; export declare type StyleStateMap = { [key: string]: StyleState; }; export declare type RenderedStyleStateMap = { [key: string]: RenderedStyleState; }; export declare type StyleStateMapList = StyleStateMap[]; export declare type RenderedStyleStateMapList = { [key: string]: RenderedStyleStateMap; }; export declare type StyleStateListMap = { [key: string]: StyleStateList; }; export declare const CUSTOM_UNITS: { r: string; bw: string; ow: string; x: string; fs: string; lh: string; rp: string; gp: string; dvh: (num: any) => string; sp: (num: any) => string; }; export declare const DIRECTIONS: string[]; export declare function createRule(prop: string, value: StyleValue, selector?: string): string; /** * * @param {String} value * @param {Number} mode * @returns {Object} */ export declare function parseStyle(value: StyleValue, mode?: number): ParsedStyle; /** * Parse color. Find it value, name and opacity. */ export declare function parseColor(val: string, ignoreError?: boolean): ParsedColor; export declare function rgbColorProp(colorName: string, opacity: number, fallbackColorName?: Function, fallbackValue?: Function): string; export declare function colorProp(colorName: any, fallbackColorName: any, fallbackValue: any): string; export declare function strToRgb(color: any, ignoreAlpha?: boolean): any; export declare function getRgbValuesFromRgbaString(str: any): any; export declare function hexToRgb(hex: any): string | null; export declare function transferMods(mods: any, from: any, to: any): void; export declare function filterMods(mods: any, allowedMods: any): any; export declare function customUnit(value: any, unit: any): any; export declare function extendStyles(defaultStyles: any, newStyles: any): {}; /** * Split properties into style and non-style properties. * @param props - Component prop map. * @param [styleList] - List of all style properties. * @param [defaultStyles] - Default style map of the component. * @param [propMap] - Props to style alias map. * @param [ignoreList] - A list of properties to ignore. */ export declare function extractStyles(props: { [key: string]: any; }, styleList?: readonly string[], defaultStyles?: Styles, propMap?: { [key: string]: string; }, ignoreList?: readonly string[]): Styles; /** * Render CSSMap to Styled Components CSS * @param styles * @param [selector] */ export declare function renderStylesToSC(styles: StyleHandlerResult, selector?: string): any; /** * Compile states to finite CSS with selectors. * State values should contain a string value with CSS style list. * @param {string} selector * @param {StyleStateList|StyleStateMapList} states * @param {string} suffix */ export declare function applyStates(selector: string, states: any, suffix?: string): any; export declare function styleHandlerCacheWrapper(styleHandler: StyleHandler, limit?: number): ((styleMap: any, suffix?: string | undefined) => any) & { __lookupStyles: string[]; }; /** * Replace state values with new ones. * For example, if you want to replace initial values with finite CSS code. */ export declare function replaceStateValues(states: StyleStateList | StyleStateMapList, replaceFn: (value: string) => string): RenderedStyleStateList | RenderedStyleStateMapList; /** * Get all presented modes from the style state list. */ export declare function getModesFromStyleStateList(stateList: StyleStateList): string[]; /** * Get all presented modes from the style state map list. */ export declare function getModesFromStyleStateListMap(stateListMap: StyleStateMapList): string[]; /** * Convert the style map to the normalized style state list. */ export declare function styleMapToStyleMapStateList(styleMap: StyleMap, filterKeys?: string[]): StyleStateList; export declare const STATE_OPERATORS: { NOT: string; AND: string; OR: string; XOR: string; }; export declare const STATE_OPERATOR_LIST: string[]; /** * Parse state notation and return tokens, modifiers and compute model. */ declare function parseStateNotationInner(notation: string, value: any): StyleStateData; export declare const parseStateNotation: typeof parseStateNotationInner; /** * Parse state notation and return tokens, modifiers and compute model. */ export declare function styleStateMapToStyleStateDataList(styleStateMap: StyleStateMap | ResponsiveStyleValue): { states: StyleStateDataList; mods: string[]; }; export declare const COMPUTE_FUNC_MAP: { '!': (a: any) => boolean; '^': (a: any, b: any) => number; '|': (a: any, b: any) => number; '&': (a: any, b: any) => number; }; /** * Compute a result based on a model and incoming map. */ export declare function computeState(computeModel: ComputeModel, valueMap: (number | boolean)[] | { [key: string]: boolean; } | Function): any; export {};