@xberg-io/tree-sitter-language-pack 1.17.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // This file is auto-generated by alef — DO NOT EDIT.
2
- // alef:hash:350fe61d645ed79aae34ddd692ebf560b5c2e800adb5846d1e84be07051eeb5f
2
+ // alef:hash:78d8af075d33d367ecac6d93cf1ff2224cc8ca072b49392de478f0d3a15dc3fd
3
3
  // To regenerate: alef generate
4
4
  // To verify freshness: alef verify
5
5
  /* eslint-disable */
@@ -248,27 +248,27 @@ export declare function init(config?: PackConfig | undefined | null): void;
248
248
  /** A byte range — start (inclusive) to end (exclusive). */
249
249
  export interface ByteRange {
250
250
  /** Inclusive start byte offset. */
251
- readonly start: number
251
+ readonly start: number;
252
252
  /** Exclusive end byte offset. */
253
- readonly end: number
253
+ readonly end: number;
254
254
  }
255
255
 
256
256
  /** Metadata for a single chunk of source code. */
257
257
  export interface ChunkContext {
258
258
  /** Language name used to parse this chunk. */
259
- readonly language?: string
259
+ readonly language?: string;
260
260
  /** Zero-indexed position of this chunk within the file's chunk list. */
261
- readonly chunkIndex?: number
261
+ readonly chunkIndex?: number;
262
262
  /** Total number of chunks the file was split into. */
263
- readonly totalChunks?: number
263
+ readonly totalChunks?: number;
264
264
  /** Tree-sitter node kinds that appear at the top level of this chunk. */
265
- readonly nodeTypes?: Array<string>
265
+ readonly nodeTypes?: Array<string>;
266
266
  /** Hierarchical path of enclosing structural items (e.g., `["MyClass", "my_method"]`). */
267
- readonly contextPath?: Array<string>
267
+ readonly contextPath?: Array<string>;
268
268
  /** Names of symbols defined within this chunk. */
269
- readonly symbolsDefined?: Array<string>
269
+ readonly symbolsDefined?: Array<string>;
270
270
  /** Comments contained within this chunk. */
271
- readonly comments?: Array<CommentInfo>
271
+ readonly comments?: Array<CommentInfo>;
272
272
  /**
273
273
  * Docstrings contained within this chunk.
274
274
  *
@@ -276,21 +276,21 @@ export interface ChunkContext {
276
276
  * `ProcessResult.docstrings` is populated, and by the same
277
277
  * classifier. Always empty for every other language.
278
278
  */
279
- readonly docstrings?: Array<DocstringInfo>
279
+ readonly docstrings?: Array<DocstringInfo>;
280
280
  /** Whether this chunk contains any tree-sitter error nodes. */
281
- readonly hasErrorNodes?: boolean
281
+ readonly hasErrorNodes?: boolean;
282
282
  }
283
283
 
284
284
  /** A chunk of source code with rich metadata. */
285
285
  export interface CodeChunk {
286
286
  /** The raw source text of this chunk. */
287
- readonly content?: string
287
+ readonly content?: string;
288
288
  /** Inclusive start byte offset of this chunk in the original source. */
289
- readonly startByte?: number
289
+ readonly startByte?: number;
290
290
  /** Exclusive end byte offset of this chunk in the original source. */
291
- readonly endByte?: number
291
+ readonly endByte?: number;
292
292
  /** Zero-indexed start line of this chunk. */
293
- readonly startLine?: number
293
+ readonly startLine?: number;
294
294
  /**
295
295
  * Zero-indexed row of the last byte actually included in this chunk
296
296
  * (inclusive — the same row a `Span.end_line` would report for a node
@@ -298,21 +298,21 @@ export interface CodeChunk {
298
298
  * source has a trailing newline: it is always the row of `end_byte - 1`,
299
299
  * never a phantom row past the file's real content.
300
300
  */
301
- readonly endLine?: number
301
+ readonly endLine?: number;
302
302
  /** Contextual metadata about this chunk. */
303
- readonly metadata?: ChunkContext
303
+ readonly metadata?: ChunkContext;
304
304
  }
305
305
 
306
306
  /** A comment extracted from source code. */
307
307
  export interface CommentInfo {
308
308
  /** The raw text content of the comment. */
309
- readonly text?: string
309
+ readonly text?: string;
310
310
  /** The kind of comment (line, block, or doc). */
311
- readonly kind?: CommentKind
311
+ readonly kind?: CommentKind;
312
312
  /** Source span covering the comment. */
313
- readonly span?: Span
313
+ readonly span?: Span;
314
314
  /** Name of the syntax node this comment is directly associated with. */
315
- readonly associatedNode?: string
315
+ readonly associatedNode?: string;
316
316
  }
317
317
 
318
318
  /**
@@ -338,11 +338,11 @@ export declare enum CommentKind {
338
338
  */
339
339
  export interface DataAttribute {
340
340
  /** Attribute name (e.g. `"class"`, `"href"`). */
341
- readonly name?: string
341
+ readonly name?: string;
342
342
  /** Attribute value as a raw string (quotes stripped). */
343
- readonly value?: string
343
+ readonly value?: string;
344
344
  /** Source span covering the entire `name="value"` attribute token. */
345
- readonly span?: Span
345
+ readonly span?: Span;
346
346
  }
