@@ -78,7 +78,7 @@ Use-case:
78
78
```
79
79
import type {SetParameterType} from 'type-fest';
80
80
81
- type HandleMessage = (data: Data, message: string, ...arguments : any[]) => void;
81
+ type HandleMessage = (data: Data, message: string, ...arguments_ : any[]) => void;
82
82
83
83
type HandleOk = SetParameterType<HandleMessage, {0: SuccessData, 1: 'ok'}>;
84
84
//=> type HandleOk = (data: SuccessData, message: 'ok') => void;
@@ -94,12 +94,12 @@ type HandleWarn = SetParameterType<HandleMessage, {1: 'warn'}>;
94
94
// Change rest parameter type.
95
95
96
96
// Way 1: Input full parameter type.
97
- type HandleLog = SetParameterType<HandleMessage, [data: Data, message: 'log', ...arguments : string[]]>;
98
- //=> type HandleLog = (data: Data, message: 'log', ...arguments : string[]) => void;
97
+ type HandleLog = SetParameterType<HandleMessage, [data: Data, message: 'log', ...arguments_ : string[]]>;
98
+ //=> type HandleLog = (data: Data, message: 'log', ...arguments_ : string[]) => void;
99
99
100
100
// Way 2: Input rest parameter type by Object index.
101
101
type HandleLog2 = SetParameterType<HandleMessage, {2: string}>;
102
- //=> type HandleLog2 = (data: Data, message: string, ...arguments : string[]) => void;
102
+ //=> type HandleLog2 = (data: Data, message: string, ...arguments_ : string[]) => void;
103
103
```
104
104
105
105
@category Function
0 commit comments