import AbstractActor from "../../actors/runtime/AbstractActor"; import Class from "../../types/Class"; /** * Dapr server interface for Actor runtime. * Provides methods to register and manage actor types for incoming actor invocations. * * @see https://docs.dapr.io/developing-applications/building-blocks/actors/ */ export default interface IServerActor { /** * Registers an actor type with the server. * The actor class will handle incoming method invocations for that actor type. * * @typeParam T - The actor class type extending AbstractActor. * @param cls - The actor class to register. Must extend AbstractActor. * @returns A promise that resolves when the actor type is registered. * * @example * ```ts * class UserActor extends AbstractActor { * async updateProfile(profile: any) { * // actor logic * } * } * * await server.actor.registerActor(UserActor); * ``` * * @see https://docs.dapr.io/developing-applications/building-blocks/actors/ */ registerActor(cls: Class): Promise; /** * Retrieves a list of all registered actor type names. * Useful for debugging and monitoring which actors are available. * * @returns A promise that resolves to an array of registered actor type names. * * @see https://docs.dapr.io/developing-applications/building-blocks/actors/ */ getRegisteredActors(): Promise; /** * Initializes the actor runtime. * Must be called before the server starts to ensure actors are ready to receive invocations. * * @returns A promise that resolves when the actor runtime is initialized. * * @see https://docs.dapr.io/developing-applications/building-blocks/actors/ */ init(): Promise; }