@wix/error-handler-types
Advanced tools
Comparing version
import { ShowErrorProps } from './ShowError'; | ||
import { ErrorCodesMap } from './ErrorCodesMap'; | ||
export interface ErrorHandlerState { | ||
sessionId?: string; | ||
resolvedError?: ShowErrorProps | null; | ||
errorCodesMap?: ErrorCodesMap | null; | ||
} | ||
export interface ErrorHandlerError { | ||
_errorHandlerSessionId?: string; | ||
_errorHandlerResolvedError?: ShowErrorProps | null; | ||
_errorHandlerErrorCodesMap?: ErrorCodesMap | null; | ||
_errorHandlerState?: ErrorHandlerState | null; | ||
} | ||
//# sourceMappingURL=ErrorHandlerError.d.ts.map |
@@ -10,3 +10,3 @@ import { StatusCode } from '../types/StatusCode'; | ||
export type StatusCodeMap = Partial<Record<StatusCode, ShowErrorMapFunction>>; | ||
export type ErrorCodesMap = Partial<Record<string, ShowErrorMapFunction>>; | ||
export type ErrorCodesMapUntyped = Partial<Record<string, ShowErrorMapFunction>>; | ||
export type ApplicationErrorsMap<TApplicationError extends ApplicationError = ApplicationError> = { | ||
@@ -22,5 +22,5 @@ [K in NonNullable<TApplicationError['code']>]?: ShowErrorMapFunction | false; | ||
}; | ||
export type ErrorCodesMapConditionalApplicationError<T extends ErrorMetaResponse> = NonNullable<NonNullable<T['__applicationErrorsType']>['code']> extends string ? ApplicationErrorsMap<NonNullable<T['__applicationErrorsType']>> : ErrorCodesMap; | ||
export type ErrorCodesMapConditionalValidationError<T extends ErrorMetaResponse> = NonNullable<NonNullable<T['__validationErrorsType']>['ruleName']> extends string ? ValidationErrorsMap<NonNullable<T['__validationErrorsType']>> : ErrorCodesMap; | ||
export type ErrorCodesMapAuto<T> = T extends ErrorMetaResponse ? ErrorCodesMapConditionalApplicationError<T> & ErrorCodesMapConditionalValidationError<T> : ErrorCodesMap; | ||
export type ErrorCodesMapConditionalApplicationError<T extends ErrorMetaResponse> = NonNullable<NonNullable<T['__applicationErrorsType']>['code']> extends string ? ApplicationErrorsMap<NonNullable<T['__applicationErrorsType']>> : ErrorCodesMapUntyped; | ||
export type ErrorCodesMapConditionalValidationError<T extends ErrorMetaResponse> = NonNullable<NonNullable<T['__validationErrorsType']>['ruleName']> extends string ? ValidationErrorsMap<NonNullable<T['__validationErrorsType']>> : ErrorCodesMapUntyped; | ||
export type ErrorCodesMap<T = {}> = T extends ErrorMetaResponse ? ErrorCodesMapConditionalApplicationError<T> & ErrorCodesMapConditionalValidationError<T> : ErrorCodesMapUntyped; | ||
//# sourceMappingURL=ErrorCodesMap.d.ts.map |
import { ResolvedError } from './ResolvedError'; | ||
import { ShowErrorOverrideProps } from './ShowError'; | ||
import { ErrorCodesMapAuto, ShowErrorMapFunction, StatusCodeMap } from './ErrorCodesMap'; | ||
import { ErrorCodesMap, ShowErrorMapFunction, StatusCodeMap } from './ErrorCodesMap'; | ||
export interface WithErrorHandlerOptions { | ||
@@ -19,3 +19,3 @@ /** | ||
*/ | ||
errorCodesMap: ErrorCodesMapAuto<T>, options?: WithErrorHandlerOptions) => Promise<T>; | ||
errorCodesMap: ErrorCodesMap<T>, options?: WithErrorHandlerOptions) => Promise<T>; | ||
getResolvedError: <T>(error: unknown) => ResolvedError & Partial<T>; | ||
@@ -22,0 +22,0 @@ reportRetryAttempt: (error: unknown) => void; |
{ | ||
"name": "@wix/error-handler-types", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"license": "MIT", | ||
@@ -29,3 +29,3 @@ "author": { | ||
"dependencies": { | ||
"@babel/runtime": "^7.27.6" | ||
"@babel/runtime": "^7.28.2" | ||
}, | ||
@@ -119,3 +119,3 @@ "devDependencies": { | ||
}, | ||
"falconPackageHash": "928221ce0336ed4bee01fe090e0afad37a95a5ab33b131cd8efb9aef" | ||
"falconPackageHash": "7dfa2b8fca293274c9d31c5ff44c1be34fcd00cc756a34ae249bbc5e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
91660
0.34%593
0.51%Updated