Skip to content

Commit

Permalink
refactor: optimizing interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
dlcastillop committed Oct 7, 2023
1 parent c84ec7f commit 1c1fdca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/interfaces/IZero.ts

This file was deleted.

25 changes: 11 additions & 14 deletions src/interfaces/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ type IZero = {
withoutLeadingZero: string;
};

interface IBaseCounterStatus {
currentDays: number;
currentHours: number;
currentMinutes: number;
currentSeconds: number;
elapsedSeconds: number;
remainingSeconds?: number;
}

export interface IBaseCounter {
current: IZero;
isPaused: boolean;
Expand All @@ -13,22 +22,10 @@ export interface IBaseCounter {
togglePause: () => void;
}

export interface IStopwatch extends IBaseCounter {
currentDays: number;
currentHours: number;
currentMinutes: number;
currentSeconds: number;
elapsedSeconds: number;
remainingSeconds?: number;
export interface IStopwatch extends IBaseCounter, IBaseCounterStatus {
remainingTime?: IZero;
}

export interface ITimer extends IBaseCounter {
currentDays: number;
currentHours: number;
currentMinutes: number;
currentSeconds: number;
elapsedSeconds: number;
remainingSeconds: number;
export interface ITimer extends IBaseCounter, IBaseCounterStatus {
elapsedTime?: IZero;
}

0 comments on commit 1c1fdca

Please sign in to comment.