import { Context } from '@declaro/core';
import { type MessageHandler } from './utils';
/**
 * Push a message to a queue to be resolved by only one client.
 * NOTE: This uses LPUSH under the hood, not PUBLISH. For PUBLISH functionality, use `sendMessage`
 *
 * @param context
 * @param channel The channel to send the message on
 * @param payload The payload to send
 * @returns
 */
export declare function pushMessage<T = string>(context: Context, channel: string | string[], payload: T): Promise<number[]>;
/**
 * Fulfills messages pushed to a list (LPUSH), and pops them from the list to ensure they are only processed once.
 * NOTE: If the handler fails, the message will be pushed back to the queue and an error message will be logged.
 *
 * @param context
 * @param channel The channel to receive messages on
 */
export declare function onFulfillMessage<T>(context: Context, channel: string, handler: MessageHandler<T>): Promise<() => boolean>;
//# sourceMappingURL=queue.d.ts.map