// Returned by `addListener`; invoke it to stop listening. export type UnlistenCallback = () => void; // A source of health information: the current failures (of some domain-specific // shape `F`) and a way to observe changes to them. interface HealthInterface { getFailures(): F[]; addListener(listener: () => void): UnlistenCallback; } // Health that also supports a user-driven retry of whatever is currently // failing. Separate from HealthInterface because observation and recovery are // distinct capabilities: a read-only health source has nothing to retry. export interface RecoverableHealthInterface extends HealthInterface { retry(): void; }