adds settings collection
This commit is contained in:
28
web/src/lib/models/settings.ts
Normal file
28
web/src/lib/models/settings.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
class Settings {
|
||||
id?: string;
|
||||
unit?: "metric" | "imperial";
|
||||
language?: "en" | "de" | "fr" | "hu" | "nl" | "pl" | "pt" | "zh";
|
||||
mapFocus?: "trails" | "location";
|
||||
location?: { name: string, lat: number, lon: number };
|
||||
user?: string;
|
||||
|
||||
constructor(
|
||||
unit: "metric" | "imperial",
|
||||
language: "en" | "de" | "fr" | "hu" | "nl" | "pl" | "pt" | "zh",
|
||||
mapFocus: "trails" | "location",
|
||||
user: string,
|
||||
params?: {
|
||||
location: { name: string, lat: number, lon: number }
|
||||
}
|
||||
) {
|
||||
this.unit = unit;
|
||||
this.language = language;
|
||||
this.mapFocus = mapFocus;
|
||||
this.user = user;
|
||||
this.location = params?.location;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export { Settings };
|
||||
@@ -115,6 +115,13 @@ interface TrailFilterValues {
|
||||
max_duration: number,
|
||||
}
|
||||
|
||||
interface TrailBoundingBox {
|
||||
max_lat: number,
|
||||
min_lat: number,
|
||||
max_lon: number,
|
||||
min_lon: number,
|
||||
}
|
||||
|
||||
export { Trail };
|
||||
|
||||
export type { TrailFilter, TrailFilterValues };
|
||||
export type { TrailFilter, TrailFilterValues, TrailBoundingBox };
|
||||
10
web/src/lib/models/user.ts
Normal file
10
web/src/lib/models/user.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { Settings } from "./settings";
|
||||
|
||||
export type User = {
|
||||
id: string,
|
||||
username?: string,
|
||||
email?: string,
|
||||
password: string,
|
||||
avatar?: string;
|
||||
language?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user