347
347
 
348
348
  /**
@@ -362,23 +362,23 @@ export interface DataAttribute {
362
362
  */
363
363
  export interface DataNode {
364
364
  /** Whether this node is a key/value pair, XML element, or sequence item. */
365
- readonly kind?: DataNodeKind
365
+ readonly kind?: DataNodeKind;
366
366
  /**
367
367
  * Key, attribute name, tag name, or positional index (`"0"`, `"1"`, …).
368
368
  * `None` at the document root.
369
369
  */
370
- readonly key?: string
370
+ readonly key?: string;
371
371
  /**
372
372
  * Leaf scalar value, if any. `None` for containers (objects, arrays, XML elements
373
373
  * with child elements).
374
374
  */
375
- readonly value?: string
375
+ readonly value?: string;
376
376
  /** Attributes on element-shape nodes (XML `STag` attributes). Empty for all other kinds. */
377
- readonly attributes?: Array<DataAttribute>
377
+ readonly attributes?: Array<DataAttribute>;
378
378
  /** Children for nested containers and XML element bodies. */
379
- readonly children?: Array<DataNode>
379
+ readonly children?: Array<DataNode>;
380
380
  /** Source span covering this node in the original source file. */
381
- readonly span?: Span
381
+ readonly span?: Span;
382
382
  }
383
383
 
384
384
  /**
@@ -413,11 +413,11 @@ export declare enum DataNodeKind {
413
413
  /** A diagnostic (syntax error, missing node, etc.) from parsing. */
414
414
  export interface Diagnostic {
415
415
  /** Human-readable description of the diagnostic. */
416
- readonly message?: string
416
+ readonly message?: string;
417
417
  /** Severity of the diagnostic. */
418
- readonly severity?: DiagnosticSeverity
418
+ readonly severity?: DiagnosticSeverity;
419
419
  /** Source span where the diagnostic was detected. */
420
- readonly span?: Span
420
+ readonly span?: Span;
421
421
  }
422
422
 
423
423
  /**
@@ -438,11 +438,11 @@ export declare enum DiagnosticSeverity {
438
438
  /** A section within a docstring (e.g., Args, Returns, Raises). */
439
439
  export interface DocSection {
440
440
  /** Section kind (e.g., `"args"`, `"returns"`, `"raises"`). */
441
- readonly kind?: string
441
+ readonly kind?: string;
442
442
  /** Parameter or return value name, if applicable. */
443
- readonly name?: string
443
+ readonly name?: string;
444
444
  /** Description text for this section. */
445
- readonly description?: string
445
+ readonly description?: string;
446
446
  }
447
447
 
448
448
  /**
@@ -458,23 +458,23 @@ export interface DocSection {
458
458
  * NOT add `#[serde(tag = "...")]`. Covered by `tests/wire_format.rs`.
459
459
  */
460
460
  export type DocstringFormat =
461
- | { type: 'PythonTripleQuote' }
462
- | { type: 'JSDoc' }
463
- | { type: 'Rustdoc' }
464
- | { type: 'GoDoc' }
465
- | { type: 'JavaDoc' }
466
- | { type: 'Other'; other: string }
461
+ | { type: "PythonTripleQuote" }
462
+ | { type: "JSDoc" }
463
+ | { type: "Rustdoc" }
464
+ | { type: "GoDoc" }
465
+ | { type: "JavaDoc" }
466
+ | { type: "Other"; other: string };
467
467
 
468
468
  /** A docstring extracted from source code. */
469
469
  export interface DocstringInfo {
470
470
  /** The raw text of the docstring. */
471
- readonly text?: string
471
+ readonly text?: string;
472
472
  /** The docstring format (Python, JSDoc, Rustdoc, etc.). */
473
- readonly format?: DocstringFormat
473
+ readonly format?: DocstringFormat;
474
474
  /** Source span covering the docstring. */
475
- readonly span?: Span
475
+ readonly span?: Span;
476
476
  /** Name of the item this docstring documents. */
477
- readonly associatedItem?: string
477
+ readonly associatedItem?: string;
478
478
  /**
479
479
  * Parsed sections of the docstring (Args, Returns, Raises, etc.).
480
480
  *
@@ -485,7 +485,7 @@ export interface DocstringInfo {
485
485
  * no extractor here does yet. The field is kept rather than removed so
486
486
  * a consumer's deserializer does not need updating once it is.
487
487
  */
488
- readonly parsedSections?: Array<DocSection>
488
+ readonly parsedSections?: Array<DocSection>;
489
489
  }
490
490
 
491
491
  /** Manages downloading and caching of pre-built parser shared libraries. */
