/** * Small dependency-free string/date helpers. * * This module intentionally imports nothing else from the project so it can be * safely used from low-level files (logging, trackers) without creating import cycles. */ /** * Format a date as `yyyy-mm-dd"T"HH∶MM∶ss` using local time. * * Note the separator between the time parts is U+2236 (RATIO), not a colon -- these * strings are used in log *filenames*, and `:` is not a legal filename character on windows. * * Replaces the `dateformat` package, which was used for this single format string. */ export declare function formatLogDate(date: Date): string; /** * Replace the LAST occurrence of `pattern` in `text` with `replacement`. * Returns `text` unchanged when `pattern` is not found. * * Replaces the `replace-last` package. Mirrors that package's string behavior, * including the empty-pattern case (`lastIndexOf('')` returns `text.length`, so the * replacement is appended). */ export declare function replaceLast(text: string, pattern: string, replacement: string): string; /** * Convert an unknown thrown value into a plain JSON-serializable object. Walks nested * objects and arrays (so an Error nested inside a plain wrapper object still yields its * `message`/`stack`), handles circular references, and returns primitives as-is. * * Replaces the `serialize-error` package, with two deliberate improvements on it: * - `cause` chains are serialized (the package drops them, since `cause` is non-enumerable) * - the depth counter tracks true nesting rather than being shared across siblings * * `maxDepth` defaults to unlimited, matching the package -- pass one when serializing * values of unknown shape. */ export declare function serializeError(value: unknown, options?: { maxDepth?: number; }): unknown;