@bespunky/angular-zen
Version:
The Angular tools you always wished were there.
27 lines (26 loc) • 1.19 kB
TypeScript
import { Observable } from 'rxjs';
import { ActivatedRouteSnapshot } from '@angular/router';
import { AnyObject } from '@bespunky/typescript-utils';
/**
* Creates an observable which emits the latest state of the published router outlets in the app.
* The emitted state is a dictionary of outlet names and corresponding component instances.
*
* @see `PublishComponentDirective` for more details.
*
* @export
* @return {Observable<Map<string, AnyObject | null>>} An observable which emits the latest state of the published router outlets in the app.
*/
export declare function useRouterOutletStateTracker(): Observable<Map<string, AnyObject | null>>;
export declare type ActivatedRouteWithComponent = {
component: AnyObject | null;
route: ActivatedRouteSnapshot;
};
/**
* Creates an observable which emits the latest component instance for the currently activated route.
*
* @see `PublishComponentDirective` for more details.
*
* @export
* @return {Observable<ActivatedRouteWithComponent>} An observable which emits the component instance for the currently activated route.
*/
export declare function useActivatedRouteComponent(): Observable<ActivatedRouteWithComponent>;