interface ApiError < TData = unknown > extends Error { type : string ; data ? : TData ; } declare class ApiError < TData extends unknown > { constructor ( type , message ? , data ? ) ; } function ApiError < TData extends unknown > ( this , type = ApiError . INTERNAL_ERROR , message ? , data ? ) { const err = new Error ( message ) as ApiError < TData > ; err . name = 'ApiError' ; err . type = type ; err . data = data ; Object . setPrototypeOf ( err , Object . getPrototypeOf ( this ) ) ; Error . captureStackTrace ?. ( err , ApiError ) ; return err ; } ApiError [ 'prototype' ] = Object . create ( Error . prototype , { constructor : { value : Error , enumerable : false , writable : true , configurable : true } } ) ; Object . setPrototypeOf ( ApiError , Error ) ; ApiError . INTERNAL_ERROR = 'INTERNAL_ERROR' ; ApiError . BAD_REQUEST = 'BAD_REQUEST' ; ApiError . NOT_FOUND = 'NOT_FOUND' ; ApiError . TIMEOUT = 'TIMEOUT' ; ApiError . WRONG_CSRF_TOKEN = 'WRONG_CSRF_TOKEN' ; export default ApiError ;