UNPKG

@netgrif/components-core

Version:

Netgrif Application engine frontend core Angular library

46 lines (45 loc) 2.02 kB
import { Injector, OnDestroy } from '@angular/core'; import { TaskContentService } from './task-content.service'; import { FieldConverterService } from './field-converter.service'; import { SnackBarService } from '../../snack-bar/services/snack-bar.service'; import { TranslateService } from '@ngx-translate/core'; import { LoggerService } from '../../logger/services/logger.service'; import { Observable, ReplaySubject } from 'rxjs'; import { Task } from '../../resources/interface/task'; import * as i0 from "@angular/core"; /** * Provides an implementation of the {@link TaskContentService} abstract class that allows only a * single call to the setter of the managed Task object. * * If you want to use an unlimited number of calls use {@link UnlimitedTaskContentService} instead. */ export declare class SingleTaskContentService extends TaskContentService implements OnDestroy { /** * Acts as the underling stream for notifications on Task changes. * * `bufferSize` of the `ReplaySubject` instance is set to 1. */ protected _task$: ReplaySubject<Task>; constructor(_fieldConverterService: FieldConverterService, _snackBarService: SnackBarService, _translate: TranslateService, _logger: LoggerService, _injector: Injector); /** * @returns the Task object if set and `undefined` otherwise */ get task(): Task | undefined; /** * The task can be only set once. All other call do nothing and log an error. * @param task the Task that owns the content managed by this service */ set task(task: Task); /** * Stream returns a single {@link Task} object and then completes. * * Use [task]{@link TaskContentService#task} setter method to set the Task. */ get task$(): Observable<Task>; /** * Completes the underling stream. */ ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<SingleTaskContentService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<SingleTaskContentService>; }