import { DestroyRef, type Injector } from '@angular/core'; import { ReplaySubject } from 'rxjs'; /** * Injects the `DestroyRef` service and returns a `ReplaySubject` that emits * when the component is destroyed. * * @throws {Error} If no `DestroyRef` is found. * @returns {ReplaySubject} A `ReplaySubject` that emits when the component is destroyed. * * @example * // In your component: * export class MyComponent { * private destroy$ = injectDestroy(); * * getData() { * return this.service.getData() * .pipe(takeUntil(this.destroy$)) * .subscribe(data => { ... }); * } * } */ export declare const injectDestroy: (injector?: Injector) => ReplaySubject & { onDestroy: DestroyRef["onDestroy"]; };