nrgy
Version:
The library for reactive programming using efficient computing and MVC/MVVM patterns
43 lines (40 loc) • 1.91 kB
TypeScript
export { B as BaseControllerContext, a as BaseService, C as Controller, d as ControllerClassDeclaration, j as ControllerConstructorError, b as ControllerContext, c as ControllerDeclaration, e as ControllerFactory, f as ControllerParams, g as ControllerParamsContext, E as ExtensionFn, h as ExtensionParams, i as ExtensionParamsProvider, k as declareController, l as provideControllerParams, p as provideExtensionParams } from './controller-BVEgCAYk.js';
import { V as ViewProps, a as ViewBinding } from './viewModel-CspUG5If.js';
export { B as BaseViewModel, I as InferViewPropsFromControllerContext, i as ViewControllerContext, b as ViewModel, e as ViewModelClassDeclaration, d as ViewModelDeclaration, c as ViewModelFactory, g as ViewPropAtoms, h as ViewStatus, f as declareViewModel, p as provideView, w as withView } from './viewModel-CspUG5If.js';
import './types-CxOJPpKX.js';
import './types-jkBBq3Lp.js';
import './atom-DIp83xZa.js';
/**
* ViewProxy implements the binding between the controller and the view.
*
* It can be used to represent a view inside unit tests for the controller.
*/
type ViewProxy<TProps extends ViewProps> = ViewBinding<TProps> & {
/**
* Mount the view
*/
readonly mount: () => void;
/**
* Update the view.
*
* @param props - The props that were updated
*/
readonly update: (props?: Partial<TProps>) => void;
/**
* Unmount the view
*/
readonly unmount: () => void;
/**
* Destroy the view
*/
readonly destroy: () => void;
};
/**
* Creates a view proxy that implements the view binding
*/
declare function createViewProxy(): ViewProxy<Record<string, never>>;
/**
* Creates a view proxy that implements the view binding
*/
declare function createViewProxy<TProps extends ViewProps>(initialProps: TProps): ViewProxy<TProps>;
export { ViewBinding, ViewProps, type ViewProxy, createViewProxy };