import { HttpStatusText } from './constants.js'; import { Readable } from 'node:stream'; import { CookieOptions } from './types.js'; import { Buffer } from 'node:buffer'; export declare const serializeToString: (value: unknown) => string; export declare const isOkay: (status: number) => boolean; export declare const isRedirect: (status: number) => boolean; export declare const isError: (status: number) => boolean; export declare const statusCodeToMessage: (status: number) => HttpStatusText; export declare const parseJsonStr: (jsonString: string) => object | null; export declare const isBinary: (value: unknown) => boolean; /** * @returns [filename, path] * @param readable */ export declare const getFileDescriptorFromReadable: (readable: Readable) => { filename: string; path: string; mimetype: string; } | null; export declare const isObject: (candidate: unknown) => candidate is object; /** * Doesn't preserver functions and other non-serializable values * @param obj */ export declare const copyObject: (obj: T) => T; export declare const wrapArray: (value: T | T[]) => T[]; /** * Converts a stream to a buffer. Loads a file if string is passed. * @param stream */ export declare const streamToBuffer: (stream: Readable | string) => Promise; export declare const parseSetCookieHeader: (setCookieHeader?: string[] | string) => Record; /** * Just a more verbose syntactic sugar for create an async function and immediately calling it. * @param value */ export declare const wrapInPromise: (value: () => Promise) => Promise;