-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3d82ca
commit 9d43713
Showing
233 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export const programModeEnumMap = { | ||
GROUP: "group", | ||
ANNOUNCEMENT: "announcement", | ||
ONE_ON_ONE: "1on1", | ||
SELF_DIRECTED: "selfDirected", | ||
PLANNED_ONE_ON_ONE: "planned1on1", | ||
PLANNED_SELF_DIRECTED: "plannedSelfDirected", | ||
} as const; | ||
|
||
type ProgramModeMap = typeof programModeEnumMap; | ||
|
||
// How do we make sure Group stays in sync with programModeEnumMap? | ||
type Group = unknown; | ||
|
||
type test = Expect<Equal<Group, "group">>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export const programModeEnumMap = { | ||
GROUP: "group", | ||
ANNOUNCEMENT: "announcement", | ||
ONE_ON_ONE: "1on1", | ||
SELF_DIRECTED: "selfDirected", | ||
PLANNED_ONE_ON_ONE: "planned1on1", | ||
PLANNED_SELF_DIRECTED: "plannedSelfDirected", | ||
} as const; | ||
|
||
type ProgramModeMap = typeof programModeEnumMap; | ||
|
||
// How do we make sure Group stays in sync with programModeEnumMap? | ||
type Group = ProgramModeMap["GROUP"]; | ||
|
||
type test = Expect<Equal<Group, "group">>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const programModeEnumMap = { | ||
GROUP: "group", | ||
ANNOUNCEMENT: "announcement", | ||
ONE_ON_ONE: "1on1", | ||
SELF_DIRECTED: "selfDirected", | ||
PLANNED_ONE_ON_ONE: "planned1on1", | ||
PLANNED_SELF_DIRECTED: "plannedSelfDirected", | ||
} as const; | ||
|
||
type ProgramModeMap = typeof programModeEnumMap; | ||
|
||
// How do we make sure PlannedPrograms stays in sync with programModeEnumMap? | ||
type PlannedPrograms = unknown; | ||
|
||
type test = Expect< | ||
Equal<PlannedPrograms, "planned1on1" | "plannedSelfDirected"> | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const programModeEnumMap = { | ||
GROUP: "group", | ||
ANNOUNCEMENT: "announcement", | ||
ONE_ON_ONE: "1on1", | ||
SELF_DIRECTED: "selfDirected", | ||
PLANNED_ONE_ON_ONE: "planned1on1", | ||
PLANNED_SELF_DIRECTED: "plannedSelfDirected", | ||
} as const; | ||
|
||
type ProgramModeMap = typeof programModeEnumMap; | ||
|
||
type PlannedPrograms = ProgramModeMap[ | ||
| "PLANNED_ONE_ON_ONE" | ||
| "PLANNED_SELF_DIRECTED"]; | ||
|
||
type test = Expect< | ||
Equal<PlannedPrograms, "planned1on1" | "plannedSelfDirected"> | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export const programModeEnumMap = { | ||
GROUP: "group", | ||
ANNOUNCEMENT: "announcement", | ||
ONE_ON_ONE: "1on1", | ||
SELF_DIRECTED: "selfDirected", | ||
PLANNED_ONE_ON_ONE: "planned1on1", | ||
PLANNED_SELF_DIRECTED: "plannedSelfDirected", | ||
} as const; | ||
|
||
type ProgramModeMap = typeof programModeEnumMap; | ||
|
||
type AllPrograms = unknown; | ||
|
||
type test = Expect< | ||
Equal< | ||
AllPrograms, | ||
| "group" | ||
| "announcement" | ||
| "1on1" | ||
| "selfDirected" | ||
| "planned1on1" | ||
| "plannedSelfDirected" | ||
> | ||
>; |
24 changes: 24 additions & 0 deletions
24
src/040-deriving-types-from-values/136-pass-keyof-into-an-indexed-access-type.solution.1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export const programModeEnumMap = { | ||
GROUP: "group", | ||
ANNOUNCEMENT: "announcement", | ||
ONE_ON_ONE: "1on1", | ||
SELF_DIRECTED: "selfDirected", | ||
PLANNED_ONE_ON_ONE: "planned1on1", | ||
PLANNED_SELF_DIRECTED: "plannedSelfDirected", | ||
} as const; | ||
|
||
type ProgramModeMap = typeof programModeEnumMap; | ||
|
||
type AllPrograms = ProgramModeMap[keyof ProgramModeMap]; | ||
|
||
type test = Expect< | ||
Equal< | ||
AllPrograms, | ||
| "group" | ||
| "announcement" | ||
| "1on1" | ||
| "selfDirected" | ||
| "planned1on1" | ||
| "plannedSelfDirected" | ||
> | ||
>; |
22 changes: 22 additions & 0 deletions
22
src/040-deriving-types-from-values/136-pass-keyof-into-an-indexed-access-type.solution.2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const programModeEnumMap = { | ||
GROUP: "group", | ||
ANNOUNCEMENT: "announcement", | ||
ONE_ON_ONE: "1on1", | ||
SELF_DIRECTED: "selfDirected", | ||
PLANNED_ONE_ON_ONE: "planned1on1", | ||
PLANNED_SELF_DIRECTED: "plannedSelfDirected", | ||
} as const; | ||
|
||
type AllPrograms = (typeof programModeEnumMap)[keyof typeof programModeEnumMap]; | ||
|
||
type test = Expect< | ||
Equal< | ||
AllPrograms, | ||
| "group" | ||
| "announcement" | ||
| "1on1" | ||
| "selfDirected" | ||
| "planned1on1" | ||
| "plannedSelfDirected" | ||
> | ||
>; |
22 changes: 22 additions & 0 deletions
22
src/040-deriving-types-from-values/137-create-a-union-from-an-as-const-array.problem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const programModes = [ | ||
"group", | ||
"announcement", | ||
"1on1", | ||
"selfDirected", | ||
"planned1on1", | ||
"plannedSelfDirected", | ||
] as const; | ||
|
||
type AllPrograms = (typeof programModes)[keyof typeof programModes]; | ||
|
||
type test = Expect< | ||
Equal< | ||
AllPrograms, | ||
| "group" | ||
| "announcement" | ||
| "1on1" | ||
| "selfDirected" | ||
| "planned1on1" | ||
| "plannedSelfDirected" | ||
> | ||
>; |
22 changes: 22 additions & 0 deletions
22
src/040-deriving-types-from-values/137-create-a-union-from-an-as-const-array.solution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const programModes = [ | ||
"group", | ||
"announcement", | ||
"1on1", | ||
"selfDirected", | ||
"planned1on1", | ||
"plannedSelfDirected", | ||
] as const; | ||
|
||
type AllPrograms = (typeof programModes)[number]; | ||
|
||
type test = Expect< | ||
Equal< | ||
AllPrograms, | ||
| "group" | ||
| "announcement" | ||
| "1on1" | ||
| "selfDirected" | ||
| "planned1on1" | ||
| "plannedSelfDirected" | ||
> | ||
>; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.