stylex_transform/shared/structures/
types.rs1use std::rc::Rc;
2
3use indexmap::IndexMap;
4use rustc_hash::FxHashMap;
5use swc_core::{
6 atoms::Atom,
7 ecma::ast::{BindingIdent, Expr},
8};
9
10use crate::shared::enums::data_structures::evaluate_result_value::EvaluateResultValue;
11use crate::shared::enums::data_structures::flat_compiled_styles_value::FlatCompiledStylesValue;
12use stylex_types::enums::data_structures::injectable_style::InjectableStyleKind;
13
14use super::functions::FunctionConfigType;
15use stylex_structures::inline_style::InlineStyle;
16use stylex_structures::named_import_source::ImportSources;
17
18pub(crate) type FlatCompiledStyles = IndexMap<String, Rc<FlatCompiledStylesValue>>;
19pub(crate) type DynamicFns = IndexMap<String, (Vec<BindingIdent>, TInlineStyles)>;
20
21pub(crate) type EvaluationCallback = Rc<dyn Fn(Vec<Option<EvaluateResultValue>>) -> Expr + 'static>;
22pub(crate) type FunctionMapMemberExpression =
23 FxHashMap<ImportSources, Box<FxHashMap<Atom, Box<FunctionConfigType>>>>;
24pub(crate) type FunctionMapIdentifiers = FxHashMap<Atom, Box<FunctionConfigType>>;
25pub(crate) type StylesObjectMap = IndexMap<String, Rc<FlatCompiledStyles>>;
26pub(crate) type InjectableStylesMap = IndexMap<String, Rc<InjectableStyleKind>>;
27pub(crate) type ClassPathsMap = IndexMap<String, Rc<ClassPathsInNamespace>>;
28pub(crate) type ClassesToOriginalPaths = IndexMap<String, Vec<String>>;
29pub(crate) type ClassPathsInNamespace = ClassesToOriginalPaths;
30pub(crate) type TInlineStyles = IndexMap<String, Box<InlineStyle>>;