import Class from "../../types/Class"; /** * Dapr client interface for creating service invocation proxies. * Allows creation of typed proxies for remote service method invocation. * * @see https://docs.dapr.io/developing-applications/building-blocks/service-invocation/ */ export default interface IClientProxy { /** * Creates a strongly-typed proxy for a remote service. * The proxy transparently handles serialization and routing to the remote service via Dapr. * * @typeParam T - The interface or class type representing the remote service API. * @param cls - The class or interface representing the remote service methods. * @param clientOptions - Optional client-specific options passed to the proxy (e.g., invocation options). * @returns A promise that resolves to a proxy instance that implements the provided service interface. * * @example * ```ts * interface UserService { * getUser(id: string): Promise<{ id: string; name: string }>; * updateUser(id: string, user: any): Promise; * } * * const userServiceProxy = await client.proxy.create(UserService); * const user = await userServiceProxy.getUser("user-123"); * ``` * * @see https://docs.dapr.io/reference/api/service_invocation_api/ */ create(cls: Class, clientOptions?: Record): Promise; }