@@ -497,7 +497,7 @@ export declare class DownloadManager {
497
497
  * `validate_version` — or if no cache directory can be resolved (see
498
498
  * `Self.default_cache_dir`).
499
499
  */
500
- static new(version: string): DownloadManager
500
+ static new(version: string): DownloadManager;
501
501
  /**
502
502
  * List languages that are already downloaded and cached.
503
503
  *
@@ -515,7 +515,7 @@ export declare class DownloadManager {
515
515
  * language binding — but logs a `tracing.warn!` so the failure is not
516
516
  * silently indistinguishable from "nothing installed".
517
517
  */
518
- installedLanguages(): Array<string>
518
+ installedLanguages(): Array<string>;
519
519
  /**
520
520
  * Download the platform bundle and extract every library file it contains.
521
521
  *
@@ -526,7 +526,7 @@ export declare class DownloadManager {
526
526
  *
527
527
  * Returns the number of library files extracted (including those already cached).
528
528
  */
529
- downloadAllBestEffort(): number
529
+ downloadAllBestEffort(): number;
530
530
  /**
531
531
  * Remove all cached parser libraries.
532
532
  *
@@ -537,17 +537,17 @@ export declare class DownloadManager {
537
537
  * already opened the file to continue holding a stale lock handle while a new
538
538
  * process opens a fresh inode, breaking the mutual-exclusion guarantee.
539
539
  */
540
- cleanCache(): void
540
+ cleanCache(): void;
541
541
  }
542
542
 
543
543
  /** An export statement extracted from source code. */
544
544
  export interface ExportInfo {
545
545
  /** The exported name. */
546
- readonly name?: string
546
+ readonly name?: string;
547
547
  /** The kind of export (named, default, or re-export). */
548
- readonly kind?: ExportKind
548
+ readonly kind?: ExportKind;
549
549
  /** Source span covering the export statement. */
550
- readonly span?: Span
550
+ readonly span?: Span;
551
551
  }
552
552
 
553
553
  /**
@@ -567,27 +567,27 @@ export declare enum ExportKind {
567
567
  /** Aggregate metrics for a source file. */
568
568
  export interface FileMetrics {
569
569
  /** Total number of lines (including blank and comment lines). */
570
- readonly totalLines?: number
570
+ readonly totalLines?: number;
571
571
  /** Number of lines containing non-blank, non-comment source code. */
572
- readonly codeLines?: number
572
+ readonly codeLines?: number;
573
573
  /** Number of lines that are entirely comments. */
574
- readonly commentLines?: number
574
+ readonly commentLines?: number;
575
575
  /** Number of blank (whitespace-only) lines. */
576
- readonly blankLines?: number
576
+ readonly blankLines?: number;
577
577
  /** Total byte length of the source file. */
578
- readonly totalBytes?: number
578
+ readonly totalBytes?: number;
579
579
  /** Total number of nodes in the syntax tree. */
580
- readonly nodeCount?: number
580
+ readonly nodeCount?: number;
581
581
  /** Number of error nodes in the syntax tree (parse errors). */
582
- readonly errorCount?: number
582
+ readonly errorCount?: number;
583
583
  /** Maximum nesting depth reached in the syntax tree. */
584
- readonly maxDepth?: number
584
+ readonly maxDepth?: number;
585
585
  }
586
586
 
587
587
  /** An import statement extracted from source code. */
588
588
  export interface ImportInfo {
589
589
  /** The module or path being imported from. */
590
- readonly source?: string
590
+ readonly source?: string;
591
591
  /**
592
592
  * Specific names imported from the source module.
593
593
  *
@@ -601,7 +601,7 @@ export interface ImportInfo {
601
601
  * — and for a JS/TS namespace import (`import * as ns`) or default
602
602
  * import (`import x from 'm'`), neither of which names individual items.
603
603
  */
604
- readonly items?: Array<string>
604
+ readonly items?: Array<string>;
605
605
  /**
606
606
  * Alias assigned to the import (e.g., `import numpy as np`).
607
607
  *
@@ -615,7 +615,7 @@ export interface ImportInfo {
615
615
  * where there is no single alias to report for the statement as a
616
616
  * whole, so only `items` is populated for it.
617
617
  */
618
- readonly alias?: string
618
+ readonly alias?: string;
619
619
  /**
620
620
  * Whether this is a wildcard import (e.g., `import *` or `use foo.*`).
621
621
  *
@@ -625,9 +625,9 @@ export interface ImportInfo {
625
625
  * import's source text for a `*` character, so a glob in an import path
626
626
  * string (`import a from './glob*.js'`) is not mistaken for one.
627
627
  */
628
- readonly isWildcard?: boolean
628
+ readonly isWildcard?: boolean;
629
629
  /** Source span covering the import statement. */
630
- readonly span?: Span
630
+ readonly span?: Span;
631
631
  }
632
632
 
633
633
  /**
@@ -645,14 +645,14 @@ export declare class LanguageRegistry {
645
645
  * When the `dynamic-loading` feature is enabled, the registry also knows
646
646
  * about dynamically loadable grammars and will load them on demand.
647
647
  */
648
- static new(): LanguageRegistry
648
+ static new(): LanguageRegistry;
649
649
  /**
650
650
  * List all available language names, sorted and deduplicated.
651
651
  *
652
652
  * Includes statically compiled languages, dynamically loadable languages
653
653
  * (if the `dynamic-loading` feature is enabled), and all configured aliases.
654
654
  */
