- Discovering Typescript through playground, why does this compile and run successfully ? https://www.typescriptlang.org/fr/play#code/DYUwLgBGBcEHYFcC2AjEAnCAfCBnM6AlnAOYBQkAvBAKxkDGA9nLo6AHTCMkAUYAlBQjUARDRENmrDl14Ch1AGYBDYLhCSWbEJ259+QA 3 comments typescript
- Generic not type checking as expected? https://www.typescriptlang.org/play?#code/MYGwhgzhAEDiBOB7ArgB2gbwL4FgBQ+ALgJ6oCmcSaA0mcRADwAqAfNALyb4CQA2tdACWAO2gBrOogBm0JgF0AXLP5zoZAB6EywgCYwEKdAH5oApcLIA3MvADc+LLwnFpsufYJ5QkGAHkARgBWzCz4GPjQkULCBmgQSrGotPQhvKqcaQ74+N5Q0AGBAMLgeRpaun5BDIkAEoggOjaheOF4UdGJMBkA5ADmVKgAgt2qAPSjsqQU3RCE8CK9ad1CMMKIhNA+gr3CYP4gFISI0CTk0N2JyYy19Y3wLEsRUU+RIIjAYCAAkjED8ZSGK7VAZ1BpNNIcaC8PoDYYAGnOa0IgxAbwA7mQdCNoONoGjEPAxDBINFyo0dNk2lEwDodIkABQASi4VPakUIAAtBBAAHQiTqQ6H9QwAIRGLzZnO5fN+hi6UO6SJR6Mx2Nx+MJEAR-mQGwgHJQDWgSMpbKiUt5bw+31lcUFMNFaomGqJmxgIjJmIl7QtPKtnx+nR5qGQ+vp50+EEQADl1srEBisdBmeqCa6SR7tOSJbg8LmciV9CDbjYwhLhWhBgBCBIDcsDEU1gFoBxAA 2 comments typescript
- Structurally incompatible but no error? https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgGIHt3IN4ChnIDaoAJhAB4BcyIArgLYBG0AutXU9ANz7IA2cAM5gAcnHoRqwqKADmPAL64A9MoDq6KAGtBAOmQBRcgAcICSCVwJ0IYchiYAjNQxYAvDl4AGao4A0vM7IAEwBBMHUAMxh-EKi4pLIAOQAIrQIWkkBCjwq6po6+gCqIBSm5hCWqgDKABbotHwkIElgyMBtYLVQ6ADuyHDI0D1QyLXQKAA8ALSzVjZ2DugRaJjIHngEAsJiEtSp6ZnZuXnWtuh8ELp86LIAFACCUFBwAJ66wIJPL693S8EASgBuCAA 5 comments typescript
- How can I use the union of values of an object passed as argument as a generic of that function. https://www.typescriptlang.org/play?#code/PTAEGUHsFsFNQK4DsCWkmgC4E8AO8EBnWAE1BQ0wAt4BDXXAGxQGNbM0kBYAKB31ABZbAFVU6UAF5QAclozQAH1kAjBcpkt1skjIDcvXiFABBDJBUArWC0yJiZAGaQATqBboAbrBcckAc1BCTBcKf0JQSEcsGkRxSkhQJFgAdyCQsMJefnhBegB5KylQACUbVxIAHmExTgAadNCAgD4DHiMwAHUqdlAehlgkCJoXeBJIWEIkGTtR2kZGbFBodkwfADoO0AAVWJRoXFdMWiQ7ajDyCOpemWCm-wUKGPhRzAQXSjx4QipIBEYyCp4NBXN98CwUI5WJseMYAJJ2H5-AGgIHPOKcSLRTzzBCTLFCApWGEeIZ2aDYABiGGkAApaC4XLRsAAuISieIAbQAug0Vrg2XlcIVLABKNl3MI8qTNUAAb14oHc6GCoFGhH+mDZJkZzMqkpaxR5elAxnAtDgfR8sEVoFtxhKJ3G0FAsAAHhamPAVEQKJMIoxIP5obaGUzsOtRt4XMRaaL1s4XABRWgsKi02k4xiimXy21K9Wa9a4Ijp-mcrPc0VtJUAX2rhh4Bdgbw+asmmratbajeMSY9B0YBEItH8Np4pNVHkDLiFxQVTdAtDZMlGujqtpUK5UjDxMg3i5YK-8o0G+9tJBX2FgC0gKXPPG7vbAABFJig167HI4bFqsF8CULRhEV+f5AXgWlV1IbQZB3PclFkE9YDPBCZGvW971FHleEnWYO2A4oKWpWlOU0fdZHkBpYPImR1womReWVGchQbHggA 9 comments typescript
- Type | Treat Day 5 https://www.typescriptlang.org/play?#gist/927ccc66ae3022dc64c4f650109b937a-18 16 comments typescript
- Recursive Function Problem https://www.typescriptlang.org/play?#code/FAFwngDgpgBAEgSygJwIbIMYAswFEA2UAtlAHYgwC8MA3sDDAgCYBcMAziMgqQOYDc9GKVQk2nbn0EMI6MiACSrDlx68h2BPibIyAfjaIU6bHkIlyAbQC6ggL7BgUAB4QA9sgoAzAK6kMIAhupDBePExKAHJQnFBMABRMqCCohkhomDgExPIANIzKEmoAlGykPkQARig2tEIIXjCJyagAdMxUlNTMxTC6ID7IITaCQoQUuuw++CBlFdXII44MGMGcjFRNSSmtmtq6IQA+hzA2xa1hpBFXLvHxe0y9lAB8dQwM-YMh8ZPTFNSXCJMaKxBIPfI9YrSGB2KHLRiNH4xP69T5DU4IfKtbG-Ga2YB2IA 7 comments typescript
- [TS 4.4.3] Did I finally figure out how to create a callable object with properties in a type-safe way (playground link inside)? https://www.typescriptlang.org/play?#code/HYQwtgpgzgDiDGEAEAxJBvAsAKCXpEAHjAPYBOALkgJbAURkBmCyKJJGO+3Sj7AXEmABXMACMGXfAF8cUvLXpMWqdigQVyAT064eeABR8SgkeIYBKQWxLyks7HYpaYrdgFkSAE2EAbZAC8qiTq8JpkOgBkuvp4ZBAgXiTAvjpeEMx+FNbsdg52RKSUSPDJUFQ2OSSePv5IQQYGFvUAfDGxpcDlSGD1SEYCQqISZM0BbQbovOz2FnbcYAB06Zm+VEFTxoIAjPbz+PEUwmTAPXkWTTj52J3djNvWizZ9KE-sBttzN2VUjABMj2eQVeNmWGRAWTk3y6JH8i18JAA5kZPjhbrCIPCkUY-l90XCEcj7vUAkF-niyhisUTtotjCSyX86ewLEA 12 comments typescript
- I'm having trouble documenting the following function with JSDoc. Unable to type a parameter with T[K] https://www.typescriptlang.org/play?#code/PQKhCgAIUgxBLANgFwKYCcDOkCG704CekA9gGakBGAVqgMbLaXF0kC2ADnvAHYDmkZAAtUkAG45EAV1HlckPvDGoekDuhIcMyYshLzFy1ROmoAdFAjRIAATSdEONJAAqAGkgBpS7a4E2kADeLgDaALoAvuKSMtguIrj4RKQUJDT0jJCEJFKQAO44PMiC+mRIaOgW1jZ+OAGBnlEA1qjEAHJ1shTCouqa2oTALbpCTvlIiJCUoqyceKgAJlUwNXh1QaGekZCzfqguJABqMaImMpBSmIslkAuoFWy8onlC8HRCVLQM2HqQZSgYZa2dD3KToHjYYLhKJ4AgsEhFHC8XgCHrRUzYOSGFSQYbLYDgVAADw4JHQxTIUh4DHgCL+5QwAHl0t8AEKEAAKGi05MIx1MAB53F5IMS0DwFthhnIXAA+AAUZ1QmAAXK5wh5hmrPB5dvMDvyZGrNmEAJTG8JBKCQEHIMHGE6YMz-CryxUnY2myAAXll6JkIWGYR93u9O3YewNJ1NAG5wBEgA 6 comments typescript
- Strange generic inference for string literals http://www.typescriptlang.org/play/#src=type%20NoInfer%3CT%3E%20%3D%20T%20%26%20%7B%20%5BK%20in%20keyof%20T%5D%3A%20T%5BK%5D%20%7D%0D%0A%0D%0Aexport%20const%20widens%20%3D%0D%0A%20%20%3CT%20extends%20string%2C%20U%20extends%20Record%3Cstring%2C%20T%3E%3E(o%3A%20U)%3A%20U%20%3D%3E%20o%0D%0A%0D%0Aexport%20const%20doesNotWiden%20%3D%0D%0A%20%20%3CT%20extends%20string%2C%20U%20extends%20Record%3Cstring%2C%20T%3E%3E(o%3A%20U)%3A%20NoInfer%3CU%3E%20%3D%3E%20o%0D%0A%0D%0Aconst%20a%20%3D%20widens(%7B%20prop%3A%20'This%20will%20turn%20into%20a%20string'%20%7D)%0D%0A%0D%0Aconst%20b%20%3D%20doesNotWiden(%7B%20prop%3A%20'This%20will%20stay%20a%20string%20literal'%20%7D)%0D%0A%0D%0Aconst%20c%20%3D%20()%20%3D%3E%20(%7B%20prop%3A%20a.prop%20%7D)%0D%0A%0D%0Aconst%20d%20%3D%20()%20%3D%3E%20(%7B%20prop%3A%20b.prop%20%7D)%0D%0A%0D%0A%2F%2F%20Inspect%20the%20types%20of%20c%20and%20 4 comments typescript
- Adding an array to a type union results in misleading error message - is this expected? https://www.typescriptlang.org/play/index.html#src=%2F%2F%20This%20type%20gives%20the%20error%20message%20I'd%20expect%3A%0D%0A%2F%2F%20%20%20%20%20%60Property%20'name'%20is%20missing%20in%20type%20'%7B%7D'.%60%0D%0Atype%20Foo%20%3D%20string%20%7C%20%7B%20name%3A%20string%20%7D%3B%0D%0Aconst%20foo%3A%20Foo%20%3D%20%7B%7D%3B%0D%0A%0D%0A%2F%2F%20Adding%20an%20array%20type%20to%20the%20union%20results%20in%20a%20misleading%20error%20message%3A%0D%0A%2F%2F%20%20%20%20%20%60Type%20'%7B%7D'%20is%20not%20assignable%20to%20type%20'string'.%60%0D%0Atype%20Bar%20%3D%20string%20%7C%20%7B%20name%3A%20string%20%7D%20%7C%20any%5B%5D%3B%0D%0Aconst%20bar%3A%20Bar%20%3D%20%7B%7D%3B%0D%0A%0D%0A%2F%2F%20Removing%20the%20string%20type%20gives%20the%20expected%20error%3A%0D%0A%2F%2F%20%20%20%20%20%60Property%20'name'%20is%20missing%20in%20type%20'%7B%7D'.%60%0D%0Atype%20Baz%20%3D%20%7B%20name%3A%20string%20%7D%20%7C%20any%5B%5D%3B%0D%0Aconst%20baz%3A%20Baz%20%3D%20%7B%7D%3B 12 comments typescript
- Restrict a prop in an interface to of a group of variables/values of object? https://www.typescriptlang.org/play/#src=const%20classes%20%3D%20%7B%0D%0A%20%20%20%20Add%3A%20'pr-add'%2C%0D%0A%20%20%20%20Edit%3A%20'pr-edit'%2C%0D%0A%20%20%20%20Delete%3A%20'pr-delete'%0D%0A%7D%3B%0D%0A%0D%0Aenum%20Classes%20%7B%0D%0A%20%20%20%20ADD%20%3D%20classes.Add%2C%0D%0A%20%20%20%20EDIT%20%3D%20classes.Edit%2C%0D%0A%20%20%20%20DELETE%20%3D%20classes.Delete%2C%0D%0A%7D%0D%0A%0D%0Ainterface%20IProps%20%7B%0D%0A%20%20%20%20prClasses%3A%20%3CRESTRICTED%20CLASSES%20HERE%3E%0D%0A%7D%0D%0A%0D%0A 6 comments typescript
- Help newbie with event listeners - not sure what's the right way to do this. https://www.typescriptlang.org/play/#src=const%20video%20%3D%20document.createelement('video')%3B%0D%0Aconst%20handler%20%3D%20(event%3A%20event)%20%3D%3E%20console.log(event.target.duration)%3B%20%2F%2F%20but%20i%20need%20duration%20%3A(%0D%0Aconst%20options%20%3D%20%7B%20once%3A%20true%2C%20passive%3A%20true%20%7D%3B%0D%0Avideo.src%20%3D%20'...'%3B%20%2F%2F%20some%20video%20sample%0D%0Avideo.addeventlistener('loadedmetadata'%2C%20handler%2C%20options)%3B%20%2F%2F%20no%20options%20allowed%3F%0D%0A%0D%0A%2F%2F%20surely%20there%20must%20be%20a%20better%20way%20to%20do%20this.%0D%0Aconst%20videotarget%3A%20eventtarget%20%3D%20video%3B%0D%0Avideotarget.addeventlistener('loadedmetadata'%2C%20handler%2C%20options)%3B 3 comments typescript
- Typescript generic object - append properties in return https://www.typescriptlang.org/play/#src=interface%20PermissionsAvailable%20%7B%0D%0A%20%20%20%20%5Bkey%3A%20string%5D%3A%20%7B%0D%0A%20%20%20%20%20%20%20%20role%3F%3A%20number%3B%0D%0A%20%20%20%20%20%20%20%20feature%3F%3A%20string%3B%0D%0A%20%20%20%20%20%20%20%20has%3F%3A%20boolean%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Aexport%20function%20verifyPermissions%3CT%20extends%20PermissionsAvailable%3E(p%3A%20T)%3A%20T%20%26%20%7B%20%5Bkey%3A%20string%5D%3A%20%7B%20has%3A%20boolean%20%7D%7D%20%7B%0D%0A%20%20%20%20for%20(let%20i%20in%20p)%20%7B%0D%0A%20%20%20%20%20%20%20%20p%5Bi%5D.has%20%3D%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20return%20p%20as%20T%20%26%20%7B%20%5Bkey%3A%20string%5D%3A%20%7B%20has%3A%20boolean%20%7D%7D%3B%0D%0A%7D%0D%0A%0D%0Aconst%20r%20%3D%20verifyPermissions(%7Bprop1%3A%20%7Brole%3A%202%7D%7D)%3B%0D%0A%0D%0Aif%20(r.prop1.has)%20%7B%0D%0A%09console.log(%22HAS%20PERMISSION!%22)%3B%0D%0A%7D 4 comments typescript
Linking pages
- Typescript is terrible for library developers: We spend a disproportionate amount of time on types https://erock.prose.sh/typescript-terrible-for-library-developers 341 comments
- Use string literal instead of enums! https://devsparks.goooseman.dev/hacks/20240715-use-string-literals-not-enums/ 99 comments
- GitHub - typescript-cheatsheets/react: Cheatsheets for experienced React developers getting started with TypeScript https://github.com/sw-yx/react-typescript-cheatsheet 57 comments
- GitHub - markerikson/react-redux-links: Curated tutorial and resource links I've collected on React, Redux, ES6, and more https://github.com/markerikson/react-redux-links 39 comments
- Typescript : class vs interface. I want to adress a problem I’ve seen… | by Valentin PARSY | Frontend Weekly | Medium https://medium.com/front-end-hacking/typescript-class-vs-interface-99c0ae1c2136 37 comments
- GitHub - microsoft/TypeScript: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. https://github.com/microsoft/TypeScript 32 comments
- GitHub - dexteryy/spellbook-of-modern-webdev: A Big Picture, Thesaurus, and Taxonomy of Modern JavaScript Web Development https://github.com/dexteryy/spellbook-of-modern-webdev 32 comments
- Functional Programming concept of Either in typescript | by Pierre Dahmani | Aug, 2022 | Medium https://medium.com/@business_59035/fp-for-the-practical-programmer-pt1-the-either-type-2b14380cc8cc 30 comments
- Using TypeScript – React https://react.dev/learn/typescript 29 comments
- TypeScript for Pythonistas. Authored by Allison Kaptur | by Pilot EPD | Medium https://medium.com/@Pilot-EPD-Blog/typescript-for-pythonistas-f90bbb297f0a 26 comments
- How to handle and design the startup of a React application | by Andréas Hanss | JavaScript in Plain English https://medium.com/javascript-in-plain-english/how-to-handle-and-design-the-startup-of-a-react-application-da779f3727e5 18 comments
- TypeScript enums explained. This article explains the difference… | by Kat Busch | Medium https://medium.com/p/typescript-enums-explained-e5f9a101afc9 17 comments
- JavaScript vs JavaScript: Round 2. Fight! - DEV Community https://dev.to/this-is-learning/javascript-vs-javascript-round-2-fight-2m44 14 comments
- Manual Typing is No Fun: Introducing TypeWiz! | by Uri Shaked | Medium https://medium.com/@urish/manual-typing-is-no-fun-introducing-typewiz-58e3e8813f4c 14 comments
- Typing the Technical Interview in TypeScript https://gal.hagever.com/posts/typing-the-technical-interview-in-typescript/ 11 comments
- 14 Useful Packages Every React Developer Should Know | by Trevor-Indrek Lasn | Better Programming https://medium.com/p/55b47a325d3 11 comments
- Taming Complex React State with Union Types https://www.joefiorini.com/taming-complex-state-union-types 9 comments
- Solving Riddles with 0 lines of program in Typescript | by Damodharan Jay | ITNEXT https://medium.com/@damodharanjay/solving-riddles-with-0-lines-of-program-b23994072dd0 9 comments
- Redux & Typescript typed Actions with less keystrokes | by Martin Hochel | Medium https://medium.com/@martin_hotell/redux-typescript-typed-actions-with-less-keystrokes-d984063901d 8 comments
- To mutate, or immutate, that is the question - LogRocket Blog https://blog.logrocket.com/to-mutate-or-immutate/ 8 comments
Would you like to stay up to date with Web Development? Checkout Web Development
Weekly.
Related searches:
Search whole site: site:www.typescriptlang.org
Search title: TypeScript: Playground TS - Un éditeur en ligne pour explorer TypeScript et JavaScript
See how to search.