/** @effect-diagnostics anyUnknownInErrorContext:off */ import * as Layer from "effect/Layer"; import type { ProviderService } from "../../Provider.ts"; import type { ResourceLike } from "../../Resource.ts"; /** * Wraps a {@link ProviderService} so that EVERY lifecycle method * (`reconcile`, `diff`, `read`, `delete`, `list`, `precreate`, `tail`, * `logs`, ...) runs with the given services provided. The services are * provided *closest* to the lifecycle effect, so they override anything the * engine's ambient context supplies (credentials, region, endpoint, * environment). * * Method identity/shape is preserved exactly — the Provider interface is * structural, and the Proxy forwards non-function members (`version`, * `stables`, `aliases`, `nuke`, ...) untouched. Modeled on the lifecycle * Proxy in [Local/RpcProvider.ts](../../Local/RpcProvider.ts). */ export declare const withProviderContext: (provider: ProviderService, services: Layer.Layer) => ProviderService; /** * Layer-level companion to {@link withProviderContext}: given a provider * layer (e.g. `S3.BucketProvider()`) and a layer of override services, * returns a layer that builds both and re-registers every provider service * with its lifecycle methods wrapped in the override context. * * Built with `Layer.fromBuildMemo` (like `ProviderLayer.dual`) so the * `services` layer is built through the ambient `MemoMap`: pass a * **module-memoized layer reference** and it is constructed exactly once per * stack build no matter how many providers are wrapped with it. * * The services are also provided to the provider layer's *build* (winning * over the ambient context), so providers that resolve environment services * at layer construction see the override too. */ export declare const provideProviderContext: (providerLayer: Layer.Layer, services: Layer.Layer) => Layer.Layer; //# sourceMappingURL=ProviderContext.d.ts.map