Skip to content

Commit 1aa6433

Browse files
committed
refactor!: use default exports
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 0920a64 commit 1aa6433

13 files changed

+42
-22
lines changed

src/dtos/exception-data.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { ExceptionData } from 'src/types'
1313
*
1414
* @extends {ExceptionData}
1515
*/
16-
export interface ExceptionDataDTO<T = any> extends ExceptionData {
16+
interface ExceptionDataDTO<T = any> extends ExceptionData {
1717
/**
1818
* Single error or group of errors.
1919
*/
@@ -24,3 +24,5 @@ export interface ExceptionDataDTO<T = any> extends ExceptionData {
2424
*/
2525
message?: string
2626
}
27+
28+
export type { ExceptionDataDTO as default }

src/dtos/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
* @module exceptions/dtos
44
*/
55

6-
export type { ExceptionDataDTO } from './exception-data'
7-
export type { ValidationExceptionDTO } from './validation-exception'
6+
export type { default as ExceptionDataDTO } from './exception-data'
7+
export type { default as ValidationExceptionDTO } from './validation-exception'

src/dtos/validation-exception.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import type { ValidationError } from 'class-validator'
77
import type ExceptionCode from 'src/enums/exception-code'
8-
import type { ExceptionDataDTO } from './exception-data'
8+
import type ExceptionDataDTO from './exception-data'
99

1010
/**
1111
* `ValidationExceptionData` data transfer object.
@@ -21,3 +21,5 @@ export interface ValidationExceptionDTO
2121
*/
2222
code?: ExceptionCode
2323
}
24+
25+
export type { ValidationExceptionDTO as default }

src/interfaces/axios-error-json.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type ExceptionCode from 'src/enums/exception-code'
1515
*
1616
* @extends {Error}
1717
*/
18-
export interface AxiosErrorJSON<Data = any> extends Error {
18+
interface AxiosErrorJSON<Data = any> extends Error {
1919
readonly code?: string
2020
readonly columnNumber?: number
2121
readonly config: AxiosRequestConfig<Data>
@@ -25,3 +25,5 @@ export interface AxiosErrorJSON<Data = any> extends Error {
2525
readonly number?: number
2626
readonly status: ExceptionCode | null
2727
}
28+
29+
export type { AxiosErrorJSON as default }

src/interfaces/axios-error.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import type { AxiosRequestConfig, AxiosResponse } from 'axios'
77
import type { ClientRequest } from 'node:http'
8-
import type { AxiosErrorJSON } from './axios-error-json'
8+
import type AxiosErrorJSON from './axios-error-json'
99

1010
/**
1111
* Error from Axios HTTP client.
@@ -17,11 +17,13 @@ import type { AxiosErrorJSON } from './axios-error-json'
1717
*
1818
* @extends {Error}
1919
*/
20-
export interface AxiosError<Payload = any, Data = any> extends Error {
20+
interface AxiosError<Payload = any, Data = any> extends Error {
2121
readonly code?: string
2222
readonly config: AxiosRequestConfig<Data>
2323
readonly isAxiosError: boolean
2424
readonly request?: ClientRequest
2525
readonly response?: AxiosResponse<Payload, Data>
2626
toJSON(): AxiosErrorJSON<Data>
2727
}
28+
29+
export type { AxiosError as default }

src/interfaces/exception-json.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import type { ExceptionData, ExceptionErrors } from 'src/types'
1313
*
1414
* @template T - Aggergated error type(s)
1515
*/
16-
export interface ExceptionJSON<T = any> {
16+
interface ExceptionJSON<T = any> {
1717
readonly className: ExceptionClassName
1818
readonly code: ExceptionCode
1919
readonly data: Readonly<ExceptionData & { isExceptionJSON: true }>
2020
readonly errors: Readonly<ExceptionErrors<T>>
2121
readonly message: string
2222
readonly name: ExceptionId
2323
}
24+
25+
export type { ExceptionJSON as default }

src/interfaces/firebase-error.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { FirebaseError as ErrorA } from 'firebase-admin/lib/utils/error'
1414
*
1515
* @extends {Error}
1616
*/
17-
export interface FirebaseError extends Error {
17+
interface FirebaseError extends Error {
1818
/**
1919
* Firebase error code.
2020
*/
@@ -51,3 +51,5 @@ export interface FirebaseError extends Error {
5151
*/
5252
toJSON?(): { code: FirebaseError['code']; message: FirebaseError['message'] }
5353
}
54+
55+
export type { FirebaseError as default }

src/interfaces/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* @module exceptions/interfaces
44
*/
55

6-
export type { AxiosError } from './axios-error'
7-
export type { AxiosErrorJSON } from './axios-error-json'
8-
export type { ExceptionJSON } from './exception-json'
9-
export type { FirebaseError } from './firebase-error'
10-
export type { NextError } from './next-error'
6+
export type { default as AxiosError } from './axios-error'
7+
export type { default as AxiosErrorJSON } from './axios-error-json'
8+
export type { default as ExceptionJSON } from './exception-json'
9+
export type { default as FirebaseError } from './firebase-error'
10+
export type { default as NextError } from './next-error'

src/interfaces/next-error.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import type ExceptionCode from 'src/enums/exception-code'
1212
*
1313
* @extends {Error}
1414
*/
15-
export interface NextError extends Error {
15+
interface NextError extends Error {
1616
readonly statusCode?: ExceptionCode
1717
}
18+
19+
export type { NextError as default }

src/types/exception-data.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
/**
77
* Custom `Exception` data.
88
*/
9-
export type ExceptionData = Record<string, any>
9+
type ExceptionData = Record<string, any>
10+
11+
export type { ExceptionData as default }

0 commit comments

Comments
 (0)