types: expand interfaces for SBB, Spotify, Weather, and widget layout
This commit is contained in:
parent
bb30691c1e
commit
73bf363407
1 changed files with 60 additions and 10 deletions
|
|
@ -1,23 +1,45 @@
|
|||
export interface Config {
|
||||
export type ZoneId = 'header-left' | 'header-right' | 'main-1' | 'main-2' | 'footer-1' | 'footer-2' | 'footer-3';
|
||||
export type WidgetId = 'clock' | 'weather' | 'sl' | 'sbb' | 'spotify' | 'system' | 'spacer';
|
||||
export type WidgetLayout = Partial<Record<ZoneId, WidgetId>>;
|
||||
|
||||
export interface SLWidgetConfig {
|
||||
stationId: string;
|
||||
stationName: string;
|
||||
}
|
||||
|
||||
export interface SBBWidgetConfig {
|
||||
stationId: string;
|
||||
stationName: string;
|
||||
}
|
||||
|
||||
export interface SpotifyWidgetConfig {
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
}
|
||||
|
||||
export interface WeatherWidgetConfig {
|
||||
plz: string;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
refreshRate: number;
|
||||
alwaysOn: boolean;
|
||||
layout: WidgetLayout;
|
||||
sl: SLWidgetConfig;
|
||||
sbb: SBBWidgetConfig;
|
||||
spotify: SpotifyWidgetConfig;
|
||||
weather: WeatherWidgetConfig;
|
||||
}
|
||||
|
||||
export interface Departure {
|
||||
line: {
|
||||
designation: string;
|
||||
transport_mode: string;
|
||||
group_of_lines?: string;
|
||||
};
|
||||
destination: string;
|
||||
scheduled: string;
|
||||
stop_area: {
|
||||
name: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SLData {
|
||||
departures: Departure[];
|
||||
stop_area: { name: string };
|
||||
}
|
||||
|
||||
export interface StopLocation {
|
||||
|
|
@ -25,6 +47,34 @@ export interface StopLocation {
|
|||
name: string;
|
||||
}
|
||||
|
||||
export interface SearchData {
|
||||
StopLocation: StopLocation[];
|
||||
export interface SBBDeparture {
|
||||
name: string;
|
||||
category: string;
|
||||
number: string;
|
||||
to: string;
|
||||
stop: {
|
||||
departure: string | null;
|
||||
delay: number | null;
|
||||
platform: string | null;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SpotifyNowPlaying {
|
||||
playing: boolean;
|
||||
track?: {
|
||||
name: string;
|
||||
artist: string;
|
||||
album: string;
|
||||
durationMs: number;
|
||||
progressMs: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface WeatherData {
|
||||
temperature: number;
|
||||
description: string;
|
||||
sunrise: string;
|
||||
sunset: string;
|
||||
moonPhase: string;
|
||||
hourly: Array<{ time: string; temp: number }>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue