diff --git a/services/protocol.ts b/services/protocol.ts index 9e94da3..6c64fce 100644 --- a/services/protocol.ts +++ b/services/protocol.ts @@ -2,8 +2,7 @@ type Response> = T & { returnValue: true; }; -// eslint-disable-next-line @typescript-eslint/no-redeclare -type Error> = T & { +type ErrorResponse> = T & { returnValue: false; errorText: string; }; @@ -12,6 +11,6 @@ export function makeSuccess(payload: T): Response { return { returnValue: true, ...payload }; } -export function makeError(error: string, payload?: T): Error { +export function makeError(error: string, payload?: T): ErrorResponse { return { returnValue: false, errorText: error, ...payload }; }