Courses / TypeScript
7. interface
Declaring interfaces to describe object shapes and extend them across files.
JavaScript (TypeScript-style interfaces for describing object shapes)
interface
An interface names the expected shape of an object so tools and collaborators know what properties and types to expect.
"I want my function to accept any object that looks like what I need, without tying callers to a concrete class."
An interface is a named description of an object's properties and their types; you can extend or merge interfaces across files to evolve shapes incrementally.
"I want my function to accept any object that looks like what I need, without tying callers to a concrete class."
An interface is a named description of an object's properties and their types; you can extend or merge interfaces across files to evolve shapes incrementally.