@stylexjs/babel-plugin 0.16.3 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/lib/index.js +994 -1837
  2. package/lib/index.js.flow +1 -0
  3. package/lib/shared/common-types.d.ts +1 -0
  4. package/lib/shared/common-types.js.flow +9 -0
  5. package/lib/shared/hash.d.ts +3 -0
  6. package/lib/shared/index.d.ts +13 -1
  7. package/lib/shared/index.js.flow +1 -1
  8. package/lib/shared/messages.d.ts +32 -0
  9. package/lib/shared/physical-rtl/generate-ltr.d.ts +1 -1
  10. package/lib/shared/physical-rtl/generate-ltr.js.flow +1 -1
  11. package/lib/shared/physical-rtl/generate-rtl.d.ts +1 -1
  12. package/lib/shared/physical-rtl/generate-rtl.js.flow +1 -1
  13. package/lib/shared/preprocess-rules/application-order.d.ts +35 -34
  14. package/lib/shared/preprocess-rules/application-order.js.flow +35 -29
  15. package/lib/shared/preprocess-rules/basic-validation.d.ts +1 -1
  16. package/lib/shared/preprocess-rules/basic-validation.js.flow +1 -1
  17. package/lib/shared/preprocess-rules/legacy-expand-shorthands.d.ts +26 -15
  18. package/lib/shared/preprocess-rules/legacy-expand-shorthands.js.flow +19 -14
  19. package/lib/shared/preprocess-rules/property-specificity.d.ts +12 -11
  20. package/lib/shared/preprocess-rules/property-specificity.js.flow +12 -6
  21. package/lib/shared/stylex-define-consts.d.ts +1 -1
  22. package/lib/shared/stylex-keyframes.d.ts +1 -1
  23. package/lib/shared/stylex-keyframes.js.flow +1 -1
  24. package/lib/shared/stylex-position-try.d.ts +1 -1
  25. package/lib/shared/stylex-position-try.js.flow +1 -1
  26. package/lib/shared/stylex-vars-utils.d.ts +2 -2
  27. package/lib/shared/stylex-vars-utils.js.flow +3 -3
  28. package/lib/shared/stylex-view-transition-class.d.ts +1 -1
  29. package/lib/shared/stylex-view-transition-class.js.flow +1 -1
  30. package/lib/shared/types/index.d.ts +14 -0
  31. package/lib/shared/types/index.js.flow +1 -1
  32. package/lib/shared/utils/convert-to-className.d.ts +1 -1
  33. package/lib/shared/utils/convert-to-className.js.flow +1 -1
  34. package/lib/shared/utils/default-options.d.ts +1 -0
  35. package/lib/shared/utils/file-based-identifier.js.flow +1 -1
  36. package/lib/shared/utils/generate-css-rule.d.ts +1 -1
  37. package/lib/shared/utils/generate-css-rule.js.flow +1 -1
  38. package/lib/shared/utils/normalize-value.js.flow +1 -1
  39. package/lib/shared/utils/object-utils.d.ts +10 -8
  40. package/lib/shared/utils/object-utils.js.flow +2 -2
  41. package/lib/shared/utils/rule-utils.d.ts +2 -0
  42. package/lib/shared/utils/transform-value.d.ts +2 -0
  43. package/lib/shared/validate.js.flow +3 -1
  44. package/lib/shared/when/when.d.ts +10 -10
  45. package/lib/shared/when/when.js.flow +10 -10
  46. package/lib/utils/evaluate-path.d.ts +3 -2
  47. package/lib/utils/evaluate-path.js.flow +3 -2
  48. package/lib/utils/evaluation-errors.d.ts +15 -0
  49. package/lib/utils/js-to-ast.d.ts +0 -4
  50. package/lib/utils/js-to-ast.js.flow +0 -6
  51. package/lib/utils/state-manager.d.ts +41 -35
  52. package/lib/utils/state-manager.js.flow +5 -0
  53. package/lib/utils/validate.d.ts +18 -3
  54. package/lib/utils/validate.js.flow +5 -3
  55. package/lib/visitors/parse-stylex-create-arg.d.ts +1 -1
  56. package/lib/visitors/parse-stylex-create-arg.js.flow +1 -1
  57. package/lib/visitors/stylex-default-target.d.ts +20 -0
  58. package/lib/visitors/stylex-default-target.js.flow +21 -0
  59. package/lib/visitors/stylex-define-marker.d.ts +22 -0
  60. package/lib/visitors/stylex-define-marker.js.flow +22 -0
  61. package/package.json +5 -4
