import { EventEmitter, TemplateRef } from '@angular/core'; import { LoadingState, NgxLoadWithDirective } from 'ngx-load-with'; import { Observable } from 'rxjs'; import * as i0 from "@angular/core"; export declare class NgxDataLoaderComponent { loadedTemplate?: TemplateRef; errorTemplate?: TemplateRef; loadingTemplate?: TemplateRef; /** * Function that returns an `Observable` of the data to be loaded. * Called on init and on reload. * * @example * loadFn = () => this.http.get('https://example.com/api/data') */ loadFn: (args?: any) => Observable; /** * Arguments to pass to `loadFn`. Changes to this property will trigger a reload. * * @example * loadFn = () => this.http.get('https://example.com/api/data') */ loadFnArgs?: any; /** * Data to be rendered on init. When set, `loadFn` will not be invoked on init. * The loading state will be set to `loaded`. */ initialData?: T; /** * Number of milliseconds to debounce reloads. * @defaultValue `0` | */ debounceTime: number; /** * Whether to keep displaying previously loaded data while reloading. * @defaultValue `false` */ showStaleData: boolean; /** * Delay in milliseconds before showing the loading template. * @defaultValue `0` */ loadingTemplateDelay: number; /** * Emits the data when loaded. */ dataLoaded: EventEmitter; /** * Emits the error when the data fails to load. */ loadAttemptFailed: EventEmitter; /** * Emits when the data loading completes (either successfully or unsuccessfully). */ loadAttemptFinished: EventEmitter; /** * Emits when the data loading starts. */ loadAttemptStarted: EventEmitter; /** * Emits the loading state when it changes. */ loadingStateChange: EventEmitter>; loader: NgxLoadWithDirective; setData(data: T): void; setError(error: Error): void; reload(): void; cancel(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "ngx-data-loader", never, { "loadFn": { "alias": "loadFn"; "required": false; }; "loadFnArgs": { "alias": "loadFnArgs"; "required": false; }; "initialData": { "alias": "initialData"; "required": false; }; "debounceTime": { "alias": "debounceTime"; "required": false; }; "showStaleData": { "alias": "showStaleData"; "required": false; }; "loadingTemplateDelay": { "alias": "loadingTemplateDelay"; "required": false; }; }, { "dataLoaded": "dataLoaded"; "loadAttemptFailed": "loadAttemptFailed"; "loadAttemptFinished": "loadAttemptFinished"; "loadAttemptStarted": "loadAttemptStarted"; "loadingStateChange": "loadingStateChange"; }, ["loadedTemplate", "errorTemplate", "loadingTemplate"], never, false, never>; }