1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
import { QueryClient, useInfiniteQuery, useQuery } from '@tanstack/react-query'
//import type { Colors } from "@/constants/colors";
const endpoint = "https://a.cccccc.ch/projet"
type API = {
'/getstation/[id]/[from]/[to]': {
response: number,
id: number,
method: string,
next: string | null,
fields: {
id_field: number,
field_name: string,
field_longname: string,
field_city: string,
field_lat: number,
field_lng: number
}[],
stations: {
id_field: number,
field_name: string,
id_station: number,
station_longname: string,
id_station_type: number,
station_type_name: string,
station_archive: number,
lat: number,
lng: number,
alt: number,
measures?: {
datasets?: {
data?:{
value: number,
label: string,
date: string,
dataPointText: number
}[],
label: string,
showLine:boolean,
borderColor:string,
backgroundColor:string,
pointStyle:string,
fill:boolean,
borderWidth:number,
pointRadius:number,
type:string,
},
labels: {}[],
unit: string,
chartContainer: string,
id_sensor_type: number,
id_sensor:number,
sensor_type: string,
sensor_type_longname: string,
sensor_type_awe: string,
}[],
measures_found: number,
station_found: number,
latest_measure: string,
}[],
map_center:{
lat: number,
lng: number,
},
}
} |
Partager