Added character list in search
This commit is contained in:
12
src/models/Characters.ts
Normal file
12
src/models/Characters.ts
Normal 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
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export type LeimDate = {
|
||||
export interface LeimDate {
|
||||
day: number
|
||||
month: number
|
||||
year: number
|
||||
|
||||
20
src/models/Events.ts
Normal file
20
src/models/Events.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user