-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathemulate.ts
35 lines (28 loc) · 1.09 KB
/
emulate.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
export class EmulateCommandBase {
constructor(private $platformService: IPlatformService) { }
executeCore(args: string[]): IFuture<void> {
return this.$platformService.emulatePlatform(args[0]);
}
}
export class EmulateIosCommand extends EmulateCommandBase implements ICommand {
constructor($platformService: IPlatformService,
private $platformsData: IPlatformsData) {
super($platformService);
}
public allowedParameters: ICommandParameter[] = [];
public execute(args: string[]): IFuture<void> {
return this.executeCore([this.$platformsData.availablePlatforms.iOS]);
}
}
$injector.registerCommand("emulate|ios", EmulateIosCommand);
export class EmulateAndroidCommand extends EmulateCommandBase implements ICommand {
constructor($platformService: IPlatformService,
private $platformsData: IPlatformsData) {
super($platformService);
}
public allowedParameters: ICommandParameter[] = [];
public execute(args: string[]): IFuture<void> {
return this.executeCore([this.$platformsData.availablePlatforms.Android]);
}
}
$injector.registerCommand("emulate|android", EmulateAndroidCommand);