import React, { FC, PropsWithChildren } from 'react'; import { i as ExtensionParamsProvider, B as BaseControllerContext, a as BaseService, c as ControllerDeclaration } from './controller-BeiM0Zjy.cjs'; import { I as InferViewPropsFromControllerContext, V as ViewProps, i as ViewControllerContext, B as BaseViewModel, d as ViewModelDeclaration, j as InferViewModelProps } from './viewModel-DcZgBSw9.cjs'; import './types-CxOJPpKX.cjs'; import './types-Bej5aaZB.cjs'; import './atom-C10tpvQt.cjs'; /** * NrgyControllerExtension provides a way to add extension params * to view controller contexts of all its children. */ declare const NrgyControllerExtension: FC>; /** * Returns a controller instance for the given controller declaration. */ declare function useController(declaration: ControllerDeclaration): TService; /** * Returns a controller instance for the given controller declaration and props. */ declare function useController>(declaration: ControllerDeclaration, props: TProps): TService; /** * Returns parent's view controller that is provided for the given controller declaration. * * If the controller is not provided in the context, an error will be thrown. */ declare function useProvidedViewController(declaration: ControllerDeclaration): TService; /** * Returns parent's view controller that is provided for the given controller declaration. * * Optional view controller can be used when the controller is not provided in the context. */ declare function useOptionalViewController(declaration: ControllerDeclaration): TService | undefined; /** * Returns parent's view controller that is provided for the given controller declaration. * * Optional view controller can be used when the controller is not provided in the context. */ declare function useOptionalViewController(declaration: ControllerDeclaration, defaultValue: TDefault): TService | TDefault; /** * Provides a controller for a given controller declaration using a React context. */ declare const ViewControllerProvider: (props: PropsWithChildren<{ declaration: ControllerDeclaration; controller: TService; }>) => React.JSX.Element; /** * Creates a higher-order React component that provides a controller for a given view component. * * @param controllerDeclaration - Controller declaration */ declare function withViewController(controllerDeclaration: ControllerDeclaration, TService>): (ViewComponent: React.ComponentType) => FC; type InferHocComponent> = FC & TViewModelProps>>; /** * Creates a higher-order React component that provides a view model for a given view component. * * @param viewModelDeclaration - Controller declaration */ declare function withViewModel(viewModelDeclaration: ViewModelDeclaration>>): (ViewComponent: React.ComponentType>) => InferHocComponent; export { NrgyControllerExtension, ViewControllerProvider, useController, useOptionalViewController, useProvidedViewController, withViewController, withViewModel };