import type Ticker from '../Ticker' ; import type { $IntentionalAny , VoidFn } from '../types' ; import type Tappable from '../utils/Tappable' ; type IDependent = ( msgComingFrom : IDerivation < $IntentionalAny > ) => void ; export interface IDerivation < V > { isDerivation : true ; isHot : boolean ; changes ( ticker ) : Tappable < V > ; changesWithoutValues ( ) : Tappable < void > ; keepHot ( ) : VoidFn ; tapImmediate ( ticker , fn ) : VoidFn ; addDependent ( d ) : void ; removeDependent ( d ) : void ; getValue ( ) : V ; map < T > ( fn ) : IDerivation < T > ; flatMap < R > ( fn ) : IDerivation < R extends IDerivation < infer T > ? T : R > ; } export function isDerivation ( d ) { return d && d . isDerivation && d . isDerivation === true ; }