Skip to content

Commit

Permalink
refactor(types): split into separate file
Browse files Browse the repository at this point in the history
`HistoryItem` and `HistoryList` will be used in `CalculatorContainer`
  • Loading branch information
lemredd committed Jan 9, 2023
1 parent c013b6a commit c555f55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/CalculatorContainer/HistoryContainer.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<script setup lang="ts">
import { ref } from "vue"
import { Operations } from "@/types/buttons"
import { HistoryItem, HistoryList } from "@/types/history"
interface HistoryItem {
leftOperand: number
operation: Operations
rightOperand: number
}
interface Props {
historyList: HistoryItem[]
historyList: HistoryList
}
defineProps<Props>()
Expand Down
9 changes: 9 additions & 0 deletions src/components/types/history.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Operations } from "@/types/buttons"

export interface HistoryItem {
leftOperand: number
operation: Operations
rightOperand: number
}

export type HistoryList = HistoryItem[]

0 comments on commit c555f55

Please sign in to comment.