export namespace main { export class Disk { Name: string; Free: number; static createFrom(source: any = {}) { return new Disk(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.Name = source["Name"]; this.Free = source["Free"]; } } export class Project { name: string; last_directory: string; last_directory_path: string; // Go type: time last_directory_time: any; static createFrom(source: any = {}) { return new Project(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.name = source["name"]; this.last_directory = source["last_directory"]; this.last_directory_path = source["last_directory_path"]; this.last_directory_time = this.convertValues(source["last_directory_time"], null); } 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; } } }