Добавлен тип для получения типа элемента массива

This commit is contained in:
goodmice 2022-10-06 20:27:34 +05:00
parent 38004088a7
commit 89835f7f00
No known key found for this signature in database
GPG Key ID: 63EA771203189CF1

View File

@ -9,3 +9,5 @@
export type OmitExtends<T, R> = T & Omit<R, keyof T> export type OmitExtends<T, R> = T & Omit<R, keyof T>
export type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any ? A : never export type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any ? A : never
export type ArrayElement<ArrType> = ArrType extends readonly (infer ElementType)[] ? ElementType : never