TypeScript Generics
Generics
1 | function foo<T>(arg: T): T { |
Generics Types
1 | function foo<T>(arg: T): T { |
TypeScript Functions
Function Types
Typing the function
1 | function foo(x: number, y: string): string { |
Writing the function type
1 | let foo: (x: number, y: string) => string = function ( |
Inferring types
1 | let foo: (x: number, y: string) => string = function (x, y) { |
TypeScript Interface
Interface
1 | interface labelValue { |
Optional Properties
1 | interface SquareConfig { |
Readonly Properties
1 | interface Point { |
Excess Property Checks
1 | interface SquareConfig { |
TypeScript Type Compatibility
Introduction
1 | interface A { |
At least same member
1 | interface A { |