readme files
This commit is contained in:
1 parent
6b64d09397
commit
1d2802f113
17 files changed
+107
-49
No files matched your search
@@ -0,0 +1,3 @@
|
||||
# Разберите приведённые примеры
|
||||
|
||||
> обратите внимание как применяется infer
|
||||
+1
-1
@@ -14,4 +14,4 @@ const double = (x: number, s: 'foo') => x * 2;
|
||||
// get type of first argument of function
|
||||
type GetFirstFuncArg<Arg> = Arg extends (a, x: infer T) => any ? T : never;
|
||||
|
||||
type DoubleArgType = GetFirstFuncArg<typeof double>
|
||||
type DoubleArgType = GetFirstFuncArg<typeof double>
|
||||
Reference in new issue
Block a user