Add typescript types
This commit is contained in:
		
							
								
								
									
										29
									
								
								frontend/src/types.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								frontend/src/types.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
export type Player = {
 | 
			
		||||
	id: number;
 | 
			
		||||
	name: string;
 | 
			
		||||
	guild: {
 | 
			
		||||
		id: number;
 | 
			
		||||
		name: string;
 | 
			
		||||
	};
 | 
			
		||||
	associations: Association[];
 | 
			
		||||
	notes: Note[];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export type Association = {
 | 
			
		||||
	id: number;
 | 
			
		||||
	name: string;
 | 
			
		||||
	note: string;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export type Note = {
 | 
			
		||||
	id: number;
 | 
			
		||||
	content: string;
 | 
			
		||||
	timestamp: string;
 | 
			
		||||
	player: Player;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export type APIResponse<T> = {
 | 
			
		||||
	success: boolean;
 | 
			
		||||
	message: string;
 | 
			
		||||
	data: T;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user