From 36522ce928716c734c1056c24f559b4bde90c8f9 Mon Sep 17 00:00:00 2001 From: Daniel Perez <167243403+cctidal@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:48:18 -0700 Subject: [PATCH] feat(types): add errors classes to the typescript definition file --- index.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/index.d.ts b/index.d.ts index 0d1089c..6c617ef 100644 --- a/index.d.ts +++ b/index.d.ts @@ -190,5 +190,31 @@ declare namespace Pusher { getTime(): Date } + export class RequestError extends Error { + constructor( + message: string, + url: string, + error: Error, + status?: number, + body?: string + ) + url: string + error: Error + status?: number + body?: string + } + + export class WebHookError extends Error { + constructor( + message: string, + contentType: string, + body: string, + signature: string + ) + contentType: string + body: string + signature: string + } + export { Response } }