@cr_docs_t/dts 0.32.0 → 0.33.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/dist/misc/fetch/index.d.ts +9 -4
- package/dist/misc/fetch/index.d.ts.map +1 -1
- package/dist/misc/fetch/index.js +10 -1
- package/dist/treesitter/types/AST.d.ts +245 -12
- package/dist/treesitter/types/AST.d.ts.map +1 -1
- package/dist/treesitter/types/AST.js +1491 -856
- package/dist/type-gen.js +37 -37
- package/dist/types/Presence.d.ts +4 -2
- package/dist/types/Presence.d.ts.map +1 -1
- package/dist/types/Presence.js +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,11 @@ export declare class APIError extends Error {
|
|
|
5
5
|
data: any;
|
|
6
6
|
constructor(message: string, status: number, statusText?: string | undefined, data?: any);
|
|
7
7
|
}
|
|
8
|
+
type Options = RequestInit & {
|
|
9
|
+
asBlob?: boolean;
|
|
10
|
+
asArrayBuffer?: boolean;
|
|
11
|
+
handleHeaders?: (headers: Headers) => void;
|
|
12
|
+
};
|
|
8
13
|
declare class Fetch {
|
|
9
14
|
private baseUrl;
|
|
10
15
|
private defaultOptions;
|
|
@@ -13,10 +18,10 @@ declare class Fetch {
|
|
|
13
18
|
* Centralized request handler to manage errors and JSON parsing
|
|
14
19
|
*/
|
|
15
20
|
private request;
|
|
16
|
-
get<T>(url: string, options?:
|
|
17
|
-
post<T, D = unknown>(url: string, data: D, options?:
|
|
18
|
-
put<T, D = unknown>(url: string, data: D, options?:
|
|
19
|
-
delete<T>(url: string, options?:
|
|
21
|
+
get<T>(url: string, options?: Options): Promise<T>;
|
|
22
|
+
post<T, D = unknown>(url: string, data: D, options?: Options): Promise<T>;
|
|
23
|
+
put<T, D = unknown>(url: string, data: D, options?: Options): Promise<T>;
|
|
24
|
+
delete<T>(url: string, options?: Options): Promise<T>;
|
|
20
25
|
}
|
|
21
26
|
export declare const f: Fetch;
|
|
22
27
|
export default Fetch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/misc/fetch/index.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAS,SAAQ,KAAK;IAEpB,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,MAAM,GAAG,SAAS;IAC9B,IAAI,EAAE,GAAG;gBAHT,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,MAAM,GAAG,SAAqB,EAC1C,IAAI,GAAE,GAAU;CAK9B;AAED,cAAM,KAAK;IACP,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,cAAc,CAAc;gBAExB,OAAO,GAAE,MAAW;IAWhC;;OAEG;YACW,OAAO;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/misc/fetch/index.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAS,SAAQ,KAAK;IAEpB,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,MAAM,GAAG,SAAS;IAC9B,IAAI,EAAE,GAAG;gBAHT,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,MAAM,GAAG,SAAqB,EAC1C,IAAI,GAAE,GAAU;CAK9B;AAED,KAAK,OAAO,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,CAAC;AAEvH,cAAM,KAAK;IACP,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,cAAc,CAAc;gBAExB,OAAO,GAAE,MAAW;IAWhC;;OAEG;YACW,OAAO;IA+Df,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIlD,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAQzE,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAQxE,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;CAG9D;AAED,eAAO,MAAM,CAAC,OAAc,CAAC;AAC7B,eAAe,KAAK,CAAC"}
|
package/dist/misc/fetch/index.js
CHANGED
|
@@ -26,7 +26,7 @@ class Fetch {
|
|
|
26
26
|
async request(url, options) {
|
|
27
27
|
const fullUrl = url.startsWith("http") ? url : `${this.baseUrl}${url}`;
|
|
28
28
|
try {
|
|
29
|
-
const response = await
|
|
29
|
+
const response = await fetch(fullUrl, {
|
|
30
30
|
...this.defaultOptions,
|
|
31
31
|
...options,
|
|
32
32
|
headers: {
|
|
@@ -55,6 +55,15 @@ class Fetch {
|
|
|
55
55
|
if (response.status === 204) {
|
|
56
56
|
return {};
|
|
57
57
|
}
|
|
58
|
+
if (options.handleHeaders) {
|
|
59
|
+
options.handleHeaders(response.headers);
|
|
60
|
+
}
|
|
61
|
+
if (options.asArrayBuffer) {
|
|
62
|
+
return (await response.arrayBuffer());
|
|
63
|
+
}
|
|
64
|
+
if (options.asBlob) {
|
|
65
|
+
return (await response.blob());
|
|
66
|
+
}
|
|
58
67
|
return (await response.json());
|
|
59
68
|
}
|
|
60
69
|
catch (error) {
|