/* tslint:disable */
/* eslint-disable */

/**
 * A byte range — start (inclusive) to end (exclusive).
 */
export class WasmByteRange {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmByteRange;
    constructor(start: number, end: number);
    end: number;
    start: number;
}

/**
 * Metadata for a single chunk of source code.
 */
export class WasmChunkContext {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmChunkContext;
    constructor(language?: string | null, chunk_index?: number | null, total_chunks?: number | null, node_types?: string[] | null, context_path?: string[] | null, symbols_defined?: string[] | null, comments?: WasmCommentInfo[] | null, docstrings?: WasmDocstringInfo[] | null, has_error_nodes?: boolean | null);
    chunkIndex: number;
    comments: WasmCommentInfo[];
    contextPath: string[];
    docstrings: WasmDocstringInfo[];
    hasErrorNodes: boolean;
    language: string;
    nodeTypes: string[];
    symbolsDefined: string[];
    totalChunks: number;
}

/**
 * A chunk of source code with rich metadata.
 */
export class WasmCodeChunk {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmCodeChunk;
    constructor(content?: string | null, start_byte?: number | null, end_byte?: number | null, start_line?: number | null, end_line?: number | null, metadata?: WasmChunkContext | null);
    content: string;
    endByte: number;
    endLine: number;
    metadata: WasmChunkContext;
    startByte: number;
    startLine: number;
}

/**
 * A comment extracted from source code.
 */
export class WasmCommentInfo {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmCommentInfo;
    constructor(text?: string | null, kind?: WasmCommentKind | null, span?: WasmSpan | null, associated_node?: string | null);
    get associatedNode(): string | undefined;
    set associatedNode(value: string | null | undefined);
    get kind(): string;
    set kind(value: WasmCommentKind);
    span: WasmSpan;
    text: string;
}

/**
 * The kind of a comment found in source code.
 *
 * Distinguishes between single-line comments, block (multi-line) comments,
 * and documentation comments.
 */
export enum WasmCommentKind {
    Line = 0,
    Block = 1,
    Doc = 2,
}

/**
 * A diagnostic (syntax error, missing node, etc.) from parsing.
 */
export class WasmDiagnostic {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmDiagnostic;
    constructor(message?: string | null, severity?: WasmDiagnosticSeverity | null, span?: WasmSpan | null);
    message: string;
    get severity(): string;
    set severity(value: WasmDiagnosticSeverity);
    span: WasmSpan;
}

/**
 * Severity level of a diagnostic produced during parsing.
 *
 * Used to classify parse errors, warnings, and informational messages
 * found in the syntax tree.
 */
export enum WasmDiagnosticSeverity {
    Error = 0,
    Warning = 1,
    Info = 2,
}

/**
 * A section within a docstring (e.g., Args, Returns, Raises).
 */
export class WasmDocSection {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmDocSection;
    constructor(kind?: string | null, description?: string | null, name?: string | null);
    description: string;
    kind: string;
    get name(): string | undefined;
    set name(value: string | null | undefined);
}

/**
 * The format of a docstring extracted from source code.
 *
 * Identifies the docstring convention used, which varies by language
 * (e.g., Python triple-quoted strings, JSDoc, Rustdoc `///` comments).
 */
export enum WasmDocstringFormat {
    PythonTripleQuote = 0,
    JSDoc = 1,
    Rustdoc = 2,
    GoDoc = 3,
    JavaDoc = 4,
    Other = 5,
}

/**
 * A docstring extracted from source code.
 */
export class WasmDocstringInfo {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmDocstringInfo;
    constructor(text?: string | null, format?: WasmDocstringFormat | null, span?: WasmSpan | null, parsed_sections?: WasmDocSection[] | null, associated_item?: string | null);
    get associatedItem(): string | undefined;
    set associatedItem(value: string | null | undefined);
    get format(): string;
    set format(value: WasmDocstringFormat);
    parsedSections: WasmDocSection[];
    span: WasmSpan;
    text: string;
}

/**
 * An export statement extracted from source code.
 */
export class WasmExportInfo {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmExportInfo;
    constructor(name?: string | null, kind?: WasmExportKind | null, span?: WasmSpan | null);
    get kind(): string;
    set kind(value: WasmExportKind);
    name: string;
    span: WasmSpan;
}

