/** * Lightweight console logger for the SDK. * * Every line is prefixed with `[melio-sdk]` so partners can filter SDK output out * of a busy host page. */ /** * Severity levels, lowest first. `debug` is opt-in via `init({ debug: true })`; * `warn` and `error` always print, because a partner debugging a broken flow * should not have to enable anything to see that something failed. */ export type LogLevel = 'debug' | 'warn' | 'error'; /** Enable or disable debug-level output. Called from `init({ debug })`. */ export declare const setDebugEnabled: (enabled: boolean) => void; /** * Strip credential-bearing query params so a flow URL can be logged safely. * On a URL we cannot parse we fall back to the path, never the raw string. */ export declare const redactUrl: (url: string) => string; /** * Flatten an unknown throwable into something that survives a console capture. * * Never throws. Reading a thrown value can itself fail — `String()` on a * null-prototype object or a throwing `toString`, `instanceof` on a revoked * Proxy, a getter that throws — and this runs inside catch blocks that rethrow, * so a throw here would replace the original error instead of reporting it. */ export declare const describeError: (error: unknown) => Record; /** * Shallow-copy a config with credentials and PII redacted, so it can be logged * without printing customer details into the partner's console. * * Never throws, for the same reason as {@link describeError}. */ export declare const describeConfig: (config: object | undefined) => Record; /** * Describe the host environment once at init. The Safari regression on Xero's * Bills page only reproduced on specific browser builds, and whether we run * inside a frame decides which failure modes are possible — so both belong in * any console capture we are asked to read. */ export declare const describeHost: () => Record; export declare const logger: { debug(message: string, context?: Record): void; warn(message: string, context?: Record): void; error(message: string, context?: Record): void; };