import * as i0 from '@angular/core'; import { ModuleWithProviders, ElementRef, Injector } from '@angular/core'; import { IInjectable, StateRegistry, UIRouter } from '@uirouter/core'; import * as i1 from '@uirouter/angular'; import { Ng2StateDeclaration, StatesModule, ParentUIViewInject } from '@uirouter/angular'; import { Ng1StateDeclaration, Ng1StateTransitionHook } from '@uirouter/angularjs'; import * as i2 from '@angular/upgrade/static'; interface _NgHybridStateDeclaration extends Ng2StateDeclaration { onExit?: any; onRetain?: any; onEnter?: any; } interface _NgHybridStateModule extends StatesModule { states?: any; } interface NgHybridStateDeclaration extends _NgHybridStateDeclaration { onEnter?: Ng1StateTransitionHook | IInjectable; onRetain?: Ng1StateTransitionHook | IInjectable; onExit?: Ng1StateTransitionHook | IInjectable; } interface NgHybridStatesModule extends _NgHybridStateModule { states?: NgHybridStateDeclaration[]; } declare module '@uirouter/core/lib/state/stateRegistry' { interface StateRegistry { register(state: Ng1StateDeclaration): any; register(state: Ng2StateDeclaration): any; } } declare module '@uirouter/angularjs/lib/stateProvider' { interface StateProvider { state(name: string, definition: Ng1StateDeclaration): StateProvider; state(name: string, definition: Ng2StateDeclaration): StateProvider; state(definition: Ng1StateDeclaration): StateProvider; state(definition: Ng2StateDeclaration): StateProvider; } } /** * Create a ng1 module for the ng1 half of the hybrid application to depend on. * * Example: * const myApp = angular.module('myApp', ['ui.router.upgrade']); */ declare const upgradeModule: any; declare function objectFactory(): {}; /** * UIViewNgUpgrade is a component bridge from ng1 ui-view to ng2 ui-view * * When a ui-router for ng1 is registering a state it checks if a view's * `component:` is an ng2 Component class. If so, it creates a special ng1 template * which references this component, i.e., * * See that code by searching ng1-to-ng2 source for: "$stateProvider.decorator" * * --- * * ng1-to-ng2 component bridge process: * * 1) * When an ng1 template creates a ui-view which is targeted by a ng2 Component, * * ``` * Go to foo *
*
* ``` * * the state decorator spits out a custom template. That template loads this * ng2 Component adapter as a downgraded-to-ng1 directive. * * ``` * Go to foo *
* * *
* ``` * * This downgraded ng2 Component then creates a child UIView (ng2 component) * * ``` * Go to foo *
* * * * *
* ``` * * which in turn is filled with the routed ng2 component. * * ``` * Go to foo *
* * * *

ng2 routed component contents

*
*
*
*
* ``` * * This adapter exposes the parent view context (ParentUIViewInject) * as an ng2 DI Provider, which the nested ng2 UIView requires. * * It gets the ParentUIViewContext information (from the parent ng1 ui-view) by walking * up the DOM and grabbing the .data('$uiView') which the ng1 ui-view directive exposes. */ declare class UIViewNgUpgrade { name: string; constructor(ref: ElementRef, parent: ParentUIViewInject, registry: StateRegistry); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /********************************** * Ng2 @NgModule and bootstrap code **********************************/ declare function uiRouterUpgradeFactory(router: UIRouter, injector: Injector): UIRouter; declare function getUIRouter($injector: any): any; declare function getParentUIViewInject(r: StateRegistry): ParentUIViewInject; /** * This NgModule should be added to the root module of the hybrid app. */ declare class UIRouterUpgradeModule { static forRoot(module?: NgHybridStatesModule): ModuleWithProviders; static forChild(module?: NgHybridStatesModule): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { UIRouterUpgradeModule, UIViewNgUpgrade, getParentUIViewInject, getUIRouter, objectFactory, uiRouterUpgradeFactory, upgradeModule }; export type { NgHybridStateDeclaration, NgHybridStatesModule, _NgHybridStateDeclaration, _NgHybridStateModule };