aus Iflight soll jetzt CFlightProxy werden

This commit is contained in:
2022-12-05 23:09:56 +01:00
parent dfaa6f6c4c
commit 9c3cae8350
5 changed files with 68 additions and 31 deletions

View File

@ -113,15 +113,15 @@ export interface IFlights {
// Stores the currently-being-typechecked object for error messages.
let obj: any = null;
export class IFlightsProxy {
export class CFlightsProxy {
public readonly success: boolean;
public readonly message: string;
public readonly meta: MetaProxy;
public readonly data: IFlightProxy[] | null;
public static Parse(d: string): IFlightsProxy {
return IFlightsProxy.Create(JSON.parse(d));
public static Parse(d: string): CFlightsProxy {
return CFlightsProxy.Create(JSON.parse(d));
}
public static Create(d: any, field: string = 'root'): IFlightsProxy {
public static Create(d: any, field: string = 'root'): CFlightsProxy {
if (!field) {
obj = d;
field = "root";
@ -139,13 +139,13 @@ export class IFlightsProxy {
checkArray(d.data, field + ".data");
if (d.data) {
for (let i = 0; i < d.data.length; i++) {
d.data[i] = IFlightProxy.Create(d.data[i], field + ".data" + "[" + i + "]");
d.data[i] = CFlightProxy.Create(d.data[i], field + ".data" + "[" + i + "]");
}
}
if (d.data === undefined) {
d.data = null;
}
return new IFlightsProxy(d);
return new CFlightsProxy(d);
}
private constructor(d: any) {
this.success = d.success;
@ -180,7 +180,7 @@ export class MetaProxy {
}
}
export class IFlightProxy {
export class CFlightProxy {
public readonly IDFlight: string;
public readonly FKGliderCategory: string;
public readonly Category: string;
@ -277,8 +277,8 @@ export class IFlightProxy {
public readonly TC: string;
public readonly US: string;
public readonly TS: string;
public static Parse(d: string): IFlightProxy {
return IFlightProxy.Create(JSON.parse(d));
public static Parse(d: string): CFlightProxy {
return CFlightProxy.Create(JSON.parse(d));
}
public static Create(d: any, field: string = 'root'): IFlightProxy {
if (!field) {
@ -466,7 +466,7 @@ export class IFlightProxy {
checkString(d.TC, false, field + ".TC");
checkString(d.US, false, field + ".US");
checkString(d.TS, false, field + ".TS");
return new IFlightProxy(d);
return new CFlightProxy(d);
}
private constructor(d: any) {
this.IDFlight = d.IDFlight;