Files
echecsfrance/src/types.ts
T
owenrees feadb465eb upgrade Nodemailer to v10
fix dead code with knip

upgrade TS to v6 and fix linting errors

auto apply oxfmt rules

fix linting errors - unused deps etc

ignore file

remove all ignored files in knip

add knip - dead code analysis tool

swap prettier and eslint of oxfmt and oxlint

fix: fix map rendering in react strict mode

fix: headlessUI float replace

fix: disable Matomo if not URL and SITE ID exist

upgrade: 1st pass upgrade to Next.js v16

deps: upgrade react to v19
2026-10-05 16:15:25 +02:00

61 lines
1.4 KiB
TypeScript

import { LatLngLiteral } from "leaflet";
import { TournamentModel } from "./server/models/tournamentModel";
type Status = "scheduled" | "ongoing" | "finished" | "in-play";
export enum TimeControl {
Classic = "Classic",
Rapid = "Rapid",
Blitz = "Blitz",
Other = "Other",
}
export type Tournament = {
id: string;
ffeId: string;
groupId: string;
town: string;
department: string;
tournament: string;
url: string;
timeControl: TimeControl;
date: string;
latLng: LatLngLiteral;
norm: boolean;
pending: boolean;
status: Status;
};
export const tcMap: Record<TournamentModel["time_control"], TimeControl> = {
"Cadence Lente": TimeControl.Classic,
Rapide: TimeControl.Rapid,
Blitz: TimeControl.Blitz,
};
export type Club = {
id: string;
name: string;
url?: string;
address?: string;
email?: string;
website?: string;
latLng: LatLngLiteral;
};
export type DatePickerDirection = "horizontal" | "vertical";
// 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];
} & {};
export type Path<T, K extends keyof T = keyof T> = K extends string
? T[K] extends Record<string, unknown>
? `${K}.${Path<T[K], keyof T[K]>}`
: K
: never;