import { Injector } from '@angular/core'; /** * `assertInjector` extends `assertInInjectionContext` with an optional `Injector` * After assertion, `assertInjector` runs the `runner` function with the guaranteed `Injector` * whether it is the default `Injector` within the current **Injection Context** * or the custom `Injector` that was passed in. * * @template {() => any} Runner - Runner is a function that can return anything * @param {Function} fn - the Function to pass in `assertInInjectionContext` * @param {Injector | undefined | null} injector - the optional "custom" Injector * @param {Runner} runner - the runner fn * @returns {ReturnType} result - returns the result of the Runner * * @example * ```ts * function injectValue(injector?: Injector) { * return assertInjector(injectValue, injector, () => 'value'); * } * * injectValue(); // string * ``` */ export declare function assertInjector any>(fn: Function, injector: Injector | undefined | null, runner: Runner): ReturnType; /** * `assertInjector` extends `assertInInjectionContext` with an optional `Injector` * After assertion, `assertInjector` returns a guaranteed `Injector` whether it is the default `Injector` * within the current **Injection Context** or the custom `Injector` that was passed in. * * @param {Function} fn - the Function to pass in `assertInInjectionContext` * @param {Injector | undefined | null} injector - the optional "custom" Injector * @returns Injector * * @example * ```ts * function injectDestroy(injector?: Injector) { * injector = assertInjector(injectDestroy, injector); * * return runInInjectionContext(injector, () => { * // code * }) * } * ``` */ export declare function assertInjector(fn: Function, injector: Injector | undefined | null): Injector;