support caching map data when map_data_fetch_proxy is set true

This commit is contained in:
MaysWind
2026-02-28 18:16:34 +08:00
parent d5dfdc8c05
commit 247181830c
35 changed files with 740 additions and 179 deletions
+7 -2
View File
@@ -65,12 +65,17 @@ export function* values<K extends string | number | symbol, V>(obj: Record<K, V>
}
}
export interface NameValue {
export interface GenericNameValue<T> {
readonly name: string;
readonly value: T;
}
export interface NameValue extends GenericNameValue<string> {
readonly name: string;
readonly value: string;
}
export interface NameNumeralValue {
export interface NameNumeralValue extends GenericNameValue<number> {
readonly name: string;
readonly value: number;
}
+7
View File
@@ -5,3 +5,10 @@ export interface BrowserCacheStatistics {
readonly mapCacheSize: number;
readonly othersCacheSize: number;
}
export interface SWMapCacheConfig {
enabled: boolean;
patterns: string[];
maxEntries: number;
maxAgeMilliseconds: number;
}
+4
View File
@@ -62,6 +62,8 @@ export interface ApplicationSettings extends BaseApplicationSetting {
hideCategoriesWithoutAccounts: boolean;
// Exchange Rates Data Page
currencySortByInExchangeRatesPage: number;
// Browser Cache Settings
mapCacheExpiration: number,
// Statistics Settings
statistics: {
defaultChartDataType: number;
@@ -187,6 +189,8 @@ export const DEFAULT_APPLICATION_SETTINGS: ApplicationSettings = {
hideCategoriesWithoutAccounts: false,
// Exchange Rates Data Page
currencySortByInExchangeRatesPage: CurrencySortingType.Default.type,
// Browser Cache Settings
mapCacheExpiration: -1,
// Statistics Settings
statistics: {
defaultChartDataType: ChartDataType.Default.type,