655
- availableLanguages(): Array<string>
655
+ availableLanguages(): Array<string>;
656
656
  /**
657
657
  * Check whether this language can be parsed right now, without downloading.
658
658
  *
@@ -677,7 +677,7 @@ export declare class LanguageRegistry {
677
677
  * or wrong-architecture library exists on disk but cannot parse. Loads are
678
678
  * cached process-wide, so repeat calls are cheap.
679
679
  */
680
- hasParser(name: string): boolean
680
+ hasParser(name: string): boolean;
681
681
  /**
682
682
  * Check whether a language is available by name or alias.
683
683
  *
@@ -690,14 +690,14 @@ export declare class LanguageRegistry {
690
690
  * of the `stat` calls is what keeps this off the syscall path for the
691
691
  * languages a process actually uses.
692
692
  */
693
- hasLanguage(name: string): boolean
693
+ hasLanguage(name: string): boolean;
694
694
  /**
695
695
  * Return the total number of available languages (including aliases).
696
696
  *
697
697
  * Counts the same set `available_languages`
698
698
  * lists, without materialising or sorting it.
699
699
  */
700
- languageCount(): number
700
+ languageCount(): number;
701
701
  /**
702
702
  * Parse source code and extract file intelligence based on config in a single pass.
703
703
  * @throws Returns `Error.InvalidRange` if the config is invalid (see
@@ -707,8 +707,8 @@ export declare class LanguageRegistry {
707
707
  * `Error.LanguageNotFound` if the language is unknown; or
708
708
  * `Error.ParseFailed` if parsing produces no tree.
709
709
  */
710
- process(source: string, config?: ProcessConfig | undefined | null): ProcessResult
711
- static default(): LanguageRegistry
710
+ process(source: string, config?: ProcessConfig | undefined | null): ProcessResult;
711
+ static default(): LanguageRegistry;
712
712
  }
713
713
 
714
714
  /**
@@ -719,7 +719,7 @@ export declare class LanguageRegistry {
719
719
  */
720
720
  export declare class Node {
721
721
  /** Return the node's kind name (e.g. `"function_definition"`). */
722
- kind(): string
722
+ kind(): string;
723
723
  /**
724
724
  * Return the node's numeric kind ID.
725
725
  *
@@ -727,48 +727,48 @@ export declare class Node {
727
727
  * (e.g. `"function_definition" → 42`). Comparing `kind_id()` is cheaper
728
728
  * than comparing the string `kind()` in tight AST loops.
729
729
  */
730
- kindId(): number
730
+ kindId(): number;
731
731
  /** Return the inclusive start byte offset of this node. */
732
- startByte(): number
732
+ startByte(): number;
733
733
  /** Return the exclusive end byte offset of this node. */
734
- endByte(): number
734
+ endByte(): number;
735
735
  /**
736
736
  * Return the node's byte range as a `ByteRange`.
737
737
  *
738
738
  * Callers should slice their own source bytes — this is a zero-copy
739
739
  * text accessor.
740
740
  */
741
- byteRange(): ByteRange
741
+ byteRange(): ByteRange;
742
742
  /** Return the start `Point` (row, column). */
743
- startPosition(): Point
743
+ startPosition(): Point;
744
744
  /** Return the end `Point` (row, column). */
745
- endPosition(): Point
745
+ endPosition(): Point;
746
746
  /** True when this node is named (not punctuation/whitespace). */
747
- isNamed(): boolean
747
+ isNamed(): boolean;
748
748
  /** True when this is an error node. */
749
- isError(): boolean
749
+ isError(): boolean;
750
750
  /** True when this is a missing-token node. */
751
- isMissing(): boolean
751
+ isMissing(): boolean;
752
752
  /** True when this is an "extra" node (e.g. a comment). */
753
- isExtra(): boolean
753
+ isExtra(): boolean;
754
754
  /** True when this node or any descendant is an error. */
755
- hasError(): boolean
755
+ hasError(): boolean;
756
756
  /** Return this node's parent, if any. */
757
- parent(): Node | null
757
+ parent(): Node | null;
758
758
  /** Return the i-th child of this node, if any. */
759
- child(index: number): Node | null
759
+ child(index: number): Node | null;
760
760
  /** Total number of children (including unnamed). */
761
- childCount(): number
761
+ childCount(): number;
762
762
  /** Return the i-th named child of this node, if any. */
763
- namedChild(index: number): Node | null
763
+ namedChild(index: number): Node | null;
764
764
  /** Number of named children of this node. */
765
- namedChildCount(): number
765
+ namedChildCount(): number;
766
766
  /** Look up a child by its grammar-defined field name. */
767
- childByFieldName(name: string): Node | null
767
+ childByFieldName(name: string): Node | null;
768
768
  /** Return the S-expression form of this node's subtree. */
769
- toSexp(): string
769
+ toSexp(): string;
770
770
  /** Return a `TreeCursor` positioned at this node. */
771
- walk(): TreeCursor
771
+ walk(): TreeCursor;
772
772
  }
773
773
 
