import type { AuthenticationCreds, WAVersion } from '../Types/index.js'; /** unix timestamp of a date in seconds */ export declare const unixTimestampSeconds: (date?: Date) => number; /** * Coerce a protobuf timestamp into a plain JS number. Matches upstream * Baileys' `Utils/generics.ts:toNumber` — protobufjs may hand us a `Long` * (`{ low, high, toNumber() }`), a plain number, or `null`/`undefined`. * * When the value is a Long without a `.toNumber()` method, we fall back to * `low` only when `high === 0` — otherwise the value exceeds 32 bits and * dropping `high` would silently truncate (e.g. messageTimestamps in ms * past 2038). For oversized values we still call into Number conversion * manually so the caller gets a usable approximation rather than a * zero-shifted lie. */ export declare const toNumber: (t: { toNumber?: () => number; low?: number; high?: number; } | number | null | undefined) => number; /** * Promise-based timeout. Mirrors upstream Baileys' `delay` so bot code that * destructures `delay` from the package keeps working unchanged. */ export declare const delay: (ms: number) => Promise; /** * JSON replacer/reviver pair for serializing `Buffer`/`Uint8Array` values as * `{ type: 'Buffer', data: }`. API-compatible with the upstream Baileys * `BufferJSON` helper — drop-in replacement for legacy auth-state code that * persists creds via `JSON.stringify(state, BufferJSON.replacer)`. */ export declare const BufferJSON: { replacer: (_: string, value: unknown) => unknown; reviver: (_: string, value: unknown) => unknown; }; /** * Returns a minimal {@link AuthenticationCreds} placeholder. All real credential * material is owned by the Rust bridge; this stub exists only for upstream * Baileys code paths that call `initAuthCreds()` to seed a fresh `auth.creds` * object before pairing. The returned object is safe to pass as `auth.creds` * but the bridge will ignore every field except `me`/`registered`/`platform`. */ export declare const initAuthCreds: () => AuthenticationCreds; export declare const fetchLatestWaWebVersion: (options?: RequestInit) => Promise<{ version: WAVersion; isLatest: boolean; error?: undefined; } | { version: WAVersion; isLatest: boolean; error: unknown; }>; /** * Alias for {@link fetchLatestWaWebVersion}. Kept for source-level compatibility * with upstream Baileys code that imports `fetchLatestBaileysVersion`. */ export declare const fetchLatestBaileysVersion: (options?: RequestInit) => Promise<{ version: WAVersion; isLatest: boolean; error?: undefined; } | { version: WAVersion; isLatest: boolean; error: unknown; }>; //# sourceMappingURL=generics.d.ts.map