import type { TokenUsage } from "./types.js"; /** Normalize exact provider-reported token counters. Never estimates usage. */ export declare function tokenUsageFromRecord(raw: unknown): TokenUsage | undefined; /** * Merge later counters over earlier ones without letting an absent field erase a present one. * * `tokenUsageFromRecord` returns every key and sets the ones it did not find to `undefined`, * so a spread merge overwrites good values with `undefined`. Anthropic's streaming * `message_delta` carries `output_tokens` only, which made a spread wipe the input and cache * counters captured at `message_start`. * * This deliberately does not recompute `totalTokens`. Whether a cache counter is additive * depends on the provider (Anthropic reports it outside `input_tokens`, OpenAI inside * `prompt_tokens`), and that distinction is gone by the time usage has been normalised. The * caller knows its provider and owns the total. */ export declare function mergeTokenUsage(base: TokenUsage | undefined, next: TokenUsage | undefined): TokenUsage | undefined; //# sourceMappingURL=usage.d.ts.map