Last active
March 9, 2020 11:28
-
-
Save mrstalon/4c0eddd276e82d9c91a6e7ba0d701180 to your computer and use it in GitHub Desktop.
Typescript Handbook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ES6 classes | |
public // - access anywhere | |
private // - access only inside class ( without inheritance ) | |
protected // - access only inside class and its children | |
readonly - // can be assigned only on default/constructor stages | |
static - // common property for all class instances ( as if we write it to class prototype ) | |
abstract // - can be used only for inheritance, putting before method make method obligatory to implement ( for children ) | |
// Interface | |
// Is a description of either class implementation or object itself | |
interface AnimalInterface { | |
name: string; | |
move: () => void; | |
} | |
class Animal implements AnimalInterface { | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment