import { Observable } from 'rxjs'; import { Signal } from '@angular/core'; import { ToObservableOptions } from '@angular/core/rxjs-interop'; /** * Type to specify an object of observables */ type ObservableMap = Record>; /** * Type to map `ObservableMap` to a static record type * the 'in' syntax forces the type specification by key */ type ObservableAccumulation = { [K in keyof T]: ExtractObservableValue; }; /** * This type avoids empty objects */ type NotEmpty; }> = Partial & U[keyof U]; type ExtractObservableValue = T extends Observable ? R : never; /** * This Observable creation function helps to accumulate an object of key & Observable of values to * an Observable of objects of key & value. * This comes in handy if you quickly want to create subsets as objects/state-slices of different Observables. * * The resulting Observable filters out undefined values forwards only distinct values and shared the aggregated output. * * @example * * Default usage: * * const object$: Observable<{ * prop1: number, * prop2: string, * prop3: string * }> = accumulateObservables({ * prop1: interval(42), * prop2: of('lorem'), * prop3: 'test' * }); * * Usage with custom duration selector: * * const object$: Observable<{ * prop1: number, * prop2: string, * prop3: string * }> = accumulateObservables({ * prop1: interval(42), * prop2: of('lorem'), * prop3: 'test' * }, timer(0, 20)); * * @param obj - An object of key & Observable values pairs * @param durationSelector - An Observable determining the duration for the internal coalescing method */ declare function accumulateObservables>(obj: T, durationSelector?: Observable): Observable<{ [K in keyof T]: ExtractObservableValue; }>; /** * @description * * This function returns the zone un-patched API for the a specific Browser API. * If no target is passed the window is used instead * * @param name - The name of the API to check. * @param target - The target to get un-patched API from. * @return {Function} - The zone un-patched API in question. * */ declare function getZoneUnPatchedApi(name: N): (Window & typeof globalThis)[N]; declare function getZoneUnPatchedApi(target: T, name: N): T[N]; /** * */ declare function timeoutSwitchMapWith(): (o$: Observable) => Observable; declare function toObservableMicrotaskInternal(source: Signal, options?: ToObservableOptions): Observable; export { accumulateObservables, getZoneUnPatchedApi, timeoutSwitchMapWith, toObservableMicrotaskInternal }; export type { ObservableAccumulation, ObservableMap };