cleaned up user anilist functions
This commit is contained in:
@ -14,24 +14,32 @@ export function AniListUpdateEntry(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg
|
||||
return window['go']['main']['App']['AniListUpdateEntry'](arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
|
||||
}
|
||||
|
||||
export function CheckIfAniListLoggedIn() {
|
||||
return window['go']['main']['App']['CheckIfAniListLoggedIn']();
|
||||
}
|
||||
|
||||
export function CheckIfSimklLoggedIn() {
|
||||
return window['go']['main']['App']['CheckIfSimklLoggedIn']();
|
||||
}
|
||||
|
||||
export function GetAniListItem(arg1, arg2) {
|
||||
return window['go']['main']['App']['GetAniListItem'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function GetAniListLoggedInUserId() {
|
||||
return window['go']['main']['App']['GetAniListLoggedInUserId']();
|
||||
export function GetAniListLoggedInUser() {
|
||||
return window['go']['main']['App']['GetAniListLoggedInUser']();
|
||||
}
|
||||
|
||||
export function GetAniListUserWatchingList(arg1, arg2, arg3) {
|
||||
return window['go']['main']['App']['GetAniListUserWatchingList'](arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
export function GetSimklLoggedInUserId() {
|
||||
return window['go']['main']['App']['GetSimklLoggedInUserId']();
|
||||
export function GetSimklLoggedInUser() {
|
||||
return window['go']['main']['App']['GetSimklLoggedInUser']();
|
||||
}
|
||||
|
||||
export function Greet(arg1) {
|
||||
return window['go']['main']['App']['Greet'](arg1);
|
||||
export function SimklGetUserWatchlist() {
|
||||
return window['go']['main']['App']['SimklGetUserWatchlist']();
|
||||
}
|
||||
|
||||
export function SimklLogin() {
|
||||
|
@ -61,7 +61,7 @@ export namespace main {
|
||||
}
|
||||
}
|
||||
export class AniListUser {
|
||||
// Go type: struct { Viewer struct { ID int "json:\"id\""; Name string "json:\"name\"" } "json:\"Viewer\"" }
|
||||
// Go type: struct { Viewer struct { ID int "json:\"id\""; Name string "json:\"name\""; Avatar struct { Large string "json:\"large\""; Medium string "json:\"medium\"" } "json:\"avatar\""; BannerImage string "json:\"bannerImage\""; SiteUrl string "json:\"siteUrl\"" } "json:\"Viewer\"" }
|
||||
data: any;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
@ -148,8 +148,9 @@ export namespace main {
|
||||
}
|
||||
}
|
||||
export class SimklUser {
|
||||
// Go type: struct { Viewer struct { ID int "json:\"id\""; Name string "json:\"name\"" } "json:\"Viewer\"" }
|
||||
data: any;
|
||||
user: user;
|
||||
account: account;
|
||||
connections: connections;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new SimklUser(source);
|
||||
@ -157,26 +158,22 @@ export namespace main {
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.data = this.convertValues(source["data"], Object);
|
||||
this.user = source["user"];
|
||||
this.account = source["account"];
|
||||
this.connections = source["connections"];
|
||||
}
|
||||
}
|
||||
export class SimklWatchList {
|
||||
anime: anime;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new SimklWatchList(source);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.anime = source["anime"];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user