UNPKG

signicat-client-ts

Version:

Community TypeScript client for Signicat Authentication REST API with automatic token management

27 lines (26 loc) 1.22 kB
import type { ApiRequestOptions } from "./ApiRequestOptions"; export declare class CancelError extends Error { readonly url: string; readonly status: number; readonly statusText: string; readonly body: any; readonly request: ApiRequestOptions | null; constructor(message: string); get isCancelled(): boolean; } export interface OnCancel { readonly isResolved: boolean; readonly isRejected: boolean; readonly isCancelled: boolean; (cancelHandler: () => void): void; } export declare class CancelablePromise<T> implements Promise<T> { #private; constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void); get [Symbol.toStringTag](): string; then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>; catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>; finally(onFinally?: (() => void) | null): Promise<T>; cancel(): void; get isCancelled(): boolean; }