adds notifications
This commit is contained in:
26
web/src/lib/models/notification.ts
Normal file
26
web/src/lib/models/notification.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { UserAnonymous } from "./user";
|
||||
|
||||
enum NotificationType {
|
||||
trailCreate = "trail_create",
|
||||
trailShare = "trail_share",
|
||||
listCreate = "list_create",
|
||||
listShare = "list_share",
|
||||
newFollower = "new_follower",
|
||||
trailComment = "trail_comment"
|
||||
};
|
||||
|
||||
interface Notification {
|
||||
id: string;
|
||||
type: NotificationType;
|
||||
metadata?: Record<string, any>;
|
||||
seen: boolean;
|
||||
recipient: string
|
||||
author: string
|
||||
created: string;
|
||||
expand: {
|
||||
recipient: UserAnonymous;
|
||||
author: UserAnonymous;
|
||||
}
|
||||
}
|
||||
|
||||
export { type Notification, NotificationType }
|
||||
@@ -1,26 +1,28 @@
|
||||
import type { NotificationType } from "./notification";
|
||||
|
||||
class Settings {
|
||||
id?: string;
|
||||
unit?: "metric" | "imperial";
|
||||
language?: "en" | "de" | "fr" | "hu"| "it" | "nl" | "pl" | "pt" | "zh";
|
||||
language?: "en" | "de" | "fr" | "hu" | "it" | "nl" | "pl" | "pt" | "zh";
|
||||
mapFocus?: "trails" | "location";
|
||||
location?: { name: string, lat: number, lon: number };
|
||||
category?: string;
|
||||
tilesets?: {name: string, url: string}[]
|
||||
terrain?: { terrain: string, hillshading: string};
|
||||
tilesets?: { name: string, url: string }[]
|
||||
terrain?: { terrain: string, hillshading: string };
|
||||
user?: string;
|
||||
privacy?: {account: "public" | "private", trails: "public" | "private", lists: "public" | "private"}
|
||||
privacy?: { account: "public" | "private", trails: "public" | "private", lists: "public" | "private" }
|
||||
notifications?: Record<NotificationType, { web: boolean, email: boolean }>
|
||||
|
||||
constructor(
|
||||
unit: "metric" | "imperial",
|
||||
language: "en" | "de" | "fr" | "hu"| "it" | "nl" | "pl" | "pt" | "zh",
|
||||
language: "en" | "de" | "fr" | "hu" | "it" | "nl" | "pl" | "pt" | "zh",
|
||||
mapFocus: "trails" | "location",
|
||||
user: string,
|
||||
params?: {
|
||||
location?: { name: string, lat: number, lon: number }
|
||||
category?: string
|
||||
tilesets?: {name: string, url: string}[]
|
||||
terrain?: { terrain: string, hillshading: string};
|
||||
tilesets?: { name: string, url: string }[]
|
||||
terrain?: { terrain: string, hillshading: string };
|
||||
}
|
||||
) {
|
||||
this.unit = unit;
|
||||
|
||||
Reference in New Issue
Block a user