mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-23 10:55:07 +00:00
35 lines
917 B
TypeScript
35 lines
917 B
TypeScript
import { Injectable } from '@angular/core'
|
|
|
|
import { ChartData, LibrarySearch } 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, page?: number, pageSize?: number): Promise<ChartData[]> {
|
|
const librarySearch = {
|
|
searchTerm: searchTerm,
|
|
page: page,
|
|
pageSize: pageSize,
|
|
} as LibrarySearch
|
|
|
|
return window.electron.invoke.getChartsBySearchTerm(librarySearch)
|
|
}
|
|
|
|
async removeAllCharts(): Promise<void> {
|
|
return window.electron.emit.removeAllCharts()
|
|
}
|
|
}
|