import { Config, Context, Effect, Layer, Redacted } from "effect"; import { HttpClient } from "effect/unstable/http"; import type { LogHook } from "../logging/types.js"; export interface PushoverMessage { message: string; title: string; url?: string; url_title?: string; priority?: number; sound?: string; timestamp?: number; /** Overrides the configured application token for this message. */ token?: string; } export interface PushoverCredentials { /** * The application token. Optional: a message may carry its own `token`; * a message with no token at all is skipped (debug log), as in v3. */ readonly token?: string | Redacted.Redacted | undefined; readonly user: string; } declare const PushoverError_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & { readonly _tag: "PushoverError"; } & Readonly; /** The Pushover API rejected the message, or the request never completed. */ export declare class PushoverError extends PushoverError_base<{ /** HTTP status of the rejection, or undefined when the request failed before a response. */ readonly status: number | undefined; readonly body: string | undefined; readonly cause: unknown; }> { get message(): string; } declare const Pushover_base: Context.ServiceClass; }>; /** * Pushover notifications. `layerConfig` turns into a silent no-op when the * credentials are absent, so a dev environment needs no configuration. */ export declare class Pushover extends Pushover_base { /** Sends through the `HttpClient` service (provide `FetchHttpClient.layer`). */ static layer(credentials: PushoverCredentials): Layer.Layer; /** Never sends anything. */ static readonly layerNoop: Layer.Layer; /** * Reads `PUSHOVER_TOKEN` and `PUSHOVER_USER`. Without a user the service is * the no-op (a debug line says so); without a token only messages that carry * their own `token` are sent. */ static readonly layerConfig: Layer.Layer; /** * A `Logger` error hook that forwards every `error` log to Pushover: the * old default behaviour, now opt-in via `Logger.layer({ onError: Pushover.logHook })`. * A delivery failure is written to the console (never re-logged, which would loop). */ static readonly logHook: LogHook; } /** Sends through the `Pushover` service. */ export declare const notify: (message: PushoverMessage) => Effect.Effect; export {};