import { Observable } from 'rxjs'; import { Action } from '@state-adapt/core'; /** `catchErrorSource` is a custom RxJS [operator](https://rxjs.dev/guide/operators) that converts an RxJS [Observable](https://rxjs.dev/guide/observable) of any values into a source of errors, using RxJS' [catchError](https://rxjs.dev/api/operators/catchError) operator. It takes one argument, {@link TypePrefix}, and prefixes it to create an object of type {@link Action}. #### Example: Catching errors from a source ```typescript import { timer, map } from 'rxjs'; const timer$ = timer(1000).pipe( map(n => ({ type: 'timer$', payload: n.fakeNumberMethod() })), catchErrorSource('timer'), ); timer$.subscribe(console.log); // { type: 'timer.error$', payload: 'Error: n.fakeNumberMethod is not a function' } ``` */ export declare function catchErrorSource(typePrefix: TypePrefix): (source$: Observable) => Observable>;