Update interface with project format.

This commit is contained in:
Rory Kelly
2021-11-27 17:01:29 +00:00
parent dad8b87dee
commit 47c9969df5
2 changed files with 39 additions and 2 deletions
+29
View File
@@ -57,6 +57,24 @@ export interface IResource {
tooltip?: string;
}
/**
* Contains information about a decomp project and how to process the associated CSV data.
*/
export interface IProject {
slugs: string[];
name: string;
matched: string;
unmatched: string;
columns: [
{
type: string,
index: number | number[];
name: string;
display: string
}
]
}
/**
* Functions to implement within "GamesService".
*/
@@ -72,4 +90,15 @@ export interface IGamesService {
*/
getResources(): Observable<IResource[]>;
/**
* Get all of the projects.
*/
getProjects(): Observable<IProject[]>;
/**
* Get the CSV data for a project.
*
* @param filename The filename of the desired CSV.
*/
getProjectCSV(filename: string): Observable<string>;
}
+10 -2
View File
@@ -14,10 +14,18 @@ export class GamesService implements IGamesService {
constructor(private http: HttpClient) { }
getSummaries(): Observable<ISummary[]> {
return this.http.get<ISummary[]>("/assets/json/summaries.json")
return this.http.get<ISummary[]>("/assets/json/summaries.json");
}
getResources(): Observable<IResource[]> {
return this.http.get<IResource[]>("/assets/json/resources.json")
return this.http.get<IResource[]>("/assets/json/resources.json");
}
getProjects(): Observable<IProject[]> {
return this.http.get<IProject[]>("/assets/json/projects.json");
}
getProjectCSV(filename: string): Observable<string> {
return this.http.get<string>(`/assets/csv/${filename}.csv`);
}
}