-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from tahmid-saj/dev-ts-fitness-context
fitness context migration to ts
- Loading branch information
Showing
2 changed files
with
90 additions
and
26 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
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,61 @@ | ||
import { ReactNode } from "react"; | ||
|
||
// fitness types | ||
|
||
export interface FitnessContextType { | ||
exercises: Exercise[]; | ||
exercisesTagLimit: number; | ||
selectedScheduledExerciseDate: string | Date | undefined; | ||
exercisesSearchResults: Exercise[]; | ||
selectedSearchedExercise: ExerciseSearchResult | undefined; | ||
exercisesView: Exercise[]; | ||
upcomingExercisesView: Exercise[]; | ||
|
||
searchExercise: (exerciseQuery: ExerciseQueryInput) => void; | ||
addExercise: (exercise: AddExerciseInput) => void; | ||
|
||
selectScheduledExercise: (exerciseDate: string | Date) => void; | ||
unselectScheduledExercise: () => void; | ||
selectSearchedExercises: (exercise: ExerciseSearchResult) => void; | ||
|
||
removeExercise: (exerciseTag: number) => void; | ||
} | ||
|
||
export interface FitnessProviderProps { | ||
children: ReactNode; | ||
} | ||
|
||
export type Exercise = { | ||
exerciseDate: string | Date; | ||
exerciseName: string; | ||
exerciseSets: number; | ||
exerciseReps: number; | ||
exerciseType: string; | ||
exerciseMuscle: string; | ||
exerciseEquipment: string; | ||
exerciseDifficulty: string; | ||
exerciseInstructions: string; | ||
exerciseTag: number; | ||
} | ||
|
||
export type ExerciseQueryInput = { | ||
exerciseName: string; | ||
exerciseType: string; | ||
exerciseMuscle: string; | ||
exerciseDifficulty: string; | ||
} | ||
|
||
export type AddExerciseInput = { | ||
exerciseDate: string | Date; | ||
exerciseSets: string; | ||
exerciseReps: string; | ||
} | ||
|
||
export type ExerciseSearchResult = { | ||
exerciseName: string; | ||
exerciseType: string; | ||
exerciseMuscle: string; | ||
exerciseEquipment: string; | ||
exerciseDifficulty: string; | ||
exerciseInstructions: string; | ||
} |