type ApiRequestOptions = { readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; readonly url: string; readonly path?: Record; readonly cookies?: Record; readonly headers?: Record; readonly query?: Record; readonly formData?: Record; readonly body?: any; readonly mediaType?: string; readonly responseHeader?: string; readonly errors?: Record; }; type ApiResult = { readonly url: string; readonly ok: boolean; readonly status: number; readonly statusText: string; readonly body: any; }; declare class ApiError extends Error { readonly url: string; readonly status: number; readonly statusText: string; readonly body: any; readonly request: ApiRequestOptions; readonly retryAfter?: number; readonly rateLimitReset?: number; readonly rateLimitRemaining?: number; readonly rateLimitLimit?: number; constructor(request: ApiRequestOptions, response: ApiResult, message: string, rateLimitInfo?: { retryAfter?: number; rateLimitReset?: number; rateLimitRemaining?: number; rateLimitLimit?: number; }); isRateLimitError(): boolean; } type Resolver = (options: ApiRequestOptions) => Promise; type Headers = Record; type OpenAPIConfig = { BASE: string; VERSION: string; WITH_CREDENTIALS: boolean; CREDENTIALS: 'include' | 'omit' | 'same-origin'; TOKEN?: string | Resolver | undefined; USERNAME?: string | Resolver | undefined; PASSWORD?: string | Resolver | undefined; HEADERS?: Headers | Resolver | undefined; ENCODE_PATH?: ((path: string) => string) | undefined; }; interface RateLimitConfig { enabled: boolean; maxRetries: number; initialRetryDelay: number; backoffMultiplier: number; headerNames: { retryAfter?: string; resetTime?: string; remaining?: string; limit?: string; }; isRateLimitError?: (status: number, body: any) => boolean; } interface OnCancel { readonly isResolved: boolean; readonly isRejected: boolean; readonly isCancelled: boolean; (cancelHandler: () => void): void; } declare class CancelablePromise implements Promise { #private; constructor(executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void); get [Symbol.toStringTag](): string; then(onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike) | null): Promise; catch(onRejected?: ((reason: any) => TResult | PromiseLike) | null): Promise; finally(onFinally?: (() => void) | null): Promise; cancel(): void; get isCancelled(): boolean; } interface RequestOptions { rateLimitConfig?: RateLimitConfig; } declare const request: (config: OpenAPIConfig, options: ApiRequestOptions, requestOptions?: RequestOptions) => CancelablePromise; type WebhookEventHandler = (event: TEvent) => void | Promise; interface BaseHandleWebhookResult { success: boolean; error?: string; } declare abstract class BaseWebhookHandler { protected handlers: Map[]>; on(eventName: TEventName, handler: WebhookEventHandler): this; off(eventName: TEventName, handler: WebhookEventHandler): this; getRegisteredEvents(): TEventName[]; hasHandlers(eventName: TEventName): boolean; clearHandlers(eventName?: TEventName): this; protected executeHandlers(eventName: TEventName, event: TEvent): Promise; } declare function verifyHmacSignature(payload: string | Buffer, secret: string, signature: string, algorithm?: 'sha256' | 'sha1'): boolean; declare function verifyHmacSignatureWithPrefix(payload: string | Buffer, secret: string, signature: string, prefix: string, algorithm?: 'sha256' | 'sha1'): boolean; declare function verifyHmacSha256Signature(payload: string, secret: string, timestamp: string, signature: string, maxAgeSeconds?: number): boolean; declare function verifySlackSignature(payload: string, secret: string, timestamp: string, signature: string, maxAgeSeconds?: number): boolean; export { ApiError, type ApiRequestOptions, type ApiResult, type BaseHandleWebhookResult, BaseWebhookHandler, type OpenAPIConfig, type RateLimitConfig, type WebhookEventHandler, request, verifyHmacSha256Signature, verifyHmacSignature, verifyHmacSignatureWithPrefix, verifySlackSignature };