2021-03-09 23:14:27 +01:00
|
|
|
; inherits: ecma
|
2020-06-12 07:41:20 -05:00
|
|
|
[
|
|
|
|
|
"abstract"
|
|
|
|
|
"declare"
|
|
|
|
|
"enum"
|
|
|
|
|
"export"
|
|
|
|
|
"implements"
|
|
|
|
|
"interface"
|
|
|
|
|
"keyof"
|
|
|
|
|
"namespace"
|
|
|
|
|
"private"
|
|
|
|
|
"protected"
|
|
|
|
|
"public"
|
|
|
|
|
"type"
|
2021-03-07 18:59:39 +01:00
|
|
|
"readonly"
|
2020-06-12 07:41:20 -05:00
|
|
|
] @keyword
|
|
|
|
|
|
2020-11-14 18:44:55 -05:00
|
|
|
; types
|
|
|
|
|
|
2020-06-12 07:41:20 -05:00
|
|
|
(type_identifier) @type
|
|
|
|
|
(predefined_type) @type.builtin
|
|
|
|
|
|
2021-06-26 15:25:57 +06:00
|
|
|
(import_statement "type"
|
|
|
|
|
(import_clause
|
|
|
|
|
(named_imports
|
|
|
|
|
((import_specifier
|
|
|
|
|
name: (identifier) @type)))))
|
|
|
|
|
|
2020-11-14 18:44:55 -05:00
|
|
|
; punctuation
|
|
|
|
|
|
2020-06-12 07:41:20 -05:00
|
|
|
(type_arguments
|
|
|
|
|
"<" @punctuation.bracket
|
|
|
|
|
">" @punctuation.bracket)
|
|
|
|
|
|
2020-11-14 19:02:20 -05:00
|
|
|
(union_type
|
|
|
|
|
"|" @punctuation.delimiter)
|
|
|
|
|
|
|
|
|
|
(intersection_type
|
|
|
|
|
"&" @punctuation.delimiter)
|
|
|
|
|
|
2020-11-14 18:44:55 -05:00
|
|
|
(type_annotation
|
|
|
|
|
":" @punctuation.delimiter)
|
|
|
|
|
|
|
|
|
|
(pair
|
|
|
|
|
":" @punctuation.delimiter)
|
|
|
|
|
|
2020-11-21 11:48:58 -05:00
|
|
|
(property_signature "?" @punctuation.special)
|
|
|
|
|
(optional_parameter "?" @punctuation.special)
|
2020-11-14 19:02:20 -05:00
|
|
|
|
2020-06-12 07:41:20 -05:00
|
|
|
; Variables
|
|
|
|
|
|
2020-11-14 18:44:55 -05:00
|
|
|
(undefined) @variable.builtin
|
|
|
|
|
|
2021-04-23 14:20:51 +02:00
|
|
|
;;; Parameters
|
2020-09-06 09:11:54 -05:00
|
|
|
(required_parameter (identifier) @parameter)
|
|
|
|
|
(optional_parameter (identifier) @parameter)
|
2021-04-23 14:20:51 +02:00
|
|
|
|
|
|
|
|
(required_parameter
|
|
|
|
|
(rest_pattern
|
|
|
|
|
(identifier) @parameter))
|
|
|
|
|
|
|
|
|
|
;; ({ a }) => null
|
|
|
|
|
(required_parameter
|
|
|
|
|
(object_pattern
|
|
|
|
|
(shorthand_property_identifier_pattern) @parameter))
|
|
|
|
|
|
|
|
|
|
;; ({ a: b }) => null
|
|
|
|
|
(required_parameter
|
|
|
|
|
(object_pattern
|
|
|
|
|
(pair_pattern
|
|
|
|
|
value: (identifier) @parameter)))
|
|
|
|
|
|
|
|
|
|
;; ([ a ]) => null
|
|
|
|
|
(required_parameter
|
|
|
|
|
(array_pattern
|
|
|
|
|
(identifier) @parameter))
|
|
|
|
|
|
|
|
|
|
;; a => null
|
|
|
|
|
(arrow_function
|
|
|
|
|
parameter: (identifier) @parameter)
|