/**
 * The kind of an export statement found in source code.
 *
 * Covers named exports, default exports, and re-exports from other modules.
 */
export enum WasmExportKind {
    Named = 0,
    Default = 1,
    ReExport = 2,
}

/**
 * Aggregate metrics for a source file.
 */
export class WasmFileMetrics {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmFileMetrics;
    constructor(total_lines?: number | null, code_lines?: number | null, comment_lines?: number | null, blank_lines?: number | null, total_bytes?: number | null, node_count?: number | null, error_count?: number | null, max_depth?: number | null);
    blankLines: number;
    codeLines: number;
    commentLines: number;
    errorCount: number;
    maxDepth: number;
    nodeCount: number;
    totalBytes: number;
    totalLines: number;
}

/**
 * An import statement extracted from source code.
 */
export class WasmImportInfo {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmImportInfo;
    constructor(source?: string | null, items?: string[] | null, is_wildcard?: boolean | null, span?: WasmSpan | null, alias?: string | null);
    get alias(): string | undefined;
    set alias(value: string | null | undefined);
    isWildcard: boolean;
    items: string[];
    source: string;
    span: WasmSpan;
}

export class WasmLanguage {
    private constructor();
    free(): void;
    [Symbol.dispose](): void;
}

/**
 * Thread-safe registry of tree-sitter language parsers.
 *
 * Manages both statically compiled and dynamically loaded language grammars.
 * Use [`LanguageRegistry::new()`] for the default registry, or access the
 * global instance via the module-level convenience functions
 * (`get_language`, `available_languages`, etc.).
 *
 * # Example
 *
 * ```no_run
 * use tree_sitter_language_pack::{LanguageRegistry, ProcessConfig};
 *
 * let registry = LanguageRegistry::new();
 * let langs = registry.available_languages();
 * println!("Available: {:?}", langs);
 *
 * let config = ProcessConfig::new("python").all();
 * let result = registry.process("def hello(): pass", &config).unwrap();
 * println!("Structure: {:?}", result.structure);
 * ```
 */
export class WasmLanguageRegistry {
    private constructor();
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Add an additional directory to search for dynamic libraries.
     *
     * When [`get_language`](Self::get_language) cannot find a grammar in the
     * primary library directory, it searches these extra directories in order.
     * Typically used by the download system to register its cache directory.
     *
     * Takes `&self` (not `&mut self`) because `extra_lib_dirs` uses interior
     * mutability via an `Arc<RwLock<...>>`, so the outer registry can remain
     * immutable while the directory list is updated.
     */
    addExtraLibsDir(dir: string): void;
    /**
     * List all available language names, sorted and deduplicated.
     *
     * Includes statically compiled languages, dynamically loadable languages
     * (if the `dynamic-loading` feature is enabled), and all configured aliases.
     */
    availableLanguages(): string[];
    static default(): WasmLanguageRegistry;
    /**
     * Get a tree-sitter [`Language`] by name.
     *
     * Resolves aliases (e.g., `"shell"` -> `"bash"`, `"makefile"` -> `"make"`),
     * then looks up the language in the static table. When the `dynamic-loading`
     * feature is enabled, falls back to loading a shared library on demand.
     *
     * # Errors
     *
     * Returns [`Error::LanguageNotFound`] if the name (after alias resolution)
     * does not match any known grammar.
     */
    getLanguage(name: string): WasmLanguage;
    /**
     * Check whether a language is available by name or alias.
     *
     * Returns `true` if the language can be loaded, either from the static
     * table or from a dynamic library on disk.
     */
    hasLanguage(name: string): boolean;
    /**
     * Return the total number of available languages (including aliases).
     */
    languageCount(): number;
    /**
     * Parse source code and extract file intelligence based on config in a single pass.
     */
    process(_source: string, _config: WasmProcessConfig): WasmProcessResult;
    /**
     * Create a registry with a custom directory for dynamic libraries.
     *
     * Overrides the default build-time library directory. Useful when
     * dynamic grammar shared libraries are stored in a non-standard location.
     */
    static withLibsDir(libs_dir: string): WasmLanguageRegistry;
}

