import { ApiCallback } from '../../../common/events';
import { ServiceResponse } from '../../util';
/**
 * Represents an intent message.
 * @template T - The payload/options type for the intent.
 * @property {string} type - The intent type (e.g., "studio.start.vm").
 * @property {T} options - The payload/options for the intent.
 */
export interface Intent<T extends Record<string, any> = Record<string, any>> {
    type: string;
    options: T;
}
/**
 * Sends an intent as a fire-and-forget event.
 * If there are subscribers for the intent type, the event is published; otherwise, a log message is emitted.
 *
 * @param {Intent} intent - The intent to send.
 * @returns {void}
 *
 * @example
 * sendIntent({
 *   type: "studio.start.vm",
 *   options: { imageId: id },
 * });
 */
declare const sendIntent: (intent: Intent) => void;
/**
 * Sends an intent and waits for a response. Returns a promise that resolves with the response or a timeout error after 1 second.
 *
 * - If there are subscribers, a unique request ID is generated and used for the response channel.
 * - If no subscribers, resolves with `body: undefined`.
 *
 * @template R - The expected response body type.
 * @param {Intent} intent - The intent to send.
 * @returns {Promise<ServiceResponse<{ body: R | undefined; payload: ApiCallback<R> | undefined }>>}
 *
 * @example
 * sendAsyncIntent({
 *   type: "studio.start.vm",
 *   options: { imageId: id },
 * }).then(([error, data]) => {
 *   if (error) {
 *     log.error(`Error starting VM: ${error}`);
 *   } else if (data) {
 *     log.warn(`result: ${JSON.stringify(data, null, 2)}`);
 *   }
 * });
 */
declare const sendAsyncIntent: <R = any>(intent: Intent) => Promise<ServiceResponse<{
    body: R | undefined;
    payload: ApiCallback<R> | undefined;
}>>;
export { sendAsyncIntent, sendIntent };
//# sourceMappingURL=intent-service.d.ts.map