Add database for library

This commit is contained in:
Myx
2025-03-28 04:46:29 +01:00
committed by Myx
parent c0cfca39a2
commit 35fd50c728
17 changed files with 382 additions and 80 deletions

View File

@@ -0,0 +1,27 @@
import { Injectable } from '@angular/core'
import { ChartData } from 'src-shared/interfaces/search.interface'
@Injectable({
providedIn: 'root',
})
export class StorageService {
async addChart(chartData: ChartData): Promise<ChartData> {
return window.electron.invoke.addChart(chartData)
}
async removeChart(md5: string): Promise<void> {
return window.electron.invoke.removeChart(md5)
}
async removeCharts(charts: ChartData[]): Promise<void> {
return window.electron.invoke.removeCharts(charts)
}
async getChartsBySearchTerm(searchTerm?: string): Promise<ChartData[]> {
return window.electron.invoke.getChartsBySearchTerm(searchTerm)
}
async removeAllCharts(): Promise<void> {
return window.electron.emit.removeAllCharts()
}
}