/**
 * A single syntax node within a [`Tree`].
 *
 * Nodes hold a strong reference to their parent tree so they remain valid
 * regardless of how the tree is moved or stored at the FFI boundary.
 */
export class WasmNode {
    private constructor();
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Return the node's byte range as a [`ByteRange`].
     *
     * Callers should slice their own source bytes — this is a zero-copy
     * text accessor.
     */
    byteRange(): WasmByteRange;
    /**
     * Return the i-th child of this node, if any.
     */
    child(index: number): WasmNode | undefined;
    /**
     * Look up a child by its grammar-defined field name.
     */
    childByFieldName(name: string): WasmNode | undefined;
    /**
     * Total number of children (including unnamed).
     */
    childCount(): number;
    clone(): WasmNode;
    /**
     * Return the exclusive end byte offset of this node.
     */
    endByte(): number;
    /**
     * Return the end [`Point`] (row, column).
     */
    endPosition(): WasmPoint;
    /**
     * True when this node or any descendant is an error.
     */
    hasError(): boolean;
    /**
     * True when this is an error node.
     */
    isError(): boolean;
    /**
     * True when this is an "extra" node (e.g. a comment).
     */
    isExtra(): boolean;
    /**
     * True when this is a missing-token node.
     */
    isMissing(): boolean;
    /**
     * True when this node is named (not punctuation/whitespace).
     */
    isNamed(): boolean;
    /**
     * Return the node's kind name (e.g. `"function_definition"`).
     */
    kind(): string;
    /**
     * Return the node's numeric kind ID.
     */
    kindId(): number;
    /**
     * Return the i-th named child of this node, if any.
     */
    namedChild(index: number): WasmNode | undefined;
    /**
     * Number of named children of this node.
     */
    namedChildCount(): number;
    /**
     * Return this node's parent, if any.
     */
    parent(): WasmNode | undefined;
    /**
     * Return the inclusive start byte offset of this node.
     */
    startByte(): number;
    /**
     * Return the start [`Point`] (row, column).
     */
    startPosition(): WasmPoint;
    /**
     * Return the S-expression form of this node's subtree.
     */
    toSexp(): string;
    /**
     * Return a [`TreeCursor`] positioned at this node.
     */
    walk(): WasmTreeCursor;
}

/**
 * Configuration for the tree-sitter language pack.
 *
 * Controls cache directory and which languages to pre-download.
 * Can be loaded from a TOML file, constructed programmatically,
 * or passed as a dict/object from language bindings.
 *
 * # Example
 *
 * ```no_run
 * use tree_sitter_language_pack::PackConfig;
 *
 * let config = PackConfig {
 *     cache_dir: None,
 *     languages: Some(vec!["python".to_string(), "rust".to_string()]),
 *     groups: None,
 * };
 * ```
 */
export class WasmPackConfig {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmPackConfig;
    /**
     * Discover configuration by searching for `language-pack.toml` in:
     *
     * 1. Current directory and up to 10 parent directories
     * 2. `$XDG_CONFIG_HOME/tree-sitter-language-pack/config.toml`
     * 3. `~/.config/tree-sitter-language-pack/config.toml`
     *
     * Returns `None` if no configuration file is found.
     *
     * # Example
     *
     * ```no_run
     * use tree_sitter_language_pack::PackConfig;
     *
     * if let Some(config) = PackConfig::discover() {
     *     println!("Found config with {:?} languages", config.languages);
     * }
     * ```
     */
    static discover(): WasmPackConfig | undefined;
    /**
     * Load configuration from a TOML file.
     *
     * # Errors
     *
     * Returns an error if the file cannot be read or the TOML is invalid.
     *
     * # Example
     *
     * ```no_run
     * use std::path::Path;
     * use tree_sitter_language_pack::PackConfig;
     *
     * let config = PackConfig::from_toml_file(Path::new("language-pack.toml")).unwrap();
     * ```
     */
    static fromTomlFile(path: string): WasmPackConfig;
    constructor(cache_dir?: string | null, languages?: string[] | null, groups?: string[] | null);
    get cacheDir(): string | undefined;
    set cacheDir(value: string | null | undefined);
    get groups(): string[] | undefined;
    set groups(value: string[] | null | undefined);
    get languages(): string[] | undefined;
    set languages(value: string[] | null | undefined);
}

