@xberg-io/tree-sitter-language-pack 1.28.1 → 1.29.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:46317da62f751125dc0fe8a38f0b201bbf35ec47554bd8f9f2d7037855eb38e3
2
+ // alef:hash:4c7d955d7536f3dbee7a6d650aa8326ef549680020bb8783390fef09d6724a65
3
3
  // To regenerate: alef generate
4
4
  // To verify freshness: alef verify
5
5
  /* eslint-disable */
@@ -201,6 +201,46 @@ export declare function getInjectionsQuery(language: string): string | null;
201
201
  */
202
202
  export declare function getLanguage(name: string): Language;
203
203
 
204
+ /**
205
+ * Get a tree-sitter `Language` by name without any network access.
206
+ *
207
+ * Returns a statically compiled grammar, or a dynamic grammar whose shared
208
+ * library is present right now. Anything else fails with `Error.CacheMiss`
209
+ * and no request is made — the manifest is never fetched, not even to discover
210
+ * a download URL.
211
+ *
212
+ * The on-disk cache is checked on every call, so a concurrent
213
+ * `clean_cache` turns a later cache-only lookup into a miss instead of a
214
+ * download. In builds without the `download` feature this behaves the same way
215
+ * as `get_language` for locally available grammars, but reports a missing
216
+ * grammar as `Error.CacheMiss`.
217
+ * @throws Returns `Error.CacheMiss` when the grammar is known but not cached, or
218
+ * `Error.LanguageNotFound` when the name is not recognised at all.
219
+ */
220
+ export declare function getLanguageCacheOnly(name: string): Language;
221
+
222
+ /**
223
+ * Get a tree-sitter `Language` by name with a wall-clock acquisition deadline.
224
+ *
225
+ * Behaves like `get_language` but bounds the complete acquisition by
226
+ * `deadline_secs`: the in-process and cross-process cache-lock waits, DNS
227
+ * resolution, redirects, the manifest request and the complete platform-bundle
228
+ * download all draw from the same budget.
229
+ *
230
+ * When the budget is exhausted the call fails with
231
+ * `Error.AcquisitionTimeout` and nothing partial is returned. With no
232
+ * deadline, `get_language` keeps the historical 60-second network timeout,
233
+ * which surfaces as `Error.Download`.
234
+ *
235
+ * In builds without the `download` feature there is no network step at all, so
236
+ * the argument is validated and otherwise unused.
237
+ * @throws Returns `Error.Config` when `deadline_secs` is not a positive finite
238
+ * number, `Error.LanguageNotFound` for an unknown name,
239
+ * `Error.AcquisitionTimeout` when the budget is exhausted, or
240
+ * `Error.Download` for any other fetch failure.
241
+ */
242
+ export declare function getLanguageWithDeadline(name: string, deadlineSecs: number): Language;
243
+
204
244
  /**
205
245
  * Get the locals query for a language, if bundled.
206
246
  *
@@ -1310,6 +1350,6 @@ export declare function process(source: string, config?: ProcessConfig | undefin
1310
1350
 
1311
1351
  /** The error a binding call throws for `Error`. */
1312
1352
  export interface ThrownError extends Error {
1313
- kind: "LanguageNotFound" | "DynamicLoad" | "NullLanguagePointer" | "ParserSetup" | "LockPoisoned" | "Config" | "ParseFailed" | "ParseTimeout" | "QueryError" | "InvalidRange" | "Download" | "ChecksumMismatch" | "CacheLock" | "Unknown"
1353
+ kind: "LanguageNotFound" | "DynamicLoad" | "NullLanguagePointer" | "ParserSetup" | "LockPoisoned" | "Config" | "ParseFailed" | "ParseTimeout" | "QueryError" | "InvalidRange" | "Download" | "ChecksumMismatch" | "CacheLock" | "AcquisitionTimeout" | "CacheMiss" | "Unknown"
1314
1354
  errorCode: number
1315
1355
  }
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // DO NOT EDIT - auto-generated by alef
2
- // alef:hash:3c195c58900cbcbebad357df3c3152b5c6da421696e61d0dfc14d2b06d4e06b7
2
+ // alef:hash:d5510802e606885e74c75a3efc9c588faf546d2badeeda9ab7528d41bb6004bd
3
3
  import binding from "./index.js";
4
4
 
5
5
  export const CommentKind = binding.CommentKind;
@@ -39,6 +39,8 @@ export const getHighlightsQuery = binding.getHighlightsQuery;
39
39
  export const getIndentsQuery = binding.getIndentsQuery;
40
40
  export const getInjectionsQuery = binding.getInjectionsQuery;
41
41
  export const getLanguage = binding.getLanguage;
42
+ export const getLanguageCacheOnly = binding.getLanguageCacheOnly;
43
+ export const getLanguageWithDeadline = binding.getLanguageWithDeadline;
42
44
  export const getLocalsQuery = binding.getLocalsQuery;
43
45
  export const getParser = binding.getParser;
44
46
  export const getTagsQuery = binding.getTagsQuery;
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  }
11
11
  ],
12
12
  "name": "@xberg-io/tree-sitter-language-pack",
13
- "version": "1.28.1",
13
+ "version": "1.29.0",
14
14
  "description": "Pre-compiled tree-sitter grammars for 371 programming languages",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -35,14 +35,14 @@
35
35
  "*.node"
36
36
  ],
37
37
  "optionalDependencies": {
38
- "@xberg-io/tree-sitter-language-pack-darwin-arm64": "1.28.1",
39
- "@xberg-io/tree-sitter-language-pack-darwin-x64": "1.28.1",
40
- "@xberg-io/tree-sitter-language-pack-linux-arm64-gnu": "1.28.1",
41
- "@xberg-io/tree-sitter-language-pack-linux-arm64-musl": "1.28.1",
42
- "@xberg-io/tree-sitter-language-pack-linux-x64-gnu": "1.28.1",
43
- "@xberg-io/tree-sitter-language-pack-linux-x64-musl": "1.28.1",
44
- "@xberg-io/tree-sitter-language-pack-win32-arm64-msvc": "1.28.1",
45
- "@xberg-io/tree-sitter-language-pack-win32-x64-msvc": "1.28.1"
38
+ "@xberg-io/tree-sitter-language-pack-darwin-arm64": "1.29.0",
39
+ "@xberg-io/tree-sitter-language-pack-darwin-x64": "1.29.0",
40
+ "@xberg-io/tree-sitter-language-pack-linux-arm64-gnu": "1.29.0",
41
+ "@xberg-io/tree-sitter-language-pack-linux-arm64-musl": "1.29.0",
42
+ "@xberg-io/tree-sitter-language-pack-linux-x64-gnu": "1.29.0",
43
+ "@xberg-io/tree-sitter-language-pack-linux-x64-musl": "1.29.0",
44
+ "@xberg-io/tree-sitter-language-pack-win32-arm64-msvc": "1.29.0",
45
+ "@xberg-io/tree-sitter-language-pack-win32-x64-msvc": "1.29.0"
46
46
  },
47
47
  "napi": {
48
48
  "packageName": "@xberg-io/tree-sitter-language-pack",
Binary file
Binary file