import { ComponentFactoryResolver, Provider } from '@angular/core'; import { Injector, ComponentRef, ViewContainerRef, TemplateRef } from '@angular/core'; import { Overlay } from '@angular/cdk/overlay'; import { Subject } from 'rxjs/Subject'; import { Observable } from 'rxjs/Observable'; import { AtLoadingContext } from '../directives/loading.directive'; import { LoadingStyle } from '../loading.component'; import { IAtLoadingConfig } from './loading.service'; export interface IInternalLoadingOptions extends IAtLoadingConfig { height?: number; style?: LoadingStyle; } export interface ILoadingRef { observable: Observable; componentRef: ComponentRef; subject?: Subject; times?: number; } /** * NOTE: @internal usage only. */ export declare class AtLoadingFactory { private _componentFactoryResolver; private _overlay; private _injector; constructor(_componentFactoryResolver: ComponentFactoryResolver, _overlay: Overlay, _injector: Injector); /** * Uses material `Overlay` services to create a DOM element and attach the loading component * into it. Leveraging the state and configuration from it. * * Saves a reference in context to be called when registering/resolving the loading element. */ createFullScreenComponent(options: IAtLoadingConfig): ILoadingRef; /** * Creates a loading component dynamically and attaches it into the given viewContainerRef. * Leverages TemplatePortals from material to inject the template inside of it so it fits * perfectly when overlaying it. * * Saves a reference in context to be called when registering/resolving the loading element. */ createOverlayComponent(options: IAtLoadingConfig, viewContainerRef: ViewContainerRef, templateRef: TemplateRef): ILoadingRef; /** * Creates a loading component dynamically and attaches it into the given viewContainerRef. * Replaces the template with the loading component depending if it was registered or resolved. * * Saves a reference in context to be called when registering/resolving the loading element. */ createReplaceComponent(options: IAtLoadingConfig, viewContainerRef: ViewContainerRef, templateRef: TemplateRef, context: AtLoadingContext): ILoadingRef; /** * Creates a fullscreen overlay for the loading usage. */ private _createOverlay(); /** * Creates a generic component dynamically waiting to be attached to a viewContainerRef. */ private _createComponent(options); /** * Initialize context for loading component. */ private _initializeContext(); /** * Maps configuration to the loading component instance. */ private _mapOptions(options, instance); } export declare function LOADING_FACTORY_PROVIDER_FACTORY(parent: AtLoadingFactory, componentFactoryResolver: ComponentFactoryResolver, overlay: Overlay, injector: Injector): AtLoadingFactory; export declare const LOADING_FACTORY_PROVIDER: Provider;