; TypeScript symbol extraction queries
; Captures: @node (full declaration), @name (identifier), @kind (implicit from pattern)

; === Exported declarations ===

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

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

; export interface IFoo {}
(export_statement
  (interface_declaration
    name: (type_identifier) @name) @node) @exported

; export type MyType = ...
(export_statement
  (type_alias_declaration
    name: (type_identifier) @name) @node) @exported

; export enum Color {}
(export_statement
  (enum_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: (type_identifier) @name) @node) @exported

; === Non-exported declarations ===

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

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

; interface IFoo {}
(interface_declaration
  name: (type_identifier) @name) @node

; type MyType = ...
(type_alias_declaration
  name: (type_identifier) @name) @node

; enum Color {}
(enum_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 / readonly foo: Type
(public_field_definition
  name: (property_identifier) @name) @node
