38 lines
863 B
TypeScript
38 lines
863 B
TypeScript
|
|
export namespace main {
|
||
|
|
|
||
|
|
export class CSVData {
|
||
|
|
Headers: string[];
|
||
|
|
Rows: string[][];
|
||
|
|
FilePath: string;
|
||
|
|
|
||
|
|
static createFrom(source: any = {}) {
|
||
|
|
return new CSVData(source);
|
||
|
|
}
|
||
|
|
|
||
|
|
constructor(source: any = {}) {
|
||
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
||
|
|
this.Headers = source["Headers"];
|
||
|
|
this.Rows = source["Rows"];
|
||
|
|
this.FilePath = source["FilePath"];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
export class Command {
|
||
|
|
ID: string;
|
||
|
|
Name: string;
|
||
|
|
Shortcut: string;
|
||
|
|
|
||
|
|
static createFrom(source: any = {}) {
|
||
|
|
return new Command(source);
|
||
|
|
}
|
||
|
|
|
||
|
|
constructor(source: any = {}) {
|
||
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
||
|
|
this.ID = source["ID"];
|
||
|
|
this.Name = source["Name"];
|
||
|
|
this.Shortcut = source["Shortcut"];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|