@solidrt/flux-types 0.0.27 → 0.0.29
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/modules/fs.d.ts +7 -0
- package/package.json +1 -1
- package/standards/console.d.ts +2 -0
- package/standards/fetch.d.ts +27 -1
- package/standards/time.d.ts +4 -4
package/modules/fs.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ declare module "flux:fs" {
|
|
|
16
16
|
text(): Promise<string>
|
|
17
17
|
/** Read the whole file as raw bytes. */
|
|
18
18
|
bytes(): Promise<Uint8Array>
|
|
19
|
+
/** Read the whole file as an ArrayBuffer. */
|
|
20
|
+
arrayBuffer(): Promise<ArrayBuffer>
|
|
19
21
|
/** Read and parse the file as JSON. */
|
|
20
22
|
json(): Promise<any>
|
|
21
23
|
/** Resolve to whether the file exists. */
|
|
@@ -40,6 +42,11 @@ declare module "flux:fs" {
|
|
|
40
42
|
entries(): Promise<DirEntry[]>
|
|
41
43
|
/** Resolve to whether the directory exists. */
|
|
42
44
|
exists(): Promise<boolean>
|
|
45
|
+
/**
|
|
46
|
+
* Create the directory, including any missing parents. Succeeds if it
|
|
47
|
+
* already exists.
|
|
48
|
+
*/
|
|
49
|
+
create(): Promise<void>
|
|
43
50
|
}
|
|
44
51
|
|
|
45
52
|
/**
|
package/package.json
CHANGED
package/standards/console.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// The web-standard `console` global. flux provides exactly these four methods
|
|
2
2
|
// (no info/trace/table/group/...). A global script file: these declarations
|
|
3
3
|
// stand in for the ones lib.dom would otherwise supply.
|
|
4
|
+
// Formatting: arguments joined by spaces; strings as-is, Error objects as
|
|
5
|
+
// `name: message` plus stack, other values JSON-stringified.
|
|
4
6
|
|
|
5
7
|
declare let console: {
|
|
6
8
|
debug(...args: any[]): void
|
package/standards/fetch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The Fetch API cluster (Headers, Request, Response, fetch). A deliberate subset
|
|
2
2
|
// of the WHATWG Fetch standard: flux provides exactly these members and no more
|
|
3
|
-
// (no Blob, FormData, ReadableStream,
|
|
3
|
+
// (no Blob, FormData, ReadableStream, clone(), AbortSignal, ...).
|
|
4
4
|
// Grouped in one file because the four share BodyInit/HeadersInit and reference
|
|
5
5
|
// each other.
|
|
6
6
|
|
|
@@ -44,6 +44,28 @@ interface RequestInit {
|
|
|
44
44
|
body?: BodyInit | null
|
|
45
45
|
/** Request headers. */
|
|
46
46
|
headers?: HeadersInit
|
|
47
|
+
/**
|
|
48
|
+
* Disk-cache policy, explicit and per call. flux never caches by default
|
|
49
|
+
* (like Node/Bun/Deno), and server cache headers (`cache-control`,
|
|
50
|
+
* `expires`, `etag`) are ignored entirely: the caller decides.
|
|
51
|
+
*
|
|
52
|
+
* - `"force-cache"`: serve from disk if stored, otherwise fetch and store.
|
|
53
|
+
* No freshness, no TTL: the entry lives until evicted by the size cap or
|
|
54
|
+
* overwritten by `"reload"`. Use for assets (images, audio, fonts);
|
|
55
|
+
* versioned URLs are the normal way to handle updatable assets.
|
|
56
|
+
* - `"reload"`: fetch fresh and overwrite the stored entry.
|
|
57
|
+
* - `"default"`, `"no-store"`, `"no-cache"`: accepted, plain network
|
|
58
|
+
* request (all equivalent to omitting the option here; there is no
|
|
59
|
+
* freshness model to modulate).
|
|
60
|
+
*
|
|
61
|
+
* Only GET requests with 2xx responses are cached, keyed by URL; on other
|
|
62
|
+
* methods the option is ignored. Unknown values throw.
|
|
63
|
+
*
|
|
64
|
+
* Cached fetches queue on a small per-host concurrency limit so asset
|
|
65
|
+
* floods stay polite; disk hits and plain (uncached) fetches are never
|
|
66
|
+
* throttled.
|
|
67
|
+
*/
|
|
68
|
+
cache?: "force-cache" | "reload" | "default" | "no-store" | "no-cache"
|
|
47
69
|
}
|
|
48
70
|
|
|
49
71
|
/**
|
|
@@ -62,6 +84,8 @@ interface Request {
|
|
|
62
84
|
text(): Promise<string>
|
|
63
85
|
/** Read the whole body as raw bytes. */
|
|
64
86
|
bytes(): Promise<Uint8Array>
|
|
87
|
+
/** Read the whole body as an ArrayBuffer. */
|
|
88
|
+
arrayBuffer(): Promise<ArrayBuffer>
|
|
65
89
|
/** Read and parse the whole body as JSON. */
|
|
66
90
|
json(): Promise<any>
|
|
67
91
|
}
|
|
@@ -93,6 +117,8 @@ interface Response {
|
|
|
93
117
|
text(): Promise<string>
|
|
94
118
|
/** Read the whole body as raw bytes. */
|
|
95
119
|
bytes(): Promise<Uint8Array>
|
|
120
|
+
/** Read the whole body as an ArrayBuffer. */
|
|
121
|
+
arrayBuffer(): Promise<ArrayBuffer>
|
|
96
122
|
/** Read and parse the whole body as JSON. */
|
|
97
123
|
json(): Promise<any>
|
|
98
124
|
}
|
package/standards/time.d.ts
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
* {@link clearTimeout}.
|
|
8
8
|
*/
|
|
9
9
|
declare function setTimeout(callback: () => void, ms: number): number
|
|
10
|
-
/** Cancel a pending timeout.
|
|
11
|
-
declare function clearTimeout(id
|
|
10
|
+
/** Cancel a pending timeout. Unknown or missing ids are ignored. */
|
|
11
|
+
declare function clearTimeout(id?: number): void
|
|
12
12
|
/**
|
|
13
13
|
* Run `callback` every `ms` milliseconds. Returns a timer id for
|
|
14
14
|
* {@link clearInterval}.
|
|
15
15
|
*/
|
|
16
16
|
declare function setInterval(callback: () => void, ms: number): number
|
|
17
|
-
/** Cancel a running interval.
|
|
18
|
-
declare function clearInterval(id
|
|
17
|
+
/** Cancel a running interval. Unknown or missing ids are ignored. */
|
|
18
|
+
declare function clearInterval(id?: number): void
|
|
19
19
|
/**
|
|
20
20
|
* Queue `callback` to run as a microtask: after the current job finishes, before
|
|
21
21
|
* any timer fires.
|