File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import type {
1010 DailyDataPoint ,
1111 DateRangeFields ,
1212 EvolutionData ,
13+ EvolutionOptions ,
1314 MonthlyDataPoint ,
1415 WeeklyDataPoint ,
1516 YearlyDataPoint ,
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ import type { MaybeRefOrGetter } from 'vue'
22import { toValue } from 'vue'
33import type {
44 DailyDataPoint ,
5- EvolutionOptionsBase ,
5+ DailyRawPoint ,
6+ EvolutionOptions ,
67 MonthlyDataPoint ,
78 WeeklyDataPoint ,
89 YearlyDataPoint ,
@@ -13,29 +14,6 @@ export type PackumentLikeForTime = {
1314 time ?: Record < string , string >
1415}
1516
16- export type EvolutionOptionsDay = EvolutionOptionsBase & {
17- granularity : 'day'
18- }
19- export type EvolutionOptionsWeek = EvolutionOptionsBase & {
20- granularity : 'week'
21- weeks ?: number
22- }
23- export type EvolutionOptionsMonth = EvolutionOptionsBase & {
24- granularity : 'month'
25- months ?: number
26- }
27- export type EvolutionOptionsYear = EvolutionOptionsBase & {
28- granularity : 'year'
29- }
30-
31- export type EvolutionOptions =
32- | EvolutionOptionsDay
33- | EvolutionOptionsWeek
34- | EvolutionOptionsMonth
35- | EvolutionOptionsYear
36-
37- type DailyRawPoint = { day : string ; value : number }
38-
3917function toIsoDateString ( date : Date ) : string {
4018 return date . toISOString ( ) . slice ( 0 , 10 )
4119}
Original file line number Diff line number Diff line change @@ -27,3 +27,26 @@ export type EvolutionOptionsBase = {
2727 startDate ?: string
2828 endDate ?: string
2929}
30+
31+ export type EvolutionOptionsDay = EvolutionOptionsBase & {
32+ granularity : 'day'
33+ }
34+ export type EvolutionOptionsWeek = EvolutionOptionsBase & {
35+ granularity : 'week'
36+ weeks ?: number
37+ }
38+ export type EvolutionOptionsMonth = EvolutionOptionsBase & {
39+ granularity : 'month'
40+ months ?: number
41+ }
42+ export type EvolutionOptionsYear = EvolutionOptionsBase & {
43+ granularity : 'year'
44+ }
45+
46+ export type EvolutionOptions =
47+ | EvolutionOptionsDay
48+ | EvolutionOptionsWeek
49+ | EvolutionOptionsMonth
50+ | EvolutionOptionsYear
51+
52+ export type DailyRawPoint = { day : string ; value : number }
You can’t perform that action at this time.
0 commit comments