Type merge, intersection, generic
type MergeStringsArray = [string, string, …string[]];
type ProductCode = number | string - unions
type ApiGetUserResponse = StatusResponse & GetUserResponse; intersection type,
ApiGetUserResponse матиме всі властивості із обох типів
type StringThatStartsWithGet = get${string}
;
const myString: StringThatStartsWithGet = ‘getAbc’;
template strings type
const valueB = valueA as string; - type assertions, as використовується щоб явно вказати тип або змінити тип на необхідний(переназначити)
Array
function sum(…args: number[]) {}