import { ReactHooksRenderer , ReactHooksServerRenderer , RenderHookOptions , RenderHookResult } from '../../types/react' ; type RendererResolvers = typeof rendererResolvers ; type Renderer = keyof RendererResolvers ; type InferredRenderer < TRenderers extends Renderer > = ReturnType < RendererResolvers [ TRenderers ] > ; declare global { function runForRenderers < TRenderers extends Renderer > ( renderers , fn ) ; function runForLazyRenderers < TRenderer extends Renderer > ( renderers , fn ) ; } function requireRenderer < TRendererType extends ReactHooksRenderer = ReactHooksRenderer > ( rendererName ) { let requirePath = `../../${ rendererName }` ; if ( rendererName . startsWith ( 'default' ) ) { requirePath = requirePath . replace ( '/default' , '' ) ; } return require ( requirePath ) as TRendererType ; } function hydratedServerRenderer ( baseRenderer ) { const { renderHook , ... otherImports } = requireRenderer < ReactHooksServerRenderer > ( baseRenderer ) ; return { renderHook < TProps , TResult > ( callback , options ? ) { const { hydrate , ... otherUtils } = renderHook < TProps , TResult > ( callback , options ) ; hydrate ( ) ; return { ... otherUtils } ; } , ... otherImports } ; } const rendererResolvers = { default : ( ) => requireRenderer ( 'default' ) , dom : ( ) => requireRenderer ( 'dom' ) , native : ( ) => requireRenderer ( 'native' ) , server : ( ) => requireRenderer < ReactHooksServerRenderer > ( 'server' ) , 'default/pure' : ( ) => requireRenderer ( 'default/pure' ) , 'dom/pure' : ( ) => requireRenderer ( 'dom/pure' ) , 'native/pure' : ( ) => requireRenderer ( 'native/pure' ) , 'server/pure' : ( ) => requireRenderer < ReactHooksServerRenderer > ( 'server/pure' ) , 'server/hydrated' : ( ) => hydratedServerRenderer ( 'server' ) , 'server/hydrated/pure' : ( ) => hydratedServerRenderer ( 'server/pure' ) } ; global . runForRenderers = function runForRenderers < TRenderer extends Renderer > ( renderers , fn ) : void { runForLazyRenderers ( renderers , ( getRenderer , rendererName ) => fn ( getRenderer ( ) , rendererName ) ) ; } ; global . runForLazyRenderers = function runForLazyRenderers < TRenderer extends Renderer > ( renderers , fn ) : void { renderers . forEach ( ( renderer ) => { describe ( renderer , ( ) => { fn ( ( ) => rendererResolvers [ renderer ] ( ) as InferredRenderer < TRenderer > , renderer ) ; } ) ; } ) ; } ; export { } ;