/** * @oxpulse/chat-widget — auth error detection utility (W2.2 slice 5). */ import type { WriteFailureReason } from '../types.js'; /** * Returns true if the given error indicates an authentication failure * (401, 403, auth_expired kind, unauthorized/forbidden code, or message * containing an auth-related pattern). * * Used to differentiate auth errors (require fresh JWT) from network errors * (can be retried with same JWT). * * Understands both the widget's own bridged shape (`{status, kind}`, used by * the subscribe/reconnect path) and the raw SDKChatError shape * (`{statusCode, code}`, thrown directly by sendReaction/removeReaction/ * sendText) — a call site never needs to hand-build a bridge object before * calling this (write-401 fix, issue #78: that bridging used to live only * inline in element.ts's handleSubscribeError; extended here instead of * copying it a 2nd and 3rd time into message-list.ts and the composer path). */ export declare function isAuthError(err: unknown): boolean; /** * Classify a write-op failure (sendReaction/removeReaction/sendText) into * the coarse reason bucket the write-failure telemetry hook reports (issue * #78: onWriteError / oxpulse-chat:write-error detail.reason). auth_expired * takes priority over a 'network' code — an expired token is actionable * (refresh + retry), a transient network blip is not. */ export declare function classifyWriteFailureReason(err: unknown): WriteFailureReason; //# sourceMappingURL=auth.d.ts.map