node-event-bot/server/interfaces.ts

30 lines
753 B
TypeScript
Raw Normal View History

2022-01-03 15:07:49 +01:00
export type Maybe<T> = T | undefined
export interface Player {
name: string
}
export type supported_languages = "german" | "english"
export interface localized_string {
[k: string]: {
2022-04-09 23:02:08 +02:00
[k in supported_languages]: string
2022-01-03 15:07:49 +01:00
}
}
export class CustomError extends Error {
private code: string
public constructor(message: string, errorCode: string) {
super(message)
this.code = errorCode
}
public getCode() { return this.code }
}
export const errorCodes = {
no_end_date: 'no_end_date',
no_string_present: 'no_string_present',
no_schedule: 'no_schedule',
schedule_not_supported: 'schedule_not_supported',
no_repetition_amount: 'no_repetition_amount',
invalid_repetition_string: 'invalid_repetition_string',
no_creator_id: "no_creator_id",
}