diff --git a/src/065-four-spaces-of-typescript-declarations/157-modifying-window.problem.ts b/src/065-four-spaces-of-typescript-declarations/157-modifying-window.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/065-four-spaces-of-typescript-declarations/157-modifying-window.solution.ts b/src/065-four-spaces-of-typescript-declarations/157-modifying-window.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/065-four-spaces-of-typescript-declarations/158-modifying-globalthis.problem.ts b/src/065-four-spaces-of-typescript-declarations/158-modifying-globalthis.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/065-four-spaces-of-typescript-declarations/158-modifying-globalthis.solution.ts b/src/065-four-spaces-of-typescript-declarations/158-modifying-globalthis.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/065-four-spaces-of-typescript-declarations/159-modifying-process-env.problem.ts b/src/065-four-spaces-of-typescript-declarations/159-modifying-process-env.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/065-four-spaces-of-typescript-declarations/159-modifying-process-env.solution.ts b/src/065-four-spaces-of-typescript-declarations/159-modifying-process-env.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/160-domain-modelling-in-typescript.problem.ts b/src/075-designing-your-types/160-domain-modelling-in-typescript.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/160-domain-modelling-in-typescript.solution.ts b/src/075-designing-your-types/160-domain-modelling-in-typescript.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/161-intro-to-helper-types.problem.ts b/src/075-designing-your-types/161-intro-to-helper-types.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/161-intro-to-helper-types.solution.ts b/src/075-designing-your-types/161-intro-to-helper-types.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/162-multiple-type-parameters.problem.ts b/src/075-designing-your-types/162-multiple-type-parameters.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/162-multiple-type-parameters.solution.ts b/src/075-designing-your-types/162-multiple-type-parameters.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/163-default-type-parameters.problem.ts b/src/075-designing-your-types/163-default-type-parameters.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/163-default-type-parameters.solution.ts b/src/075-designing-your-types/163-default-type-parameters.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/164-type-helper-constraints.problem.ts b/src/075-designing-your-types/164-type-helper-constraints.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/164-type-helper-constraints.solution.ts b/src/075-designing-your-types/164-type-helper-constraints.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/165-tighter-version-of-omit.problem.ts b/src/075-designing-your-types/165-tighter-version-of-omit.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/165-tighter-version-of-omit.solution.ts b/src/075-designing-your-types/165-tighter-version-of-omit.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/166-template-literal-types.problem.ts b/src/075-designing-your-types/166-template-literal-types.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/166-template-literal-types.solution.ts b/src/075-designing-your-types/166-template-literal-types.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/167-passing-unions-to-template-literal-types.problem.ts b/src/075-designing-your-types/167-passing-unions-to-template-literal-types.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/167-passing-unions-to-template-literal-types.solution.ts b/src/075-designing-your-types/167-passing-unions-to-template-literal-types.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/075-designing-your-types/plan.md b/src/075-designing-your-types/plan.md index fd69a6b..fe27b3b 100644 --- a/src/075-designing-your-types/plan.md +++ b/src/075-designing-your-types/plan.md @@ -3,3 +3,24 @@ Title here! ## Exercises + +- Modeling your domain in TypeScript + - Defining types that represent the concepts and entities of the problem domain + - Users, Products, Orders, etc. + - Modeling early helps keep code maintainable +- Helper types + - Types that are defined using other types that help you manipulate, transform, or constrain existing types + - Type arguments in types + - The parameters you pass to a generic type + - Can be any valid type expression + - e.g. `Array` is a type that takes a type argument `string` and represents an array of strings + - Type variables, constraints, defaults, and inference make type arguments more flexible and expressive + - Composing types into other types + - Use unions and intersections + - `User & Admin` + - Template literals for strings + - Create string types based on template literals which can contain placeholders, expressions, and modifiers + - e.g. a string type representing a valid email address with `@` and `.` as placeholders + - `type Email = `${string}@${string}.${string}`;` + - Create your own with generics, keyof, typeof, indexed access, conditional types, and mapped types + - Example of a helper type that makes all properties of a type optional except for a few specified ones diff --git a/src/080-configuring-typescript/168-introduction-to-tsconfig.problem.ts b/src/080-configuring-typescript/168-introduction-to-tsconfig.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/168-introduction-to-tsconfig.solution.ts b/src/080-configuring-typescript/168-introduction-to-tsconfig.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/169-tsconfig-bases.problem.ts b/src/080-configuring-typescript/169-tsconfig-bases.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/169-tsconfig-bases.solution.ts b/src/080-configuring-typescript/169-tsconfig-bases.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/170-multiple-tsconfig-json-files.problem.ts b/src/080-configuring-typescript/170-multiple-tsconfig-json-files.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/170-multiple-tsconfig-json-files.solution.ts b/src/080-configuring-typescript/170-multiple-tsconfig-json-files.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/171-extending-from-other-tsconfig-json-files.problem.ts b/src/080-configuring-typescript/171-extending-from-other-tsconfig-json-files.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/171-extending-from-other-tsconfig-json-files.solution.ts b/src/080-configuring-typescript/171-extending-from-other-tsconfig-json-files.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/172-project-references.problem.ts b/src/080-configuring-typescript/172-project-references.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/172-project-references.solution.ts b/src/080-configuring-typescript/172-project-references.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/173-jsx.problem.ts b/src/080-configuring-typescript/173-jsx.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/173-jsx.solution.ts b/src/080-configuring-typescript/173-jsx.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/174-rules-that-make-up-strict-mode.problem.ts b/src/080-configuring-typescript/174-rules-that-make-up-strict-mode.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/174-rules-that-make-up-strict-mode.solution.ts b/src/080-configuring-typescript/174-rules-that-make-up-strict-mode.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/175-no-unchecked-indexed-access.problem.ts b/src/080-configuring-typescript/175-no-unchecked-indexed-access.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/175-no-unchecked-indexed-access.solution.ts b/src/080-configuring-typescript/175-no-unchecked-indexed-access.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/176-creating-declaration-files-and-declaration-maps.problem.ts b/src/080-configuring-typescript/176-creating-declaration-files-and-declaration-maps.problem.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/176-creating-declaration-files-and-declaration-maps.solution.ts b/src/080-configuring-typescript/176-creating-declaration-files-and-declaration-maps.solution.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/080-configuring-typescript/plan.md b/src/080-configuring-typescript/plan.md index fd69a6b..8129ebc 100644 --- a/src/080-configuring-typescript/plan.md +++ b/src/080-configuring-typescript/plan.md @@ -3,3 +3,17 @@ Title here! ## Exercises + +- `tsconfig.json` + - The file that contains compiler options and the files or folders to compile + - Nesting `tsconfig.json` inside subfolders + - Multiple `tsconfig.json` files can be in different subfolders of the project, and each will be treated as a separate project + - The `extends` property can be used to inherit configuration from another `tsconfig.json` and override or add options. +- My recommended `tsconfig.json` +- Commonly used `tsconfig.json` attributes: + - `jsx` + - `strict` + - `noImplicitAny`, `strictNullChecks`, `strictFunctionTypes`, etc. + - `noUncheckedIndexedAccess` + - `moduleResolution` + - `declaration` and `declarationMap`