Skip to content

typescript

The community/lang/typescript directory contains files that add support for the TypeScript language to Talon.

The file typescript.talon defines the basic grammar for working with TypeScript. It specifies that the code language is typescript or typescriptreact. It defines voice commands for inserting type unions (type union), intersections (type intersect), type definitions (state type), and as const.

The file typescript.py defines the context and actions specific to TypeScript. It sets the context to be active when the code language is typescript or typescriptreact and the mode is command. It defines a list of code types user.code_type, including boolean, integer, string, null, undefined, number, and any. It defines the following actions on the user action class: * code_private_function: inserts a private function declaration. * code_protected_function: inserts a protected function declaration. * code_public_function: inserts a public function declaration. * code_insert_type_annotation: inserts a type annotation. * code_insert_return_type: inserts a return type.