Reorganise code - use src folder

This commit is contained in:
Timothy Armes
2023-10-11 08:45:36 +02:00
committed by Owen Rees
parent 2dc5f477c9
commit b5061b1c78
89 changed files with 70 additions and 69 deletions
+77
View File
@@ -0,0 +1,77 @@
import { LatLngLiteral } from "leaflet";
import { ObjectId } from "mongodb";
export type Status = "scheduled" | "ongoing" | "finished";
export type TournamentData = {
_id: ObjectId;
town: string;
department: string;
country: string;
tournament: string;
url: string;
time_control: "Cadence Lente" | "Rapide" | "Blitz" | string;
norm_tournament: boolean;
date: string;
coordinates: [number, number];
entry_method: "manual" | "auto";
pending: boolean;
status: Status;
};
export type ClubData = {
_id: ObjectId;
name: string;
url?: string;
address?: string;
email?: string;
website?: string;
coordinates: [number, number];
};
export enum TimeControl {
Classic = "Classic",
Rapid = "Rapid",
Blitz = "Blitz",
Other = "Other",
}
export type Tournament = {
id: string;
groupId: string;
town: string;
department: string;
tournament: string;
url: string;
timeControl: TimeControl;
date: string;
latLng: LatLngLiteral;
norm: boolean;
pending: boolean;
status: Status;
};
export type Club = {
id: string;
name: string;
url?: string;
address?: string;
email?: string;
website?: string;
latLng: LatLngLiteral;
};
export type ResponseMessage = {
isSuccessful: boolean;
message: string;
};
export type ScrollableElement = Window | HTMLElement;
// Prettify takes a type as its argument and returns a new type that has the same properties as the original type,
// but the properties are not intersected. This means that the new type is easier to read and understand.
// https://gist.github.com/palashmon/db68706d4f26d2dbf187e76409905399
export type Prettify<T> = {
[K in keyof T]: T[K];
} & {};