Files
hipctf/types.ts
m0rph3us1987 40f496c3f2 Made app more modular.
Fixed some bugs.
Added some functionality.
2026-01-21 18:59:14 +01:00

57 lines
1.1 KiB
TypeScript

export type Difficulty = 'Low' | 'Medium' | 'High';
export interface ChallengeFile {
name: string;
url: string;
}
export interface Challenge {
id: string;
title: string;
category: string;
difficulty: Difficulty;
description: string;
initialPoints: number;
minimumPoints: number; // Lowest possible points
decaySolves: number; // Solves to reach minimum
flag: string;
files: ChallengeFile[];
solves: string[]; // Team IDs
port?: number;
connectionType?: 'nc' | 'http';
overrideIp?: string;
}
export interface Team {
id: string;
name: string;
password?: string;
isAdmin?: boolean | number;
isDisabled?: boolean | number;
}
export interface Solve {
teamId: string;
challengeId: string;
timestamp: number;
pointsEarned: number; // Not used for dynamic calc but stored for history
}
export interface BlogPost {
id: string;
title: string;
content: string;
timestamp: number;
}
export interface CTFState {
isStarted: boolean;
startTime: number | null;
teams: Team[];
challenges: Challenge[];
solves: Solve[];
blogs: BlogPost[];
config: Record<string, string>;
}