/// import { ListForecastQueries } from "forecast-query/weather/list-query-types"; import { TypeOfWeather, WeatherMain, Language } from "forecast-query/weather/derived-request-types"; import { Forecast } from "forecast-query"; export declare type ExtendedWeatherMain = NonNullable | 'Day' | 'Any'; export interface InfoQueryResult { value: number | Date; date: Date; } export interface InfoQuerySimplified { value: number; date: Date; } export declare type WeatherQueryResult = TypeOfWeather & { date: Date; }; export interface WeatherCommonProps { from: string | number | Date; to: string | number | Date; by: 'hour' | 'day'; apiKey: string; loadingHandler: () => JSX.Element; isPro?: boolean; errorHandler?: (error: any) => JSX.Element; storage?: Storage; cacheExpiration?: 'never' | number; lang?: Language; units?: 'metric' | 'imperial'; dateHandler?: (date: Date) => JSX.Element; } export interface WeatherComponentInfoProps { query: 'info'; infoQuery: (forec: ListForecastQueries) => Promise; children: (forec: Forecast, result: InfoQueryResult[]) => JSX.Element; } export interface WeatherComponentQueryProps { query: 'weather'; weatherQuery: (forec: ListForecastQueries) => Promise>; children: (forec: Forecast, result: Array) => JSX.Element; } export interface WeatherComponentIdProps { ids: number[]; kind: 'ids'; } export interface WeatherComponentNamesProps { names: string[]; kind: 'names'; } export interface WeatherComponentGeoProps { lat: number; lon: number; kind: 'geo'; } export declare type WeatherComponentLocationProps = WeatherComponentIdProps | WeatherComponentNamesProps | WeatherComponentGeoProps; export declare type WeatherResultDate = { kind: 'date'; result: Array<{ value: Date; date: Date; }>; }; export declare type WeatherResultInfo = { kind: 'number'; result: Array<{ value: number; date: Date; }>; }; export declare type WeatherResultWeather = { kind: 'weather'; result: Array; }; export declare type WeatherResult = WeatherResultWeather | WeatherResultDate | WeatherResultInfo | { kind: 'nothing'; result: []; }; export interface WeatherComponentState { results: WeatherResult; loading: boolean; error?: any; } export declare type WeatherComponentProps = WeatherCommonProps & (WeatherComponentLocationProps) & (WeatherComponentInfoProps | WeatherComponentQueryProps); export interface WeatherGraphDisplayProps { items: Array; label: string; } export declare type WeatherGraphProps = WeatherComponentLocationProps & { type: WeatherInfoType; label: string; }; export declare type WeatherListProps = WeatherComponentLocationProps & { type: WeatherInfoType; }; export declare type WeatherConditionsProps = WeatherComponentLocationProps & { type?: ExtendedWeatherMain; list?: boolean; }; export interface WeatherQueryEnhancerProps { data: Array; } export interface InfoQueryEnhancerProps { data: Array; } export declare type ComponentEnhancerType = T & (E extends WeatherInfoType ? InfoQueryEnhancerProps : (E extends ExtendedWeatherMain ? WeatherQueryEnhancerProps : never)); export interface WeatherDisplayProps { item: WeatherQueryResult; forecast: Forecast; } export declare type WeatherInfoType = 'temp' | 'temp_max' | 'temp_feel' | 'temp_min' | 'pressure' | 'pressure_ground' | 'pressure_sea' | 'humidity' | 'clouds' | 'visibility' | 'wind' | 'wind_degree' | 'wind_gust' | 'rain' | 'snow' | 'sunset' | 'sunrise';