/**
 * A tree-sitter parser configured for one language at a time.
 *
 * # Example
 *
 * ```no_run
 * use tree_sitter_language_pack::Parser;
 *
 * let mut parser = Parser::new();
 * parser.set_language("python")?;
 * let tree = parser.parse("def hello(): pass").expect("parse failed");
 * assert_eq!(tree.root_node().kind(), "module");
 * # Ok::<(), tree_sitter_language_pack::Error>(())
 * ```
 */
export class WasmParser {
    private constructor();
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmParser;
    /**
     * Parse a UTF-8 source string. Returns `None` if parsing was cancelled
     * or no language is set.
     */
    parse(source: string): WasmTree | undefined;
    /**
     * Parse a raw byte slice. Returns `None` if parsing was cancelled or
     * no language is set.
     */
    parseBytes(source: Uint8Array): WasmTree | undefined;
    /**
     * Reset internal state. The next call to [`parse`](Self::parse) will
     * not be incremental.
     */
    reset(): void;
    /**
     * Configure the parser to use the language identified by name (e.g. `"python"`).
     *
     * Resolves the language through the global registry — auto-downloading
     * if necessary, when the `download` feature is enabled.
     *
     * # Errors
     *
     * Returns [`Error::LanguageNotFound`] if the language is not recognized,
     * or [`Error::ParserSetup`] if the language ABI is incompatible.
     */
    setLanguage(name: string): void;
}

/**
 * A source position — row + column, zero-indexed.
 */
export class WasmPoint {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmPoint;
    static from(p: WasmPoint): WasmPoint;
    constructor(row: number, column: number);
    column: number;
    row: number;
}

/**
 * Configuration for the `process()` function.
 *
 * Controls which analysis features are enabled and whether chunking is performed.
 *
 * # Examples
 *
 * ```
 * use tree_sitter_language_pack::ProcessConfig;
 *
 * // Defaults: structure + imports + exports enabled
 * let config = ProcessConfig::new("python");
 *
 * // With chunking
 * let config = ProcessConfig::new("python").with_chunking(1000);
 *
 * // Everything enabled
 * let config = ProcessConfig::new("python").all();
 * ```
 */
export class WasmProcessConfig {
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Enable all analysis features.
     */
    all(): WasmProcessConfig;
    static default(): WasmProcessConfig;
    /**
     * Disable all analysis features (only metrics computed).
     */
    minimal(): WasmProcessConfig;
    constructor(language?: string | null, structure?: boolean | null, imports?: boolean | null, exports?: boolean | null, comments?: boolean | null, docstrings?: boolean | null, symbols?: boolean | null, diagnostics?: boolean | null, chunk_max_size?: number | null);
    /**
     * Enable chunking with the given maximum chunk size in bytes.
     */
    withChunking(max_size: number): WasmProcessConfig;
    get chunkMaxSize(): number | undefined;
    set chunkMaxSize(value: number | null | undefined);
    comments: boolean;
    diagnostics: boolean;
    docstrings: boolean;
    exports: boolean;
    imports: boolean;
    language: string;
    structure: boolean;
    symbols: boolean;
}

/**
 * Complete analysis result from processing a source file.
 *
 * Contains metrics, structural analysis, imports/exports, comments,
 * docstrings, symbols, diagnostics, and optionally chunked code segments.
 * Fields are populated based on the `ProcessConfig` flags.
 *
 * # Fields
 *
 * - `language` - The language used for parsing
 * - `metrics` - Always computed: line counts, byte sizes, error counts
 * - `structure` - Functions, classes, structs (when `config.structure = true`)
 * - `imports` - Import statements (when `config.imports = true`)
 * - `exports` - Export statements (when `config.exports = true`)
 * - `comments` - Comments (when `config.comments = true`)
 * - `docstrings` - Docstrings (when `config.docstrings = true`)
 * - `symbols` - Symbol definitions (when `config.symbols = true`)
 * - `diagnostics` - Parse errors (when `config.diagnostics = true`)
 * - `chunks` - Chunked code segments (when `config.chunk_max_size` is set)
 */
export class WasmProcessResult {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmProcessResult;
    constructor(language?: string | null, metrics?: WasmFileMetrics | null, structure?: WasmStructureItem[] | null, imports?: WasmImportInfo[] | null, exports?: WasmExportInfo[] | null, comments?: WasmCommentInfo[] | null, docstrings?: WasmDocstringInfo[] | null, symbols?: WasmSymbolInfo[] | null, diagnostics?: WasmDiagnostic[] | null, chunks?: WasmCodeChunk[] | null);
    chunks: WasmCodeChunk[];
    comments: WasmCommentInfo[];
    diagnostics: WasmDiagnostic[];
    docstrings: WasmDocstringInfo[];
    exports: WasmExportInfo[];
    imports: WasmImportInfo[];
    language: string;
    metrics: WasmFileMetrics;
    structure: WasmStructureItem[];
    symbols: WasmSymbolInfo[];
}

/**
 * Byte and line/column range in source code.
 *
 * Represents both byte offsets (for slicing) and human-readable line/column
 * positions (for display and diagnostics).
 */
export class WasmSpan {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmSpan;
    constructor(start_byte?: number | null, end_byte?: number | null, start_line?: number | null, start_column?: number | null, end_line?: number | null, end_column?: number | null);
    endByte: number;
    endColumn: number;
    endLine: number;
    startByte: number;
    startColumn: number;
    startLine: number;
}

/**
 * A structural item (function, class, struct, etc.) in source code.
 */
export class WasmStructureItem {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmStructureItem;
    constructor(kind?: WasmStructureKind | null, span?: WasmSpan | null, children?: WasmStructureItem[] | null, decorators?: string[] | null, name?: string | null, visibility?: string | null, doc_comment?: string | null, signature?: string | null, body_span?: WasmSpan | null);
    get bodySpan(): WasmSpan | undefined;
    set bodySpan(value: WasmSpan | null | undefined);
    children: WasmStructureItem[];
    decorators: string[];
    get docComment(): string | undefined;
    set docComment(value: string | null | undefined);
    get kind(): string;
    set kind(value: WasmStructureKind);
    get name(): string | undefined;
    set name(value: string | null | undefined);
    get signature(): string | undefined;
    set signature(value: string | null | undefined);
    span: WasmSpan;
    get visibility(): string | undefined;
    set visibility(value: string | null | undefined);
}

/**
 * The kind of structural item found in source code.
 *
 * Categorizes top-level and nested declarations such as functions, classes,
 * structs, enums, traits, and more. Use [`Other`](StructureKind::Other) for
 * language-specific constructs that do not fit a standard category.
 */
export enum WasmStructureKind {
    Function = 0,
    Method = 1,
    Class = 2,
    Struct = 3,
    Interface = 4,
    Enum = 5,
    Module = 6,
    Trait = 7,
    Impl = 8,
    Namespace = 9,
    Other = 10,
}

/**
 * A symbol (variable, function, type, etc.) extracted from source code.
 */
export class WasmSymbolInfo {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmSymbolInfo;
    constructor(name?: string | null, kind?: WasmSymbolKind | null, span?: WasmSpan | null, type_annotation?: string | null, doc?: string | null);
    get doc(): string | undefined;
    set doc(value: string | null | undefined);
    get kind(): string;
    set kind(value: WasmSymbolKind);
    name: string;
    span: WasmSpan;
    get typeAnnotation(): string | undefined;
    set typeAnnotation(value: string | null | undefined);
}

/**
 * The kind of a symbol definition found in source code.
 *
 * Categorizes symbol definitions such as variables, constants, functions,
 * classes, types, interfaces, enums, and modules.
 */
export enum WasmSymbolKind {
    Variable = 0,
    Constant = 1,
    Function = 2,
    Class = 3,
    Type = 4,
    Interface = 5,
    Enum = 6,
    Module = 7,
    Other = 8,
}

/**
 * A parsed syntax tree. Cheap to clone (refcount bump).
 */
export class WasmTree {
    private constructor();
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Return the root [`Node`] of this tree.
     */
    rootNode(): WasmNode;
    /**
     * Return a [`TreeCursor`] positioned at the root.
     */
    walk(): WasmTreeCursor;
}

/**
 * A cursor for traversing a [`Tree`].
 */
