@daiso-tech/core
Version:
The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.
20 lines (19 loc) • 906 B
TypeScript
/**
* @module CircuitBreaker
*/
import { type ICircuitBreakerProvider } from "../../circuit-breaker/contracts/circuit-breaker-provider.contract.js";
/**
* The `ICircuitBreakerProviderFactory` contract makes it easy to configure and switch between different {@link ICircuitBreakerProvider | `ICircuitBreakerProvider`} dynamically.
*
* IMPORT_PATH: `"@daiso-tech/core/circuit-breaker/contracts"`
* @group Contracts
*/
export type ICircuitBreakerProviderFactory<TAdapters extends string = string> = {
/**
* The `use` method will throw an error if you provide it unregisted adapter.
* If no default adapter is defined an error will be thrown by `use` method.
* @throws {UnregisteredAdapterError} {@link UnregisteredAdapterError}
* @throws {DefaultAdapterNotDefinedError} {@link DefaultAdapterNotDefinedError}
*/
use(adapterName?: TAdapters): ICircuitBreakerProvider;
};