/** * Error taxonomy. * * The upstream library surfaced every failure as an opaque `error` event, so consumers could not * tell "the stream ended" apart from "we are being rate limited" apart from "YouTube changed its * HTML and our scraping broke". Those need different reactions, so they get different types. */ /** Base class for every error this library emits. */ export declare abstract class YoutubeChatError extends Error { constructor(message: string); } /** * The live page could not be scraped: a required token was missing. * * Almost always means YouTube changed its page shape and this library needs a patch — as opposed * to a transient failure. Consumers should treat this as "stop and alert", not "retry". */ export declare class ScrapeError extends YoutubeChatError { readonly field: string; constructor(field: string, message?: string); } /** The requested stream does not exist, is not live, or is a finished/replay stream. */ export declare class NotLiveError extends YoutubeChatError { } /** YouTube rate limited (429) or rejected (403) the request. */ export declare class RateLimitError extends YoutubeChatError { readonly status: number; readonly retryAfterMs?: number | undefined; constructor(status: number, retryAfterMs?: number | undefined); } /** * A chat response arrived but did not parse into the shape we expect. * * Like ScrapeError, this is a drift signal rather than a transient fault. */ export declare class ParseError extends YoutubeChatError { }