Files
IoPlot-Dash/src/lib/types.ts
2025-05-07 23:44:49 +03:30

80 lines
1.2 KiB
TypeScript

// Auth API Types
export interface RegisterRequest {
username: string;
password: string;
email: string;
}
export interface RegisterResponse {
success: boolean;
}
export interface LoginRequest {
username: string;
password: string;
}
export interface LoginResponse {
success: boolean;
wrongCredentials: boolean;
token: string;
}
export interface ApiKeyResponse {
success: boolean;
apiKey: string;
}
// New ApiKey Type
export interface ApiKey {
createdAt: string;
key: string;
}
// Feed API Types
export interface Feed {
id: string;
createdAt: string;
name: string;
isPublic: boolean;
}
export interface AddFeedRequest {
Name: string;
IsPublic: boolean;
}
export interface AddFeedResponse {
success: boolean;
feedId: string;
}
export interface FeedDataPoint {
timestamp: string;
data: string;
}
// Form Types
export interface AuthFormValues {
username: string;
password: string;
email?: string;
}
// Time Range Options
export interface TimeRangeOption {
label: string;
value: string;
getTimeRange: () => {
startTime: string;
endTime: string;
};
}
// Error Types
export interface ApiError {
success: boolean;
message: string;
}