builder.io 1.6.10 → 1.6.12

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 (57) hide show
  1. package/cli/index.cjs +323 -324
  2. package/cli/index.cjs.map +4 -4
  3. package/cli/main.cjs +2 -2
  4. package/core/index.cjs +58 -58
  5. package/core/index.mjs +58 -58
  6. package/figma/jsx-runtime/index.d.ts +2 -2
  7. package/figma/jsx-runtime/prop-types.d.ts +9 -9
  8. package/figma/jsx-runtime/react.d.ts +101 -105
  9. package/node/index.cjs +46 -47
  10. package/node/index.mjs +46 -47
  11. package/package.json +1 -1
  12. package/remix/build.cjs +1 -1
  13. package/remix/index.mjs +1 -1
  14. package/remix/server-build/index.cjs +3 -3
  15. package/server/index.cjs +119 -119
  16. package/server/index.mjs +119 -119
  17. package/types/_tests_/code.e2e.d.ts +1 -0
  18. package/types/_tests_/create-builder.e2e.d.ts +1 -0
  19. package/types/_tests_/figma-generate.e2e.d.ts +1 -0
  20. package/types/_tests_/figma-publish.e2e.d.ts +1 -0
  21. package/types/_tests_/help.e2e.d.ts +1 -0
  22. package/types/_tests_/utils.d.ts +42 -0
  23. package/types/_tests_/vitest.config.d.ts +2 -0
  24. package/types/cli/builder-add/options.d.ts +1 -1
  25. package/types/cli/code-file-utils.d.ts +1 -1
  26. package/types/cli/credentials.d.ts +1 -1
  27. package/types/cli/figma-publish.d.ts +3 -1
  28. package/types/cli/index.d.ts +2 -0
  29. package/types/cli/spinner.d.ts +0 -1
  30. package/types/cli/track.d.ts +1 -1
  31. package/types/common/ast/component-input-types.d.ts +1 -1
  32. package/types/common/builder/builder-api.d.ts +1 -1
  33. package/types/common/builder/content-generation.d.ts +1 -1
  34. package/types/common/test-utils.d.ts +1 -1
  35. package/types/core/adapters/next/next-test-utils.d.ts +5 -5
  36. package/types/core/adapters/react/react-test-utils.d.ts +2 -2
  37. package/types/core/adapters/remix/remix-test-utils.d.ts +2 -2
  38. package/types/figma/index.d.ts +0 -1
  39. package/types/server/request-handler.d.ts +0 -1
  40. package/types/tsconfig.tsbuildinfo +1 -0
  41. package/types/types.d.ts +0 -1
  42. package/types/vitest.config.d.ts +2 -0
  43. package/vite/index.cjs +3 -3
  44. package/vite/index.d.ts +1 -1
  45. package/vite/index.mjs +3 -3
  46. package/webpack/index.cjs +1 -1
  47. package/webpack/index.d.ts +1 -1
  48. package/webpack/index.mjs +1 -1
  49. package/types/cli/kv.d.ts +0 -20
  50. package/types/cli/main.d.cts +0 -2
  51. package/types/figma/jsx-runtime/index.d.cts +0 -2
  52. package/types/figma/jsx-runtime/index.d.ts +0 -2
  53. package/types/next/index.d.cts +0 -4
  54. package/types/next/index.d.mts +0 -4
  55. package/types/remix/index-shim.d.cts +0 -2
  56. /package/types/vite/{index.d.ts → main.d.ts} +0 -0
  57. /package/types/webpack/{index.d.ts → main.d.ts} +0 -0
