; export default function Foo() {}
(export_statement
  "default"
  declaration: (function_declaration
    name: (identifier) @export.default.func))

; export default class Foo {}
(export_statement
  "default"
  declaration: (class_declaration
    name: (type_identifier) @export.default.class))

; export default <identifier>
(export_statement
  "default"
  value: (identifier) @export.default.value)

; export function Foo() {}
(export_statement
  declaration: (function_declaration
    name: (identifier) @export.named.func))

; export class Foo {}
(export_statement
  declaration: (class_declaration
    name: (type_identifier) @export.named.class))

; export const Foo = ...
(export_statement
  declaration: (lexical_declaration
    (variable_declarator
      name: (identifier) @export.named.const)))

; export const { Foo, Bar } = ... (destructured re-export — Auth.js v5 pattern)
(export_statement
  declaration: (lexical_declaration
    (variable_declarator
      name: (object_pattern
        (shorthand_property_identifier_pattern) @export.named.const))))

; export type Foo = ...
(export_statement
  declaration: (type_alias_declaration
    name: (type_identifier) @export.named.type))

; export interface Foo {}
(export_statement
  declaration: (interface_declaration
    name: (type_identifier) @export.named.interface))

; export enum Foo {}
(export_statement
  declaration: (enum_declaration
    name: (identifier) @export.named.enum))

; export { A, B } from 'x' (re-exports with names)
(export_statement
  (export_clause
    (export_specifier
      name: (identifier) @reexport.name))
  source: (string (string_fragment) @reexport.source))

; export * from 'x' (wildcard re-export — tree-sitter represents * as literal)
(export_statement
  "*"
  source: (string (string_fragment) @reexport.wildcard.source))

; export { A, B } (bare named exports, no source)
(export_statement
  (export_clause
    (export_specifier
      name: (identifier) @export.bare.name))
  !source)
