From 3aba82f9172b74bb7ee3b49ab297184837843103 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 29 Aug 2020 11:32:26 +0200 Subject: [PATCH] Create more types for UI --- src/components/charts/CumProfitChart.vue | 4 ++-- src/types/{auth.types.ts => auth.d.ts} | 0 src/types/chart.d.ts | 5 +++++ src/types/index.ts | 5 +++-- src/types/{types.ts => types.d.ts} | 0 5 files changed, 10 insertions(+), 4 deletions(-) rename src/types/{auth.types.ts => auth.d.ts} (100%) create mode 100644 src/types/chart.d.ts rename src/types/{types.ts => types.d.ts} (100%) diff --git a/src/components/charts/CumProfitChart.vue b/src/components/charts/CumProfitChart.vue index e3935bff..e744bd21 100644 --- a/src/components/charts/CumProfitChart.vue +++ b/src/components/charts/CumProfitChart.vue @@ -16,7 +16,7 @@ import 'echarts/lib/component/dataZoom'; import 'echarts/lib/component/visualMap'; import 'echarts/lib/component/visualMapPiecewise'; -import { ClosedTrade } from '@/types'; +import { ClosedTrade, CumProfitData } from '@/types'; // Define Column labels here to avoid typos const CHART_PROFIT = 'Profit'; @@ -31,7 +31,7 @@ export default class CumProfitChart extends Vue { @Prop({ required: true }) trades!: ClosedTrade[]; get cumulativeData() { - const res: Record[] = []; + const res: CumProfitData[] = []; const closedTrades = this.trades; // .filter((t) => t.close_timestamp); closedTrades.sort((a, b) => (a.close_timestamp > b.close_timestamp ? 1 : -1)); diff --git a/src/types/auth.types.ts b/src/types/auth.d.ts similarity index 100% rename from src/types/auth.types.ts rename to src/types/auth.d.ts diff --git a/src/types/chart.d.ts b/src/types/chart.d.ts new file mode 100644 index 00000000..a7448f99 --- /dev/null +++ b/src/types/chart.d.ts @@ -0,0 +1,5 @@ +export interface CumProfitData { + date: number; + profit: number; + raising: boolean; +} diff --git a/src/types/index.ts b/src/types/index.ts index a49f36ea..d97e095c 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,3 +1,4 @@ -export * from './auth.types'; +export * from './auth.d'; +export * from './chart.d'; -export * from './types'; +export * from './types.d'; diff --git a/src/types/types.ts b/src/types/types.d.ts similarity index 100% rename from src/types/types.ts rename to src/types/types.d.ts