import { OnDestroy } from '@angular/core'; import type { MonoTypeOperatorFunction } from 'rxjs'; import { Observable, OperatorFunction, Subscription } from 'rxjs'; import * as i0 from "@angular/core"; export declare type SelectorResults[]> = { [Key in keyof TSelectors]: TSelectors[Key] extends Observable ? TResult : never; }; export declare type Projector[], TResult> = (...args: SelectorResults) => TResult; /** * Implementation from ngrx/component-store with slight modification */ export declare abstract class NgtComponentStore implements OnDestroy { private readonly destroySubject$; readonly destroy$: Observable; private readonly stateSubject$; /** Completes all relevant Observable streams. */ ngOnDestroy(): void; get(): TState; get(projector: (s: TState) => TResult): TResult; /** * Patches the state with provided partial state. * * @param partialStateOrUpdaterFn a partial state or a partial updater * function that accepts the state and returns the partial state. */ set(partialStateOrUpdaterFn: Partial | Observable> | ((state: TState) => Partial | Observable>)): void; /** * Creates a selector. * * @param projector A pure projection function that takes the current state and * returns some new slice/projection of that state. * @return An observable of the projector results. */ select(): Observable; select(projector: (s: TState) => TResult): Observable; select[], TResult>(...args: [...selectors: TSelectors, projector: Projector]): Observable; select[]>(...args: [...selectors: TSelectors]): Observable<{}>; /** * Creates an effect. * * This effect is subscribed to throughout the lifecycle of the ComponentStore. * @param generator A function that takes an origin Observable input and * returns an Observable. The Observable that is returned will be * subscribed to for the life of the component. * @return A function that, when called, will trigger the origin Observable. */ effect | unknown = Observable, TObservableType = TOriginType extends Observable ? A : never, TReturnType = TProvidedType | TObservableType extends void ? () => void : (observableOrValue: TObservableType | Observable) => Subscription>(generator: (origin$: TOriginType) => Observable): TReturnType; private updateState; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, {}, {}, never, never, false>; } /** * An extended `tap` operator that accepts an `effectFn` which: * - runs on every `next` notification from `source$` * - can optionally return a `cleanUp` function that * invokes from the 2nd `next` notification onward and on `unsubscribe` (destroyed) * * * @example * ```typescript * source$.pipe( * tapEffect((sourceValue) = { * const cb = () => { * doStuff(sourceValue); * }; * addListener('event', cb); * * return () => { * removeListener('event', cb); * } * }) * ) * ``` */ export declare function tapEffect(effectFn: (value: TValue) => ((cleanUpParams: { prev: TValue | undefined; complete: boolean; error: boolean; }) => void) | void | undefined): MonoTypeOperatorFunction; export declare function skipUndefined(): MonoTypeOperatorFunction; export declare function startWithUndefined(): OperatorFunction;