@@ -31,7 +31,7 @@ export namespace JSX {
31
31
  export function jsx(
32
32
  type: React.ElementType,
33
33
  props: unknown,
34
- key?: React.Key
34
+ key?: React.Key,
35
35
  ): React.ReactElement;
36
36
 
37
37
  /**
@@ -42,5 +42,5 @@ export function jsx(
42
42
  export function jsxs(
43
43
  type: React.ElementType,
44
44
  props: unknown,
45
- key?: React.Key
45
+ key?: React.Key,
46
46
  ): React.ReactElement;
@@ -40,7 +40,7 @@ export interface Validator<T> {
40
40
  propName: string,
41
41
  componentName: string,
42
42
  location: string,
43
- propFullName: string
43
+ propFullName: string,
44
44
  ): Error | null;
45
45
  [nominalTypeHack]?:
46
46
  | {
@@ -64,8 +64,8 @@ export type WeakValidationMap<T> = {
64
64
  [K in keyof T]?: null extends T[K]
65
65
  ? Validator<T[K] | null | undefined>
66
66
  : undefined extends T[K]
67
- ? Validator<T[K] | null | undefined>
68
- : Validator<T[K]>;
67
+ ? Validator<T[K] | null | undefined>
68
+ : Validator<T[K]>;
69
69
  };
70
70
 
71
71
  export type InferType<V> = V extends Validator<infer T> ? T : any;
@@ -84,21 +84,21 @@ export const element: Requireable<ReactElementLike>;
84
84
  export const symbol: Requireable<symbol>;
85
85
  export const elementType: Requireable<ReactComponentLike>;
86
86
  export function instanceOf<T>(
87
- expectedClass: new (...args: any[]) => T
87
+ expectedClass: new (...args: any[]) => T,
88
88
  ): Requireable<T>;
89
89
  export function oneOf<T>(types: readonly T[]): Requireable<T>;
90
90
  export function oneOfType<T extends Validator<any>>(
91
- types: T[]
91
+ types: T[],
92
92
  ): Requireable<NonNullable<InferType<T>>>;
93
93
  export function arrayOf<T>(type: Validator<T>): Requireable<T[]>;
94
94
  export function objectOf<T>(
95
- type: Validator<T>
95
+ type: Validator<T>,
96
96
  ): Requireable<{ [K in keyof any]: T }>;
97
97
  export function shape<P extends ValidationMap<any>>(
98
- type: P
98
+ type: P,
99
99
  ): Requireable<InferProps<P>>;
100
100
  export function exact<P extends ValidationMap<any>>(
101
- type: P
101
+ type: P,
102
102
  ): Requireable<Required<InferProps<P>>>;
103
103
 
104
104
  /**
@@ -116,7 +116,7 @@ export function checkPropTypes(
116
116
  values: any,
117
117
  location: string,
118
118
  componentName: string,
119
- getStack?: () => any
119
+ getStack?: () => any,
120
120
  ): void;
121
121
 
122
122
  /**
@@ -85,7 +85,7 @@ declare namespace React {
85
85
  */
86
86
  type ElementType<
87
87
  P = any,
88
- Tag extends keyof JSX.IntrinsicElements = keyof JSX.IntrinsicElements
88
+ Tag extends keyof JSX.IntrinsicElements = keyof JSX.IntrinsicElements,
89
89
  > =
90
90
  | { [K in Tag]: P extends JSX.IntrinsicElements[K] ? K : never }[Tag]
91
91
  | ComponentType<P>;
@@ -121,7 +121,7 @@ declare namespace React {
121
121
  *
122
122
  * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-stateless-function-components React Docs}
123
123
  */
124
- deprecatedLegacyContext?: any
124
+ deprecatedLegacyContext?: any,
125
125
  ) => ReactNode)
