chore(wailsjs): regenerate Go bindings for the AniList Browse feature
Re-run the Wails binding generator so the frontend reflects the browse Go types that were added in earlier commits (AniListBrowse plus the Media / MediaList model refinements): - App.d.ts / App.js: expose the new AniListBrowse() method - models.ts: add the Media model, the anonymous tags element type, and type MediaList.media as Media instead of a generic object
This commit is contained in:
@@ -359,13 +359,125 @@ export namespace main {
|
||||
this.updated_at = source["updated_at"];
|
||||
}
|
||||
}
|
||||
export class {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
rank: number;
|
||||
isMediaSpoiler: boolean;
|
||||
isAdult: boolean;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new (source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.id = source["id"];
|
||||
this.name = source["name"];
|
||||
this.description = source["description"];
|
||||
this.rank = source["rank"];
|
||||
this.isMediaSpoiler = source["isMediaSpoiler"];
|
||||
this.isAdult = source["isAdult"];
|
||||
}
|
||||
}
|
||||
export class Media {
|
||||
id: number;
|
||||
idMal: number;
|
||||
// Go type: struct { UserPreferred string "json:\"userPreferred\""; Romaji string "json:\"romaji\""; English string "json:\"english\""; Native string "json:\"native\"" }
|
||||
title: any;
|
||||
description: string;
|
||||
// Go type: struct { ExtraLarge string; Large string "json:\"large\""; Medium string; Color string }
|
||||
coverImage: any;
|
||||
BannerImage: string;
|
||||
Format: string;
|
||||
season: string;
|
||||
seasonYear: number;
|
||||
status: string;
|
||||
episodes: number;
|
||||
Duration: number;
|
||||
CountryOfOrigin: string;
|
||||
Source: string;
|
||||
Synonyms: string[];
|
||||
AverageScore: number;
|
||||
MeanScore: number;
|
||||
Popularity: number;
|
||||
Trending: number;
|
||||
Favourites: number;
|
||||
// Go type: struct { nodes struct { id int; Title struct { UserPreferred string "json:\"userPreferred\""; Romaji string "json:\"romaji\""; English string "json:\"english\""; Native string "json:\"native\"" } "json:\"title\"" } }
|
||||
Relations: any;
|
||||
// Go type: struct { Year int; Month int; Day int }
|
||||
StartDate: any;
|
||||
// Go type: struct { Year int; Month int; Day int }
|
||||
EndDate: any;
|
||||
// Go type: struct { AiringAt int "json:\"airingAt\""; TimeUntilAiring int "json:\"timeUntilAiring\""; Episode int "json:\"episode\"" }
|
||||
nextAiringEpisode: any;
|
||||
// Go type: struct { Nodes struct { Id int; AiringAt int; TimeUntilAiring int; Episode int; MediaId int } }
|
||||
AiringSchedule: any;
|
||||
genres: string[];
|
||||
tags: [];
|
||||
isAdult: boolean;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Media(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.id = source["id"];
|
||||
this.idMal = source["idMal"];
|
||||
this.title = this.convertValues(source["title"], Object);
|
||||
this.description = source["description"];
|
||||
this.coverImage = this.convertValues(source["coverImage"], Object);
|
||||
this.BannerImage = source["BannerImage"];
|
||||
this.Format = source["Format"];
|
||||
this.season = source["season"];
|
||||
this.seasonYear = source["seasonYear"];
|
||||
this.status = source["status"];
|
||||
this.episodes = source["episodes"];
|
||||
this.Duration = source["Duration"];
|
||||
this.CountryOfOrigin = source["CountryOfOrigin"];
|
||||
this.Source = source["Source"];
|
||||
this.Synonyms = source["Synonyms"];
|
||||
this.AverageScore = source["AverageScore"];
|
||||
this.MeanScore = source["MeanScore"];
|
||||
this.Popularity = source["Popularity"];
|
||||
this.Trending = source["Trending"];
|
||||
this.Favourites = source["Favourites"];
|
||||
this.Relations = this.convertValues(source["Relations"], Object);
|
||||
this.StartDate = this.convertValues(source["StartDate"], Object);
|
||||
this.EndDate = this.convertValues(source["EndDate"], Object);
|
||||
this.nextAiringEpisode = this.convertValues(source["nextAiringEpisode"], Object);
|
||||
this.AiringSchedule = this.convertValues(source["AiringSchedule"], Object);
|
||||
this.genres = source["genres"];
|
||||
this.tags = this.convertValues(source["tags"], );
|
||||
this.isAdult = source["isAdult"];
|
||||
}
|
||||
|
||||
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
||||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
for (const key of Object.keys(a)) {
|
||||
a[key] = new classs(a[key]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
return new classs(a);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
export class MediaList {
|
||||
id: number;
|
||||
mediaId: number;
|
||||
userId: number;
|
||||
// Go type: struct { ID int "json:\"id\""; IDMal int "json:\"idMal\""; Title struct { Romaji string "json:\"romaji\""; English string "json:\"english\""; Native string "json:\"native\"" } "json:\"title\""; Description string "json:\"description\""; CoverImage struct { Large string "json:\"large\"" } "json:\"coverImage\""; Season string "json:\"season\""; SeasonYear int "json:\"seasonYear\""; Status string "json:\"status\""; Episodes int "json:\"episodes\""; NextAiringEpisode struct { AiringAt int "json:\"airingAt\""; TimeUntilAiring int "json:\"timeUntilAiring\""; Episode int "json:\"episode\"" } "json:\"nextAiringEpisode\""; Genres []string "json:\"genres\""; Tags []struct { Id int "json:\"id\""; Name string "json:\"name\""; Description string "json:\"description\""; Rank int "json:\"rank\""; IsMediaSpoiler bool "json:\"isMediaSpoiler\""; IsAdult bool "json:\"isAdult\"" } "json:\"tags\""; IsAdult bool "json:\"isAdult\"" }
|
||||
media: any;
|
||||
status: string;
|
||||
media: Media;
|
||||
// Go type: struct { Year int "json:\"year\""; Month int "json:\"month\""; Day int "json:\"day\"" }
|
||||
startedAt: any;
|
||||
// Go type: struct { Year int "json:\"year\""; Month int "json:\"month\""; Day int "json:\"day\"" }
|
||||
@@ -386,8 +498,8 @@ export namespace main {
|
||||
this.id = source["id"];
|
||||
this.mediaId = source["mediaId"];
|
||||
this.userId = source["userId"];
|
||||
this.media = this.convertValues(source["media"], Object);
|
||||
this.status = source["status"];
|
||||
this.media = this.convertValues(source["media"], Media);
|
||||
this.startedAt = this.convertValues(source["startedAt"], Object);
|
||||
this.completedAt = this.convertValues(source["completedAt"], Object);
|
||||
this.notes = source["notes"];
|
||||
|
||||
Reference in New Issue
Block a user