import { MessengerUnit, GetOptions, PostOptions } from '../interfaces/MessengerUnit.js'; import { UnitInfo } from '../types/UnitInfo.js'; import { Monitor } from './messenger/Monitor.js'; import './messenger/monitor/Process.js'; /** * This class is responsible for interacting with Messenger Unit API endpoints. * * For more information on this API's endpoints, see the following: * * - https://ao.g8way.io/#/spec > Messenger (MU) */ declare class Messenger implements MessengerUnit { /** * The URL to this unit. Examples: * * - https://mu.ao-testnet.xyz * - https://mu24.ao-testnet.xyz */ protected mu_url: string; /** * @param muUrl (Optional) The URL to this unit. Can be a Scheduler * Unit URL or a unit Router URL. * * Defaults to the following unit Router URL: * * https://su-router.ao-testnet.xyz. */ constructor(muUrl?: string); fetch(path: string, requestInit?: RequestInit): Promise; /** * Make the following request(s): * * ```text * GET {mu-url} * ``` * * @returns The result of the request. * * @example * ```ts * const res = await new MessengerUnit().get(); * * // - end of example - * ``` */ get(options: GetOptions): Promise; /** * @returns See {@linkcode Monitor} */ monitor(): Monitor; /** * Make the following request(s): * * ```text * POST {mu-url} * ``` * * @returns The result of the request. * * @example * ```ts * const res = await new MessengerUnit() * .post({ * body: new TextEncoder().encode(JSON.stringify({})) * }); * * // - end of example - * ``` */ post(options: PostOptions): Promise; } export { Messenger };