774
774
  /**
@@ -795,13 +795,13 @@ export interface PackConfig {
795
795
  *
796
796
  * Default base: the platform cache dir, e.g. `~/.cache` on Linux.
797
797
  */
798
- readonly cacheDir?: string
798
+ readonly cacheDir?: string;
799
799
  /**
800
800
  * Languages to pre-download on init.
801
801
  *
802
802
  * Each entry is a language name (e.g. `"python"`, `"rust"`).
803
803
  */
804
- readonly languages?: Array<string>
804
+ readonly languages?: Array<string>;
805
805
  /**
806
806
  * Language groups to pre-download.
807
807
  *
@@ -810,7 +810,7 @@ export interface PackConfig {
810
810
  * Call `manifest_groups` to enumerate them.
811
811
  * An unknown name makes `init` fail.
812
812
  */
813
- readonly groups?: Array<string>
813
+ readonly groups?: Array<string>;
814
814
  }
815
815
 
816
816
  /** A tree-sitter parser configured for one language at a time. */
@@ -823,7 +823,7 @@ export declare class Parser {
823
823
  * `set_parse_timeout_ms`; both default to
824
824
  * unbounded so that existing callers are unaffected.
825
825
  */
826
- static new(): Parser
826
+ static new(): Parser;
827
827
  /**
828
828
  * Refuse to parse sources longer than `max_bytes`.
829
829
  *
@@ -833,7 +833,7 @@ export declare class Parser {
833
833
  *
834
834
  * See `RECOMMENDED_MAX_SOURCE_BYTES`.
835
835
  */
836
- setMaxSourceBytes(maxBytes?: number | undefined | null): void
836
+ setMaxSourceBytes(maxBytes?: number | undefined | null): void;
837
837
  /**
838
838
  * Cancel a parse that exceeds `timeout_ms` milliseconds of wall clock.
839
839
  *
@@ -843,7 +843,7 @@ export declare class Parser {
843
843
  *
844
844
  * See `RECOMMENDED_PARSE_TIMEOUT_MS`.
845
845
  */
846
- setParseTimeoutMs(timeoutMs?: number | undefined | null): void
846
+ setParseTimeoutMs(timeoutMs?: number | undefined | null): void;
847
847
  /**
848
848
  * Configure the parser to use the language identified by name (e.g. `"python"`).
849
849
  *
@@ -852,7 +852,7 @@ export declare class Parser {
852
852
  * @throws Returns `Error.LanguageNotFound` if the language is not recognized,
853
853
  * or `Error.ParserSetup` if the language ABI is incompatible.
854
854
  */
855
- setLanguage(name: string): void
855
+ setLanguage(name: string): void;
856
856
  /**
857
857
  * Parse a UTF-8 source string.
858
858
  *
@@ -870,26 +870,26 @@ export declare class Parser {
870
870
  * threads can't corrupt shared scanner state. Every other language is unaffected by that
871
871
  * lock and never waits on it.
872
872
  */
873
- parse(source: string): Tree | null
873
+ parse(source: string): Tree | null;
874
874
  /**
875
875
  * Parse a raw byte slice.
876
876
  *
877
877
  * Same outcomes as `parse`, including the concurrency behaviour documented
878
878
  * there.
879
879
  */
880
- parseBytes(source: Uint8Array): Tree | null
880
+ parseBytes(source: Uint8Array): Tree | null;
881
881
  /**
882
882
  * Reset internal state. The next call to `parse` will
883
883
  * not be incremental.
884
884
  */
885
- reset(): void
886
- static default(): Parser
885
+ reset(): void;
886
+ static default(): Parser;
887
887
  }
888
888
 
889
889
  /** A source position — row + column, zero-indexed. */
890
890
  export interface Point {
891
891
  /** Zero-indexed row number. */
892
- readonly row: number
892
+ readonly row: number;
893
893
  /**
894
894
  * Zero-indexed column, counted in **bytes** from the start of the row.
895
895
  *
@@ -906,7 +906,7 @@ export interface Point {
906
906
  * instead. Earlier releases documented this field as UTF-16 code units;
907
907
  * that was never what the value contained.
908
908
  */
909
- readonly column: number
909
+ readonly column: number;
910
910
  }
911
911
 
912
912
  /**
@@ -916,21 +916,21 @@ export interface Point {
916
916
  */
