Intial Version
This commit is contained in:
3
electron-app/src/shared/types.js
Normal file
3
electron-app/src/shared/types.js
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
// Shared types between main and renderer processes
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
43
electron-app/src/shared/types.ts
Normal file
43
electron-app/src/shared/types.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
// Shared types between main and renderer processes
|
||||
|
||||
export interface VendorPrice {
|
||||
id: string;
|
||||
platform: 'eldorado' | 'playerauctions';
|
||||
sellerName: string;
|
||||
pricePerMillion: number;
|
||||
timestamp: Date;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface PriceIndex {
|
||||
timestamp: Date;
|
||||
lowestPrice: number;
|
||||
platform: string;
|
||||
sellerName: string;
|
||||
allPrices: VendorPrice[];
|
||||
}
|
||||
|
||||
export interface PriceAlert {
|
||||
id: string;
|
||||
type: 'below' | 'above';
|
||||
threshold: number;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface WebSocketMessage {
|
||||
type: 'price_update' | 'connection_status' | 'error' | 'history_data' | 'get_history' | 'subscribe';
|
||||
data: any;
|
||||
}
|
||||
|
||||
export interface HistoricalData {
|
||||
range: string;
|
||||
from: Date;
|
||||
to: Date;
|
||||
prices: VendorPrice[];
|
||||
}
|
||||
|
||||
export interface ConnectionStatus {
|
||||
connected: boolean;
|
||||
lastUpdate?: Date;
|
||||
error?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user