11import { isApplePlatform , type DeviceInfo } from '../utils/device.ts' ;
2+ import { INTERACTION_COMMAND_CAPABILITIES } from '../commands/interactions/definition.ts' ;
23
34type KindMatrix = {
45 simulator ?: boolean ;
@@ -7,7 +8,7 @@ type KindMatrix = {
78 unknown ?: boolean ;
89} ;
910
10- type CommandCapability = {
11+ export type CommandCapability = {
1112 apple ?: KindMatrix ;
1213 android ?: KindMatrix ;
1314 linux ?: KindMatrix ;
@@ -227,11 +228,7 @@ const COMMAND_CAPABILITY_MATRIX: Record<string, CommandCapability> = {
227228 android : { emulator : true , device : true , unknown : true } ,
228229 linux : LINUX_NONE ,
229230 } ,
230- type : {
231- apple : { simulator : true , device : true } ,
232- android : { emulator : true , device : true , unknown : true } ,
233- linux : LINUX_DEVICE ,
234- } ,
231+ ...INTERACTION_COMMAND_CAPABILITIES ,
235232 wait : {
236233 apple : { simulator : true , device : true } ,
237234 android : { emulator : true , device : true , unknown : true } ,
@@ -253,6 +250,10 @@ export function isCommandSupportedOnDevice(command: string, device: DeviceInfo):
253250 return byPlatform [ kind ] === true ;
254251}
255252
253+ export function getCommandCapability ( command : string ) : CommandCapability | undefined {
254+ return COMMAND_CAPABILITY_MATRIX [ command ] ;
255+ }
256+
256257export function listCapabilityCommands ( ) : string [ ] {
257258 return Object . keys ( COMMAND_CAPABILITY_MATRIX ) . sort ( ) ;
258259}
0 commit comments