917
917
  export interface ProcessConfig {
918
918
  /** Language name (required). */
919
- readonly language?: string
919
+ readonly language?: string;
920
920
  /** Extract structural items (functions, classes, etc.). Default: true. */
921
- readonly structure?: boolean
921
+ readonly structure?: boolean;
922
922
  /** Extract import statements. Default: true. */
923
- readonly imports?: boolean
923
+ readonly imports?: boolean;
924
924
  /** Extract export statements. Default: true. */
925
- readonly exports?: boolean
925
+ readonly exports?: boolean;
926
926
  /** Extract comments. Default: false. */
927
- readonly comments?: boolean
927
+ readonly comments?: boolean;
928
928
  /** Extract docstrings. Default: false. */
929
- readonly docstrings?: boolean
929
+ readonly docstrings?: boolean;
930
930
  /** Extract symbol definitions. Default: false. */
931
- readonly symbols?: boolean
931
+ readonly symbols?: boolean;
932
932
  /** Include parse diagnostics. Default: false. */
933
- readonly diagnostics?: boolean
933
+ readonly diagnostics?: boolean;
934
934
  /**
935
935
  * Maximum chunk size in bytes. `None` disables chunking.
936
936
  *
@@ -939,7 +939,7 @@ export interface ProcessConfig {
939
939
  * limit previously produced an empty chunk list and silently discarded the
940
940
  * whole source; use `None` to mean "do not chunk".
941
941
  */
942
- readonly chunkMaxSize?: number
942
+ readonly chunkMaxSize?: number;
943
943
  /**
944
944
  * Extract hierarchical key/value data tree from data-format files. Default: false.
945
945
  *
@@ -950,7 +950,7 @@ export interface ProcessConfig {
950
950
  *
951
951
  * For languages outside this set the field is left as `None`.
952
952
  */
953
- readonly dataExtraction?: boolean
953
+ readonly dataExtraction?: boolean;
954
954
  /**
955
955
  * Reject source longer than this many bytes instead of parsing it.
956
956
  * Default: `None` (unbounded).
@@ -965,7 +965,7 @@ export interface ProcessConfig {
965
965
  * `Error.InvalidRange` — the source is never
966
966
  * silently truncated.
967
967
  */
968
- readonly maxSourceBytes?: number
968
+ readonly maxSourceBytes?: number;
969
969
  /**
970
970
  * Wall-clock budget for the parse step, in milliseconds.
971
971
  * Default: `None` (no timeout).
@@ -975,7 +975,7 @@ export interface ProcessConfig {
975
975
  * interval rather than exact. A parse that exceeds the budget fails with
976
976
  * `Error.ParseTimeout`.
977
977
  */
978
- readonly parseTimeoutMs?: number
978
+ readonly parseTimeoutMs?: number;
979
979
  }
980
980
 
981
981
  /**
@@ -1000,25 +1000,25 @@ export interface ProcessConfig {
1000
1000
  */
1001
1001
  export interface ProcessResult {
1002
1002
  /** The language name used to parse the source file. */
1003
- readonly language?: string
1003
+ readonly language?: string;
1004
1004
  /** File-level metrics (line counts, byte size, error count). */
1005
- readonly metrics?: FileMetrics
1005
+ readonly metrics?: FileMetrics;
1006
1006
  /** Top-level structural items (functions, classes, etc.). */
1007
- readonly structure?: Array<StructureItem>
1007
+ readonly structure?: Array<StructureItem>;
1008
1008
  /** Import statements extracted from the source. */
1009
- readonly imports?: Array<ImportInfo>
1009
+ readonly imports?: Array<ImportInfo>;
1010
1010
  /** Export statements extracted from the source. */
1011
- readonly exports?: Array<ExportInfo>
1011
+ readonly exports?: Array<ExportInfo>;
1012
1012
  /** Comments extracted from the source. */
1013
- readonly comments?: Array<CommentInfo>
1013
+ readonly comments?: Array<CommentInfo>;
1014
1014
  /** Docstrings extracted from the source. */
1015
- readonly docstrings?: Array<DocstringInfo>
1015
+ readonly docstrings?: Array<DocstringInfo>;
1016
1016
  /** Symbol definitions (variables, types, functions) extracted from the source. */
1017
- readonly symbols?: Array<SymbolInfo>
1017
+ readonly symbols?: Array<SymbolInfo>;
1018
1018
  /** Parse diagnostics (syntax errors, missing nodes) from tree-sitter. */
1019
- readonly diagnostics?: Array<Diagnostic>
1019
+ readonly diagnostics?: Array<Diagnostic>;
1020
1020
  /** Syntax-aware code chunks produced when chunking is enabled. */
1021
- readonly chunks?: Array<CodeChunk>
1021
+ readonly chunks?: Array<CodeChunk>;
1022
1022
  /**
1023
1023
  * Hierarchical data tree extracted when `config.data_extraction` is `true`.
1024
1024
  *
@@ -1028,7 +1028,7 @@ export interface ProcessResult {
1028
1028
  *
1029
1029
  * See `DataNode` for the shape of the returned tree.
1030
1030
  */
1031
- readonly data?: DataNode
1031
+ readonly data?: DataNode;
1032
1032
  }
1033
1033
 
1034
1034
  /**
@@ -1039,37 +1039,37 @@ export interface ProcessResult {
1039
1039
  */
1040
1040
  export interface Span {
1041
1041
  /** Inclusive start byte offset in the source. */
1042
- readonly startByte?: number
1042
+ readonly startByte?: number;
1043
1043
  /** Exclusive end byte offset in the source. */
1044
- readonly endByte?: number
1044
+ readonly endByte?: number;
1045
1045
  /** Zero-indexed line number of the span's start. */
1046
- readonly startLine?: number
1046
+ readonly startLine?: number;
1047
1047
  /**
1048
1048
  * Zero-indexed column of the span's start, counted in **bytes** from the
1049
1049
  * start of the line — not characters, not UTF-16 code units.
1050
1050
  */
1051
- readonly startColumn?: number
1051
+ readonly startColumn?: number;
1052
1052
  /** Zero-indexed line number of the span's end. */
1053
- readonly endLine?: number
1053
+ readonly endLine?: number;
1054
1054
  /**
1055
1055
  * Zero-indexed column of the span's end, counted in **bytes** from the
1056
1056
  * start of the line — not characters, not UTF-16 code units.
1057
1057
  */
1058
- readonly endColumn?: number
1058
+ readonly endColumn?: number;
1059
1059
  }
