Skip to content

Commit

Permalink
refactor: fix timer interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
dlcastillop committed Oct 7, 2023
1 parent e2daa69 commit c84ec7f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/helpers/useInternalTimer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from "react";
import { addLeadingZero } from "../helpers";
import { IInternalTimer } from "../interfaces";
import { ITimer } from "../interfaces";

export const useInternalTimer = (
days: number,
Expand All @@ -9,7 +9,7 @@ export const useInternalTimer = (
seconds: number,
startPaused?: boolean,
separator?: string
): IInternalTimer => {
): ITimer => {
if (days < 0) {
throw new Error("The days parameter has to be more or equal than 0.");
} else if (hours < 0 || hours >= 24) {
Expand Down
17 changes: 0 additions & 17 deletions src/interfaces/IInternalTimer.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/interfaces/ITimer.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export * from "./ITimer";
export * from "./IInternalTimer";
export * from "./interfaces";
10 changes: 10 additions & 0 deletions src/interfaces/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ export interface IStopwatch extends IBaseCounter {
remainingSeconds?: number;
remainingTime?: IZero;
}

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

0 comments on commit c84ec7f

Please sign in to comment.