import { AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { Observable, Subject } from 'rxjs'; export declare const hookSubject: unique symbol; export declare const hooksPatched: unique symbol; export declare type AllHooks = OnChanges & OnInit & DoCheck & AfterContentInit & AfterContentChecked & AfterViewInit & AfterViewChecked & OnDestroy; export declare type LifecycleHookKey = keyof AllHooks; export interface TypedSimpleChange { previousValue: Data; currentValue: Data; firstChange: boolean; } /** * FIRST POINT: * the key is made optional because an ngOnChanges will only give keys of inputs that have changed * SECOND POINT: * the value is associated with `| null` as if an input value is defined but actually retrieved with * an `async` pipe, we'll initially get a `null` value * * For both point, feel free to check the following stackblitz that demo this * https://stackblitz.com/edit/stackblitz-starters-s5uphw?file=src%2Fmain.ts */ export declare type TypedSimpleChanges = { [Key in Keys]?: TypedSimpleChange | null; }; export declare type DecoratedHooks = Record, Observable> & { ngOnChanges: Observable>; }; export declare type DecoratedHooksSub = { [k in keyof DecoratedHooks]: DecoratedHooks[k] extends Observable ? Subject : never; }; /** * Library authors should use this to create their own lifecycle-aware functionality */ export declare function getObservableLifecycle(classInstance: Component): DecoratedHooks;