import { DaprClientOptions } from "../../types/DaprClientOptions"; /** * Base Dapr client interface for managing client lifecycle and initialization. * Handles connection management to the Dapr sidecar and provides options configuration. */ export default interface IClient { /** * Configuration options for the Dapr client. * Contains settings for sidecar address, port, protocol, and other connection parameters. */ options: DaprClientOptions; /** * Retrieves the underlying client instance. * * @param requiresInitialization - If true, ensures the client is initialized before returning. * Defaults to false. * @returns A promise that resolves to the internal client instance. * * @see https://docs.dapr.io/reference/api/ */ getClient(requiresInitialization?: boolean): Promise; /** * Sets the initialization state of the client. * * @param isInitialized - Boolean flag indicating whether the client is initialized. * Used internally to track connection state to the Dapr sidecar. */ setIsInitialized(isInitialized: boolean): void; /** * Checks if the client is initialized and connected to the sidecar. * * @returns True if the client has completed initialization; false otherwise. */ getIsInitialized(): boolean; /** * Stops the client and closes the connection to the Dapr sidecar. * * @returns A promise that resolves when the client has been stopped. * * @see https://docs.dapr.io/concepts/dapr-services/sidecar/ */ stop(): Promise; /** * Starts the client and establishes a connection to the Dapr sidecar. * * @returns A promise that resolves when the client has been initialized and connected. * * @see https://docs.dapr.io/concepts/dapr-services/sidecar/ */ start(): Promise; }