@@ -16,14 +16,14 @@ import type { CSSType } from './VarTypes';
1616export type { StyleXClassNameFor , StyleXVar } from './StyleXOpaqueTypes' ;
1717
1818// Using an opaque type to declare ClassNames generated by stylex.
19- export type StyleXClassNameForValue < + V > = StyleXClassNameFor < mixed , V > ;
20- export type StyleXClassNameForKey < + K > = StyleXClassNameFor < K , mixed > ;
21- export type StyleXClassName = StyleXClassNameFor < mixed , mixed > ;
19+ export type StyleXClassNameForValue < + V > = StyleXClassNameFor < unknown , V > ;
20+ export type StyleXClassNameForKey < + K > = StyleXClassNameFor < K , unknown > ;
21+ export type StyleXClassName = StyleXClassNameFor < unknown , unknown > ;
2222
2323// Type for arbitrarily nested Array.
24- export type StyleXArray < + T > = T | $ReadOnlyArray < StyleXArray < T >> ;
24+ export type StyleXArray < + T > = T | ReadonlyArray < StyleXArray < T >> ;
2525
26- type CSSPropertiesWithExtras = $ReadOnly < {
26+ type CSSPropertiesWithExtras = Readonly < {
2727 ...CSSProperties ,
2828 '::before' ?: CSSProperties ,
2929 '::after' ?: CSSProperties ,
@@ -47,21 +47,21 @@ type CSSPropertiesWithExtras = $ReadOnly<{
4747 '::-webkit-search-results-decoration' ?: CSSProperties ,
4848} > ;
4949
50- export type NestedCSSPropTypes = $ReadOnly < {
50+ export type NestedCSSPropTypes = Readonly < {
5151 [ Key in keyof CSSPropertiesWithExtras ] ?: StyleXClassNameForKey < Key > ,
5252} > ;
5353
5454export type StyleXSingleStyle = false | ?NestedCSSPropTypes ;
5555export type XStyle < + T = NestedCSSPropTypes > = StyleXArray <
56- false | ?$ReadOnly < { ...T , $$css : true } > ,
56+ false | ?Readonly < { ...T , $$css : true } > ,
5757> ;
5858
59- export type XStyleWithout < + T : { + [ _K in keyof NestedCSSPropTypes ] ? : mixed } > =
60- XStyle < $ReadOnly < Omit < NestedCSSPropTypes , $Keys < T > >>> ;
59+ export type XStyleWithout < + T : { + [ _K in keyof NestedCSSPropTypes ] ? : unknown } > =
60+ XStyle < Readonly < Omit < NestedCSSPropTypes , keyof T >>> ;
6161
62- export type Keyframes = $ReadOnly < { [ name : string ] : CSSProperties , ... } > ;
62+ export type Keyframes = Readonly < { [ name : string ] : CSSProperties , ... } > ;
6363
64- export type PositionTry = $ReadOnly < {
64+ export type PositionTry = Readonly < {
6565 // Anchor Positioning Properties
6666 positionAnchor ?: CSSProperties [ 'positionAnchor' ] ,
6767 positionArea ?: CSSProperties [ 'positionArea' ] ,
@@ -108,14 +108,14 @@ export type PositionTry = $ReadOnly<{
108108 placeSelf ?: CSSProperties [ 'placeSelf' ] ,
109109} > ;
110110
111- export type ViewTransitionClass = $ReadOnly < {
111+ export type ViewTransitionClass = Readonly < {
112112 group ?: CSSProperties ,
113113 imagePair ?: CSSProperties ,
114114 old ?: CSSProperties ,
115115 new ?: CSSProperties ,
116116} > ;
117117
118- export type LegacyThemeStyles = $ReadOnly < {
118+ export type LegacyThemeStyles = Readonly < {
119119 [ constantName : string ] : string ,
120120 ...
121121} > ;
@@ -127,85 +127,88 @@ type ComplexStyleValueType<+T> =
127127 : U
128128 : T extends string | number | null
129129 ? T
130- : T extends $ReadOnlyArray < infer U >
130+ : T extends ReadonlyArray < infer U >
131131 ? ComplexStyleValueType < U >
132132 : T extends { + default : infer A , + [ string ] : infer B }
133133 ? ComplexStyleValueType < A > | ComplexStyleValueType < B >
134- : $ReadOnly < T > ;
134+ : Readonly < T > ;
135135
136- type _MapNamespace < + CSS : { + [ string ] : mixed } > = $ReadOnly < {
136+ type _MapNamespace < + CSS : { + [ string ] : unknown } > = Readonly < {
137137 [ Key in keyof CSS ] : StyleXClassNameFor < Key , ComplexStyleValueType< CSS [ Key ] >> ,
138138} > ;
139- export type MapNamespace < + CSS : { + [ string ] : mixed } > = $ReadOnly < {
139+ export type MapNamespace < + CSS : { + [ string ] : unknown } > = Readonly < {
140140 ..._MapNamespace < CSS > ,
141141 $$css : true ,
142142} > ;
143- export type MapNamespaces < + S : { + [ string ] : mixed } > = $ReadOnly < {
143+ export type MapNamespaces < + S : { + [ string ] : unknown } > = Readonly < {
144144 [ Key in keyof S ] : S [ Key ] extends ( ...args : infer Args ) = > infer Obj
145- ? ( ...args : Args ) => $ReadOnly < [ MapNamespace < Obj > , InlineStyles ] >
145+ ? ( ...args : Args ) => Readonly < [ MapNamespace < Obj > , InlineStyles ] >
146146 : MapNamespace < S [ Key ] > ,
147147} > ;
148148export type StyleX$Create = < const S : { + [ string ] : { ... } } > (
149149 styles: S,
150150) => MapNamespaces < S > ;
151151
152- export type CompiledStyles = $ReadOnly < {
152+ export type CompiledStyles = Readonly < {
153153 $$css : true ,
154154 [ key : string ] : StyleXClassName ,
155155} > ;
156- export type InlineStyles = $ReadOnly < {
156+ export type InlineStyles = Readonly < {
157157 $$css ?: void ,
158158 [ key : string ] : string ,
159159} > ;
160160
161- type _GenStylePropType < + CSS : { + [ string ] : mixed } > = $ReadOnly < {
162- [ Key in keyof CSS ] : CSS [ Key ] extends { + [ string ] : mixed }
163- ? StyleXClassNameFor< Key , $ReadOnly < CSS [ Key ] >>
161+ type _GenStylePropType < + CSS : { + [ string ] : unknown } > = Readonly < {
162+ [ Key in keyof CSS ] : CSS [ Key ] extends { + [ string ] : unknown }
163+ ? StyleXClassNameFor< Key , Readonly < CSS [ Key ] >>
164164 : StyleXClassNameFor < Key , CSS [ Key ] > ,
165165} > ;
166- type GenStylePropType < + CSS : { + [ string ] : mixed } > = $ReadOnly < {
166+ type GenStylePropType < + CSS : { + [ string ] : unknown } > = Readonly < {
167167 ..._GenStylePropType < CSS > ,
168168 $$css : true ,
169169} > ;
170170
171171// Replace `XStyle` with this.
172- export type StaticStyles < + CSS : { + [ string ] : mixed } = CSSPropertiesWithExtras > =
173- StyleXArray< false | ?GenStylePropType < $ReadOnly < CSS > >> ;
172+ export type StaticStyles <
173+ + CSS : { + [ string ] : unknown } = CSSPropertiesWithExtras ,
174+ > = StyleXArray< false | ?GenStylePropType < Readonly < CSS > >> ;
174175
175- export type StaticStylesWithout < + CSS : { + [ string ] : mixed } > = StaticStyles<
176- Omit < CSSPropertiesWithExtras , $Keys < CSS > > ,
176+ export type StaticStylesWithout < + CSS : { + [ string ] : unknown } > = StaticStyles<
177+ Omit < CSSPropertiesWithExtras , keyof CSS > ,
177178> ;
178179
179- export type StyleXStyles < + CSS : { + [ string ] : mixed } = CSSPropertiesWithExtras > =
180- StyleXArray<
181- | ?false
182- | GenStylePropType < $ReadOnly < CSS > >
183- | $ReadOnly < [ GenStylePropType < $ReadOnly < CSS > > , InlineStyles ] > ,
184- > ;
180+ export type StyleXStyles <
181+ + CSS : { + [ string ] : unknown } = CSSPropertiesWithExtras ,
182+ > = StyleXArray<
183+ | ?false
184+ | GenStylePropType < Readonly < CSS > >
185+ | Readonly < [ GenStylePropType < Readonly < CSS > > , InlineStyles ] > ,
186+ > ;
185187
186- export type StyleXStylesWithout < + CSS : { + [ string ] : mixed } > = StyleXStyles<
187- Omit < CSSPropertiesWithExtras , $Keys < CSS > > ,
188+ export type StyleXStylesWithout < + CSS : { + [ string ] : unknown } > = StyleXStyles<
189+ Omit < CSSPropertiesWithExtras , keyof CSS > ,
188190> ;
189191
190- export type VarGroup < + Tokens : { + [ string ] : mixed } , + _ID : string = string > = {
192+ export type VarGroup < + Tokens : { + [ string ] : unknown } , + _ID : string = string > = {
191193 + [ Key in keyof Tokens ] : StyleXVar < Tokens [ Key ] > ,
192194} ;
193195
194- export type TokensFromVarGroup< + T : VarGroup < { + [ string ] : mixed } > > = $ReadOnly < {
195- [ Key in keyof T ] : UnwrapVar < T [ Key ] > ,
196- } > ;
196+ export type TokensFromVarGroup< + T : VarGroup < { + [ string ] : unknown } > > =
197+ Readonly < {
198+ [ Key in keyof T ] : UnwrapVar < T [ Key ] > ,
199+ } > ;
197200
198- type IDFromVarGroup < + T : VarGroup < { + [ string ] : mixed } > > =
199- T extends VarGroup < { + [ string ] : mixed } , infer ID> ? ID : empty ;
201+ type IDFromVarGroup < + T : VarGroup < { + [ string ] : unknown } > > =
202+ T extends VarGroup < { + [ string ] : unknown } , infer ID> ? ID : empty ;
200203
201204type NestedVarObject < + T > =
202205 | T
203- | $ReadOnly < {
206+ | Readonly < {
204207 default : NestedVarObject < T > ,
205208 [ string ] : NestedVarObject < T > ,
206209 } > ;
207210
208- type TTokens = $ReadOnly < {
211+ type TTokens = Readonly < {
209212 [ string ] :
210213 | NestedVarObject < null | string | number >
211214 | StyleXVar < null | string | number >
@@ -231,24 +234,24 @@ export type StyleX$DefineConsts = <
231234 tokens: DefaultTokens,
232235) => DefaultTokens ;
233236
234- // opaque type ThemeKey<+_VG: VarGroup<{ +[string]: mixed }>>: string = string;
237+ // opaque type ThemeKey<+_VG: VarGroup<{ +[string]: unknown }>>: string = string;
235238export opaque type Theme <
236- + T : VarGroup < { + [ string ] : mixed } , string > ,
239+ + T : VarGroup < { + [ string ] : unknown } , string > ,
237240 +_Tag: string = string,
238- > : $ReadOnly < {
241+ > : Readonly < {
239242 $$css : true ,
240243 theme : StyleXClassNameFor < 'theme ', IDFromVarGroup < T > > ,
241- } > = $ReadOnly < {
244+ } > = Readonly < {
242245 $$css : true ,
243246 theme : StyleXClassNameFor < 'theme ', IDFromVarGroup < T > > ,
244247} > ;
245248
246- export type OverridesForTokenType < + Config : { + [ string ] : mixed } > = {
249+ export type OverridesForTokenType < + Config : { + [ string ] : unknown } > = {
247250 [ Key in keyof Config ] ?: NestedVarObject < Config [ Key ] > ,
248251} ;
249252
250253export type StyleX$CreateTheme = <
251- BaseTokens : VarGroup < { + [ string ] : mixed } > ,
254+ BaseTokens : VarGroup < { + [ string ] : unknown } > ,
252255 ID: string = string,
253256> (
254257 baseTokens : BaseTokens ,
0 commit comments