TypeScript
TypeScript end-to-end सीखें। Types, interfaces, generics, classes, modules, utility और mapped types, declaration files, और compiler।
18 पाठ, क्रम में
- 120 मिनट
Hello, TypeScript
यहाँ एक छोटा JavaScript प्रोग्राम है जो पूरी तरह ग़लत है, और JavaScript इसे ख़ुशी-ख़ुशी चला देगा:
What TypeScript isTsc compile stepRunning a .ts fileThe play button - 225 मिनट
Type Basics
.ts फ़ाइल चलाना आपको आ गया है। अब बुनियादी ईंटों से मिलिए: वे प्रिमिटिव टाइप जो TypeScript के साथ ही आते हैं, और साथ में बचाव के वे दो रास्ते (any और...
Primitive typesStringNumberBooleanNullUndefined+3 - 325 मिनट
Arrays and Tuples
अकेला मान शायद ही कभी काफ़ी होता है। आपके पास तापमानों की सूची होती है, नामों की सूची, क़ीमतों की सूची। और जैसे ही सूची आती है, एक नई क़िस्म की ग़लती...
Array typesReadonly arraysTuple typesFixed-length tuplesNamed tuple elements - 425 मिनट
Object Types and Interfaces
प्रिमिटिव और ऐरे से काफ़ी दूर तक काम चल जाता है, पर असल दुनिया के डेटा का कोई ढाँचा होता है: उपयोगकर्ता के पास नाम और उम्र होती है, अनुरोध के पास...
Object literal typesInterface keywordRequired vs optional propertiesStructural typingExcess property checks - 525 मिनट
Functions
ज़्यादातर बग फ़ंक्शन में ही बसते हैं, और टाइप का सबसे बड़ा फ़ायदा भी वहीं मिलता है। किसी फ़ंक्शन का सिग्नेचर (उसके पैरामीटर और उसका रिटर्न टाइप) कॉल...
Parameter typesReturn typesVoid returnDefault parametersRest parametersFunction type expressions+1 - 625 मिनट
Union and Literal Types
कुछ मान एक ही चीज़ नहीं होते। उपयोगकर्ता ढूँढ़ने वाले फ़ंक्शन को या तो कोई मिलता है या नहीं मिलता। फ़ॉर्म का कोई फ़ील्ड या तो उपयोगकर्ता की टाइप की...
Union typesString literal typesNumeric literal typesLiteral narrowing with as constUnion of object shapes - 730 मिनट
Type Narrowing
यूनियन कहता है "यह मान इन कई टाइप में से कोई एक है"। नैरोइंग (narrowing) कंपाइलर की वह प्रक्रिया है जिसमें वह आपकी लिखी हुई रनटाइम जाँचों के आधार पर...
Typeof narrowingTruthiness narrowingEquality narrowingIn operator narrowingInstanceof narrowingDiscriminated unions+1 - 820 मिनट
Type Aliases vs Interfaces
अब तक आप ऑब्जेक्ट के ढाँचे इनलाइन ही लिखते आए हैं, और चल भी गया क्योंकि ढाँचे छोटे थे। अब किसी असली कोडबेस से लिया गया यह फ़ंक्शन सिग्नेचर देखिए:
Type aliasesInterface declarationsExtending interfacesIntersection typesDeclaration mergingWhen to pick which - 925 मिनट
Optional, Readonly, and Nullable
JavaScript में चलते समय आने वाली सबसे आम त्रुटि ऐसी दिखती है:
Optional propertiesReadonly propertiesNon-null assertion operatorOptional chainingNullish coalescingStrictNullChecks - 1020 मिनट
Enums
कुछ मान एक छोटी, तय सूची से आते हैं। ऑर्डर pending है, shipped है या delivered। लॉग की पंक्ति debug, info, warn या error होती है। दिशा ऊपर, नीचे,...
Numeric enumsString enumsConst enumsEnums vs string literal unionsReverse mapping caveats - 1130 मिनट
Generics
आपको एक ऐसा फ़ंक्शन चाहिए जो कोई ऐरे ले और उसका पहला एलिमेंट लौटा दे। आसान है:
Generic functionsGeneric interfacesType parametersType inference for genericsBounded generics with extendsDefault type parameters - 1225 मिनट
Classes
यह रहा एक बैंक खाता, सादे ऑब्जेक्ट के रूप में लिखा हुआ:
Class declarationsConstructorsInstance propertiesAccess modifiers (public, private, protected)Readonly fieldsParameter properties+1 - 1325 मिनट
Inheritance and Abstract Classes
आपने किसी पेमेंट सिस्टम के लिए तीन क्लास लिखी हैं: CardPayment, BankTransfer और Voucher। तीनों में एक amount, एक currency और एक createdAt है। तीनों...
Extends keywordSuper callsMethod overrideAbstract classesAbstract methodsImplements with interface - 1425 मिनट
Modules
हर TypeScript फ़ाइल अपने आप में एक मॉड्यूल है। जिस क्षण किसी फ़ाइल में import या export आ जाता है, उसके ऊपरी स्तर के नाम ग्लोबल रहना बंद कर देते हैं...
ES module syntaxNamed exportsDefault exportType-only importsRe-exportsModule resolution basics - 1530 मिनट
Utility Types
TypeScript के साथ जेनरिक टाइप्स की एक छोटी सी लाइब्रेरी आती है, जो एक टाइप को इनपुट की तरह लेती है और बदला हुआ टाइप वापस लौटाती है। इनके नाम बहुत...
Partial<T>Required<T>Readonly<T>Pick<T, K>Omit<T, K>Record<K, V>+2 - 1630 मिनट
Mapped and Conditional Types
अभी-अभी आपने जो यूटिलिटी टाइप इस्तेमाल किए (Partial, Pick, Record, ReturnType), वे सब भाषा की दो सुविधाओं से बने हैं: किसी ऑब्जेक्ट की कुंजियों और...
Keyof operatorMapped types syntaxKey remapping with asConditional typesInfer keywordDistributive conditional types - 1725 मिनट
Declaration Files and Libraries
आप कोई लाइब्रेरी इंस्टॉल करते हैं, उसे इम्पोर्ट करते हैं, और आपका एडिटर ऑटोकम्प्लीट, पैरामीटर के संकेत और हर लौटाए गए मान का ठीक-ठीक ढाँचा दिखाने...
.d.ts filesDefinitelyTyped (@types packages)Ambient declarationsDeclare moduleTypeRoots and types option - 1830 मिनट
tsconfig and the Compiler
tsconfig.json वही फ़ाइल है जिसे पढ़कर TypeScript का कंपाइलर तय करता है कि कंपाइल क्या करना है और कैसे। इसमें सौ से ज़्यादा विकल्प हैं, पर असली...
Tsconfig.jsonStrict modeTarget and libModule and moduleResolutionOutDir and rootDirIncremental and watch+1
अपनी भाषा में TypeScript सीखें
हर पाठ, क्विज़ और ट्यूटर का जवाब आपकी भाषा में आता है। AI ट्यूटर उसी भाषा में जवाब देता है जिसमें आप पूछते हैं।
Roles that use TypeScript
See how hiring teams interview engineers on TypeScript, in production-like environments.
Frontend Engineer (React, Angular, Vue)
Hire frontend engineers in real workspaces with Vite, real component libraries and real performance budgets. Live or take-home, fully recorded.
See the interviewFull Stack Developer
Hire full stack developers in real apps with real APIs, real UIs and real tests. Live or take-home, fully recorded.
See the interviewWeb Application Engineer
Hire web application engineers in real apps with real routes, real auth and real test suites. Live or take-home, fully recorded.
See the interview