This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { paths } from '@/api'
|
||||
|
||||
export interface Window {
|
||||
label: string
|
||||
getStart: { (): number }
|
||||
@@ -6,9 +8,18 @@ export interface Window {
|
||||
interval: number
|
||||
}
|
||||
|
||||
export const typeApi = {
|
||||
export type ApiTypes =
|
||||
paths['/type/{type}/startDate/{start_date}/endDate/{end_date}/sample/{sample}']['get']['parameters']['path']['type']
|
||||
|
||||
export type NavTypes = 'temperatuur' | 'luchtvochtigheid'
|
||||
|
||||
type NavTypeToApiTypeMapping = {
|
||||
[key in NavTypes]: ApiTypes
|
||||
}
|
||||
|
||||
export const navTypeToApiTypeMapping: NavTypeToApiTypeMapping = {
|
||||
temperatuur: 'temperature',
|
||||
luchtvochtigheid: 'humidity'
|
||||
}
|
||||
|
||||
export type NavType = keyof typeof typeApi
|
||||
export const navTypes = Object.keys(navTypeToApiTypeMapping)
|
||||
|
||||
Reference in New Issue
Block a user