UNPKG

nativescript

Version:

Command-line interface for building NativeScript projects

63 lines (54 loc) 1.17 kB
export type IKeyCommandPlatform = "Android" | "iOS" | "visionOS" | "all"; export type IKeysLowerCase = | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"; export type IKeysUpperCase = Uppercase<IKeysLowerCase>; export const enum SpecialKeys { CtrlC = "\u0003", QuestionMark = "?", } export type IKeysSpecial = `${SpecialKeys}`; export type IValidKeyName = IKeysLowerCase | IKeysUpperCase | IKeysSpecial; export interface IKeyCommandHelper { attachKeyCommands: ( platform: IKeyCommandPlatform, processType: SupportedProcessType ) => void; addOverride(key: IValidKeyName, execute: () => Promise<boolean>); removeOverride(key: IValidKeyName); printCommands(platform: IKeyCommandPlatform): void; } export type SupportedProcessType = "start" | "run"; export interface IKeyCommand { key: IValidKeyName; platform: IKeyCommandPlatform; description: string; group: string; willBlockKeyCommandExecution?: boolean; execute(platform: string): Promise<void>; canExecute?: (processType: SupportedProcessType) => boolean; }