export class WasmTreeCursor {
    private constructor();
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Return the field name for the current node, if any.
     */
    fieldName(): string | undefined;
    /**
     * Move the cursor to the first child of the current node.
     * Returns `true` if a child existed.
     */
    gotoFirstChild(): boolean;
    /**
     * Move the cursor to the next sibling of the current node.
     * Returns `true` if a sibling existed.
     */
    gotoNextSibling(): boolean;
    /**
     * Move the cursor to the parent of the current node.
     * Returns `true` if a parent existed.
     */
    gotoParent(): boolean;
    /**
     * Return the [`Node`] at the cursor's current position.
     */
    node(): WasmNode;
}

/**
 * List all available language names (sorted, deduplicated, includes aliases).
 *
 * Returns names of both statically compiled and dynamically loadable languages,
 * plus any configured aliases.
 *
 * # Example
 *
 * ```no_run
 * use tree_sitter_language_pack::available_languages;
 *
 * let langs = available_languages();
 * for name in &langs {
 *     println!("{}", name);
 * }
 * ```
 */
export function availableLanguages(): string[];

/**
 * Detect language name from a file path or extension.
 *
 * This compatibility alias matches the pre-Alef Python binding API.
 */
export function detectLanguage(path: string): string | undefined;

/**
 * Detect language name from file content using the shebang line (`#!`).
 *
 * Inspects only the first line of `content`. If it begins with `#!`, the
 * interpreter name is extracted and mapped to a language name.
 *
 * Handles common patterns:
 * - `#!/usr/bin/env python3` → `"python"`
 * - `#!/bin/bash` → `"bash"`
 * - `#!/usr/bin/env node` → `"javascript"`
 *
 * The `-S` flag accepted by some `env` implementations is skipped automatically.
 * Version suffixes (e.g. `python3.11`, `ruby3.2`) are stripped before matching.
 *
 * Returns `None` when content does not start with `#!`, the shebang is
 * malformed, or the interpreter is not recognised.
 *
 * ```
 * use tree_sitter_language_pack::detect_language_from_content;
 * assert_eq!(detect_language_from_content("#!/usr/bin/env python3\npass"), Some("python"));
 * assert_eq!(detect_language_from_content("#!/bin/bash\necho hi"), Some("bash"));
 * assert_eq!(detect_language_from_content("no shebang here"), None);
 * ```
 */
export function detectLanguageFromContent(content: string): string | undefined;

/**
 * Detect language name from a file extension (without leading dot).
 *
 * Returns `None` for unrecognized extensions. The match is case-insensitive.
 *
 * ```
 * use tree_sitter_language_pack::detect_language_from_extension;
 * assert_eq!(detect_language_from_extension("py"), Some("python"));
 * assert_eq!(detect_language_from_extension("RS"), Some("rust"));
 * assert_eq!(detect_language_from_extension("xyz"), None);
 * ```
 */
export function detectLanguageFromExtension(ext: string): string | undefined;

/**
 * Detect language name from a file path.
 *
 * Extracts the file extension and looks it up. Returns `None` if the
 * path has no extension or the extension is not recognized.
 *
 * ```
 * use tree_sitter_language_pack::detect_language_from_path;
 * assert_eq!(detect_language_from_path("src/main.rs"), Some("rust"));
 * assert_eq!(detect_language_from_path("README.md"), Some("markdown"));
 * assert_eq!(detect_language_from_path("Makefile"), None);
 * ```
 */
export function detectLanguageFromPath(path: string): string | undefined;

/**
 * Get the highlights query for a language, if bundled.
 *
 * Returns the contents of `highlights.scm` as a static string, or `None`
 * if no highlights query is bundled for this language.
 *
 * # Example
 *
 * ```
 * use tree_sitter_language_pack::get_highlights_query;
 *
 * // Returns Some(...) for languages with bundled queries
 * let query = get_highlights_query("python");
 * // Returns None for languages without bundled highlights queries
 * let missing = get_highlights_query("nonexistent_lang");
 * assert!(missing.is_none());
 * ```
 */
export function getHighlightsQuery(language: string): string | undefined;

