import { LumberjackLogDriverConfig, LumberjackLogPayload, LumberjackLogDriver, LumberjackLogDriverLog, LumberjackLog } from '@ngworker/lumberjack'; import { provideHttpClient } from '@angular/common/http'; import * as i0 from '@angular/core'; import { EnvironmentProviders, OnDestroy } from '@angular/core'; /** * Settings for retrying failed HTTP requests. */ interface LumberjackHttpDriverRetryOptions { /** * The delay in milliseconds bewteen each retry. */ readonly delayMs: number; /** * The maximum number of retry attempts made before an HTTP request fails. */ readonly maxRetries: number; } /** * Settings used by the HTTP driver. */ interface LumberjackHttpDriverInternalConfig extends LumberjackLogDriverConfig { /** * The identifier of the application that emitted the log. * * This is used by the log store to organize logs. */ readonly origin: string; /** * Settings for retrying failed HTTP requests. */ readonly retryOptions: LumberjackHttpDriverRetryOptions; /** * The URL of the log store endpoint. * * NOTE! The endpoint matching this url MUST support the POST HTTP verb. */ readonly storeUrl: string; } /** * Settings used by the HTTP driver. */ type LumberjackHttpDriverConfig = Omit & Partial>; /** * Settings exclusive to the HTTP driver. */ type LumberjackHttpDriverOptions = Omit & Partial; type LumberjackHttpDriverConfigurationKind = 'options' | 'config'; type LumberjackHttpDriverConfiguration = { kind: Kind; providers: EnvironmentProviders; }; declare function withHttpConfig(config: LumberjackHttpDriverConfig): LumberjackHttpDriverConfiguration<'config'>; declare function withHttpOptions(options: LumberjackHttpDriverOptions): LumberjackHttpDriverConfiguration<'options'>; type HttpClientFeatures = Parameters; /** * Returns the [dependency-injection providers](https://angular.io/guide/glossary#provider) * * for the `LumberjackHttpDriver` and its `LumberjackHttpDriverConfig`. * @usageNotes * * The function is useful when you want to bootstrap an application using * the `bootstrapApplication` function and want to make available the `LumberjackHttpDriver` providers. * * ```typescript * bootstrapApplication(RootComponent, { * providers: [ * provideLumberjack({...}), * provideLumberjackHttpDriver({...}) * ] * }); * ``` * * @publicApi */ declare function provideLumberjackHttpDriver(configuration: LumberjackHttpDriverConfiguration, ...features: HttpClientFeatures): EnvironmentProviders[]; declare class LumberjackHttpDriverError extends Error { constructor(message?: string); } /** * The HTTP driver transports logs to the configured web API log store using the * POST HTTP verb. * * It sends the formatted log and the log including the optional log payload. */ declare class LumberjackHttpDriver implements LumberjackLogDriver, OnDestroy { #private; static readonly driverIdentifier = "LumberjackHttpDriver"; readonly config: LumberjackHttpDriverInternalConfig; ngOnDestroy(): void; /** * Send critical log to the log store. * * @param param0 The log and its text representation. */ logCritical({ formattedLog, log }: LumberjackLogDriverLog): void; /** * Send debug log to the log store. * * @param param0 The log and its text representation. */ logDebug({ formattedLog, log }: LumberjackLogDriverLog): void; /** * Send error log to the log store. * * @param param0 The log and its text representation. */ logError({ formattedLog, log }: LumberjackLogDriverLog): void; /** * Send info log to the log store. * * @param param0 The log and its text representation. */ logInfo({ formattedLog, log }: LumberjackLogDriverLog): void; /** * Send trace log to the log store. * * @param param0 The log and its text representation. */ logTrace({ formattedLog, log }: LumberjackLogDriverLog): void; /** * Send warning log to the log store. * * @param param0 The log and its text representation. */ logWarning({ formattedLog, log }: LumberjackLogDriverLog): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; } /** * The HTTP request sent to the configured log store. */ interface LumberjackHttpLog { /** * The text representation of the log. */ readonly formattedLog: string; /** * The log. Optionally supports a log payload. */ readonly log: LumberjackLog; /** * The identifier of the application that emitted the log. * * This is used by the log store to organize logs. */ readonly origin: string; } export { LumberjackHttpDriver, LumberjackHttpDriverError, provideLumberjackHttpDriver, withHttpConfig, withHttpOptions }; export type { LumberjackHttpDriverConfig, LumberjackHttpDriverOptions, LumberjackHttpDriverRetryOptions, LumberjackHttpLog };