- https://sulco.stackblitz.io/
- https://type-level-typescript.com/
- https://basarat.gitbook.io/typescript/
- https://github.com/bautistaaa/typehero
- https://github.com/sindresorhus/type-fest
- https://github.com/gibbok/typescript-book
- https://github.com/basarat/typescript-book
- https://github.com/TheAlgorithms/TypeScript
- https://github.com/imteekay/mini-typescript
- https://github.com/danvk/effective-typescript
- https://github.com/dzharii/awesome-typescript
- https://github.com/LearningTypeScript/projects
- https://github.com/typescript-cheatsheets/react
- https://github.com/mkosir/typescript-style-guide
- https://github.com/microsoft/TypeScript-Handbook
- https://github.com/labs42io/clean-code-typescript
- https://github.com/type-challenges/type-challenges
- https://www.totaltypescript.com/tsconfig-cheat-sheet
- https://github.com/DanWahlin/typescript-fundamentals
- https://github.com/santoshyadavdev/typescript-basics
- https://github.com/microsoft/TypeScript-New-Handbook
- https://github.com/glebec/beginners-typescript-tutorial
- https://github.com/CodelyTV/awesome-typescript-examples
- https://2ality.com/2020/04/migrating-to-typescript.html
- https://github.com/enricopolanski/functional-programming
- https://kentcdodds.com/blog/typescript-function-syntaxes
- https://github.com/total-typescript/total-typescript-book
- https://github.com/ghoullier/awesome-template-literal-types
- https://github.com/typescript-exercises/typescript-exercises
- https://github.com/total-typescript/beginners-typescript-tutorial
- https://dev.to/ganeshmani/typescript-basics-a-definitive-guide-57j
npm install -g typescript
tsc --init
tsc --watch
npm init
- https://tsdocs.dev
- http://json2ts.com
- https://tsdiagram.com
- https://tsconfig.guide
- https://ts-ast-viewer.com
- https://mgv.io/deep-readonly-play
- https://github.com/orta/typescript-notes
- https://rmolinamir.github.io/typescript-cheatsheet/
- https://twitter.com/mgechev/status/1240178886979223552
- https://github.com/Villanuevand/typescript-generics-workshop
- https://dev.to/ruslanchek_17/some-useful-typescript-snippets-2278
- https://gist.github.com/busypeoples/b2d9ecda58ff25f3206e8c171f04b087
- https://gist.github.com/busypeoples/eebd1f893671959162df97cc8a6292e0
- https://nehalist.io/5-typescript-tips-to-improve-your-architecture/
- https://www.sitepoint.com/10-essential-typescript-tips-tricks-angular/
- https://dev.to/phenomnominal/stricter-typescript-compilation-with-betterer-dp7
- https://dev.to/ibrahima92/advanced-typescript-types-cheat-sheet-with-examples-5414
- https://dev.to/aminejvm/cool-stuff-with-typescript-2aah
- https://www.divotion.com/blog/creating-type-safe-events
- https://backstage.orus.eu/the-5-commandments-of-clean-error-handling-in-typescript/?latest
- https://github.com/antfu/starter-ts
- https://github.com/NiGhTTraX/ts-monorepo
- https://github.com/egoist/ts-lib-starter
- https://github.com/stijnvanhulle/template
- https://github.com/wixplosives/sample-monorepo
- https://github.com/Doist/todoist-api-typescript
- https://github.com/CodelyTV/typescript-ddd-skeleton
- https://github.com/metachris/typescript-boilerplate
- https://github.com/xolvio/typescript-event-sourcing
- https://github.com/stemmlerjs/simple-typescript-starter
- https://github.com/kettanaito/create-typescript-library
- https://github.com/JoshuaKGoldberg/template-typescript-node-package
- https://github.com/takuya-motoshima/esm-and-other-format-libraries-starter
- https://github.com/egoist/tsup
- https://github.com/imjuni/ctix
- https://github.com/formium/tsdx
- https://github.com/unjs/magicast
- https://github.com/3rd/tsdiagram
- https://github.com/phero-hq/phero
- https://github.com/nonara/ts-patch
- https://github.com/esbuild-kit/tsx
- https://github.com/Microsoft/tsdoc
- https://github.com/pastelsky/tsdocs
- https://github.com/joaompneves/tsviz
- https://github.com/cevek/ttypescript
- https://github.com/johnlindquist/kit
- https://github.com/DanielXMoore/Civet
- https://github.com/microsoft/rushstack
- https://github.com/ranyitz/code-migrate
- https://github.com/tr1ckydev/hyperimport
- https://github.com/alshdavid/BorrowScript
- https://github.com/bloomberg/ts-blank-space
- https://github.com/SuperchupuDev/tinyglobby
- https://github.com/phenomnomnominal/betterer
- https://github.com/privatenumber/get-tsconfig
- https://github.com/saurabhdaware/typescript-run
- https://github.com/DavidWells/types-with-jsdocs
- https://github.com/angular-architects/detective
- https://github.com/rx-angular/import-graph-visualizer
- https://github.com/LeDDGroup/typescript-transform-paths
- https://github.com/arethetypeswrong/arethetypeswrong.github.io
- https://github.com/antfu/utils
- https://github.com/webpro/knip
- https://github.com/hqoss/guards
- https://github.com/dolanmiu/docx
- https://github.com/palmerhq/tsdx
- https://github.com/danvk/ts-mover
- https://github.com/kutyel/linq.ts
- https://github.com/microsoft/tsdoc
- https://github.com/contiamo/rhombic
- https://github.com/zMotivat0r/mrepo
- https://github.com/total-typescript
- https://github.com/Effect-TS/stream
- https://github.com/nadeesha/ts-prune
- https://github.com/renke/import-sort
- https://github.com/radarsu/ts-import
- https://github.com/compodoc/ts-stats
- https://github.com/jeffijoe/typesync
- https://github.com/nobrainr/morphism
- https://github.com/airbnb/ts-migrate
- https://github.com/rikukissa/typehole
- https://github.com/SamVerschueren/tsd
- https://github.com/true-myth/true-myth
- https://github.com/nfriend/ts-key-enum
- https://github.com/runem/ts-simple-type
- https://github.com/dsherret/ts-ast-viewer
- https://github.com/tannerntannern/ts-mixer
- https://github.com/JoshuaKGoldberg/TypeStat
- https://github.com/seek-oss/vanilla-extract
- https://github.com/radarsu/options-defaults
- https://github.com/piotrwitek/utility-types
- https://github.com/drwpow/openapi-typescript
- https://github.com/vedantroy/typecheck.macro
- https://github.com/kreuzerk/import-conductor
- https://github.com/ostrowr/ts-json-validator
- https://github.com/open-draft/event-contract
- https://github.com/ts-essentials/ts-essentials
- https://github.com/jonaskello/tslint-immutable
- https://github.com/JoshuaKGoldberg/ts-api-utils
- https://github.com/yosietserga/ts-scripts-tools
- https://github.com/robertmassaioli/ts-is-present
- https://github.com/ngfelixl/typescript-algorithms
- https://github.com/NetanelBasal/helpful-decorators
- https://github.com/Idered/typescript-expect-plugin
- https://github.com/valentinkononov/ts-runtime-checker
- https://github.com/mattpocock/total-typescript-helpers
- https://github.com/madou/typescript-transformer-handbook
- https://github.com/ggascoigne/prettier-plugin-import-sort
- https://github.com/lukeed/tsm
- https://github.com/yangshun/lago
- https://github.com/stalniy/casl
- https://github.com/krzkaczor/earl
- https://github.com/thi-ng/umbrella
- https://github.com/TypeStrong/typedoc
- https://github.com/adelsz/pgtyped
- https://github.com/codemix/ts-sql
- https://github.com/kysely-org/kysely
- https://github.com/kristiandupont/kanel
- https://github.com/kysely-org/awesome-kysely
- https://github.com/sequelize/sequelize-typescript
- https://github.com/tldraw/tldraw
- https://github.com/shikijs/twoslash
- https://github.com/stefanseeger/ts-page-object
- https://github.com/vanilla-extract-css/vanilla-extract
- https://github.com/mobily/ts-belt
- https://github.com/marpple/FxTS
- https://github.com/gcanti/fp-ts
- https://github.com/gigobyte/purify
- https://github.com/gcanti/fp-ts-contrib
- https://github.com/rametta/pratica
- https://github.com/Effect-TS/core
- https://github.com/rayepps/radash
- https://github.com/antoine-coulon/effect-introduction
- https://github.com/1Password/typeshare
- https://github.com/Aleph-Alpha/ts-rs
- https://github.com/madonoharu/tsify
- https://github.com/ddd-mtl/zits
- https://github.com/jquense/yup
- https://github.com/funkia/list
- https://github.com/gcanti/io-ts
- https://github.com/nartc/mapper
- https://github.com/pfgray/ts-adt
- https://github.com/mu-io/ts-japi
- https://github.com/skarab42/zoxy
- https://github.com/decs/typeschema
- https://github.com/pelotom/unionize
- https://github.com/pelotom/runtypes
- https://github.com/arcanis/typanion
- https://github.com/arktypeio/arktype
- https://github.com/mistlog/typetype
- https://github.com/stephenh/ts-proto
- https://github.com/syntax-tree/unist
- https://github.com/gcanti/monocle-ts
- https://github.com/maleet/marshal.ts
- https://github.com/millsp/ts-toolbelt
- https://github.com/ronami/meta-typing
- https://github.com/eonarheim/TypeState
- https://github.com/gvergnaud/hotscript
- https://github.com/willryan/factory.ts
- https://github.com/quicktype/quicktype
- https://github.com/sledorze/morphic-ts
- https://github.com/aidenybai/pattycake
- https://github.com/sinclairzx81/typebox
- https://github.com/gvergnaud/ts-pattern
- https://github.com/rsinger86/dto-classes
- https://github.com/fabian-hiller/valibot
- https://github.com/graphology/graphology
- https://github.com/jamiebuilds/sarcastic
- https://github.com/muellerbbm-vas/grivet
- https://github.com/rhys-vdw/ts-auto-guard
- https://github.com/jpbulman/Advanced-Sets
- https://github.com/wix-incubator/as-typed
- https://github.com/pksilen/validated-types
- https://github.com/krzkaczor/ts-essentials
- https://github.com/Rich-Harris/object-cull
- https://github.com/woutervh-/typescript-is
- https://github.com/jrylan/json-schema-typed
- https://github.com/practical-fp/union-types
- https://github.com/seek-oss/vanilla-extract
- https://github.com/data-forge/data-forge-ts
- https://github.com/4lessandrodev/rich-domain
- https://github.com/typestack/class-validator
- https://github.com/devexperts/remote-data-ts
- https://github.com/gustavoguichard/string-ts
- https://github.com/gbumanzordev/utility-types
- https://github.com/typestack/class-transformer
- https://github.com/timocov/dts-bundle-generator
- https://github.com/sfkiwi/linked-list-typescript
- https://github.com/ThomasAribart/json-schema-to-ts
- https://github.com/DefinitelyTyped/DefinitelyTyped
- https://github.com/YousefED/typescript-json-schema
- https://github.com/seasonedcc/composable-functions
- https://github.com/gbumanzordev/payload-transformer
- https://github.com/dsherret/conditional-type-checks
- https://github.com/moltar/typescript-runtime-type-benchmarks
- https://github.com/ecyrbe/zodios
- https://github.com/colinhacks/zod
- https://github.com/duplojs/zod-accelerator
- https://github.com/astahmer/openapi-zod-client
- https://github.com/JacobWeisenburger/zod_utilz
- https://github.com/supermacro/neverthrow
- https://github.com/skarab42/ts-pojo-error
- https://github.com/ivanhofer/exceptionally
- https://medium.com/javascript-in-plain-english/whats-coming-with-typescript-4-0-language-features-3a98fc8db48f
- https://fettblog.eu/variadic-tuple-types-preview/
- https://twitter.com/mgechev/status/1219884973328621570/photo/1
- https://twitter.com/sulco/status/1219982511180263424/photo/1
- https://twitter.com/mgechev/status/1220246042807078912/photo/1
- https://github.com/mdevils/typescript-exercises
- https://gist.github.com/busypeoples/270f29ec6cdd45780889c53e7b52884a
- https://hughfdjackson.com/javascript/arrow-function-semantics/
- http://babeljs.io/docs/learn-es2015/
- http://ponyfoo.com/
- http://www.typescriptlang.org/Playground
- http://tarh.developpez.com/articles/typescript/pourquoi-utiliser-typescript/
- http://kangax.github.io/compat-table/es6/
- http://code.tutsplus.com/articles/33-developers-you-must-subscribe-to-as-a-javascript-junkie--net-18151
- https://github.com/lukehoban/es6features
- http://www.2ality.com/2016/05/six-nifty-es6-tricks.html
- https://www.sitepen.com/blog/2016/09/01/typescript-2-0-awesomeness/
- https://www.bennadel.com/blog/3217-defining-function-and-callback-interfaces-in-typescript.htm
classe si besoin de creer des function sur le pojo ou bien interface suffit si classe alors utiliser mecanisme fromJSON (ng-book2 screencast final-app voir code source)
- https://www.typescriptlang.org/docs/handbook/classes.html
- https://css-tricks.com/creating-reusable-base-classes-in-typescript-with-a-real-life-example
- https://stackoverflow.com/questions/44129817/typescript-generic-service
- https://stackoverflow.com/questions/28273714/typescript-generics-extending-class-and-interface
- https://codereview.stackexchange.com/questions/164995/best-solution-for-returning-results-from-a-generic-typescript-service
- https://nicotsou.com/tltr-typescript-mapped-types/
typescript types - https://www.typescriptlang.org/docs/handbook/basic-types.html typescript tuto - http://www.typescriptlang.org/docs/tutorial.html interface vs classe typescript interface - https://www.typescriptlang.org/docs/handbook/interfaces.html typescript classe - http://www.typescriptlang.org/docs/handbook/classes.html typescript .d.t - https://github.com/DefinitelyTyped/DefinitelyTyped /// typescript arrays - http://www.codecompiled.com/arrays-in-typescript/
typescript interface interface HasScore { score: number; } function addPointsToScore(player: HasScore, points: number): void { player.score += points; }
typescript interface interface CanRun { run(meters: number): void; } function startRunning(pony: CanRun): void { pony.run(10); }
typescript classe class NamedPony { constructor(public name: string, private speed: number) { }
typescript optionnal public votes?: number; + this.votes = votes || 0;
typescript types const poneyNumber: number = 0; const poneyName: string = 'Rainbow Dash';
const pony: Pony = new Pony(); const ponies: Array<Pony> = [new Pony()];
typescript type retour function startRace(race: Race): Race {
typescript enum enum RaceStatus {Ready, Started, Done} const race = new Race(); race.status = RaceStatus.Ready;
es6 features - http://es6-features.org/#Constants
es6 collections const users = new Map(); OU const users = new Set();
es6 iterer for (let user of users) { console.log(user.name); }
es6 template const fullname = Miss ${firstname} ${lastname}
;
exampleObject: { [key: string]: string };
exampleObject: {
[key in IdOptionEnum]: string;
} = {
[IdOptionEnum.UID]: 'uid',
[IdOptionEnum.UUID]: 'uuid',
[IdOptionEnum.YUID]: 'yuid'
};
enum Size {
Small = 100
Medium = 200
Big = 300
}
exampleObject: keyof typeof ImageSize = 'Medium';
type Values<T> = T[keyof T];
// primitive type like bool, number, string, symbol.
const o: object; // You can't assign to primitive type neither null or undefined
const q: { [key: string]: any }; // You can't assign to primitive type neither null or undefined
const p: {}; // or Object, you can assign to primitive type but not null or undefined
- union types do not exist at compile-time, use union when the types are known at compile-time,
- programs that need access to the enumerated values should probably use an object instead.
- use kind field to make a discriminated union and thus make difference easily recognisable
- we can differentiate between types in a union with a type guard using the field kind or simply with the value.
- keywords: typescript conditional types / typescript identity / typescript Narrowing / typescript mixins / type guard
// https://stackoverflow.com/questions/64034690/typescript-extend-interface-dynamically-by-adding-new-fields-with-certain-namin
interface ProjectCostData {
purchasePrice: number;
propertyValue: number;
recentlyDamaged: boolean;
}
// Create a new setter property for each key of an interface
type WithSetters<T extends { [k: string]: any }> = T & {
[K in keyof T & string as `set_${K}`]: (newValue: T[K]) => void
// Testing
declare const obj: WithSetters<ProjectCostData>
obj.purchasePrice // number
obj.set_purchasePrice(123) // (newValue: number) => void
}
Imports within the same entry-point have to be relative, otherwise they would be considered to import from an external package/entry-point. On the other hand, imports into other entry-points must never be relative. If these rules are not followed, you run into all sorts of issues. Conceptually, this difference is essential to be able to look at an import and know where it is resolved from (i.e. whether it crosses an entry-point boundary or not) TypeScript path mappings shouldn't be used to make imports cleaner, shorter, sexier or whatever adjective you want to use. But rather used to resolve dependencies at design time that would otherwise not be automatically resolved, which is what it was designed for.
- https://www.youtube.com/watch?v=Fgcu_iB2X04 Utility Types - Advanced TypeScript
- https://www.youtube.com/watch?v=RjQpep8fBdo Mapped Types - Advanced TypeScript
- https://www.youtube.com/watch?v=QFWrbNehKk0 Conditionnal Types - Advanced TypeScript
- https://www.youtube.com/watch?v=V6eHIvwDFP4 Revealing the TypeScript Magic behind NgRx APIs
- https://www.youtube.com/watch?v=aSMCYbOxgkc Advanced TypeScript Type Utilities - Basarat Ali Syed
- https://www.youtube.com/watch?v=kTKYpkLb3u8 Indexed Access Types (Lookup Types) in TypeScript (plus keyof and generics)
- https://www.youtube.com/watch?v=FEeEItMtDwg TypeScript Type Guards Explained
- https://www.youtube.com/watch?v=DmvOmjjH2Fk Function overloading
- https://www.youtube.com/watch?v=3fXpL1O3epw TypeScript Enums Explained
- https://www.youtube.com/watch?v=t0qQSujSslQ How to use generics in TypeScript
- https://nartc.me/blog/typescript-mapped-union/
Utility types used to create a new type based on an original type, they are also called transformation types. -Partial returns a new type with all the properties of the T interface optionals. -Required returns a new type with all the properties of the T interface required. -Readonly returns a new type with all the properties of the T interface readonly. -Pick returns a new type with only the picked properties of the T interface. -Pick returns a new type with only the few omitted properties of the T interface. -Exclude<T,U> returns a new type with the U type excluded from the T interface. -Extract<T,U> returns a new type with types assignable to U extracted from the T interface. -NonNullable returns a new type with only the non nullable properties of the T interface. -ReturnType returns the return type of a function passed with the typeof F. -InstanceType returns the return type of a class passed with the typeof C. -Record<K,T> is used to describe a javascript map, K is the type of the key and T the type of the value.