import * as sd from "@distilled.cloud/aws/servicediscovery";
import * as Effect from "effect/Effect";
declare const CloudMapOperationFailed_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
readonly _tag: "CloudMapOperationFailed";
} & Readonly;
/**
* Raised when an asynchronous Cloud Map operation (namespace create/delete,
* instance register/deregister, service update) terminates with `FAIL` or
* fails to reach a terminal status within the polling budget.
*/
export declare class CloudMapOperationFailed extends CloudMapOperationFailed_base<{
readonly operationId: string;
readonly status: string | undefined;
readonly errorCode: string | undefined;
readonly errorMessage: string | undefined;
}> {
}
/**
* Await a Cloud Map async operation: poll `getOperation` (bounded) until it
* reaches a terminal status and fail with `CloudMapOperationFailed` unless
* that status is `SUCCESS`. Returns the terminal `Operation` (whose
* `Targets` map carries the created NAMESPACE/SERVICE/INSTANCE ids).
*/
export declare const awaitOperation: (operationId: string) => Effect.Effect;
/**
* Bounded retry through transient `ResourceInUse` dependency violations —
* e.g. deleting a namespace while its last service deletion is still
* propagating, or deleting a service while an instance deregistration is in
* flight. Explicitly typed for the same declaration-emit reason as above.
*/
export declare const retryWhileResourceInUse: (self: Effect.Effect) => Effect.Effect;
/**
* Deregister every instance still registered on a service and await the
* async deregistration operations. Instances registered at runtime (via the
* `RegisterInstance` binding) are data-plane ephemera owned by the service —
* they would otherwise block `DeleteService` with `ResourceInUse` forever.
* Deregistrations already in flight surface as `DuplicateRequest` and are
* tolerated; `DeleteService`'s own `ResourceInUse` retry rides out the
* remaining visibility window.
*/
export declare const deregisterAllInstances: (serviceId: string) => Effect.Effect;
export type NamespaceKind = "DNS_PRIVATE" | "DNS_PUBLIC" | "HTTP";
/** Find a namespace of the given type by exact name via the list API. */
export declare const findNamespaceByName: (type: NamespaceKind, name: string) => Effect.Effect;
/**
* Observe a namespace: by cached id when we have one (tolerating out-of-band
* deletion), falling back to an exact-name list lookup.
*/
export declare const observeNamespace: (type: NamespaceKind, name: string, namespaceId: string | undefined) => Effect.Effect;
/**
* The (identical) typed error union of the three namespace create operations.
* Kept concrete — a generic error parameter here would flow into
* `Effect.catchTag`, leaving an un-narrowable `{ _tag: unknown }` residue in
* the handler under TypeScript 7.
*/
type CreateNamespaceError = sd.CreateHttpNamespaceError | sd.CreatePrivateDnsNamespaceError | sd.CreatePublicDnsNamespaceError;
export declare const ensureNamespace: (type: NamespaceKind, name: string, create: Effect.Effect<{
OperationId?: string | undefined;
}, CreateNamespaceError, R>) => Effect.Effect;
/**
* Fetch the observed Cloud Map tags for a resource ARN as a plain record,
* tolerating a missing resource (race during create/delete) as `{}`.
*/
export declare const fetchObservedTags: (resourceArn: string) => Effect.Effect<{
[k: string]: string;
}, never, import("@distilled.cloud/aws/Credentials").Credentials | import("effect/unstable/http/HttpClient").HttpClient>;
/**
* Sync a Cloud Map resource's tags: diff the OBSERVED cloud tags against the
* desired set and apply only the delta via tagResource/untagResource.
*/
export declare const syncTags: (resourceArn: string, observed: Record, desired: Record) => Effect.Effect;
export {};
//# sourceMappingURL=internal.d.ts.map