Skip to content

Instantly share code, notes, and snippets.

@mrstalon
Last active March 9, 2020 11:28
Show Gist options
  • Save mrstalon/4c0eddd276e82d9c91a6e7ba0d701180 to your computer and use it in GitHub Desktop.
Save mrstalon/4c0eddd276e82d9c91a6e7ba0d701180 to your computer and use it in GitHub Desktop.
Typescript Handbook
// 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