11import * as React from "react" ;
2- import { type Any } from "ts-toolbelt" ;
3- import { Function } from "ts-toolbelt" ;
42import { forEachNode , forEachNodeReplace } from "./forEachNode" ;
3+ import { NoInfer , Pretty } from "./typeUtils" ;
54
65type AllowedNodes = React . ElementType | StringConstructor | NumberConstructor ;
76
@@ -27,7 +26,7 @@ type OverrideNodeProps<
2726 T extends AllowedNodes ,
2827 U extends "throw" | "ignore" | "remove" = "throw" ,
2928 TNode = GetNode < T > ,
30- TProps = Any . Compute < GetProps < T > , "flat" > ,
29+ TProps = Pretty < GetProps < T > > ,
3130> = {
3231 /**
3332 * An array specifying allowed React intrinsic element names or custom component names.
@@ -92,14 +91,14 @@ export type OverrideNode = {
9291 | ( null extends T ? null : never ) ;
9392 /** Intercepts a call to a prop and executes the x function before the original function. */
9493 chainBefore : < T extends ( ...args : any [ ] ) => any > (
95- x : Function . NoInfer < T > ,
94+ x : NoInfer < T > ,
9695 ) => ( prop : T , propName : keyof any , slotName : string ) => T ;
9796 /** Intercepts a call to a prop and executes the x function after the original function. */
9897 chainAfter : < T extends ( ...args : any [ ] ) => any > (
99- x : Function . NoInfer < T > ,
98+ x : NoInfer < T > ,
10099 ) => ( prop : T , propName : keyof any , slotName : string ) => T ;
101100 /** Overrides prop */
102- override : < T > ( x : Function . NoInfer < T > ) => ( prop : T ) => T ;
101+ override : < T > ( x : NoInfer < T > ) => ( prop : T ) => T ;
103102} ;
104103
105104export const OverrideNode = ( ( ) => {
@@ -373,7 +372,7 @@ export function applyOverride(
373372 if ( typeof currentConfig . props === "function" ) {
374373 newChild = React . cloneElement (
375374 newChild ,
376- currentConfig . props ( newChild . props ) ,
375+ currentConfig . props ( newChild . props as any ) ,
377376 ) ;
378377 } else if (
379378 typeof currentConfig . props === "object" &&
0 commit comments