/**
 * Typed wrapper for OAP admin's `/status/alarm/*` endpoints (exposed
 * by `AlarmStatusQueryHandler` in skywalking core). These are the
 * authoritative source for **alarm rule** definitions and per-entity
 * runtime state — distinct from `/runtime/rule/*`, which only covers
 * MAL/LAL/OTEL catalogs (alarm rules live in `alarm-settings.yml`
 * and are NOT in those catalogs).
 *
 * Every endpoint returns a `ClusterAlarmStatus` envelope that fans
 * out across every OAP node in the cluster. Per-node `errorMsg` is
 * the node's read-side failure (gRPC timeout, etc.) — `null` means
 * the node responded. `status` is the parsed payload (rule list /
 * detail / running context). On a sole-node OAP the envelope still
 * has a one-entry `oapInstances` array.
 */
export type FetchLike = (input: string | URL, init?: RequestInit) => Promise<Response>;
export interface AlarmStatusClientOptions {
    /** OAP admin URL, e.g. `http://oap:17128`. No trailing slash. */
    adminUrl: string;
    /** Optional fetch override (tests). */
    fetch?: FetchLike;
    /** Optional default headers (basic auth, RPC token, etc.). */
    headers?: Record<string, string>;
    /** Default per-call timeout in ms. `0` disables. */
    timeoutMs?: number;
}
/** Per-OAP-node envelope inside a `ClusterAlarmStatus`. */
export interface InstanceAlarmStatus<T> {
    /** gRPC address of the OAP node — `host:port` for peers, `Self()`
     *  literal for the node serving the HTTP request. */
    address: string;
    /** Failure reason for THIS node only. Null/absent when the node
     *  responded successfully (status field is then populated) — OAP
     *  omits the key entirely on success rather than sending `null`. */
    errorMsg?: string | null;
    status: T | null;
}
export interface ClusterAlarmStatus<T> {
    oapInstances: InstanceAlarmStatus<T>[];
}
/** Returned by `/status/alarm/rules` — only rule IDs per node. */
export interface AlarmRuleList {
    ruleList: Array<{
        id: string;
    }>;
}
/** Returned by `/status/alarm/{ruleId}` — full rule body + the set of
 *  entities the rule has fired against on this node. */
export interface AlarmRuleDetail {
    ruleId: string;
    expression: string;
    /** Number of MINUTE buckets the rule evaluates over. */
    period: number;
    /** Minutes of silence after a fire before re-evaluating. */
    silencePeriod: number;
    /** Minutes of clean observation needed before a recovery is
     *  emitted. */
    recoveryObservationPeriod: number;
    additionalPeriod: number;
    includeEntityNames: string[];
    excludeEntityNames: string[];
    includeEntityNamesRegex?: string;
    excludeEntityNamesRegex?: string;
    runningEntities: Array<{
        scope: string;
        name: string;
        formattedMessage: string;
    }>;
    tags: Array<{
        key: string;
        value: string;
    }>;
    hooks: string[];
    /** OAP metric names the rule's expression depends on — derived by
     *  OAP's MQE visitor at rule load. */
    includeMetrics: string[];
}
/** Returned by `/status/alarm/{ruleId}/{entityName}` — per-entity
 *  running window state. Used for the "what's the rule currently
 *  seeing for this entity?" pane. */
export interface AlarmRunningContext {
    ruleName: string;
    entity: string;
    /** Sliding window snapshot — bucket-per-metric values currently in
     *  the rule's evaluation window. Shape varies by rule; the UI
     *  renders as raw JSON for now. */
    [key: string]: any;
}
export declare class AlarmStatusApiError extends Error {
    readonly status: number;
    readonly url: string;
    readonly body?: string;
    constructor(status: number, url: string, body?: string);
}
export declare class AlarmStatusClient {
    private readonly fetchImpl;
    private readonly base;
    private readonly defaultHeaders;
    private readonly timeoutMs;
    constructor(options: AlarmStatusClientOptions);
    /** `GET /status/alarm/rules` — every loaded rule, per OAP node. */
    listRules(): Promise<ClusterAlarmStatus<AlarmRuleList>>;
    /** `GET /status/alarm/{ruleId}` — full body for one rule, per OAP
     *  node. */
    ruleDetail(ruleId: string): Promise<ClusterAlarmStatus<AlarmRuleDetail>>;
    /** `GET /status/alarm/{ruleId}/{entityName}` — running window state
     *  for one entity. */
    ruleContext(ruleId: string, entityName: string): Promise<ClusterAlarmStatus<AlarmRunningContext>>;
    private json;
}
//# sourceMappingURL=alarm-status.d.ts.map