1060
1060
 
1061
1061
  /** A structural item (function, class, struct, etc.) in source code. */
1062
1062
  export interface StructureItem {
1063
1063
  /** The kind of structural item. */
1064
- readonly kind?: StructureKind
1064
+ readonly kind?: StructureKind;
1065
1065
  /** The declared name of the item, if present. */
1066
- readonly name?: string
1066
+ readonly name?: string;
1067
1067
  /** Visibility modifier (e.g., `"pub"`, `"public"`, `"private"`). */
1068
- readonly visibility?: string
1068
+ readonly visibility?: string;
1069
1069
  /** Source span covering the entire item declaration. */
1070
- readonly span?: Span
1070
+ readonly span?: Span;
1071
1071
  /** Nested structural items (e.g., methods within a class). */
1072
- readonly children?: Array<StructureItem>
1072
+ readonly children?: Array<StructureItem>;
1073
1073
  /**
1074
1074
  * Decorator or attribute names applied to the item.
1075
1075
  *
@@ -1080,7 +1080,7 @@ export interface StructureItem {
1080
1080
  * implements yet. The field is kept rather than removed so a consumer's
1081
1081
  * deserializer does not need updating once it is.
1082
1082
  */
1083
- readonly decorators?: Array<string>
1083
+ readonly decorators?: Array<string>;
1084
1084
  /**
1085
1085
  * Documentation comment attached to the item, if any.
1086
1086
  *
@@ -1095,7 +1095,7 @@ export interface StructureItem {
1095
1095
  * comment in Python, Ruby, or Elixir) — Python's docstring convention is
1096
1096
  * captured separately, as `DocstringInfo`, not through this field.
1097
1097
  */
1098
- readonly docComment?: string
1098
+ readonly docComment?: string;
1099
1099
  /**
1100
1100
  * Full signature text of the item (e.g., function parameters and return type).
1101
1101
  *
@@ -1108,9 +1108,9 @@ export interface StructureItem {
1108
1108
  * it is derived from `body_span`'s boundary rather than per-language
1109
1109
  * syntax.
1110
1110
  */
1111
- readonly signature?: string
1111
+ readonly signature?: string;
1112
1112
  /** Source span covering only the body of the item, if distinct from the declaration. */
1113
- readonly bodySpan?: Span
1113
+ readonly bodySpan?: Span;
1114
1114
  }
1115
1115
 
1116
1116
  /**
@@ -1130,28 +1130,28 @@ export interface StructureItem {
1130
1130
  * Covered by `tests/wire_format.rs`.
1131
1131
  */
1132
1132
  export type StructureKind =
1133
- | { type: 'Function' }
1134
- | { type: 'Method' }
1135
- | { type: 'Class' }
1136
- | { type: 'Struct' }
1137
- | { type: 'Interface' }
1138
- | { type: 'Enum' }
1139
- | { type: 'Module' }
1140
- | { type: 'Trait' }
1141
- | { type: 'Impl' }
1142
- | { type: 'Namespace' }
1143
- | { type: 'Other'; other: string }
1133
+ | { type: "Function" }
1134
+ | { type: "Method" }
1135
+ | { type: "Class" }
1136
+ | { type: "Struct" }
1137
+ | { type: "Interface" }
1138
+ | { type: "Enum" }
1139
+ | { type: "Module" }
1140
+ | { type: "Trait" }
1141
+ | { type: "Impl" }
1142
+ | { type: "Namespace" }
1143
+ | { type: "Other"; other: string };
1144
1144
 
1145
1145
  /** A symbol (variable, function, type, etc.) extracted from source code. */
1146
1146
  export interface SymbolInfo {
1147
1147
  /** The name of the symbol. */
1148
- readonly name?: string
1148
+ readonly name?: string;
1149
1149
  /** The kind of symbol (variable, function, class, etc.). */
1150
- readonly kind?: SymbolKind
1150
+ readonly kind?: SymbolKind;
1151
1151
  /** Source span covering the symbol definition. */
1152
- readonly span?: Span
1152
+ readonly span?: Span;
1153
1153
  /** Explicit type annotation, if present in the source. */
1154
- readonly typeAnnotation?: string
1154
+ readonly typeAnnotation?: string;
1155
1155
  /**
1156
1156
  * Documentation comment immediately preceding this symbol, resolved by
1157
1157
  * the same walk `StructureItem.doc_comment` uses (see
@@ -1164,7 +1164,7 @@ export interface SymbolInfo {
1164
1164
  * also `None` when a symbol in a supported language simply has no doc
1165
1165
  * comment immediately above it.
1166
1166
  */
1167
- readonly doc?: string
1167
+ readonly doc?: string;
1168
1168
  }
