export declare function ensureDir(dir: string): Promise; export declare function clampNumber(value: number, min: number, max: number): number; export declare function clampInt(value: number, min: number, max: number): number; export type WebChannel = "web"; export declare function assertWebChannel(input: string): asserts input is WebChannel; export declare function normalizePath(p: string): string; export declare function normalizeE164(number: string): string; /** * "Self-chat mode" heuristic (single phone): the gateway is logged in as the owner's own WhatsApp account, * and `channels.whatsapp.allowFrom` includes that same number. Used to avoid side-effects that make no sense when the * "bot" and the human are the same WhatsApp identity (e.g. auto read receipts, @mention JID triggers). */ export declare function isSelfChatMode(selfE164: string | null | undefined, allowFrom?: Array | null): boolean; export declare function toWhatsappJid(number: string): string; export type JidToE164Options = { authDir?: string; lidMappingDirs?: string[]; logMissing?: boolean; }; type LidLookup = { getPNForLID?: (jid: string) => Promise; }; export declare function jidToE164(jid: string, opts?: JidToE164Options): string | null; export declare function resolveJidToE164(jid: string | null | undefined, opts?: JidToE164Options & { lidLookup?: LidLookup; }): Promise; export declare function sleep(ms: number): Promise; export declare function sliceUtf16Safe(input: string, start: number, end?: number): string; export declare function truncateUtf16Safe(input: string, maxLen: number): string; export declare function resolveUserPath(input: string): string; export declare function resolveConfigDir(env?: NodeJS.ProcessEnv, homedir?: () => string): string; export declare function resolveHomeDir(): string | undefined; export declare function shortenHomePath(input: string): string; export declare function shortenHomeInString(input: string): string; export declare function displayPath(input: string): string; export declare function displayString(input: string): string; export declare function formatTerminalLink(label: string, url: string, opts?: { fallback?: string; force?: boolean; }): string; export declare const CONFIG_DIR: string; /** * Safely parse a JSON string, returning null on failure. */ export declare function safeParseJson(raw: string): T | null; /** * JSON.stringify with safe handling of bigint, functions, Errors, and Uint8Array. * Returns null if serialization fails. */ export declare function safeJsonStringify(value: unknown): string | null; export {};