126
126
  | (new (
127
127
  props: P,
@@ -130,7 +130,7 @@ declare namespace React {
130
130
  *
131
131
  * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
132
132
  */
133
- deprecatedLegacyContext?: any
133
+ deprecatedLegacyContext?: any,
134
134
  ) => Component<any, any>);
135
135
 
136
136
  /**
@@ -171,7 +171,7 @@ declare namespace React {
171
171
  */
172
172
  type RefCallback<T> = {
173
173
  bivarianceHack(
174
- instance: T | null
174
+ instance: T | null,
175
175
  ):
176
176
  | void
177
177
  | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES];
@@ -221,7 +221,7 @@ declare namespace React {
221
221
  | ForwardRefExoticComponent<any>
222
222
  | { new (props: any): Component<any> }
223
223
  | ((props: any, deprecatedLegacyContext?: any) => ReactNode)
224
- | keyof JSX.IntrinsicElements
224
+ | keyof JSX.IntrinsicElements,
225
225
  > =
226
226
  // need to check first if `ref` is a valid prop for ts@3.0
227
227
  // otherwise it will infer `{}` instead of `never`
@@ -326,7 +326,7 @@ declare namespace React {
326
326
  P = any,
327
327
  T extends string | JSXElementConstructor<any> =
328
328
  | string
329
- | JSXElementConstructor<any>
329
+ | JSXElementConstructor<any>,
330
330
  > {
331
331
  type: T;
332
332
  props: P;
@@ -338,7 +338,10 @@ declare namespace React {
338
338
  */
339
339
  export interface ReactComponentElement<
340
340
  T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
341
- P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, "key" | "ref">>
341
+ P = Pick<
342
+ ComponentProps<T>,
343
+ Exclude<keyof ComponentProps<T>, "key" | "ref">
344
+ >,
342
345
  > extends ReactElement<P, Exclude<T, number>> {}
343
346
 
344
347
  export interface FunctionComponentElement<P>
@@ -354,7 +357,7 @@ declare namespace React {
354
357
 
355
358
  export type CElement<
356
359
  P,
357
- T extends Component<P, ComponentState>
360
+ T extends Component<P, ComponentState>,
358
361
  > = ComponentElement<P, T>;
359
362
  export interface ComponentElement<P, T extends Component<P, ComponentState>>
360
363
  extends ReactElement<P, ComponentClass<P>> {
@@ -372,7 +375,7 @@ declare namespace React {
372
375
  // string fallback for custom web-components
373
376
  export interface DOMElement<
374
377
  P extends HTMLAttributes<T> | SVGAttributes<T>,
375
- T extends Element
378
+ T extends Element,
376
379
  > extends ReactElement<P, string> {
377
380
  ref: LegacyRef<T>;
378
381
  }
@@ -383,7 +386,7 @@ declare namespace React {
383
386
 
384
387
  export interface DetailedReactHTMLElement<
385
388
  P extends HTMLAttributes<T>,
386
- T extends HTMLElement
389
+ T extends HTMLElement,
387
390
  > extends DOMElement<P, T> {
388
391
  type: keyof ReactHTML;
389
392
  }
@@ -424,7 +427,7 @@ declare namespace React {
424
427
 
425
428
  export type CFactory<
426
429
  P,
427
- T extends Component<P, ComponentState>
430
+ T extends Component<P, ComponentState>,
428
431
  > = ComponentFactory<P, T>;
429
432
  export type ClassicFactory<P> = CFactory<
430
433
  P,
@@ -441,7 +444,7 @@ declare namespace React {
441
444
 
442
445
  export interface DetailedHTMLFactory<
443
446
  P extends HTMLAttributes<T>,
444
- T extends HTMLElement
447
+ T extends HTMLElement,
445
448
  > extends DOMFactory<P, T> {
446
449
  (
447
450
  props?: (ClassAttributes<T> & P) | null,
@@ -531,25 +534,25 @@ declare namespace React {
531
534
  // DOM Elements
532
535
  /** @deprecated */
533
536
  function createFactory<T extends HTMLElement>(
534
- type: keyof ReactHTML
537
+ type: keyof ReactHTML,
535
538
  ): HTMLFactory<T>;
536
539
  /** @deprecated */
537
540
  function createFactory(type: keyof ReactSVG): SVGFactory;
538
541
  /** @deprecated */
539
542
  function createFactory<P extends DOMAttributes<T>, T extends Element>(
540
- type: string
543
+ type: string,
541
544
  ): DOMFactory<P, T>;
542
545
 
543
546
  // Custom components
544
547
  /** @deprecated */
545
548
  function createFactory<P>(
546
- type: FunctionComponent<P>
549
+ type: FunctionComponent<P>,
547
550
  ): FunctionComponentFactory<P>;
548
551
  /** @deprecated */
549
552
  function createFactory<
550
553
  P,
551
554
  T extends Component<P, ComponentState>,
552
- C extends ComponentClass<P>
555
+ C extends ComponentClass<P>,
553
556
  >(type: ClassType<P, T, C>): CFactory<P, T>;
554
557
  /** @deprecated */
555
558
  function createFactory<P>(type: ComponentClass<P>): Factory<P>;
@@ -593,7 +596,7 @@ declare namespace React {
593
596
  function createElement<
594
597
  P extends {},
595
598
  T extends Component<P, ComponentState>,
596
- C extends ComponentClass<P>
599
+ C extends ComponentClass<P>,
597
600
  >(
598
601
  type: ClassType<P, T, C>,
599
602
  props?: (ClassAttributes<T> & P) | null,
@@ -725,9 +728,8 @@ declare namespace React {
725
728
  * // ContextType = { foo: string }
726
729
  * ```
727
730
  */
728
- export type ContextType<C extends Context<any>> = C extends Context<infer T>
729
- ? T
730
- : never;
731
+ export type ContextType<C extends Context<any>> =
732
+ C extends Context<infer T> ? T : never;
731
733
 
732
734
  /**
733
735
  * Wraps your components to specify the value of this context for all components inside.
@@ -824,11 +826,11 @@ declare namespace React {
824
826
  function createContext<T>(
825
827
  // If you thought this should be optional, see
826
828
  // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24509#issuecomment-382213106
827
- defaultValue: T
829
+ defaultValue: T,
828
830
  ): Context<T>;
829
831
 
830
832
  function isValidElement<P>(
831
- object: {} | null | undefined
833
+ object: {} | null | undefined,
832
834
  ): object is ReactElement<P>;
833
835
 
834
836
  /**
@@ -837,18 +839,18 @@ declare namespace React {
837
839
  const Children: {
838
840
  map<T, C>(
839
841
  children: C | readonly C[],
840
- fn: (child: C, index: number) => T
842
+ fn: (child: C, index: number) => T,
841
843
  ): C extends null | undefined
842
844
  ? C
843
845
  : Array<Exclude<T, boolean | null | undefined>>;
844
846
  forEach<C>(
845
847
  children: C | readonly C[],
846
- fn: (child: C, index: number) => void
848
+ fn: (child: C, index: number) => void,
847
849
  ): void;
848
850
  count(children: any): number;
849
851
  only<C>(children: C): C extends any[] ? never : C;
850
852
  toArray(
851
- children: ReactNode | ReactNode[]
853
+ children: ReactNode | ReactNode[],
852
854
  ): Array<Exclude<ReactNode, boolean | null | undefined>>;
853
855
  };
854
856
  /**
@@ -980,7 +982,7 @@ declare namespace React {
980
982
  *
981
983
  * @see {@link https://react.dev/reference/react/Profiler#onrender-callback React Docs}
982
984
  */
983
- commitTime: number
985
+ commitTime: number,
984
986
  ) => void;
985
987
 
986
988
  /**
@@ -1073,10 +1075,10 @@ declare namespace React {
1073
1075
  state:
1074
1076
  | ((
1075
1077
  prevState: Readonly<S>,
1076
- props: Readonly<P>
1078
+ props: Readonly<P>,
1077
1079
  ) => Pick<S, K> | S | null)
1078
1080
  | (Pick<S, K> | S | null),
1079
- callback?: () => void
1081
+ callback?: () => void,
1080
1082
  ): void;
1081
1083
 
1082
1084
  forceUpdate(callback?: () => void): void;
@@ -1183,7 +1185,7 @@ declare namespace React {
1183
1185
  *
1184
1186
  * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
1185
1187
  */
1186
- deprecatedLegacyContext?: any
1188
+ deprecatedLegacyContext?: any,
1187
1189
  ): ReactNode;
1188
1190
  /**
1189
1191
  * Used to declare the types of the props accepted by the
@@ -1270,7 +1272,7 @@ declare namespace React {
1270
1272
  *
1271
1273
  * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
1272
1274
  */
1273
- deprecatedLegacyContext?: any
1275
+ deprecatedLegacyContext?: any,
1274
1276
  ): ReactNode;
1275
1277
  propTypes?: WeakValidationMap<P> | undefined;
1276
1278
  contextTypes?: ValidationMap<any> | undefined;
@@ -1348,7 +1350,7 @@ declare namespace React {
1348
1350
  *
1349
1351
  * @see {@link https://legacy.reactjs.org/docs/legacy-context.html#referencing-context-in-lifecycle-methods React Docs}
1350
1352
  */
1351
- deprecatedLegacyContext?: any
1353
+ deprecatedLegacyContext?: any,
1352
1354
  ): Component<P, S>;
1353
1355
  /**
1354
1356
  * Used to declare the types of the props accepted by the
@@ -1401,10 +1403,10 @@ declare namespace React {
1401
1403
  * @see {@link https://www.npmjs.com/package/create-react-class `create-react-class` on npm}
1402
1404
  */
1403
1405
  interface ClassicComponentClass<P = {}> extends ComponentClass<P> {
1404
- new (props: P, deprecatedLegacyContext?: any): ClassicComponent<
1405
- P,
1406
- ComponentState
1407
- >;
1406
+ new (
1407
+ props: P,
1408
+ deprecatedLegacyContext?: any,
1409
+ ): ClassicComponent<P, ComponentState>;
1408
1410
  getDefaultProps?(): P;
1409
1411
  }
1410
1412
 
@@ -1420,7 +1422,7 @@ declare namespace React {
1420
1422
  type ClassType<
1421
1423
  P,
1422
1424
  T extends Component<P, ComponentState>,
1423
- C extends ComponentClass<P>
1425
+ C extends ComponentClass<P>,
1424
1426
  > = C & (new (props: P, deprecatedLegacyContext?: any) => T);
1425
1427
 
1426
1428
  //
@@ -1450,7 +1452,7 @@ declare namespace React {
1450
1452
  shouldComponentUpdate?(
1451
1453
  nextProps: Readonly<P>,
1452
1454
  nextState: Readonly<S>,
1453
- nextContext: any
1455
+ nextContext: any,
1454
1456
  ): boolean;
1455
1457
  /**
1456
1458
  * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
@@ -1499,7 +1501,7 @@ declare namespace React {
1499
1501
  */
1500
1502
  getSnapshotBeforeUpdate?(
1501
1503
  prevProps: Readonly<P>,
1502
- prevState: Readonly<S>
1504
+ prevState: Readonly<S>,
1503
1505
  ): SS | null;
1504
1506
  /**
1505
1507
  * Called immediately after updating occurs. Not called for the initial render.
@@ -1509,7 +1511,7 @@ declare namespace React {
1509
1511
  componentDidUpdate?(
1510
1512
  prevProps: Readonly<P>,
1511
1513
  prevState: Readonly<S>,
1512
- snapshot?: SS
1514
+ snapshot?: SS,
1513
1515
  ): void;
1514
1516
  }
1515
1517
 
@@ -1577,7 +1579,7 @@ declare namespace React {
1577
1579
  */
1578
1580
  UNSAFE_componentWillReceiveProps?(
1579
1581
  nextProps: Readonly<P>,
1580
- nextContext: any
1582
+ nextContext: any,
1581
1583
  ): void;
1582
1584
  /**
1583
1585
  * Called immediately before rendering when new props or state is received. Not called for the initial render.
@@ -1595,7 +1597,7 @@ declare namespace React {
1595
1597
  componentWillUpdate?(
1596
1598
  nextProps: Readonly<P>,
1597
1599
  nextState: Readonly<S>,
1598
- nextContext: any
1600
+ nextContext: any,
1599
1601
  ): void;
1600
1602
  /**
1601
1603
  * Called immediately before rendering when new props or state is received. Not called for the initial render.
@@ -1615,7 +1617,7 @@ declare namespace React {
1615
1617
  UNSAFE_componentWillUpdate?(
1616
1618
  nextProps: Readonly<P>,
1617
1619
  nextState: Readonly<S>,
1618
- nextContext: any
1620
+ nextContext: any,
1619
1621
  ): void;
1620
1622
  }
1621
1623
 
@@ -1697,7 +1699,7 @@ declare namespace React {
1697
1699
  * ```
1698
1700
  */
1699
1701
  function forwardRef<T, P = {}>(
1700
- render: ForwardRefRenderFunction<T, PropsWithoutRef<P>>
1702
+ render: ForwardRefRenderFunction<T, PropsWithoutRef<P>>,
1701
1703
  ): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
1702
1704
 
1703
1705
  /**
@@ -1754,12 +1756,13 @@ declare namespace React {
1754
1756
  * ```
1755
1757
  */
1756
1758
  type ComponentProps<
1757
- T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>
1758
- > = T extends JSXElementConstructor<infer P>
1759
- ? P
1760
- : T extends keyof JSX.IntrinsicElements
1761
- ? JSX.IntrinsicElements[T]
1762
- : {};
1759
+ T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
1760
+ > =
1761
+ T extends JSXElementConstructor<infer P>
1762
+ ? P
1763
+ : T extends keyof JSX.IntrinsicElements
1764
+ ? JSX.IntrinsicElements[T]
1765
+ : {};
1763
1766
 
1764
1767
  /**
1765
1768
  * Used to retrieve the props a component accepts with its ref. Can either be
@@ -1785,7 +1788,7 @@ declare namespace React {
1785
1788
  * ```
1786
1789
  */
1787
1790
  type ComponentPropsWithRef<T extends ElementType> = T extends new (
1788
- props: infer P
1791
+ props: infer P,
1789
1792
  ) => Component<any, any>
1790
1793
  ? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
1791
1794
  : PropsWithRef<ComponentProps<T>>;
@@ -1806,12 +1809,12 @@ declare namespace React {
1806
1809
  * ```
1807
1810
  */
1808
1811
  type CustomComponentPropsWithRef<T extends ComponentType> = T extends new (
1809
- props: infer P
1812
+ props: infer P,
1810
1813
  ) => Component<any, any>
1811
1814
  ? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
1812
1815
  : T extends (props: infer P, legacyContext?: any) => ReactNode
1813
- ? PropsWithRef<P>
1814
- : never;
1816
+ ? PropsWithRef<P>
1817
+ : never;
1815
1818
 
1816
1819
  /**
1817
1820
  * Used to retrieve the props a component accepts without its ref. Can either be
@@ -1840,13 +1843,14 @@ declare namespace React {
1840
1843
  ComponentProps<T>
1841
1844
  >;
1842
1845
 
1843
- type ComponentRef<T extends ElementType> = T extends NamedExoticComponent<
1844
- ComponentPropsWithoutRef<T> & RefAttributes<infer Method>
1845
- >
1846
- ? Method
1847
- : ComponentPropsWithRef<T> extends RefAttributes<infer Method>
1848
- ? Method
1849
- : never;
1846
+ type ComponentRef<T extends ElementType> =
1847
+ T extends NamedExoticComponent<
1848
+ ComponentPropsWithoutRef<T> & RefAttributes<infer Method>
1849
+ >
1850
+ ? Method
1851
+ : ComponentPropsWithRef<T> extends RefAttributes<infer Method>
1852
+ ? Method
1853
+ : never;
1850
1854
 
1851
1855
  // will show `Memo(${Component.displayName || Component.name})` in devtools by default,
1852
1856
  // but can be given its own specific name
@@ -1876,14 +1880,14 @@ declare namespace React {
1876
1880
  */
1877
1881
  function memo<P extends object>(
1878
1882
  Component: FunctionComponent<P>,
1879
- propsAreEqual?: (prevProps: Readonly<P>, nextProps: Readonly<P>) => boolean
1883
+ propsAreEqual?: (prevProps: Readonly<P>, nextProps: Readonly<P>) => boolean,
1880
1884
  ): NamedExoticComponent<P>;
1881
1885
  function memo<T extends ComponentType<any>>(
1882
1886
  Component: T,
1883
1887
  propsAreEqual?: (
1884
1888
  prevProps: Readonly<ComponentProps<T>>,
1885
- nextProps: Readonly<ComponentProps<T>>
1886
- ) => boolean
1889
+ nextProps: Readonly<ComponentProps<T>>,
1890
+ ) => boolean,
1887
1891
  ): MemoExoticComponent<T>;
1888
1892
 
1889
1893
  interface LazyExoticComponent<T extends ComponentType<any>>
@@ -1912,7 +1916,7 @@ declare namespace React {
1912
1916
  * ```
1913
1917
  */
1914
1918
  function lazy<T extends ComponentType<any>>(
1915
- load: () => Promise<{ default: T }>
1919
+ load: () => Promise<{ default: T }>,
1916
1920
  ): LazyExoticComponent<T>;
1917
1921
 
1918
1922
  //
@@ -1956,18 +1960,10 @@ declare namespace React {
1956
1960
  type ReducerWithoutAction<S> = (prevState: S) => S;
1957
1961
  // types used to try and prevent the compiler from reducing S
1958
1962
  // to a supertype common with the second argument to useReducer()
1959
- type ReducerState<R extends Reducer<any, any>> = R extends Reducer<
1960
- infer S,
1961
- any
1962
- >
1963
- ? S
1964
- : never;
1965
- type ReducerAction<R extends Reducer<any, any>> = R extends Reducer<
1966
- any,
1967
- infer A
1968
- >
1969
- ? A
1970
- : never;
1963
+ type ReducerState<R extends Reducer<any, any>> =
1964
+ R extends Reducer<infer S, any> ? S : never;
1965
+ type ReducerAction<R extends Reducer<any, any>> =
1966
+ R extends Reducer<any, infer A> ? A : never;
1971
1967
  // The identity check is done with the SameValue algorithm (Object.is), which is stricter than ===
1972
1968
  type ReducerStateWithoutAction<R extends ReducerWithoutAction<any>> =
1973
1969
  R extends ReducerWithoutAction<infer S> ? S : never;
@@ -1989,7 +1985,7 @@ declare namespace React {
1989
1985
  * @see {@link https://react.dev/reference/react/useContext}
1990
1986
  */
1991
1987
  function useContext<T>(
1992
- context: Context<T> /*, (not public API) observedBits?: number|boolean */
1988
+ context: Context<T> /*, (not public API) observedBits?: number|boolean */,
1993
1989
  ): T;
1994
1990
  /**
1995
1991
  * Returns a stateful value, and a function to update it.
@@ -1998,7 +1994,7 @@ declare namespace React {
1998
1994
  * @see {@link https://react.dev/reference/react/useState}
1999
1995
  */
2000
1996
  function useState<S>(
2001
- initialState: S | (() => S)
1997
+ initialState: S | (() => S),
2002
1998
  ): [S, Dispatch<SetStateAction<S>>];
2003
1999
  // convenience overload when first argument is omitted
2004
2000
  /**
@@ -2009,7 +2005,7 @@ declare namespace React {
2009
2005
  */
2010
2006
  function useState<S = undefined>(): [
2011
2007
  S | undefined,
2012
- Dispatch<SetStateAction<S | undefined>>
2008
+ Dispatch<SetStateAction<S | undefined>>,
2013
2009
  ];
2014
2010
  /**
2015
2011
  * An alternative to `useState`.
@@ -2025,7 +2021,7 @@ declare namespace React {
2025
2021
  function useReducer<R extends ReducerWithoutAction<any>, I>(
2026
2022
  reducer: R,
2027
2023
  initializerArg: I,
2028
- initializer: (arg: I) => ReducerStateWithoutAction<R>
2024
+ initializer: (arg: I) => ReducerStateWithoutAction<R>,
2029
2025
  ): [ReducerStateWithoutAction<R>, DispatchWithoutAction];
2030
2026
  /**
2031
2027
  * An alternative to `useState`.
@@ -2041,7 +2037,7 @@ declare namespace React {
2041
2037
  function useReducer<R extends ReducerWithoutAction<any>>(
2042
2038
  reducer: R,
2043
2039
  initializerArg: ReducerStateWithoutAction<R>,
2044
- initializer?: undefined
2040
+ initializer?: undefined,
2045
2041
  ): [ReducerStateWithoutAction<R>, DispatchWithoutAction];
2046
2042
  /**
2047
2043
  * An alternative to `useState`.
@@ -2059,7 +2055,7 @@ declare namespace React {
2059
2055
  function useReducer<R extends Reducer<any, any>, I>(
2060
2056
  reducer: R,
2061
2057
  initializerArg: I & ReducerState<R>,
2062
- initializer: (arg: I & ReducerState<R>) => ReducerState<R>
2058
+ initializer: (arg: I & ReducerState<R>) => ReducerState<R>,
2063
2059
  ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
2064
2060
  /**
2065
2061
  * An alternative to `useState`.
@@ -2075,7 +2071,7 @@ declare namespace React {
2075
2071
  function useReducer<R extends Reducer<any, any>, I>(
2076
2072
  reducer: R,
2077
2073
  initializerArg: I,
2078
- initializer: (arg: I) => ReducerState<R>
2074
+ initializer: (arg: I) => ReducerState<R>,
2079
2075
  ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
2080
2076
  /**
2081
2077
  * An alternative to `useState`.
@@ -2100,7 +2096,7 @@ declare namespace React {
2100
2096
  function useReducer<R extends Reducer<any, any>>(
2101
2097
  reducer: R,
2102
2098
  initialState: ReducerState<R>,
2103
- initializer?: undefined
2099
+ initializer?: undefined,
2104
2100
  ): [ReducerState<R>, Dispatch<ReducerAction<R>>];
2105
2101
  /**
2106
2102
  * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
@@ -2178,7 +2174,7 @@ declare namespace React {
2178
2174
  function useImperativeHandle<T, R extends T>(
2179
2175
  ref: Ref<T> | undefined,
2180
2176
  init: () => R,
2181
- deps?: DependencyList
2177
+ deps?: DependencyList,
2182
2178
  ): void;
2183
2179
  // I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
2184
2180
  // useCallback(X) is identical to just using X, useMemo(() => Y) is identical to just using Y.
@@ -2194,7 +2190,7 @@ declare namespace React {
2194
2190
  // eslint-disable-next-line @typescript-eslint/ban-types
2195
2191
  function useCallback<T extends Function>(
2196
2192
  callback: T,
2197
- deps: DependencyList
2193
+ deps: DependencyList,
2198
2194
  ): T;
2199
2195
  /**
2200
2196
  * `useMemo` will only recompute the memoized value when one of the `deps` has changed.
@@ -2294,7 +2290,7 @@ declare namespace React {
2294
2290
  */
2295
2291
  export function useInsertionEffect(
2296
2292
  effect: EffectCallback,
2297
- deps?: DependencyList
2293
+ deps?: DependencyList,
2298
2294
  ): void;
2299
2295
 
2300
2296
  /**
@@ -2307,7 +2303,7 @@ declare namespace React {
2307
2303
  export function useSyncExternalStore<Snapshot>(
2308
2304
  subscribe: (onStoreChange: () => void) => () => void,
2309
2305
  getSnapshot: () => Snapshot,
2310
- getServerSnapshot?: () => Snapshot
2306
+ getServerSnapshot?: () => Snapshot,
2311
2307
  ): Snapshot;
2312
2308
 
2313
2309
  //
@@ -4529,8 +4525,8 @@ declare namespace React {
4529
4525
  [K in keyof T]?: null extends T[K]
4530
4526
  ? Validator<T[K] | null | undefined>
4531
4527
  : undefined extends T[K]
4532
- ? Validator<T[K] | null | undefined>
4533
- : Validator<T[K]>;
4528
+ ? Validator<T[K] | null | undefined>
4529
+ : Validator<T[K]>;
4534
4530
  };
4535
4531
 
4536
4532
  /**
@@ -4566,18 +4562,18 @@ declare namespace React {
4566
4562
  interface ReactChildren {
4567
4563
  map<T, C>(
4568
4564
  children: C | readonly C[],
4569
- fn: (child: C, index: number) => T
4565
+ fn: (child: C, index: number) => T,
4570
4566
  ): C extends null | undefined
4571
4567
  ? C
4572
4568
  : Array<Exclude<T, boolean | null | undefined>>;
4573
4569
  forEach<C>(
4574
4570
  children: C | readonly C[],
4575
- fn: (child: C, index: number) => void
4571
+ fn: (child: C, index: number) => void,
4576
4572
  ): void;
4577
4573
  count(children: any): number;
4578
4574
  only<C>(children: C): C extends any[] ? never : C;
4579
4575
  toArray(
4580
- children: ReactNode | ReactNode[]
4576
+ children: ReactNode | ReactNode[],
4581
4577
  ): Array<Exclude<ReactNode, boolean | null | undefined>>;
4582
4578
  }
4583
4579
 
@@ -4661,14 +4657,14 @@ type MergePropTypes<P, T> =
4661
4657
  IsExactlyAny<P> extends true
4662
4658
  ? T
4663
4659
  : // If declared props have indexed properties, ignore inferred props entirely as keyof gets widened
4664
- string extends keyof P
4665
- ? P
4666
- : // Prefer declared types which are not exactly any
4667
- Pick<P, NotExactlyAnyPropertyKeys<P>> &
4668
- // For props which are exactly any, use the type inferred from propTypes if present
4669
- Pick<T, Exclude<keyof T, NotExactlyAnyPropertyKeys<P>>> &
4670
- // Keep leftover props not specified in propTypes
4671
- Pick<P, Exclude<keyof P, keyof T>>
4660
+ string extends keyof P
4661
+ ? P
4662
+ : // Prefer declared types which are not exactly any
4663
+ Pick<P, NotExactlyAnyPropertyKeys<P>> &
4664
+ // For props which are exactly any, use the type inferred from propTypes if present
4665
+ Pick<T, Exclude<keyof T, NotExactlyAnyPropertyKeys<P>>> &
4666
+ // Keep leftover props not specified in propTypes
4667
+ Pick<P, Exclude<keyof P, keyof T>>
4672
4668
  : never;
4673
4669
 
4674
4670
  type InexactPartial<T> = { [K in keyof T]?: T[K] | undefined };
@@ -4691,10 +4687,10 @@ type ReactManagedAttributes<C, P> = C extends {
4691
4687
  }
4692
4688
  ? Defaultize<MergePropTypes<P, PropTypes.InferProps<T>>, D>
4693
4689
  : C extends { propTypes: infer T }
4694
- ? MergePropTypes<P, PropTypes.InferProps<T>>
4695
- : C extends { defaultProps: infer D }
4696
- ? Defaultize<P, D>
4697
- : P;
4690
+ ? MergePropTypes<P, PropTypes.InferProps<T>>
4691
+ : C extends { defaultProps: infer D }
4692
+ ? Defaultize<P, D>
4693
+ : P;
4698
4694
 
4699
4695
  /**
4700
4696
  * @deprecated Use `React.JSX` instead of the global `JSX` namespace.