1169
1169
 
1170
1170
  /**
@@ -1180,45 +1180,45 @@ export interface SymbolInfo {
1180
1180
  * NOT add `#[serde(tag = "...")]`. Covered by `tests/wire_format.rs`.
1181
1181
  */
1182
1182
  export type SymbolKind =
1183
- | { type: 'Variable' }
1184
- | { type: 'Constant' }
1185
- | { type: 'Function' }
1186
- | { type: 'Class' }
1187
- | { type: 'Type' }
1188
- | { type: 'Interface' }
1189
- | { type: 'Enum' }
1190
- | { type: 'Module' }
1191
- | { type: 'Other'; other: string }
1183
+ | { type: "Variable" }
1184
+ | { type: "Constant" }
1185
+ | { type: "Function" }
1186
+ | { type: "Class" }
1187
+ | { type: "Type" }
1188
+ | { type: "Interface" }
1189
+ | { type: "Enum" }
1190
+ | { type: "Module" }
1191
+ | { type: "Other"; other: string };
1192
1192
 
1193
1193
  /** A parsed syntax tree. Cheap to clone (refcount bump). */
1194
1194
  export declare class Tree {
1195
1195
  /** Return the root `Node` of this tree. */
1196
- rootNode(): Node
1196
+ rootNode(): Node;
1197
1197
  /** Return a `TreeCursor` positioned at the root. */
1198
- walk(): TreeCursor
1198
+ walk(): TreeCursor;
1199
1199
  }
1200
1200
 
1201
1201
  /** A cursor for traversing a `Tree`. */
1202
1202
  export declare class TreeCursor {
1203
1203
  /** Return the `Node` at the cursor's current position. */
1204
- node(): Node
1204
+ node(): Node;
1205
1205
  /**
1206
1206
  * Move the cursor to the first child of the current node.
1207
1207
  * Returns `true` if a child existed.
1208
1208
  */
1209
- gotoFirstChild(): boolean
1209
+ gotoFirstChild(): boolean;
1210
1210
  /**
1211
1211
  * Move the cursor to the parent of the current node.
1212
1212
  * Returns `true` if a parent existed.
1213
1213
  */
1214
- gotoParent(): boolean
1214
+ gotoParent(): boolean;
1215
1215
  /**
1216
1216
  * Move the cursor to the next sibling of the current node.
1217
1217
  * Returns `true` if a sibling existed.
1218
1218
  */
1219
- gotoNextSibling(): boolean
1219
+ gotoNextSibling(): boolean;
1220
1220
  /** Return the field name for the current node, if any. */
1221
- fieldName(): string | null
1221
+ fieldName(): string | null;
1222
1222
  }
1223
1223
 
1224
1224
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xberg-io/tree-sitter-language-pack",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "description": "Pre-compiled tree-sitter grammars for 371 programming languages",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -18,14 +18,14 @@
18
18
  },
19
19
  "files": ["index.js", "index.d.ts", "*.node"],
20
20
  "optionalDependencies": {
21
- "@xberg-io/tree-sitter-language-pack-darwin-arm64": "1.17.0",
22
- "@xberg-io/tree-sitter-language-pack-darwin-x64": "1.17.0",
23
- "@xberg-io/tree-sitter-language-pack-linux-arm64-gnu": "1.17.0",
24
- "@xberg-io/tree-sitter-language-pack-linux-arm64-musl": "1.17.0",
25
- "@xberg-io/tree-sitter-language-pack-linux-x64-gnu": "1.17.0",
26
- "@xberg-io/tree-sitter-language-pack-linux-x64-musl": "1.17.0",
27
- "@xberg-io/tree-sitter-language-pack-win32-arm64-msvc": "1.17.0",
28
- "@xberg-io/tree-sitter-language-pack-win32-x64-msvc": "1.17.0"
21
+ "@xberg-io/tree-sitter-language-pack-darwin-arm64": "1.19.0",
22
+ "@xberg-io/tree-sitter-language-pack-darwin-x64": "1.19.0",
23
+ "@xberg-io/tree-sitter-language-pack-linux-arm64-gnu": "1.19.0",
24
+ "@xberg-io/tree-sitter-language-pack-linux-arm64-musl": "1.19.0",
25
+ "@xberg-io/tree-sitter-language-pack-linux-x64-gnu": "1.19.0",
26
+ "@xberg-io/tree-sitter-language-pack-linux-x64-musl": "1.19.0",
27
+ "@xberg-io/tree-sitter-language-pack-win32-arm64-msvc": "1.19.0",
28
+ "@xberg-io/tree-sitter-language-pack-win32-x64-msvc": "1.19.0"
29
29
  },
30
30
  "napi": {
31
31
  "packageName": "@xberg-io/tree-sitter-language-pack",
@@ -53,6 +53,6 @@
53
53
  "access": "public"
54
54
  },
55
55
  "devDependencies": {
56
- "@napi-rs/cli": "^3.8.6"
56
+ "@napi-rs/cli": "^3.9.0"
57
57
  }
58
58
  }
Binary file
Binary file