diff --git a/guide/english/typescript/interfaces/index.md b/guide/english/typescript/interfaces/index.md index b0717a4c583..532c40c0fe3 100644 --- a/guide/english/typescript/interfaces/index.md +++ b/guide/english/typescript/interfaces/index.md @@ -26,4 +26,19 @@ Interfaces can contain optional parameters interface User = { email?: string; } -``` \ No newline at end of file +``` + +We can also use interfaces as the Promises to our classes. For example, when declaring names of methods in our interface they need to be in our implementation otherwise we will get an exception. +Example: +```typescript +interface Login { + login(): boolean; +} +class LoginImplementation implements Login { + login(): boolean { + //Here would be our implementation of login class.In this case it returns an Error. + throw new Error("Method not implemented."); + } + +} +```