import { LogLevel } from '@voltro/logger'; import { LogRecord } from '@voltro/logger'; import { VoltroPlugin } from '@voltro/protocol'; declare interface AxiomOptions extends BackendBase { readonly dataset: string; } export declare const axiomRequest: (records: ReadonlyArray, opts: AxiomOptions) => ShipRequest; declare interface BackendBase { readonly token?: string; /** Override the ingest URL (self-hosted Loki, EU regions, custom intake). */ readonly endpoint?: string; /** Static labels/tags attached to every record. */ readonly tags?: Record; } export declare const betterStackRequest: (records: ReadonlyArray, opts: BackendBase) => ShipRequest; declare interface Common { /** Flush interval (ms). Default 3000. */ readonly batchMs?: number; /** Max records per batch (also flushes early when reached). Default 200. */ readonly maxBatch?: number; /** Max approximate PAYLOAD BYTES per batch — flushes early when the buffered * records' serialised size would exceed this, so a batch of large records * can't blow past an intake's payload limit (Better Stack / Axiom / Loki * tiers cap around ~1 MB). Default 900_000 (headroom under a 1 MB limit). * A SINGLE record larger than the cap still ships alone (it can't be split) * — the cap bounds the batch, not the record. */ readonly maxBatchBytes?: number; /** Drop records below this level before shipping. Default `'info'`. */ readonly minLevel?: LogLevel; /** Redact/transform a record before it ships (drop secrets). Return the * (possibly mutated) record. */ readonly redact?: (record: LogRecord) => LogRecord; readonly name?: string; } declare interface HttpBackendOptions extends BackendBase { readonly endpoint: string; readonly headers?: Record; } export declare const httpRequest: (records: ReadonlyArray, opts: HttpBackendOptions) => ShipRequest; export declare const logshipPlugin: (opts: LogshipPluginOptions) => VoltroPlugin; export declare type LogshipPluginOptions = ({ readonly backend: 'betterstack'; } & BackendBase & Common) | ({ readonly backend: 'axiom'; } & AxiomOptions & Common) | ({ readonly backend: 'loki'; } & LokiOptions & Common) | ({ readonly backend: 'http'; } & HttpBackendOptions & Common); declare interface LokiOptions extends BackendBase { /** Loki base url, e.g. http://localhost:3100. */ readonly endpoint: string; } export declare const lokiRequest: (records: ReadonlyArray, opts: LokiOptions) => ShipRequest; export declare interface ShipRequest { readonly url: string; readonly headers: Record; /** Pre-serialised body (NDJSON for Better Stack/Axiom-style, JSON for Loki). */ readonly body: string; } export { }