import { type DynamicModule, type InjectionToken, type OnApplicationBootstrap, type OnApplicationShutdown, type OptionalFactoryDependency } from '@nestjs/common'; import { ServiceRegistryAdapterKind } from './adapter-kind'; import { type KernelStateFactory } from './kernel-state-token'; import { PeerContractEnforcer } from './peer-contract-enforcer'; import { type ServiceTokenProvider } from './service-token-provider'; import type { ServicePeerContract } from '@xemahq/contracts/biome-dependency'; import type { ServiceDescriptor, ServiceRegistry } from '@xemahq/contracts/service-registry'; export declare const SERVICE_REGISTRY_TOKEN: unique symbol; export declare const SERVICE_TOKEN_PROVIDER_TOKEN: unique symbol; export declare class RegistryOperationTimeoutError extends Error { readonly operation: string; readonly ms: number; constructor(operation: string, ms: number); } export declare enum ServiceRegistrationState { Registered = "registered", Degraded = "degraded", Unregistered = "unregistered" } export interface ServiceRegistrationHealth { readonly state: ServiceRegistrationState; readonly service: string; readonly instanceId: string; readonly lastRenewedAt: string | null; readonly msSinceLastRenewal: number | null; readonly consecutiveRenewFailures: number; readonly consecutiveReregisterFailures: number; readonly cause?: string; } export type ServiceRegistrationHealthListener = (health: ServiceRegistrationHealth) => void; export declare const exitProcessWhenRegistrationUnrecoverable: ServiceRegistrationHealthListener; export interface ServiceRegistryModuleOptions { readonly descriptor: ServiceDescriptor; readonly adapter?: ServiceRegistryAdapterKind; readonly kernelStateFactory?: KernelStateFactory; readonly renewIntervalSeconds?: number; readonly operationDeadlineSeconds?: number; readonly onRegistrationHealthChange?: ServiceRegistrationHealthListener; readonly consumes?: readonly string[]; readonly tokenProvider?: ServiceTokenProvider; readonly peerContract?: ServicePeerContract; } export interface ServiceRegistryModuleAsyncOptions { readonly imports?: DynamicModule['imports']; readonly inject?: ReadonlyArray; readonly useFactory: (...args: never[]) => Promise | ServiceRegistryModuleOptions; readonly consumes?: readonly string[]; } export declare class ServiceRegistryBootstrap implements OnApplicationBootstrap, OnApplicationShutdown { private readonly options; private readonly registry; private readonly peerContract?; private readonly logger; private beatTimer; private consecutiveFailures; private consecutiveReregisterFailures; private currentLease; private shuttingDown; private state; private cause; private lastRenewedAtMs; private readonly intervalMs; private readonly operationDeadlineMs; private readonly onHealthChange; constructor(options: ServiceRegistryModuleOptions, registry: ServiceRegistry, peerContract?: PeerContractEnforcer | undefined); onApplicationBootstrap(): void; private registerWhenListening; private waitForSelfListening; onApplicationShutdown(): Promise; private scheduleBeat; private beat; private beatDelayMs; private renewOnce; private reregister; private reportUnregistered; private transitionTo; getHealth(): ServiceRegistrationHealth; private msSinceLastRenewal; private logFailure; } export declare class ServiceRegistryModule { static forRoot(options: ServiceRegistryModuleOptions): DynamicModule; static forRootAsync(asyncOpts: ServiceRegistryModuleAsyncOptions): DynamicModule; } //# sourceMappingURL=service-registry.module.d.ts.map