@@ -24,7 +24,7 @@ export interface OnoConstructor {
24
24
* Returns an object containing all properties of the given Error object,
25
25
* which can be used with `JSON.stringify()`.
26
26
*/
27
- toJSON < E extends ErrorLike > ( error : E ) : ErrorPOJO & E ;
27
+ toJSON < T extends ErrorLike > ( error : T ) : T & ErrorPOJO ;
28
28
29
29
/**
30
30
* Extends the given Error object with enhanced Ono functionality, such as improved support for
@@ -41,7 +41,7 @@ export interface OnoConstructor {
41
41
* @param error - The error object to extend. This object instance will be modified and returned.
42
42
* @param props - An object whose properties will be added to the error
43
43
*/
44
- extend < T extends ErrorLike , P extends object > ( error : T , props ?: P ) : T & P & OnoError < T & P > ;
44
+ extend < TError extends ErrorLike , TProps extends object > ( error : TError , props ?: TProps ) : TError & TProps & OnoError < TError & TProps > ;
45
45
46
46
/**
47
47
* Extends the given Error object with enhanced Ono functionality, such as nested stack traces
@@ -50,7 +50,7 @@ export interface OnoConstructor {
50
50
* @param error - The error object to extend. This object instance will be modified and returned.
51
51
* @param originalError - The original error. This error's stack trace will be added to the error's stack trace.
52
52
*/
53
- extend < T extends ErrorLike , E extends ErrorLike > ( error : T , originalError ?: E ) : T & E & OnoError < T & E > ;
53
+ extend < TError extends ErrorLike , TOriginal extends ErrorLike > ( error : TError , originalError ?: TOriginal ) : TError & TOriginal & OnoError < TError & TOriginal > ;
54
54
55
55
/**
56
56
* Extends the given Error object with enhanced Ono functionality, such as nested stack traces,
@@ -60,7 +60,7 @@ export interface OnoConstructor {
60
60
* @param originalError - The original error. This error's stack trace will be added to the error's stack trace.
61
61
* @param props - An object whose properties will be added to the error
62
62
*/
63
- extend < T extends ErrorLike , E extends ErrorLike , P extends object > ( error : T , originalError ?: E , props ?: P ) : T & E & P & OnoError < T & E & P > ;
63
+ extend < TError extends ErrorLike , TOriginal extends ErrorLike , TProps extends object > ( error : TError , originalError ?: TOriginal , props ?: TProps ) : TError & TOriginal & TProps & OnoError < TError & TOriginal & TProps > ;
64
64
}
65
65
66
66
/**
@@ -77,7 +77,7 @@ export interface Ono<T extends ErrorLike> {
77
77
*
78
78
* @param error - The original error
79
79
*/
80
- < E extends ErrorLike > ( error : E ) : T & E & OnoError < T & E > ;
80
+ < TError extends ErrorLike > ( error : TError ) : T & TError & OnoError < T & TError > ;
81
81
82
82
/**
83
83
* Creates a new error with the message, stack trace, and properties of another error,
@@ -86,7 +86,7 @@ export interface Ono<T extends ErrorLike> {
86
86
* @param error - The original error
87
87
* @param props - An object whose properties will be added to the returned error
88
88
*/
89
- < E extends ErrorLike , P extends object > ( error : E , props : P ) : T & E & P & OnoError < T & E & P > ;
89
+ < TError extends ErrorLike , TProps extends object > ( error : TError , props : TProps ) : T & TError & TProps & OnoError < T & TError & TProps > ;
90
90
91
91
/**
92
92
* Creates a new error with a formatted message and the stack trace and properties of another error.
@@ -95,7 +95,7 @@ export interface Ono<T extends ErrorLike> {
95
95
* @param message - The new error message, possibly including argument placeholders
96
96
* @param params - Optional arguments to replace the corresponding placeholders in the message
97
97
*/
98
- < E extends ErrorLike > ( error : E , message : string , ...params : unknown [ ] ) : T & E & OnoError < T & E > ;
98
+ < TError extends ErrorLike > ( error : TError , message : string , ...params : unknown [ ] ) : T & TError & OnoError < T & TError > ;
99
99
100
100
/**
101
101
* Creates a new error with a formatted message and the stack trace and properties of another error,
@@ -106,7 +106,7 @@ export interface Ono<T extends ErrorLike> {
106
106
* @param message - The new error message, possibly including argument placeholders
107
107
* @param params - Optional arguments to replace the corresponding placeholders in the message
108
108
*/
109
- < E extends ErrorLike , P extends object > ( error : E , props : P , message : string , ...params : unknown [ ] ) : T & E & P & OnoError < T & E & P > ;
109
+ < TError extends ErrorLike , TProps extends object > ( error : TError , props : TProps , message : string , ...params : unknown [ ] ) : T & TError & TProps & OnoError < T & TError & TProps > ;
110
110
111
111
/**
112
112
* Creates an error with a formatted message.
@@ -121,7 +121,7 @@ export interface Ono<T extends ErrorLike> {
121
121
*
122
122
* @param props - An object whose properties will be added to the returned error
123
123
*/
124
- < P extends object > ( props : P ) : T & P & OnoError < T & P > ;
124
+ < TProps extends object > ( props : TProps ) : T & TProps & OnoError < T & TProps > ;
125
125
126
126
/**
127
127
* Creates an error with a formatted message and additional properties.
@@ -130,7 +130,7 @@ export interface Ono<T extends ErrorLike> {
130
130
* @param message - The new error message, possibly including argument placeholders
131
131
* @param params - Optional arguments to replace the corresponding placeholders in the message
132
132
*/
133
- < P extends object > ( props : P , message : string , ...params : unknown [ ] ) : T & P & OnoError < T & P > ;
133
+ < TProps extends object > ( props : TProps , message : string , ...params : unknown [ ] ) : T & TProps & OnoError < T & TProps > ;
134
134
}
135
135
136
136
/**
0 commit comments