Skip to content

Commit

Permalink
Update type names
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewStanciu committed Dec 13, 2023
1 parent 59fcfda commit 957bd9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import validateCustomColors from './utils/validate-custom-colors'
import stripCharges from './utils/strip-charges'
import {
Colors,
LightningString,
LightningTimeObject,
LightningTimeParts,
StaticColors
} from './types'
Expand Down Expand Up @@ -45,7 +45,7 @@ export class LightningTime {
this.staticColors = { boltColors, zapColors, sparkColors }
}

convertToLightning(time: Date): LightningString {
convertToLightning(time: Date): LightningTimeObject {
const millis =
1000 * 60 * 60 * time.getHours() +
1000 * 60 * time.getMinutes() +
Expand Down
6 changes: 3 additions & 3 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export interface LightningString {
export interface LightningTimeObject {
lightningString: string
strippedCharges: string
colors: Colors
parts: LightningTimeParts
}

export interface LightningTimeObject {
export interface LightningTimeRawParts {
bolts: number
zaps: number
sparks: number
Expand All @@ -31,7 +31,7 @@ export interface StaticColors {
sparkColors: number[]
}

export type LightningTimeClock = LightningString & {
export type LightningTimeClock = LightningTimeObject & {
formattedNormalTime: string
}
export type GenericUseState = <T>(
Expand Down
6 changes: 3 additions & 3 deletions src/utils/get-parts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LightningTimeObject, LightningTimeParts } from '../types'
import { LightningTimeRawParts, LightningTimeParts } from '../types'

const getParts = (lightningString: string): LightningTimeObject => {
const getParts = (lightningString: string): LightningTimeRawParts => {
const lightningParts = lightningString.split('~')
const bolts = parseInt(lightningParts[0], 16)
const zaps = parseInt(lightningParts[1], 16)
Expand All @@ -27,7 +27,7 @@ const getParts = (lightningString: string): LightningTimeObject => {
}
}

const toString = (parts: LightningTimeObject): LightningTimeParts => {
const toString = (parts: LightningTimeRawParts): LightningTimeParts => {
const bolts = parts.bolts.toString(16)
const zaps = parts.zaps.toString(16)
const sparks = parts.sparks.toString(16)
Expand Down

0 comments on commit 957bd9f

Please sign in to comment.