@elaraai/east-web-std 1.0.85
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/CLA.md +26 -0
- package/CONTRIBUTING.md +28 -0
- package/LICENSE.md +31 -0
- package/README.md +191 -0
- package/THIRD_PARTY_NOTICES.md +123 -0
- package/dist/src/compliance.spec.d.ts +6 -0
- package/dist/src/compliance.spec.d.ts.map +1 -0
- package/dist/src/compliance.spec.js +89 -0
- package/dist/src/compliance.spec.js.map +1 -0
- package/dist/src/console.d.ts +237 -0
- package/dist/src/console.d.ts.map +1 -0
- package/dist/src/console.js +260 -0
- package/dist/src/console.js.map +1 -0
- package/dist/src/crypto.d.ts +224 -0
- package/dist/src/crypto.d.ts.map +1 -0
- package/dist/src/crypto.js +295 -0
- package/dist/src/crypto.js.map +1 -0
- package/dist/src/fetch.d.ts +383 -0
- package/dist/src/fetch.d.ts.map +1 -0
- package/dist/src/fetch.js +412 -0
- package/dist/src/fetch.js.map +1 -0
- package/dist/src/index.d.ts +106 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +93 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/path.d.ts +243 -0
- package/dist/src/path.d.ts.map +1 -0
- package/dist/src/path.js +562 -0
- package/dist/src/path.js.map +1 -0
- package/dist/src/random/crypto-rng.d.ts +38 -0
- package/dist/src/random/crypto-rng.d.ts.map +1 -0
- package/dist/src/random/crypto-rng.js +55 -0
- package/dist/src/random/crypto-rng.js.map +1 -0
- package/dist/src/random/distributions/bates.d.ts +17 -0
- package/dist/src/random/distributions/bates.d.ts.map +1 -0
- package/dist/src/random/distributions/bates.js +15 -0
- package/dist/src/random/distributions/bates.js.map +1 -0
- package/dist/src/random/distributions/bernoulli.d.ts +17 -0
- package/dist/src/random/distributions/bernoulli.d.ts.map +1 -0
- package/dist/src/random/distributions/bernoulli.js +13 -0
- package/dist/src/random/distributions/bernoulli.js.map +1 -0
- package/dist/src/random/distributions/binomial.d.ts +17 -0
- package/dist/src/random/distributions/binomial.d.ts.map +1 -0
- package/dist/src/random/distributions/binomial.js +24 -0
- package/dist/src/random/distributions/binomial.js.map +1 -0
- package/dist/src/random/distributions/exponential.d.ts +17 -0
- package/dist/src/random/distributions/exponential.d.ts.map +1 -0
- package/dist/src/random/distributions/exponential.js +13 -0
- package/dist/src/random/distributions/exponential.js.map +1 -0
- package/dist/src/random/distributions/geometric.d.ts +17 -0
- package/dist/src/random/distributions/geometric.d.ts.map +1 -0
- package/dist/src/random/distributions/geometric.js +14 -0
- package/dist/src/random/distributions/geometric.js.map +1 -0
- package/dist/src/random/distributions/irwin-hall.d.ts +17 -0
- package/dist/src/random/distributions/irwin-hall.d.ts.map +1 -0
- package/dist/src/random/distributions/irwin-hall.js +18 -0
- package/dist/src/random/distributions/irwin-hall.js.map +1 -0
- package/dist/src/random/distributions/log-normal.d.ts +17 -0
- package/dist/src/random/distributions/log-normal.d.ts.map +1 -0
- package/dist/src/random/distributions/log-normal.js +12 -0
- package/dist/src/random/distributions/log-normal.js.map +1 -0
- package/dist/src/random/distributions/normal.d.ts +18 -0
- package/dist/src/random/distributions/normal.d.ts.map +1 -0
- package/dist/src/random/distributions/normal.js +16 -0
- package/dist/src/random/distributions/normal.js.map +1 -0
- package/dist/src/random/distributions/pareto.d.ts +17 -0
- package/dist/src/random/distributions/pareto.d.ts.map +1 -0
- package/dist/src/random/distributions/pareto.js +14 -0
- package/dist/src/random/distributions/pareto.js.map +1 -0
- package/dist/src/random/distributions/poisson.d.ts +17 -0
- package/dist/src/random/distributions/poisson.d.ts.map +1 -0
- package/dist/src/random/distributions/poisson.js +81 -0
- package/dist/src/random/distributions/poisson.js.map +1 -0
- package/dist/src/random/distributions/uniform-int.d.ts +17 -0
- package/dist/src/random/distributions/uniform-int.d.ts.map +1 -0
- package/dist/src/random/distributions/uniform-int.js +16 -0
- package/dist/src/random/distributions/uniform-int.js.map +1 -0
- package/dist/src/random/distributions/uniform.d.ts +17 -0
- package/dist/src/random/distributions/uniform.d.ts.map +1 -0
- package/dist/src/random/distributions/uniform.js +10 -0
- package/dist/src/random/distributions/uniform.js.map +1 -0
- package/dist/src/random/rng.d.ts +21 -0
- package/dist/src/random/rng.d.ts.map +1 -0
- package/dist/src/random/rng.js +7 -0
- package/dist/src/random/rng.js.map +1 -0
- package/dist/src/random/xorshift128.d.ts +42 -0
- package/dist/src/random/xorshift128.d.ts.map +1 -0
- package/dist/src/random/xorshift128.js +119 -0
- package/dist/src/random/xorshift128.js.map +1 -0
- package/dist/src/random.d.ts +822 -0
- package/dist/src/random.d.ts.map +1 -0
- package/dist/src/random.js +992 -0
- package/dist/src/random.js.map +1 -0
- package/dist/src/test.d.ts +86 -0
- package/dist/src/test.d.ts.map +1 -0
- package/dist/src/test.js +160 -0
- package/dist/src/test.js.map +1 -0
- package/dist/src/time.d.ts +201 -0
- package/dist/src/time.d.ts.map +1 -0
- package/dist/src/time.js +300 -0
- package/dist/src/time.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { StringType, IntegerType, BooleanType, DictType, OptionType, VariantType, NullType, StructType, BlobType } from "@elaraai/east";
|
|
6
|
+
import type { PlatformFunction } from "@elaraai/east/internal";
|
|
7
|
+
/**
|
|
8
|
+
* HTTP method variant type.
|
|
9
|
+
*
|
|
10
|
+
* Represents the HTTP request method for fetch operations.
|
|
11
|
+
* Supports standard HTTP methods: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS.
|
|
12
|
+
*/
|
|
13
|
+
export declare const FetchMethod: VariantType<{
|
|
14
|
+
readonly GET: NullType;
|
|
15
|
+
readonly POST: NullType;
|
|
16
|
+
readonly PUT: NullType;
|
|
17
|
+
readonly DELETE: NullType;
|
|
18
|
+
readonly PATCH: NullType;
|
|
19
|
+
readonly HEAD: NullType;
|
|
20
|
+
readonly OPTIONS: NullType;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* HTTP request configuration structure.
|
|
24
|
+
*
|
|
25
|
+
* Complete configuration for making HTTP requests with custom methods,
|
|
26
|
+
* headers, and optional body content.
|
|
27
|
+
*/
|
|
28
|
+
export declare const FetchRequestConfig: StructType<{
|
|
29
|
+
readonly url: StringType;
|
|
30
|
+
readonly method: VariantType<{
|
|
31
|
+
readonly GET: NullType;
|
|
32
|
+
readonly POST: NullType;
|
|
33
|
+
readonly PUT: NullType;
|
|
34
|
+
readonly DELETE: NullType;
|
|
35
|
+
readonly PATCH: NullType;
|
|
36
|
+
readonly HEAD: NullType;
|
|
37
|
+
readonly OPTIONS: NullType;
|
|
38
|
+
}>;
|
|
39
|
+
readonly headers: DictType<StringType, StringType>;
|
|
40
|
+
readonly body: OptionType<StringType>;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* HTTP response structure.
|
|
44
|
+
*
|
|
45
|
+
* Complete HTTP response including status code, headers, body, and success indicator.
|
|
46
|
+
* The `ok` field is true for status codes in the 200-299 range.
|
|
47
|
+
*/
|
|
48
|
+
export declare const FetchResponse: StructType<{
|
|
49
|
+
readonly status: IntegerType;
|
|
50
|
+
readonly statusText: StringType;
|
|
51
|
+
readonly headers: DictType<StringType, StringType>;
|
|
52
|
+
readonly body: StringType;
|
|
53
|
+
readonly ok: BooleanType;
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Performs an HTTP GET request and returns the response body as a string.
|
|
57
|
+
*
|
|
58
|
+
* Makes a simple GET request to the specified URL and returns the response body text.
|
|
59
|
+
* This is a convenience function for basic GET requests without custom headers.
|
|
60
|
+
* Throws an error if the response status is not in the 200-299 range.
|
|
61
|
+
*
|
|
62
|
+
* This is a platform function for the East language, enabling HTTP GET requests
|
|
63
|
+
* in East programs running in a browser, through the browser's `fetch`.
|
|
64
|
+
*
|
|
65
|
+
* @param url - The URL to fetch (must be a valid HTTP/HTTPS URL)
|
|
66
|
+
* @returns The response body as a string
|
|
67
|
+
*
|
|
68
|
+
* @throws {EastError} When request fails:
|
|
69
|
+
* - Invalid URL
|
|
70
|
+
* - Network error, or a cross-origin request the server's CORS headers refuse
|
|
71
|
+
* - Non-2xx HTTP status code
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const fetchData = East.function([], StringType, $ => {
|
|
76
|
+
* const data = $.let(Fetch.get("https://api.example.com/data"));
|
|
77
|
+
* return data;
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare const fetch_get: import("@elaraai/east").AsyncPlatformDefinition<[StringType], StringType>;
|
|
82
|
+
/**
|
|
83
|
+
* Performs an HTTP GET request and returns the response body as binary data.
|
|
84
|
+
*
|
|
85
|
+
* Makes a simple GET request to the specified URL and returns the response body
|
|
86
|
+
* as raw bytes (Blob/Uint8Array). Useful for downloading binary files like images,
|
|
87
|
+
* PDFs, or database files.
|
|
88
|
+
* Throws an error if the response status is not in the 200-299 range.
|
|
89
|
+
*
|
|
90
|
+
* This is a platform function for the East language, enabling binary HTTP GET requests
|
|
91
|
+
* in East programs running in a browser, through the browser's `fetch`.
|
|
92
|
+
*
|
|
93
|
+
* @param url - The URL to fetch (must be a valid HTTP/HTTPS URL)
|
|
94
|
+
* @returns The response body as binary data (Blob)
|
|
95
|
+
*
|
|
96
|
+
* @throws {EastError} When request fails:
|
|
97
|
+
* - Invalid URL
|
|
98
|
+
* - Network error, or a cross-origin request the server's CORS headers refuse
|
|
99
|
+
* - Non-2xx HTTP status code
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const downloadFile = East.function([], BlobType, $ => {
|
|
104
|
+
* const data = $.let(Fetch.getBytes("https://example.com/file.bin"));
|
|
105
|
+
* return data;
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare const fetch_get_bytes: import("@elaraai/east").AsyncPlatformDefinition<[StringType], BlobType>;
|
|
110
|
+
/**
|
|
111
|
+
* Performs an HTTP POST request with a string body.
|
|
112
|
+
*
|
|
113
|
+
* Makes a POST request to the specified URL with the provided string body.
|
|
114
|
+
* Sets Content-Type header to "text/plain" by default. For more control over
|
|
115
|
+
* headers and methods, use {@link fetch_request}.
|
|
116
|
+
* Throws an error if the response status is not in the 200-299 range.
|
|
117
|
+
*
|
|
118
|
+
* This is a platform function for the East language, enabling HTTP POST requests
|
|
119
|
+
* in East programs running in a browser, through the browser's `fetch`.
|
|
120
|
+
*
|
|
121
|
+
* @param url - The URL to post to (must be a valid HTTP/HTTPS URL)
|
|
122
|
+
* @param body - The request body as a string
|
|
123
|
+
* @returns The response body as a string
|
|
124
|
+
*
|
|
125
|
+
* @throws {EastError} When request fails:
|
|
126
|
+
* - Invalid URL
|
|
127
|
+
* - Network error, or a cross-origin request the server's CORS headers refuse
|
|
128
|
+
* - Non-2xx HTTP status code
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* const postData = East.function([], StringType, $ => {
|
|
133
|
+
* const response = $.let(Fetch.post("https://api.example.com/submit", "data"));
|
|
134
|
+
* return response;
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
export declare const fetch_post: import("@elaraai/east").AsyncPlatformDefinition<[StringType, StringType], StringType>;
|
|
139
|
+
/**
|
|
140
|
+
* Performs a full HTTP request with custom configuration.
|
|
141
|
+
*
|
|
142
|
+
* Makes an HTTP request with complete control over method, headers, and body.
|
|
143
|
+
* Returns the full response including status, headers, and body. Unlike {@link fetch_get}
|
|
144
|
+
* and {@link fetch_post}, this does not throw on non-2xx status codes - check the `ok`
|
|
145
|
+
* field in the response instead.
|
|
146
|
+
*
|
|
147
|
+
* This is a platform function for the East language, enabling full HTTP requests
|
|
148
|
+
* in East programs running in a browser, through the browser's `fetch`.
|
|
149
|
+
*
|
|
150
|
+
* @param config - The request configuration (url, method, headers, optional body)
|
|
151
|
+
* @returns The complete HTTP response with status, headers, and body
|
|
152
|
+
*
|
|
153
|
+
* @throws {EastError} When request fails at the network level (not for HTTP errors)
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```ts
|
|
157
|
+
* const makeRequest = East.function([], FetchResponse, $ => {
|
|
158
|
+
* const config = $.let({
|
|
159
|
+
* url: "https://api.example.com/data",
|
|
160
|
+
* method: variant("GET", null),
|
|
161
|
+
* headers: new Map([["Authorization", "Bearer token"]]),
|
|
162
|
+
* body: none,
|
|
163
|
+
* }, FetchRequestConfig);
|
|
164
|
+
* return Fetch.request(config);
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* @remarks
|
|
169
|
+
* A browser sends a request only with the headers it allows a page to set,
|
|
170
|
+
* and a cross-origin response shows only the headers its server exposes.
|
|
171
|
+
*/
|
|
172
|
+
export declare const fetch_request: import("@elaraai/east").AsyncPlatformDefinition<[StructType<{
|
|
173
|
+
readonly url: StringType;
|
|
174
|
+
readonly method: VariantType<{
|
|
175
|
+
readonly GET: NullType;
|
|
176
|
+
readonly POST: NullType;
|
|
177
|
+
readonly PUT: NullType;
|
|
178
|
+
readonly DELETE: NullType;
|
|
179
|
+
readonly PATCH: NullType;
|
|
180
|
+
readonly HEAD: NullType;
|
|
181
|
+
readonly OPTIONS: NullType;
|
|
182
|
+
}>;
|
|
183
|
+
readonly headers: DictType<StringType, StringType>;
|
|
184
|
+
readonly body: OptionType<StringType>;
|
|
185
|
+
}>], StructType<{
|
|
186
|
+
readonly status: IntegerType;
|
|
187
|
+
readonly statusText: StringType;
|
|
188
|
+
readonly headers: DictType<StringType, StringType>;
|
|
189
|
+
readonly body: StringType;
|
|
190
|
+
readonly ok: BooleanType;
|
|
191
|
+
}>>;
|
|
192
|
+
/**
|
|
193
|
+
* Browser implementation of fetch platform functions.
|
|
194
|
+
*
|
|
195
|
+
* Pass this array to {@link East.compileAsync} to enable fetch operations.
|
|
196
|
+
*/
|
|
197
|
+
declare const FetchImpl: PlatformFunction[];
|
|
198
|
+
/**
|
|
199
|
+
* Grouped fetch platform functions.
|
|
200
|
+
*
|
|
201
|
+
* Provides HTTP client operations using the browser's fetch API.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* import { East, StringType } from "@elaraai/east";
|
|
206
|
+
* import { Fetch } from "@elaraai/east-web-std";
|
|
207
|
+
*
|
|
208
|
+
* const getData = East.function([], StringType, $ => {
|
|
209
|
+
* const response = $.let(Fetch.get("https://api.example.com/data"));
|
|
210
|
+
* return response;
|
|
211
|
+
* });
|
|
212
|
+
*
|
|
213
|
+
* const compiled = await East.compileAsync(getData.toIR(), Fetch.Implementation);
|
|
214
|
+
* await compiled(); // Returns response body as string
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
export declare const Fetch: {
|
|
218
|
+
/**
|
|
219
|
+
* Performs an HTTP GET request and returns the response body.
|
|
220
|
+
*
|
|
221
|
+
* Makes a simple GET request to the specified URL and returns the response body text.
|
|
222
|
+
* Throws an error if the response status is not in the 200-299 range.
|
|
223
|
+
*
|
|
224
|
+
* @param url - The URL to fetch
|
|
225
|
+
* @returns The response body as a string
|
|
226
|
+
* @throws {EastError} When request fails or status is not 2xx
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```ts
|
|
230
|
+
* const fetchData = East.function([], StringType, $ => {
|
|
231
|
+
* return Fetch.get("https://api.example.com/data");
|
|
232
|
+
* });
|
|
233
|
+
*
|
|
234
|
+
* const compiled = await East.compileAsync(fetchData.toIR(), Fetch.Implementation);
|
|
235
|
+
* await compiled(); // Returns: response body as string
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
238
|
+
readonly get: import("@elaraai/east").AsyncPlatformDefinition<[StringType], StringType>;
|
|
239
|
+
/**
|
|
240
|
+
* Performs an HTTP GET request and returns the response body as binary data.
|
|
241
|
+
*
|
|
242
|
+
* Makes a simple GET request to the specified URL and returns the response body
|
|
243
|
+
* as raw bytes (Blob/Uint8Array). Useful for downloading binary files.
|
|
244
|
+
* Throws an error if the response status is not in the 200-299 range.
|
|
245
|
+
*
|
|
246
|
+
* @param url - The URL to fetch
|
|
247
|
+
* @returns The response body as binary data (Blob)
|
|
248
|
+
* @throws {EastError} When request fails or status is not 2xx
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```ts
|
|
252
|
+
* const downloadFile = East.function([], BlobType, $ => {
|
|
253
|
+
* return Fetch.getBytes("https://example.com/file.bin");
|
|
254
|
+
* });
|
|
255
|
+
*
|
|
256
|
+
* const compiled = await East.compileAsync(downloadFile.toIR(), Fetch.Implementation);
|
|
257
|
+
* await compiled(); // Returns: binary data as Uint8Array
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
readonly getBytes: import("@elaraai/east").AsyncPlatformDefinition<[StringType], BlobType>;
|
|
261
|
+
/**
|
|
262
|
+
* Performs an HTTP POST request with a string body.
|
|
263
|
+
*
|
|
264
|
+
* Makes a POST request to the specified URL with the provided string body.
|
|
265
|
+
* Sets Content-Type to "text/plain" by default.
|
|
266
|
+
* Throws an error if the response status is not in the 200-299 range.
|
|
267
|
+
*
|
|
268
|
+
* @param url - The URL to post to
|
|
269
|
+
* @param body - The request body as a string
|
|
270
|
+
* @returns The response body as a string
|
|
271
|
+
* @throws {EastError} When request fails or status is not 2xx
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* ```ts
|
|
275
|
+
* const postData = East.function([], StringType, $ => {
|
|
276
|
+
* return Fetch.post("https://api.example.com/submit", "data");
|
|
277
|
+
* });
|
|
278
|
+
*
|
|
279
|
+
* const compiled = await East.compileAsync(postData.toIR(), Fetch.Implementation);
|
|
280
|
+
* await compiled(); // Returns: response body as string
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
readonly post: import("@elaraai/east").AsyncPlatformDefinition<[StringType, StringType], StringType>;
|
|
284
|
+
/**
|
|
285
|
+
* Performs a full HTTP request with custom configuration.
|
|
286
|
+
*
|
|
287
|
+
* Makes an HTTP request with complete control over method, headers, and body.
|
|
288
|
+
* Returns the full response including status, headers, and body.
|
|
289
|
+
* Does not throw on non-2xx status - check the `ok` field instead.
|
|
290
|
+
*
|
|
291
|
+
* @param config - The request configuration
|
|
292
|
+
* @returns The complete HTTP response
|
|
293
|
+
* @throws {EastError} When request fails at the network level
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* ```ts
|
|
297
|
+
* const makeRequest = East.function([], FetchResponse, $ => {
|
|
298
|
+
* const config = $.let({
|
|
299
|
+
* url: "https://api.example.com/data",
|
|
300
|
+
* method: variant("GET", null),
|
|
301
|
+
* headers: new Map(),
|
|
302
|
+
* body: none,
|
|
303
|
+
* }, FetchRequestConfig);
|
|
304
|
+
* return Fetch.request(config);
|
|
305
|
+
* });
|
|
306
|
+
*
|
|
307
|
+
* const compiled = await East.compileAsync(makeRequest.toIR(), Fetch.Implementation);
|
|
308
|
+
* const response = await compiled(); // Returns: FetchResponse object
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
readonly request: import("@elaraai/east").AsyncPlatformDefinition<[StructType<{
|
|
312
|
+
readonly url: StringType;
|
|
313
|
+
readonly method: VariantType<{
|
|
314
|
+
readonly GET: NullType;
|
|
315
|
+
readonly POST: NullType;
|
|
316
|
+
readonly PUT: NullType;
|
|
317
|
+
readonly DELETE: NullType;
|
|
318
|
+
readonly PATCH: NullType;
|
|
319
|
+
readonly HEAD: NullType;
|
|
320
|
+
readonly OPTIONS: NullType;
|
|
321
|
+
}>;
|
|
322
|
+
readonly headers: DictType<StringType, StringType>;
|
|
323
|
+
readonly body: OptionType<StringType>;
|
|
324
|
+
}>], StructType<{
|
|
325
|
+
readonly status: IntegerType;
|
|
326
|
+
readonly statusText: StringType;
|
|
327
|
+
readonly headers: DictType<StringType, StringType>;
|
|
328
|
+
readonly body: StringType;
|
|
329
|
+
readonly ok: BooleanType;
|
|
330
|
+
}>>;
|
|
331
|
+
/**
|
|
332
|
+
* Browser implementation of fetch platform functions.
|
|
333
|
+
*
|
|
334
|
+
* Pass this to {@link East.compileAsync} to enable fetch operations.
|
|
335
|
+
*/
|
|
336
|
+
readonly Implementation: PlatformFunction[];
|
|
337
|
+
/**
|
|
338
|
+
* Type definitions for fetch operations.
|
|
339
|
+
*/
|
|
340
|
+
readonly Types: {
|
|
341
|
+
/**
|
|
342
|
+
* HTTP method variant type (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS).
|
|
343
|
+
*/
|
|
344
|
+
readonly Method: VariantType<{
|
|
345
|
+
readonly GET: NullType;
|
|
346
|
+
readonly POST: NullType;
|
|
347
|
+
readonly PUT: NullType;
|
|
348
|
+
readonly DELETE: NullType;
|
|
349
|
+
readonly PATCH: NullType;
|
|
350
|
+
readonly HEAD: NullType;
|
|
351
|
+
readonly OPTIONS: NullType;
|
|
352
|
+
}>;
|
|
353
|
+
/**
|
|
354
|
+
* HTTP request configuration structure.
|
|
355
|
+
*/
|
|
356
|
+
readonly RequestConfig: StructType<{
|
|
357
|
+
readonly url: StringType;
|
|
358
|
+
readonly method: VariantType<{
|
|
359
|
+
readonly GET: NullType;
|
|
360
|
+
readonly POST: NullType;
|
|
361
|
+
readonly PUT: NullType;
|
|
362
|
+
readonly DELETE: NullType;
|
|
363
|
+
readonly PATCH: NullType;
|
|
364
|
+
readonly HEAD: NullType;
|
|
365
|
+
readonly OPTIONS: NullType;
|
|
366
|
+
}>;
|
|
367
|
+
readonly headers: DictType<StringType, StringType>;
|
|
368
|
+
readonly body: OptionType<StringType>;
|
|
369
|
+
}>;
|
|
370
|
+
/**
|
|
371
|
+
* HTTP response structure.
|
|
372
|
+
*/
|
|
373
|
+
readonly Response: StructType<{
|
|
374
|
+
readonly status: IntegerType;
|
|
375
|
+
readonly statusText: StringType;
|
|
376
|
+
readonly headers: DictType<StringType, StringType>;
|
|
377
|
+
readonly body: StringType;
|
|
378
|
+
readonly ok: BooleanType;
|
|
379
|
+
}>;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
export { FetchImpl };
|
|
383
|
+
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/fetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAQ,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAA2C,MAAM,eAAe,CAAC;AACvL,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;EAQtB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;EAK7B,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;;;;EAMxB,CAAC;AAKH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,SAAS,2EAA4D,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,eAAe,yEAAgE,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU,uFAAyE,CAAC;AAEjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;GAA2E,CAAC;AAEtG;;;;GAIG;AACH,QAAA,MAAM,SAAS,EAAE,gBAAgB,EAiGhC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK;IACd;;;;;;;;;;;;;;;;;;;OAmBG;;IAGH;;;;;;;;;;;;;;;;;;;;OAoBG;;IAGH;;;;;;;;;;;;;;;;;;;;;OAqBG;;IAGH;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;;;;;;;;;;;;;;;;;;;;;IAGH;;;;OAIG;;IAGH;;OAEG;;QAEC;;WAEG;;;;;;;;;;QAGH;;WAEG;;;;;;;;;;;;;;;QAGH;;WAEG;;;;;;;;;CAGD,CAAC;AAGX,OAAO,EAAE,SAAS,EAAE,CAAC"}
|