diretto/src/store/types.ts

35 lines
533 B
TypeScript
Raw Normal View History

2019-07-16 16:04:43 +02:00
import { Dict } from "@/types";
export interface AppState {
2019-07-16 16:43:29 +02:00
sources: EventFeed[];
2019-07-16 16:04:43 +02:00
status: Dict<FetchStatus>;
}
2019-07-16 16:43:29 +02:00
export interface EventFeed {
2019-07-16 16:04:43 +02:00
url: string;
2019-07-16 16:43:29 +02:00
info?: FeedInfo;
2019-07-16 16:04:43 +02:00
}
2019-07-16 16:43:29 +02:00
export interface FeedInfo {
title: string;
}
export interface FeedEvent {
2019-07-16 16:04:43 +02:00
source: string; // Source URL
2019-07-16 16:43:29 +02:00
data: FeedEventData;
2019-07-16 16:04:43 +02:00
}
2019-07-16 16:43:29 +02:00
export interface FeedEventData {
guid: string;
2019-07-16 16:47:51 +02:00
title: string;
link?: string;
creator: string;
published?: Date;
2019-07-16 16:04:43 +02:00
}
export interface FetchStatus {
fetched: boolean;
error?: Error;
events?: Event[];
}