/**
 * Copyright: (c) Myia SAS 2026.
 * This file and its contents are licensed under the AGPLv3 License.
 * Please see the LICENSE file at the root of this repository
 */
import type { NetworkBodyPreview } from '../../domain/trace-event-recorder/model/network-trace-schema';
export declare const DEFAULT_TEXTUAL_CONTENT_TYPES: readonly RegExp[];
/**
 * Decide whether a `Content-Type` header maps to a textual body that
 * can be safely inlined as a UTF-8 preview. Anything else (images,
 * video, octet-stream, application/zip) returns `false`.
 *
 * Allowlist may be `undefined` to mean "use defaults". An empty array
 * means "no content type is allowed" — useful for users who want
 * `bytes`-only records.
 */
export declare function isTextualContentType(contentType: string | undefined, allowlist: readonly RegExp[] | undefined): boolean;
/**
 * Trim a `Buffer` to at most `maxBytes` and decode as UTF-8 without
 * cutting through a multi-byte codepoint. Walks back from the cap to
 * the most recent leading byte, then keeps the codepoint only if all
 * of its continuation bytes fall within the slice — otherwise the
 * codepoint is dropped entirely. Avoids the `�` replacement
 * characters Node would emit for a mid-codepoint cut.
 */
export declare function utf8SafeSlice(buf: Buffer, maxBytes: number): string;
/**
 * Build a `NetworkBodyPreview` from a `Buffer`. The buffer is
 * truncated at `maxBodyBytes` if larger; `bytes` reports the total,
 * `truncated` flips when the cap was hit, and `preview` carries the
 * UTF-8 view (only when the content type was already deemed textual).
 *
 * `decodeAsText: false` means the caller already knows the body is
 * binary and just wants size accounting — this returns the preview
 * with `bytes` set and no `preview` string.
 */
export declare function previewBody(buf: Buffer, maxBodyBytes: number, decodeAsText: boolean): NetworkBodyPreview;
/**
 * Helper used by the adapter when only `Content-Length` is available
 * (e.g. body capture is `'never'`). Records the size without ever
 * reading the buffer.
 */
export declare function bytesOnlyPreview(bytes: number | undefined): NetworkBodyPreview | undefined;
