/** Severity levels emitted by `FunLogger`. */ export type LogLevel = 'info' | 'debug' | 'warn' | 'error'; /** User tracking consent, mirroring the Datadog browser SDK's values. */ export type TrackingConsent = 'granted' | 'not-granted'; /** * The structured context `FunLogger` assembles for every record: the caller's * data plus the logger's resolved user/session fields. Concrete (rather than * `object`) so transport implementors get property access and autocomplete. */ export interface LogContext { /** Caller-supplied structured data for this log line, if any. */ data?: object; apiKey: string | null; userId: string | null; userName: string | null; userAddress: string | null; userLoginType: string | null; typeLabel: string | null; sdkVersion: string | null; /** * Correlates every record emitted during one deposit or withdrawal flow. * Optional so that adding these stayed a non-breaking change for anyone * constructing a context; `FunLogger` always populates all three. */ traceId?: string | null; /** Names the build that emitted this record; unset in customer builds. */ debugTag?: string | null; /** Monotonic per-record counter, so records sharing a timestamp still sort. */ seq?: number; } /** A single fully-assembled log record handed to a transport. */ export interface LogRecord { level: LogLevel; title: string; /** Assembled by `FunLogger` so transports stay dumb sinks. */ context: LogContext; /** Present only for `error`-level records. */ error?: Error; } /** * Platform sink for `FunLogger`. The logger (queueing, env detection, level * routing, console fallback, context tracking) is platform-agnostic; everything * platform-specific about *emitting* lives behind this interface. * * Part of the React Native split (see ../../../connect-rn/README.md): web * implements it with `DatadogBrowserLogsTransport`, React Native will implement * it with a Datadog React Native transport (`@datadog/mobile-react-native`). * Kept free of DOM/`@datadog/browser-logs` types so it can move to * `@funkit/connect-core` untouched. */ export interface LogTransport { /** Emit one record to the platform sink. */ log(record: LogRecord): void; /** * Reflect the resolved environment (e.g. `'development'` | `'production'`). * Optional — sinks that don't segment by environment can omit it. */ setEnv?(environment: string): void; /** Reflect user tracking consent. Optional. */ setTrackingConsent?(consent: TrackingConsent): void; /** Send anything buffered immediately, without waiting for the batch timer. */ flush?(): void; } //# sourceMappingURL=logTransport.d.ts.map