import { A as Atom, S as Signal } from './types-CxOJPpKX.js'; import { B as BaseControllerContext, E as ExtensionFn, i as ExtensionParamsProvider, b as ControllerContext, C as Controller, c as ControllerDeclaration, m as BaseController } from './controller-BVEgCAYk.js'; type AnyObject = Record; /** * ViewProps are the properties that are provided to the view */ type ViewProps = Record; /** * ViewPropAtoms are the atoms wit View's props that are provided * to the controller by the ViewBinding */ type ViewPropAtoms = TProps extends Record ? Record : Readonly<{ [K in keyof TProps]: Atom; }>; type ViewStatus = 'unmounted' | 'mounted' | 'destroyed'; /** * ViewBinding is the binding between the controller and the view */ type ViewBinding = { /** * View's props */ readonly props: ViewPropAtoms; readonly status: Atom; /** * Signals that the view has been mounted */ readonly onMount: Signal; /** * Signals that the view has been updated. * * Partial is the properties that were updated. */ readonly onUpdate: Signal>; /** * Signals that the view has been unmounted. */ readonly onUnmount: Signal; }; /** * ViewControllerContext is the context with the view binding * that is provided to the controller */ type ViewControllerContext = BaseControllerContext & { view: ViewBinding; }; /** * Utility type to infer the view props from the controller context */ type InferViewPropsFromControllerContext = TContext extends ViewControllerContext ? InferredProps : ElseType; /** * withView is an extension that provides the view to the controller */ declare function withView(): ExtensionFn>; /** * Provides the view binding to the controller */ declare function provideView(view: ViewBinding): ExtensionParamsProvider; type BaseViewModel = Record & { props?: Record>; state?: Record>; }; type ViewModel = T; type InferViewModelProps = TViewModel['props'] extends ViewPropAtoms ? InferredProps : AnyObject; type ViewModelFactory = (context: ControllerContext) => Omit; declare abstract class BaseViewController>> extends BaseController { readonly view: TContext['view']; readonly props: TContext['view']['props']; abstract readonly state: Exclude; constructor(paramsOrProviders: TContext['params'] | ReadonlyArray, extensions: ReadonlyArray>); } type ViewModelDeclaration>> = { /** @internal Keep the type for inference */ readonly __contextType?: TContext; /** @internal Keep the type for inference */ readonly __viewModelType?: TViewModel; new (): Controller; new (providers: ReadonlyArray): Controller; }; type ViewModelClassDeclaration>> = { /** @internal Keep the type for inference */ readonly __contextType?: TContext; readonly __viewModelType?: TViewModel; new (): BaseViewController; new (providers: ReadonlyArray): BaseViewController; }; declare class ViewModelDeclarationBuilder { readonly extensions: Array>; constructor(extensions?: Array>); extend(extension: ExtensionFn): ViewModelDeclarationBuilder; apply(factory: ViewModelFactory>, TViewModel>): ViewModelDeclaration>>; getBaseClass(): ViewModelClassDeclaration>>; } declare function declareViewModel>(factory: ViewModelFactory, TViewModel>): ControllerDeclaration, TViewModel>; declare function declareViewModel(): ViewModelDeclarationBuilder; export { type BaseViewModel as B, type InferViewPropsFromControllerContext as I, type ViewProps as V, type ViewBinding as a, type ViewModel as b, type ViewModelFactory as c, type ViewModelDeclaration as d, type ViewModelClassDeclaration as e, declareViewModel as f, type ViewPropAtoms as g, type ViewStatus as h, type ViewControllerContext as i, type InferViewModelProps as j, provideView as p, withView as w };