; JavaScript symbol extraction queries
; Same as TypeScript but without interface, type alias, and enum nodes.
; JS uses `identifier` for class names (not `type_identifier`).

; === Exported declarations ===

; export function foo() {}
(export_statement
  (function_declaration
    name: (identifier) @name) @node) @exported

; export class Foo {}
(export_statement
  (class_declaration
    name: (identifier) @name) @node) @exported

; export const FOO = ...
(export_statement
  (lexical_declaration
    (variable_declarator
      name: (identifier) @name)) @node) @exported

; export default class Foo {}
(export_statement
  "default"
  (class_declaration
    name: (identifier) @name) @node) @exported

; === Non-exported declarations ===

; function foo() {}
(function_declaration
  name: (identifier) @name) @node

; class Foo {}
(class_declaration
  name: (identifier) @name) @node

; const foo = ...
(lexical_declaration
  (variable_declarator
    name: (identifier) @name)) @node

; === Class members ===

; class methods: foo() {} / async foo() {} / static foo() {}
(method_definition
  name: (property_identifier) @name) @node

; class properties: foo = value
(field_definition
  property: (property_identifier) @name) @node