@@ -12,6 +12,6 @@ declare function styleXKeyframes(
12
12
  frames: {
13
13
  readonly [$$Key$$: string]: { readonly [$$Key$$: string]: string | number };
14
14
  },
15
- options: StyleXOptions,
15
+ options?: StyleXOptions,
16
16
  ): [string, InjectableStyle];
17
17
  export default styleXKeyframes;
@@ -16,5 +16,5 @@ import type { InjectableStyle, StyleXOptions } from './common-types';
16
16
  // `stylex.create`.
17
17
  declare export default function styleXKeyframes(
18
18
  frames: { +[string]: { +[string]: string | number } },
19
- options: StyleXOptions,
19
+ options?: StyleXOptions,
20
20
  ): [string, InjectableStyle];
@@ -10,6 +10,6 @@
10
10
  import type { InjectableStyle, StyleXOptions } from './common-types';
11
11
  declare function styleXPositionTry(
12
12
  styles: { readonly [$$Key$$: string]: string | number },
13
- options: StyleXOptions,
13
+ options?: StyleXOptions,
14
14
  ): [string, InjectableStyle];
15
15
  export default styleXPositionTry;
@@ -14,5 +14,5 @@ import type { InjectableStyle, StyleXOptions } from './common-types';
14
14
  // The generated string must be prefixed with -- for anchor positioning
15
15
  declare export default function styleXPositionTry(
16
16
  styles: { +[string]: string | number },
17
- options: StyleXOptions,
17
+ options?: StyleXOptions,
18
18
  ): [string, InjectableStyle];
