змінна
A named storage location that holds a value which can change during program execution
let count: number = 5;
тип
A classification of data that specifies what kind of value a variable can hold (e.g., number, string, boolean)
const name: string = 'Alice';
функція
A reusable block of code that performs a specific task and can accept parameters and return a value
function add(a: number, b: number): number { return a + b; }
клас
A blueprint for creating objects that defines properties and methods shared by instances
class Car { brand: string; }
масив
An ordered collection of elements of the same type, accessed by index
const numbers: number[] = [1, 2, 3];
об'єкт
A collection of key-value pairs representing properties and their values
const person = { name: 'John', age: 30 };
інтерфейс
A contract that defines the structure and types of properties and methods an object must have
interface User { id: number; name: string; }
загальний тип
A type parameter that allows a function or class to work with multiple types while maintaining type safety
function identity<T>(arg: T): T { return arg; }
декоратор
A special declaration that attaches metadata to a class, method, or property and modifies its behavior
@Component() class MyComponent {}
модуль
A file or collection of code that encapsulates related functionality and can be imported/exported
export const greet = () => 'Hello';
набір
A union type that allows a variable to have one of several specified types
type Status = 'success' | 'error' | 'pending';
перевизначення методу
The process of providing a new implementation of a method in a subclass that already exists in the parent class
class Dog extends Animal { bark() { ... } }
асинхронна функція
A function that returns a Promise and can pause execution using the await keyword
async function fetchData() { const data = await fetch(url); }
зберігання типу
TypeScript's ability to preserve type information at runtime through metadata reflection
Reflect.getMetadata('design:type', target, propertyKey)
умовний тип
A type that selects one of two types based on a condition, enabling dynamic type selection
type IsString<T> = T extends string ? true : false;