UNPKG

@netgrif/components-core

Version:

Netgrif Application engine frontend core Angular library

49 lines (48 loc) 2.31 kB
import { OnDestroy } from '@angular/core'; import { Observable, ReplaySubject } from 'rxjs'; import { ProcessService } from '../../process/process.service'; import { Net } from '../../process/net'; import * as i0 from "@angular/core"; /** * This service holds the information about the allowed nets for a specific view. */ export declare class AllowedNetsService implements OnDestroy { protected _processService: ProcessService; protected _allowedNets$: ReplaySubject<Array<Net>>; protected _allowedNets: Array<Net>; protected _allowedNetsIdentifiers$: ReplaySubject<Array<string>>; protected _allowedNetsIdentifiers: Array<string>; private subAllowedNets; /** * The service converts identifiers to {@link Net} objects on its own. * * When a new set of allowed nets is emitted into the input Observable the allowed nets for the view are updated. * * @param allowedNetIdentifiers$ identifiers of the allowed nets * @param _processService process service */ constructor(allowedNetIdentifiers$: Observable<Array<string>>, _processService: ProcessService); /** * Emits any time the allowed nets change. The first emission comes after the source observable emits for the first time. * * If a value has already been emitted, subscribing to the stream will provide the last emitted value. */ get allowedNets$(): Observable<Array<Net>>; /** * @returns the current value of the allowed nets. If allowed nets are yet to bee set, `undefined` is returned. */ get allowedNets(): ReadonlyArray<Net> | undefined; /** * Emits any time the allowed nets change. The first emission comes after the source observable emits for the first time. * * If a value has already been emitted, subscribing to the stream will provide the last emitted value. */ get allowedNetsIdentifiers$(): Observable<Array<string>>; /** * @returns the current value of the allowed nets identifiers. If allowed nets are yet to bee set, `undefined` is returned. */ get allowedNetsIdentifiers(): ReadonlyArray<string> | undefined; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<AllowedNetsService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<AllowedNetsService>; }