export namespace api {
	
	export class AppTabDefinition {
	    key: string;
	    title: string;
	    visible: boolean;
	    enabled: boolean;
	
	    static createFrom(source: any = {}) {
	        return new AppTabDefinition(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.key = source["key"];
	        this.title = source["title"];
	        this.visible = source["visible"];
	        this.enabled = source["enabled"];
	    }
	}

}

export namespace filesystem {
	
	export class FileOperationResult {
	    path: string;
	    name: string;
	    size: number;
	    size_str?: string;
	    is_dir: boolean;
	    mod_time?: string;
	    mode?: string;
	    old_path?: string;
	    deleted?: boolean;
	
	    static createFrom(source: any = {}) {
	        return new FileOperationResult(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.path = source["path"];
	        this.name = source["name"];
	        this.size = source["size"];
	        this.size_str = source["size_str"];
	        this.is_dir = source["is_dir"];
	        this.mod_time = source["mod_time"];
	        this.mode = source["mode"];
	        this.old_path = source["old_path"];
	        this.deleted = source["deleted"];
	    }
	}

}

export namespace main {
	
	export class RenamePathRequest {
	    oldPath: string;
	    newPath: string;
	
	    static createFrom(source: any = {}) {
	        return new RenamePathRequest(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.oldPath = source["oldPath"];
	        this.newPath = source["newPath"];
	    }
	}
	export class SaveAppConfigRequest {
	    tabs: api.AppTabDefinition[];
	    visibleTabs: string[];
	    defaultTab: string;
	
	    static createFrom(source: any = {}) {
	        return new SaveAppConfigRequest(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.tabs = this.convertValues(source["tabs"], api.AppTabDefinition);
	        this.visibleTabs = source["visibleTabs"];
	        this.defaultTab = source["defaultTab"];
	    }
	
		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 SaveBase64FileRequest {
	    path: string;
	    content: string;
	
	    static createFrom(source: any = {}) {
	        return new SaveBase64FileRequest(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.path = source["path"];
	        this.content = source["content"];
	    }
	}
	export class WriteFileRequest {
	    path: string;
	    content: string;
	
	    static createFrom(source: any = {}) {
	        return new WriteFileRequest(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.path = source["path"];
	        this.content = source["content"];
	    }
	}

}

