import { OnDestroy } from '@angular/core'; import { SafeAny } from '@ngx-simple/core/types'; import { Observable, Subject } from 'rxjs'; import { Constructor } from './constructor'; export interface CanUnsubscribe extends OnDestroy { readonly simUnsubscribe$: Subject; } export declare type CanUnsubscribeCtor = Constructor; /** * 用来扩充指令的`simUnsubscribe$`属性 指令销毁自动取消订阅 * - 在rxjs的`.pipe(..., takeUntil(this.simUnsubscribe$))`使用 * - 也可以使用`.pipe(..., untilUnmounted(this))` * - 注意:如果在组件需要`ngOnDestroy`钩子,需要调用先调用 `super.ngOnDestroy()` */ export declare function mixinUnsubscribe>(base: T): CanUnsubscribeCtor & T; /** * 取消订阅操作符 配合`mixinUnsubscribe`使用 * @example * ``` * rxjs.pipe(pipe1,untilUnmounted(this)) * ``` */ export declare function untilUnmounted(destroyInstance: T): (source: Observable) => Observable;