@@ -17,8 +17,8 @@ export type VarsConfig = Readonly<{
17
17
  export declare function collectVarsByAtRule(
18
18
  key: string,
19
19
  $$PARAM_1$$: { readonly nameHash: string; readonly value: VarsConfigValue },
20
- collection: { [$$Key$$: string]: Array<string> },
21
- atRules: Array<string>,
20
+ collection?: { [$$Key$$: string]: Array<string> },
21
+ atRules?: Array<string>,
22
22
  ): void;
23
23
  export declare function wrapWithAtRules(ltr: string, atRule: string): string;
24
24
  export declare function priorityForAtRule(atRule: string): number;
@@ -19,9 +19,9 @@ export type VarsConfig = $ReadOnly<{
19
19
 
20
20
  declare export function collectVarsByAtRule(
21
21
  key: string,
22
- { +nameHash: string, +value: VarsConfigValue },
23
- collection: { [string]: Array<string> },
24
- atRules: Array<string>,
22
+ $$PARAM_1$$: { +nameHash: string, +value: VarsConfigValue },
23
+ collection?: { [string]: Array<string> },
24
+ atRules?: Array<string>,
25
25
  ): void;
26
26
 
27
27
  declare export function wrapWithAtRules(ltr: string, atRule: string): string;
@@ -17,6 +17,6 @@ type StyleObj = {
17
17
  };
18
18
  declare function styleXViewTransitionClass(
19
19
  styles: StyleObj,
20
- options: StyleXOptions,
20
+ options?: StyleXOptions,
21
21
  ): [string, InjectableStyle];
22
22
  export default styleXViewTransitionClass;
@@ -19,5 +19,5 @@ type StyleObj = {
19
19
 
20
20
  declare export default function styleXViewTransitionClass(
21
21
  styles: StyleObj,
22
- options: StyleXOptions,
22
+ options?: StyleXOptions,
23
23
  ): [string, InjectableStyle];
@@ -49,6 +49,7 @@ export interface CSSType<_T extends string | number = string | number> {
49
49
  export declare const isCSSType: (
50
50
  value: unknown,
51
51
  ) => value is CSSType<string | number>;
52
+ export declare type isCSSType = typeof isCSSType;
52
53
  type AngleValue = string;
53
54
  export declare class Angle<T extends AngleValue>
54
55
  extends BaseCSSType
@@ -64,6 +65,7 @@ export declare class Angle<T extends AngleValue>
64
65
  export declare const angle: <T extends AngleValue = AngleValue>(
65
66
  value: ValueWithDefault,
66
67
  ) => Angle<T>;
68
+ export declare type angle = typeof angle;
67
69
  type ColorValue = string;
68
70
  export declare class Color<T extends ColorValue>
69
71
  extends BaseCSSType
@@ -78,6 +80,7 @@ export declare class Color<T extends ColorValue>
78
80
  export declare const color: <T extends ColorValue = ColorValue>(
79
81
  value: ValueWithDefault,
80
82
  ) => Color<T>;
83
+ export declare type color = typeof color;
81
84
  type URLValue = string;
82
85
  export declare class Url<T extends URLValue>
83
86
  extends BaseCSSType
@@ -90,6 +93,7 @@ export declare class Url<T extends URLValue>
90
93
  export declare const url: <T extends URLValue = URLValue>(
91
94
  value: ValueWithDefault,
92
95
  ) => Url<T>;
96
+ export declare type url = typeof url;
93
97
  type ImageValue = string;
94
98
  export declare class Image<T extends ImageValue>
95
99
  extends Url<T>
@@ -105,6 +109,7 @@ export declare class Image<T extends ImageValue>
105
109
  export declare const image: <T extends ImageValue = ImageValue>(
106
110
  value: ValueWithDefault,
107
111
  ) => Image<T>;
112
+ export declare type image = typeof image;
108
113
  type IntegerValue = number;
109
114
  export declare class Integer<T extends IntegerValue>
110
115
  extends BaseCSSType
@@ -117,6 +122,7 @@ export declare class Integer<T extends IntegerValue>
117
122
  export declare const integer: <T extends IntegerValue = IntegerValue>(
118
123
  value: T,
119
124
  ) => Integer<T>;
125
+ export declare type integer = typeof integer;
120
126
  type LengthPercentageValue = string;
121
127
  export declare class LengthPercentage<_T extends LengthPercentageValue>
122
128
  extends BaseCSSType
@@ -136,6 +142,7 @@ export declare const lengthPercentage: <
136
142
  >(
137
143
  value: ValueWithDefault,
138
144
  ) => LengthPercentage<string>;
145
+ export declare type lengthPercentage = typeof lengthPercentage;
139
146
  type LengthValue = number | string;
140
147
  export declare class Length<_T extends LengthValue>
141
148
  extends LengthPercentage<string>
@@ -150,6 +157,7 @@ export declare class Length<_T extends LengthValue>
150
157
  export declare const length: <T extends LengthValue = LengthValue>(
151
158
  value: NestedWithNumbers,
152
159
  ) => Length<T>;
160
+ export declare type length = typeof length;
153
161
  type PercentageValue = string | number;
154
162
  export declare class Percentage<_T extends PercentageValue>
155
163
  extends LengthPercentage<string>
@@ -164,6 +172,7 @@ export declare class Percentage<_T extends PercentageValue>
164
172
  export declare const percentage: <T extends PercentageValue = PercentageValue>(
165
173
  value: NestedWithNumbers,
166
174
  ) => Percentage<T>;
175
+ export declare type percentage = typeof percentage;
167
176
  type NumberValue = number;
168
177
  export declare class Num<T extends NumberValue>
169
178
  extends BaseCSSType
@@ -178,6 +187,7 @@ export declare class Num<T extends NumberValue>
178
187
  export declare const number: <T extends NumberValue = NumberValue>(
179
188
  value: NestedWithNumbers,
180
189
  ) => Num<T>;
190
+ export declare type number = typeof number;
181
191
  type ResolutionValue = string | 0;
182
192
  export declare class Resolution<T extends ResolutionValue>
183
193
  extends BaseCSSType
@@ -192,6 +202,7 @@ export declare class Resolution<T extends ResolutionValue>
192
202
  export declare const resolution: <T extends ResolutionValue = ResolutionValue>(
193
203
  value: ValueWithDefault,
194
204
  ) => Resolution<T>;
205
+ export declare type resolution = typeof resolution;
195
206
  type TimeValue = string | 0;
196
207
  export declare class Time<T extends TimeValue>
197
208
  extends BaseCSSType
@@ -206,6 +217,7 @@ export declare class Time<T extends TimeValue>
206
217
  export declare const time: <T extends TimeValue = TimeValue>(
207
218
  value: ValueWithDefault,
208
219
  ) => Time<T>;
220
+ export declare type time = typeof time;
209
221
  type TransformFunctionValue = string;
210
222
  export declare class TransformFunction<T extends TransformFunctionValue>
211
223
  extends BaseCSSType
@@ -222,6 +234,7 @@ export declare const transformFunction: <
222
234
  >(
223
235
  value: ValueWithDefault,
224
236
  ) => TransformFunction<T>;
237
+ export declare type transformFunction = typeof transformFunction;
225
238
  type TransformListValue = string;
226
239
  export declare class TransformList<T extends TransformListValue>
227
240
  extends BaseCSSType
@@ -238,3 +251,4 @@ export declare const transformList: <
238
251
  >(
239
252
  value: ValueWithDefault,
240
253
  ) => TransformList<T>;
254
+ export declare type transformList = typeof transformList;
@@ -65,7 +65,7 @@ export interface CSSType<+_T: string | number = string | number> {
65
65
 
66
66
  declare export const isCSSType: (
67
67
  value: mixed,
68
- ) => value is CSSType<string | number>;
68
+ ) => implies value is CSSType<string | number>;
69
69
 
70
70
  type AngleValue = string;
71
71
  declare export class Angle<+T: AngleValue>
@@ -13,7 +13,7 @@ export declare function convertStyleToClassName(
13
13
  pseudos: ReadonlyArray<string>,
14
14
  atRules: ReadonlyArray<string>,
15
15
  constRules: ReadonlyArray<string>,
16
- options: StyleXOptions,
16
+ options?: StyleXOptions,
17
17
  ): StyleRule;
18
18
  declare function variableFallbacks(
19
19
  values: ReadonlyArray<string>,
@@ -21,7 +21,7 @@ declare export function convertStyleToClassName(
21
21
  pseudos: $ReadOnlyArray<string>,
22
22
  atRules: $ReadOnlyArray<string>,
23
23
  constRules: $ReadOnlyArray<string>,
24
- options: StyleXOptions,
24
+ options?: StyleXOptions,
25
25
  ): StyleRule;
26
26
 
27
27
  declare export default function variableFallbacks(
@@ -9,3 +9,4 @@
9
9
 
10
10
  import type { StyleXOptions } from '../common-types';
11
11
  export declare const defaultOptions: StyleXOptions;
12
+ export declare type defaultOptions = typeof defaultOptions;
@@ -7,7 +7,7 @@
7
7
  * @flow strict
8
8
  */
9
9
 
10
- declare export default function genFileBasedIdentifier({
10
+ declare export default function genFileBasedIdentifier($$PARAM_0$$: {
11
11
  +fileName: string,
12
12
  +exportName: string,
13
13
  +key?: string,
@@ -15,5 +15,5 @@ export declare function generateCSSRule(
15
15
  pseudos: ReadonlyArray<string>,
16
16
  atRules: ReadonlyArray<string>,
17
17
  constRules: ReadonlyArray<string>,
18
- options: StyleXOptions,
18
+ options?: StyleXOptions,
19
19
  ): InjectableStyle;
@@ -15,5 +15,5 @@ declare export function generateCSSRule(
15
15
  pseudos: $ReadOnlyArray<string>,
16
16
  atRules: $ReadOnlyArray<string>,
17
17
  constRules: $ReadOnlyArray<string>,
18
- options: StyleXOptions,
18
+ options?: StyleXOptions,
19
19
  ): InjectableStyle;
@@ -12,5 +12,5 @@ import type { StyleXOptions } from '../common-types';
12
12
  declare export default function normalizeValue(
13
13
  value: string,
14
14
  key: string,
15
- StyleXOptions,
15
+ $$PARAM_2$$: StyleXOptions,
16
16
  ): string;
@@ -26,28 +26,28 @@ export declare function objValues<
26
26
  >(obj: Obj): ReadonlyArray<Obj[keyof Obj]>;
27
27
  export declare function objFromEntries<K extends string | number, V>(
28
28
  entries: ReadonlyArray<Readonly<[K, V]>>,
29
- ): { [$$Key$$: K]: V };
29
+ ): { [$$Key$$ in K]: V };
30
30
  export declare function objMapKeys<
31
31
  V,
32
32
  K1 extends string = string,
33
33
  K2 extends string = string,
34
34
  >(
35
- obj: { readonly [$$Key$$: K1]: V },
35
+ obj: { readonly [$$Key$$ in K1]: V },
36
36
  mapper: ($$PARAM_0$$: K1) => K2,
37
- ): { readonly [$$Key$$: K2]: V };
37
+ ): { readonly [$$Key$$ in K2]: V };
38
38
  export declare function objMapEntry<
39
39
  V,
40
40
  V2,
41
41
  K1 extends string = string,
42
42
  K2 extends string = string,
43
43
  >(
44
- obj: { readonly [$$Key$$: K1]: V },
44
+ obj: { readonly [$$Key$$ in K1]: V },
45
45
  mapper: ($$PARAM_0$$: Readonly<[K1, V]>) => Readonly<[K2, V2]>,
46
- ): { readonly [$$Key$$: K2]: V2 };
46
+ ): { readonly [$$Key$$ in K2]: V2 };
47
47
  export declare function objMap<V, V2, K extends string = string>(
48
- obj: { readonly [$$Key$$: K]: V },
48
+ obj: { readonly [$$Key$$ in K]: V },
49
49
  mapper: ($$PARAM_0$$: V, $$PARAM_1$$: K) => V2,
50
- ): { readonly [$$Key$$: K]: V2 };
50
+ ): { readonly [$$Key$$ in K]: V2 };
51
51
  export declare class Pipe<T> {
52
52
  value: T;
53
53
  constructor(val: T);
@@ -59,8 +59,10 @@ export declare const arraySort: <T>(
59
59
  arr: ReadonlyArray<T>,
60
60
  fn?: ($$PARAM_0$$: T, $$PARAM_1$$: T) => number,
61
61
  ) => ReadonlyArray<T>;
62
+ export declare type arraySort = typeof arraySort;
62
63
  export declare const arrayEquals: <T>(
63
64
  arr1: ReadonlyArray<T>,
64
65
  arr2: ReadonlyArray<T>,
65
- equals: ($$PARAM_0$$: T, $$PARAM_1$$: T) => boolean,
66
+ equals?: ($$PARAM_0$$: T, $$PARAM_1$$: T) => boolean,
66
67
  ) => boolean;
68
+ export declare type arrayEquals = typeof arrayEquals;
@@ -14,7 +14,7 @@ import type { CompiledStyles } from '../common-types';
14
14
  // eslint-disable-next-line no-unused-vars
15
15
  type AnyObject = { +[string]: mixed };
16
16
 
17
- declare export function isPlainObject(obj: mixed): obj is AnyObject;
17
+ declare export function isPlainObject(obj: mixed): implies obj is AnyObject;
18
18
 
19
19
  declare export function flattenObject(obj: CompiledStyles): {
20
20
  +[string]: null | string,
@@ -74,5 +74,5 @@ declare export const arraySort: <T>(
74
74
  declare export const arrayEquals: <T>(
75
75
  arr1: $ReadOnlyArray<T>,
76
76
  arr2: $ReadOnlyArray<T>,
77
- equals: (T, T) => boolean,
77
+ equals?: (T, T) => boolean,
78
78
  ) => boolean;
@@ -10,6 +10,8 @@
10
10
  export declare const sortPseudos: (
11
11
  pseudos: ReadonlyArray<string>,
12
12
  ) => ReadonlyArray<string>;
13
+ export declare type sortPseudos = typeof sortPseudos;
13
14
  export declare const sortAtRules: (
14
15
  atRules: ReadonlyArray<string>,
15
16
  ) => ReadonlyArray<string>;
17
+ export declare type sortAtRules = typeof sortAtRules;
@@ -19,4 +19,6 @@ declare function transformValue(
19
19
  export default transformValue;
20
20
  export declare function getNumberSuffix(key: string): string;
21
21
  export declare const timeUnits: Set<string>;
22
+ export declare type timeUnits = typeof timeUnits;
22
23
  export declare const lengthUnits: Set<string>;
24
+ export declare type lengthUnits = typeof lengthUnits;
@@ -9,4 +9,6 @@
9
9
 
10
10
  import type { TRawValue } from './common-types';
11
11
 
12
- declare export default function validateEntry([string, TRawValue]): void;
12
+ declare export default function validateEntry(
13
+ $$PARAM_0$$: [string, TRawValue],
14
+ ): void;
@@ -17,8 +17,8 @@ import type { StyleXOptions } from '../common-types';
17
17
  * @returns A :where() clause for the ancestor observer
18
18
  */
19
19
  export declare function ancestor(
20
- pseudo: string,
21
- options: string | StyleXOptions,
20
+ pseudo: `:${string}`,
21
+ options?: string | StyleXOptions,
22
22
  ): string;
23
23
  /**
24
24
  * Creates selector that observes if the given pseudo-class is
@@ -28,8 +28,8 @@ export declare function ancestor(
28
28
  * @returns A :has() clause for the descendant observer
29
29
  */
30
30
  export declare function descendant(
31
- pseudo: string,
32
- options: string | StyleXOptions,
31
+ pseudo: `:${string}`,
32
+ options?: string | StyleXOptions,
33
33
  ): string;
34
34
  /**
35
35
  * Creates selector that observes if the given pseudo-class is
@@ -39,8 +39,8 @@ export declare function descendant(
39
39
  * @returns A :where() clause for the previous sibling observer
40
40
  */
41
41
  export declare function siblingBefore(
42
- pseudo: string,
43
- options: string | StyleXOptions,
42
+ pseudo: `:${string}`,
43
+ options?: string | StyleXOptions,
44
44
  ): string;
45
45
  /**
46
46
  * Creates selector that observes if the given pseudo-class is
@@ -50,8 +50,8 @@ export declare function siblingBefore(
50
50
  * @returns A :has() clause for the next sibling observer
51
51
  */
52
52
  export declare function siblingAfter(
53
- pseudo: string,
54
- options: string | StyleXOptions,
53
+ pseudo: `:${string}`,
54
+ options?: string | StyleXOptions,
55
55
  ): string;
56
56
  /**
57
57
  * Creates selector that observes if the given pseudo-class is
@@ -61,6 +61,6 @@ export declare function siblingAfter(
61
61
  * @returns A :where() clause for the any sibling observer
62
62
  */
63
63
  export declare function anySibling(
64
- pseudo: string,
65
- options: string | StyleXOptions,
64
+ pseudo: `:${string}`,
65
+ options?: string | StyleXOptions,
66
66
  ): string;
@@ -18,8 +18,8 @@ import type { StyleXOptions } from '../common-types';
18
18
  * @returns A :where() clause for the ancestor observer
19
19
  */
20
20
  declare export function ancestor(
21
- pseudo: string,
22
- options: string | StyleXOptions,
21
+ pseudo: StringPrefix<':'>,
22
+ options?: string | StyleXOptions,
23
23
  ): string;
24
24
 
25
25
  /**
@@ -30,8 +30,8 @@ declare export function ancestor(
30
30
  * @returns A :has() clause for the descendant observer
31
31
  */
32
32
  declare export function descendant(
33
- pseudo: string,
34
- options: string | StyleXOptions,
33
+ pseudo: StringPrefix<':'>,
34
+ options?: string | StyleXOptions,
35
35
  ): string;
36
36
 
37
37
  /**
@@ -42,8 +42,8 @@ declare export function descendant(
42
42
  * @returns A :where() clause for the previous sibling observer
43
43
  */
44
44
  declare export function siblingBefore(
45
- pseudo: string,
46
- options: string | StyleXOptions,
45
+ pseudo: StringPrefix<':'>,
46
+ options?: string | StyleXOptions,
47
47
  ): string;
48
48
 
49
49
  /**
@@ -54,8 +54,8 @@ declare export function siblingBefore(
54
54
  * @returns A :has() clause for the next sibling observer
55
55
  */
56
56
  declare export function siblingAfter(
57
- pseudo: string,
58
- options: string | StyleXOptions,
57
+ pseudo: StringPrefix<':'>,
58
+ options?: string | StyleXOptions,
59
59
  ): string;
60
60
 
61
61
  /**
@@ -66,6 +66,6 @@ declare export function siblingAfter(
66
66
  * @returns A :where() clause for the any sibling observer
67
67
  */
68
68
  declare export function anySibling(
69
- pseudo: string,
70
- options: string | StyleXOptions,
69
+ pseudo: StringPrefix<':'>,
70
+ options?: string | StyleXOptions,
71
71
  ): string;
@@ -34,6 +34,7 @@ export type FunctionConfig = {
34
34
  };
35
35
  };
36
36
  };
37
+ disableImports?: boolean;
37
38
  };
38
39
  type Result =
39
40
  | { resolved: true; value: any }
@@ -41,8 +42,8 @@ type Result =
41
42
  export declare function evaluate(
42
43
  path: NodePath,
43
44
  traversalState: StateManager,
44
- functions: FunctionConfig,
45
- seen: Map<t.Node, Result>,
45
+ functions?: FunctionConfig,
46
+ seen?: Map<t.Node, Result>,
46
47
  ): Readonly<{
47
48
  confident: boolean;
48
49
  value: any;
@@ -37,6 +37,7 @@ export type FunctionConfig = {
37
37
  },
38
38
  },
39
39
  },
40
+ disableImports?: boolean,
40
41
  };
41
42
 
42
43
  type Result =
@@ -51,8 +52,8 @@ type Result =
51
52
  declare export function evaluate(
52
53
  path: NodePath<>,
53
54
  traversalState: StateManager,
54
- functions: FunctionConfig,
55
- seen: Map<t.Node, Result>,
55
+ functions?: FunctionConfig,
56
+ seen?: Map<t.Node, Result>,
56
57
  ): $ReadOnly<{
57
58
  confident: boolean,
58
59
  value: any,
@@ -8,15 +8,30 @@
8
8
  */
9
9
 
10
10
  export declare const IMPORT_FILE_PARSING_ERROR: any;
11
+ export declare type IMPORT_FILE_PARSING_ERROR =
12
+ typeof IMPORT_FILE_PARSING_ERROR;
11
13
  export declare const IMPORT_FILE_EVAL_ERROR: any;
14
+ export declare type IMPORT_FILE_EVAL_ERROR = typeof IMPORT_FILE_EVAL_ERROR;
12
15
  export declare const DEFAULT_IMPORT: any;
16
+ export declare type DEFAULT_IMPORT = typeof DEFAULT_IMPORT;
13
17
  export declare const PATH_WITHOUT_NODE: any;
18
+ export declare type PATH_WITHOUT_NODE = typeof PATH_WITHOUT_NODE;
14
19
  export declare const UNEXPECTED_MEMBER_LOOKUP: any;
20
+ export declare type UNEXPECTED_MEMBER_LOOKUP = typeof UNEXPECTED_MEMBER_LOOKUP;
15
21
  export declare const IMPORT_PATH_RESOLUTION_ERROR: any;
22
+ export declare type IMPORT_PATH_RESOLUTION_ERROR =
23
+ typeof IMPORT_PATH_RESOLUTION_ERROR;
16
24
  export declare const NON_CONSTANT: 'Referenced value is not a constant.\n\n';
25
+ export declare type NON_CONSTANT = typeof NON_CONSTANT;
17
26
  export declare const USED_BEFORE_DECLARATION: 'Referenced value is used before declaration.\n\n';
27
+ export declare type USED_BEFORE_DECLARATION = typeof USED_BEFORE_DECLARATION;
18
28
  export declare const UNINITIALIZED_CONST: 'Referenced constant is not initialized.\n\n';
29
+ export declare type UNINITIALIZED_CONST = typeof UNINITIALIZED_CONST;
19
30
  export declare const UNDEFINED_CONST: 'Referenced constant is not defined.';
31
+ export declare type UNDEFINED_CONST = typeof UNDEFINED_CONST;
20
32
  export declare const UNSUPPORTED_OPERATOR: (op: string) => string;
33
+ export declare type UNSUPPORTED_OPERATOR = typeof UNSUPPORTED_OPERATOR;
21
34
  export declare const OBJECT_METHOD: 'Unsupported object method.\n\n';
35
+ export declare type OBJECT_METHOD = typeof OBJECT_METHOD;
22
36
  export declare const UNSUPPORTED_EXPRESSION: (type: string) => string;
37
+ export declare type UNSUPPORTED_EXPRESSION = typeof UNSUPPORTED_EXPRESSION;
@@ -7,7 +7,6 @@
7
7
  *
8
8
  */
9
9
 
10
- import type { FlatCompiledStyles } from '../shared/common-types';
11
10
  import * as t from '@babel/types';
12
11
  type NestedStringObject = Readonly<{
13
12
  [key: string]: string | number | null | boolean | NestedStringObject;
@@ -15,6 +14,3 @@ type NestedStringObject = Readonly<{
15
14
  export declare function convertObjectToAST(
16
15
  obj: NestedStringObject,
17
16
  ): t.ObjectExpression;
18
- export declare function removeObjectsWithSpreads(obj: {
19
- readonly [$$Key$$: string]: FlatCompiledStyles;
20
- }): { readonly [$$Key$$: string]: FlatCompiledStyles };
@@ -7,8 +7,6 @@
7
7
  * @flow strict
8
8
  */
9
9
 
10
- import type { FlatCompiledStyles } from '../shared/common-types';
11
-
12
10
  import * as t from '@babel/types';
13
11
 
14
12
  type NestedStringObject = $ReadOnly<{
@@ -18,7 +16,3 @@ type NestedStringObject = $ReadOnly<{
18
16
  declare export function convertObjectToAST(
19
17
  obj: NestedStringObject,
20
18
  ): t.ObjectExpression;
21
-
22
- declare export function removeObjectsWithSpreads(obj: {
23
- +[string]: FlatCompiledStyles,
24
- }): { +[string]: FlatCompiledStyles };