/**
 * Get the injections query for a language, if bundled.
 *
 * Returns the contents of `injections.scm` as a static string, or `None`
 * if no injections query is bundled for this language.
 *
 * # Example
 *
 * ```
 * use tree_sitter_language_pack::get_injections_query;
 *
 * let query = get_injections_query("markdown");
 * // Returns None for languages without bundled injections queries
 * let missing = get_injections_query("nonexistent_lang");
 * assert!(missing.is_none());
 * ```
 */
export function getInjectionsQuery(language: string): string | undefined;

/**
 * Get a tree-sitter [`Language`] by name using the global registry.
 *
 * Resolves language aliases (e.g., `"shell"` maps to `"bash"`).
 * When the `download` feature is enabled (default), automatically downloads
 * the parser from GitHub releases if not found locally.
 *
 * # Errors
 *
 * Returns [`Error::LanguageNotFound`] if the language is not recognized,
 * or [`Error::Download`] if auto-download fails.
 *
 * # Example
 *
 * ```no_run
 * use tree_sitter_language_pack::{get_language, Parser};
 *
 * let _lang = get_language("python")?;
 * let mut parser = Parser::new();
 * parser.set_language("python")?;
 * let tree = parser.parse("x = 1").expect("parse failed");
 * assert_eq!(tree.root_node().kind(), "module");
 * # Ok::<(), tree_sitter_language_pack::Error>(())
 * ```
 */
export function getLanguage(name: string): WasmLanguage;

/**
 * Get the locals query for a language, if bundled.
 *
 * Returns the contents of `locals.scm` as a static string, or `None`
 * if no locals query is bundled for this language.
 *
 * # Example
 *
 * ```
 * use tree_sitter_language_pack::get_locals_query;
 *
 * let query = get_locals_query("python");
 * // Returns None for languages without bundled locals queries
 * let missing = get_locals_query("nonexistent_lang");
 * assert!(missing.is_none());
 * ```
 */
export function getLocalsQuery(language: string): string | undefined;

/**
 * Get a [`Parser`] pre-configured for the given language.
 *
 * This is a convenience function that calls [`get_language`] and configures
 * a new parser in one step.
 *
 * # Errors
 *
 * Returns [`Error::LanguageNotFound`] if the language is not recognized, or
 * [`Error::ParserSetup`] if the language cannot be applied to the parser.
 *
 * # Example
 *
 * ```no_run
 * use tree_sitter_language_pack::get_parser;
 *
 * let mut parser = get_parser("rust")?;
 * let tree = parser.parse("fn main() {}").expect("parse failed");
 * assert!(!tree.root_node().has_error());
 * # Ok::<(), tree_sitter_language_pack::Error>(())
 * ```
 */
export function getParser(name: string): WasmParser;

/**
 * Check if a language is available by name or alias.
 *
 * Returns `true` if the language can be loaded (statically compiled,
 * dynamically available, or a known alias for one of these).
 *
 * # Example
 *
 * ```no_run
 * use tree_sitter_language_pack::has_language;
 *
 * assert!(has_language("python"));
 * assert!(has_language("shell")); // alias for "bash"
 * assert!(!has_language("nonexistent_language"));
 * ```
 */
export function hasLanguage(name: string): boolean;

/**
 * Return the number of available languages.
 *
 * Includes statically compiled languages, dynamically loadable languages,
 * and aliases.
 *
 * # Example
 *
 * ```no_run
 * use tree_sitter_language_pack::language_count;
 *
 * let count = language_count();
 * println!("{} languages available", count);
 * ```
 */
export function languageCount(): number;

/**
 * Process source code and extract file intelligence using the global registry.
 *
 * Parses the source with tree-sitter and extracts metrics, structure, imports,
 * exports, comments, docstrings, symbols, diagnostics, and/or chunks based on
 * the flags set in [`ProcessConfig`].
 *
 * # Errors
 *
 * Returns an error if the language is not found or parsing fails.
 *
 * # Example
 *
 * ```no_run
 * use tree_sitter_language_pack::{ProcessConfig, process};
 *
 * let config = ProcessConfig::new("python").all();
 * let result = process("def hello(): pass", &config).unwrap();
 * println!("Language: {}", result.language);
 * println!("Lines: {}", result.metrics.total_lines);
 * println!("Structures: {}", result.structure.len());
 * ```
 */
export function process(source: string, config: any): WasmProcessResult;
