Files
Audio-Classifier/frontend/lib/types.ts
Benoit b923bb44cc Fix frontend build: add lib/ to git and update Docker config
- Fix .gitignore to exclude only backend/lib/, not frontend/lib/
- Add frontend/lib/ files (api.ts, types.ts, utils.ts) to git
- Add .dockerignore to frontend to exclude build artifacts
- Update backend Dockerfile to Python 3.9 with ARM64 support
- Add debug to frontend Dockerfile
- Update claude-todo with current project state

This fixes "Module not found: Can't resolve '@/lib/api'" error
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 22:49:48 +01:00

112 lines
2.1 KiB
TypeScript

/**
* TypeScript type definitions for Audio Classifier
*/
export interface Track {
id: string
filepath: string
filename: string
duration_seconds: number
file_size_bytes: number
format: string
analyzed_at: string
features: {
tempo_bpm: number
key: string
time_signature: string
energy: number
danceability: number
valence: number
loudness_lufs: number
spectral_centroid: number
zero_crossing_rate: number
}
classification: {
genre: {
primary: string
secondary: string[]
confidence: number
}
mood: {
primary: string
secondary: string[]
arousal: number
valence: number
}
instruments: string[]
vocals: {
present: boolean | null
gender: string | null
}
}
embedding: {
model: string | null
dimension: number | null
}
metadata: Record<string, any>
}
export interface FilterParams {
genre?: string
mood?: string
bpm_min?: number
bpm_max?: number
energy_min?: number
energy_max?: number
has_vocals?: boolean
sort_by?: 'analyzed_at' | 'tempo_bpm' | 'duration_seconds' | 'filename' | 'energy'
sort_desc?: boolean
}
export interface TracksResponse {
tracks: Track[]
total: number
skip: number
limit: number
}
export interface SearchResponse {
query: string
tracks: Track[]
total: number
}
export interface SimilarTracksResponse {
reference_track_id: string
similar_tracks: Track[]
total: number
}
export interface JobStatus {
job_id: string
status: 'pending' | 'running' | 'completed' | 'failed'
progress: number
total: number
current_file: string | null
errors: Array<{ file?: string; error: string }>
saved_count?: number
}
export interface AnalyzeFolderRequest {
path: string
recursive: boolean
}
export interface WaveformData {
peaks: number[]
duration: number
num_peaks: number
}
export interface Stats {
total_tracks: number
genres: Array<{ genre: string; count: number }>
moods: Array<{ mood: string; count: number }>
average_bpm: number
total_duration_hours: number
}