Curriculum Interfaces & generics Interfaces exercise 5 · fill-word
Interfaces
Type the EMPTY INTERFACE alias — the type that ANY value satisfies because it requires zero methods. Used as a parameter type when a function accepts arbitrary types.
TypeScript reference
Fill the blanks →
About this theme
interface { Foo() }. A type implements an interface by having the right methods. There is no implements keyword. Satisfaction is implicit: if the methods match, the type satisfies the interface, whether the type's author knew about the interface or not. This is the central TS→Go shift, and it changes how you design APIs.