Added character list in search

This commit is contained in:
Alexis
2024-04-06 22:13:39 +02:00
parent a69396d75b
commit dd8c4727a3
28 changed files with 556 additions and 178 deletions

12
src/models/Characters.ts Normal file
View File

@@ -0,0 +1,12 @@
import type { LeimDate } from './Date'
export interface Character {
name: string
description?: string
birth?: LeimDate
death?: LeimDate
}
export function isCharacter(object: any): object is Character {
return 'birth' in object
}

View File

@@ -1,4 +1,4 @@
export type LeimDate = {
export interface LeimDate {
day: number
month: number
year: number

20
src/models/Events.ts Normal file
View File

@@ -0,0 +1,20 @@
import type { LeimDate } from './Date'
export interface CalendarEvent {
title: string
date: LeimDate
description?: string
category?: CalendarEventCategory
}
export type CalendarEventCategory =
| 'birth'
| 'death'
| 'catastrophe'
| 'legal'
| 'natural-disaster'
| 'player'
export function isCalendarEvent(object: any): object is CalendarEvent {
return 'date' in object
}