@evolu/common 7.4.1 → 8.0.0-next.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/README.md +4 -61
- package/dist/src/Array.d.ts +343 -102
- package/dist/src/Array.d.ts.map +1 -1
- package/dist/src/Array.js +181 -85
- package/dist/src/Assert.d.ts +57 -11
- package/dist/src/Assert.d.ts.map +1 -1
- package/dist/src/Assert.js +47 -11
- package/dist/src/BigInt.d.ts +6 -1
- package/dist/src/BigInt.d.ts.map +1 -1
- package/dist/src/BigInt.js +5 -0
- package/dist/src/Brand.d.ts +40 -12
- package/dist/src/Brand.d.ts.map +1 -1
- package/dist/src/Brand.js +5 -0
- package/dist/src/Buffer.d.ts +6 -1
- package/dist/src/Buffer.d.ts.map +1 -1
- package/dist/src/Buffer.js +7 -2
- package/dist/src/Cache.d.ts +10 -2
- package/dist/src/Cache.d.ts.map +1 -1
- package/dist/src/Cache.js +6 -0
- package/dist/src/Callbacks.d.ts +10 -7
- package/dist/src/Callbacks.d.ts.map +1 -1
- package/dist/src/Callbacks.js +23 -13
- package/dist/src/Console.d.ts +361 -69
- package/dist/src/Console.d.ts.map +1 -1
- package/dist/src/Console.js +217 -117
- package/dist/src/Crypto.d.ts +70 -21
- package/dist/src/Crypto.d.ts.map +1 -1
- package/dist/src/Crypto.js +72 -27
- package/dist/src/Eq.d.ts +22 -2
- package/dist/src/Eq.d.ts.map +1 -1
- package/dist/src/Eq.js +21 -1
- package/dist/src/Error.d.ts +23 -12
- package/dist/src/Error.d.ts.map +1 -1
- package/dist/src/Error.js +27 -11
- package/dist/src/Function.d.ts +128 -56
- package/dist/src/Function.d.ts.map +1 -1
- package/dist/src/Function.js +118 -14
- package/dist/src/Identicon.d.ts +5 -0
- package/dist/src/Identicon.d.ts.map +1 -1
- package/dist/src/Identicon.js +6 -1
- package/dist/src/Lookup.d.ts +160 -0
- package/dist/src/Lookup.d.ts.map +1 -0
- package/dist/src/Lookup.js +192 -0
- package/dist/src/Microtask.d.ts +21 -0
- package/dist/src/Microtask.d.ts.map +1 -0
- package/dist/src/Microtask.js +37 -0
- package/dist/src/Number.d.ts +18 -4
- package/dist/src/Number.d.ts.map +1 -1
- package/dist/src/Number.js +23 -1
- package/dist/src/Object.d.ts +110 -5
- package/dist/src/Object.d.ts.map +1 -1
- package/dist/src/Object.js +108 -5
- package/dist/src/Option.d.ts +58 -0
- package/dist/src/Option.d.ts.map +1 -0
- package/dist/src/Option.js +43 -0
- package/dist/src/Order.d.ts +5 -0
- package/dist/src/Order.d.ts.map +1 -1
- package/dist/src/Order.js +8 -3
- package/dist/src/Platform.d.ts +36 -2
- package/dist/src/Platform.d.ts.map +1 -1
- package/dist/src/Platform.js +10 -6
- package/dist/src/Polyfills.d.ts +27 -0
- package/dist/src/Polyfills.d.ts.map +1 -0
- package/dist/src/Polyfills.js +299 -0
- package/dist/src/Random.d.ts +18 -7
- package/dist/src/Random.d.ts.map +1 -1
- package/dist/src/Random.js +9 -7
- package/dist/src/Redacted.d.ts +7 -4
- package/dist/src/Redacted.d.ts.map +1 -1
- package/dist/src/Redacted.js +5 -0
- package/dist/src/Ref.d.ts +31 -16
- package/dist/src/Ref.d.ts.map +1 -1
- package/dist/src/Ref.js +35 -7
- package/dist/src/RefCount.d.ts +62 -0
- package/dist/src/RefCount.d.ts.map +1 -0
- package/dist/src/RefCount.js +83 -0
- package/dist/src/Relation.d.ts +84 -29
- package/dist/src/Relation.d.ts.map +1 -1
- package/dist/src/Relation.js +83 -105
- package/dist/src/Resource.d.ts +263 -0
- package/dist/src/Resource.d.ts.map +1 -0
- package/dist/src/Resource.js +389 -0
- package/dist/src/Result.d.ts +390 -374
- package/dist/src/Result.d.ts.map +1 -1
- package/dist/src/Result.js +142 -70
- package/dist/src/Schedule.d.ts +953 -0
- package/dist/src/Schedule.d.ts.map +1 -0
- package/dist/src/Schedule.js +1199 -0
- package/dist/src/Set.d.ts +181 -0
- package/dist/src/Set.d.ts.map +1 -0
- package/dist/src/Set.js +137 -0
- package/dist/src/Skiplist.d.ts +6 -1
- package/dist/src/Skiplist.d.ts.map +1 -1
- package/dist/src/Skiplist.js +5 -0
- package/dist/src/Sqlite.d.ts +160 -60
- package/dist/src/Sqlite.d.ts.map +1 -1
- package/dist/src/Sqlite.js +290 -190
- package/dist/src/Store.d.ts +36 -28
- package/dist/src/Store.d.ts.map +1 -1
- package/dist/src/Store.js +55 -15
- package/dist/src/String.d.ts +5 -0
- package/dist/src/String.d.ts.map +1 -1
- package/dist/src/String.js +5 -0
- package/dist/src/Task.d.ts +2263 -423
- package/dist/src/Task.d.ts.map +1 -1
- package/dist/src/Task.js +1488 -348
- package/dist/src/Test.d.ts +122 -0
- package/dist/src/Test.d.ts.map +1 -0
- package/dist/src/Test.js +66 -0
- package/dist/src/Time.d.ts +201 -48
- package/dist/src/Time.d.ts.map +1 -1
- package/dist/src/Time.js +190 -86
- package/dist/src/Tracer.d.ts +48 -0
- package/dist/src/Tracer.d.ts.map +1 -0
- package/dist/src/Tracer.js +6 -0
- package/dist/src/Type.d.ts +582 -209
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +362 -240
- package/dist/src/Types.d.ts +160 -6
- package/dist/src/Types.d.ts.map +1 -1
- package/dist/src/Types.js +22 -2
- package/dist/src/WebSocket.d.ts +113 -58
- package/dist/src/WebSocket.d.ts.map +1 -1
- package/dist/src/WebSocket.js +210 -118
- package/dist/src/Worker.d.ts +245 -60
- package/dist/src/Worker.d.ts.map +1 -1
- package/dist/src/Worker.js +220 -64
- package/dist/src/index.d.ts +25 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +19 -3
- package/dist/src/local-first/Db.d.ts +24 -213
- package/dist/src/local-first/Db.d.ts.map +1 -1
- package/dist/src/local-first/Db.js +622 -293
- package/dist/src/local-first/Error.d.ts +12 -0
- package/dist/src/local-first/Error.d.ts.map +1 -0
- package/dist/src/local-first/Error.js +6 -0
- package/dist/src/local-first/Evolu.d.ts +330 -285
- package/dist/src/local-first/Evolu.d.ts.map +1 -1
- package/dist/src/local-first/Evolu.js +472 -402
- package/dist/src/local-first/LocalAuth.d.ts +10 -10
- package/dist/src/local-first/LocalAuth.d.ts.map +1 -1
- package/dist/src/local-first/LocalAuth.js +6 -1
- package/dist/src/local-first/Owner.d.ts +70 -27
- package/dist/src/local-first/Owner.d.ts.map +1 -1
- package/dist/src/local-first/Owner.js +27 -14
- package/dist/src/local-first/Protocol.d.ts +58 -50
- package/dist/src/local-first/Protocol.d.ts.map +1 -1
- package/dist/src/local-first/Protocol.js +253 -155
- package/dist/src/local-first/Query.d.ts +133 -43
- package/dist/src/local-first/Query.d.ts.map +1 -1
- package/dist/src/local-first/Query.js +139 -90
- package/dist/src/local-first/Relay.d.ts +18 -38
- package/dist/src/local-first/Relay.d.ts.map +1 -1
- package/dist/src/local-first/Relay.js +59 -171
- package/dist/src/local-first/Schema.d.ts +139 -144
- package/dist/src/local-first/Schema.d.ts.map +1 -1
- package/dist/src/local-first/Schema.js +78 -163
- package/dist/src/local-first/Shared.d.ts +125 -0
- package/dist/src/local-first/Shared.d.ts.map +1 -0
- package/dist/src/local-first/Shared.js +569 -0
- package/dist/src/local-first/Storage.d.ts +50 -53
- package/dist/src/local-first/Storage.d.ts.map +1 -1
- package/dist/src/local-first/Storage.js +121 -173
- package/dist/src/local-first/Timestamp.d.ts +28 -35
- package/dist/src/local-first/Timestamp.d.ts.map +1 -1
- package/dist/src/local-first/Timestamp.js +24 -25
- package/dist/src/local-first/index.d.ts +2 -15
- package/dist/src/local-first/index.d.ts.map +1 -1
- package/dist/src/local-first/index.js +2 -15
- package/package.json +36 -26
- package/src/Array.ts +467 -106
- package/src/Assert.ts +87 -12
- package/src/BigInt.ts +7 -1
- package/src/Brand.ts +41 -12
- package/src/Buffer.ts +10 -4
- package/src/Cache.ts +11 -2
- package/src/Callbacks.ts +33 -23
- package/src/Console.ts +567 -178
- package/src/Crypto.ts +111 -62
- package/src/Eq.ts +30 -3
- package/src/Error.ts +50 -34
- package/src/Function.ts +140 -68
- package/src/Identicon.ts +7 -1
- package/src/Lookup.ts +415 -0
- package/src/Microtask.ts +58 -0
- package/src/Number.ts +40 -7
- package/src/Object.ts +155 -16
- package/src/Option.ts +74 -0
- package/src/Order.ts +11 -3
- package/src/Platform.ts +43 -7
- package/src/Polyfills.ts +465 -0
- package/src/Random.ts +25 -11
- package/src/Redacted.ts +8 -4
- package/src/Ref.ts +72 -21
- package/src/RefCount.ts +170 -0
- package/src/Relation.ts +188 -136
- package/src/Resource.ts +864 -0
- package/src/Result.ts +548 -381
- package/src/Schedule.ts +1471 -0
- package/src/Set.ts +247 -0
- package/src/Skiplist.ts +7 -1
- package/src/Sqlite.ts +409 -304
- package/src/Store.ts +94 -48
- package/src/String.ts +6 -0
- package/src/Task.ts +3685 -740
- package/src/Test.ts +162 -0
- package/src/Time.ts +348 -145
- package/src/Tracer.ts +54 -0
- package/src/Type.ts +851 -430
- package/src/Types.ts +202 -7
- package/src/WebSocket.ts +311 -178
- package/src/Worker.ts +527 -147
- package/src/index.ts +74 -3
- package/src/local-first/Db.ts +871 -597
- package/src/local-first/Error.ts +17 -0
- package/src/local-first/Evolu.ts +884 -824
- package/src/local-first/LocalAuth.ts +10 -10
- package/src/local-first/Owner.ts +94 -42
- package/src/local-first/Protocol.ts +440 -303
- package/src/local-first/Query.ts +243 -194
- package/src/local-first/Relay.ts +91 -252
- package/src/local-first/Schema.ts +284 -394
- package/src/local-first/Shared.ts +932 -0
- package/src/local-first/Storage.ts +206 -277
- package/src/local-first/Timestamp.ts +38 -45
- package/src/local-first/index.ts +2 -16
- package/LICENSE +0 -21
- package/dist/src/Instances.d.ts +0 -34
- package/dist/src/Instances.d.ts.map +0 -1
- package/dist/src/Instances.js +0 -44
- package/dist/src/Resources.d.ts +0 -118
- package/dist/src/Resources.d.ts.map +0 -1
- package/dist/src/Resources.js +0 -197
- package/dist/src/local-first/Platform.d.ts +0 -25
- package/dist/src/local-first/Platform.d.ts.map +0 -1
- package/dist/src/local-first/Platform.js +0 -1
- package/dist/src/local-first/Public.d.ts +0 -22
- package/dist/src/local-first/Public.d.ts.map +0 -1
- package/dist/src/local-first/Public.js +0 -15
- package/dist/src/local-first/PublicKysely.d.ts +0 -148
- package/dist/src/local-first/PublicKysely.d.ts.map +0 -1
- package/dist/src/local-first/PublicKysely.js +0 -184
- package/dist/src/local-first/Sync.d.ts +0 -112
- package/dist/src/local-first/Sync.d.ts.map +0 -1
- package/dist/src/local-first/Sync.js +0 -526
- package/src/Instances.ts +0 -92
- package/src/Resources.ts +0 -367
- package/src/local-first/Platform.ts +0 -27
- package/src/local-first/Public.ts +0 -42
- package/src/local-first/PublicKysely.ts +0 -239
- package/src/local-first/Sync.ts +0 -949
package/dist/src/Types.d.ts
CHANGED
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TypeScript utility types
|
|
2
|
+
* TypeScript utility types.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import * as Kysely from "kysely";
|
|
7
|
+
import type { TypeName } from "./Type.js";
|
|
8
|
+
/**
|
|
9
|
+
* A function that receives a value and returns nothing.
|
|
10
|
+
*
|
|
11
|
+
* Use for event handlers, observers, and async completion handlers.
|
|
12
|
+
*
|
|
13
|
+
* ### Example
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const onComplete: Callback<string> = (value) => console.log(value);
|
|
17
|
+
* const queue = new Set<Callback<Result<Data, Error>>>();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export type Callback<T> = (value: T) => void;
|
|
21
|
+
/**
|
|
22
|
+
* A function that receives a value and optionally returns a teardown function.
|
|
23
|
+
*
|
|
24
|
+
* Use for subscriptions or callbacks that need abort-time teardown.
|
|
25
|
+
*
|
|
26
|
+
* ### Example
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* const subscribe: CallbackWithTeardown<EventSource> = (source) => {
|
|
30
|
+
* source.start();
|
|
31
|
+
* return () => source.stop();
|
|
32
|
+
* };
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export type CallbackWithTeardown<T> = (value: T) => void | (() => void);
|
|
7
36
|
/**
|
|
8
37
|
* Checks a condition on a value and returns a boolean.
|
|
9
38
|
*
|
|
@@ -102,11 +131,6 @@ export type NullablePartial<T, NK extends keyof T = {
|
|
|
102
131
|
}[keyof T], NP = Pick<T, Exclude<keyof T, NK>> & Partial<Pick<T, NK>>> = {
|
|
103
132
|
[K in keyof NP]: NP[K];
|
|
104
133
|
};
|
|
105
|
-
/**
|
|
106
|
-
* A type alias for `never` that is used intentionally when casting is not
|
|
107
|
-
* needed and unit tests exist to ensure correctness.
|
|
108
|
-
*/
|
|
109
|
-
export type IntentionalNever = never;
|
|
110
134
|
/**
|
|
111
135
|
* String, number, bigint, boolean, undefined, null
|
|
112
136
|
*
|
|
@@ -124,6 +148,15 @@ export type Literal = string | number | bigint | boolean | undefined | null;
|
|
|
124
148
|
* - True -> boolean
|
|
125
149
|
*/
|
|
126
150
|
export type WidenLiteral<T extends Literal> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends bigint ? bigint : T;
|
|
151
|
+
/**
|
|
152
|
+
* Removes `readonly` modifier from all properties of a type.
|
|
153
|
+
*
|
|
154
|
+
* Useful for constructing immutable objects step-by-step (e.g. builder pattern)
|
|
155
|
+
* before casting them back to the readonly type.
|
|
156
|
+
*/
|
|
157
|
+
export type Mutable<T> = {
|
|
158
|
+
-readonly [P in keyof T]: T[P];
|
|
159
|
+
};
|
|
127
160
|
/**
|
|
128
161
|
* Simplify an intersection type into a single mapped type.
|
|
129
162
|
*
|
|
@@ -148,4 +181,125 @@ export type Simplify<T> = Kysely.Simplify<T>;
|
|
|
148
181
|
* unchanged.
|
|
149
182
|
*/
|
|
150
183
|
export type PartialProp<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
184
|
+
/**
|
|
185
|
+
* A value that can be awaited.
|
|
186
|
+
*
|
|
187
|
+
* Use when a function may complete synchronously or asynchronously depending on
|
|
188
|
+
* runtime conditions (e.g., cache hit vs network fetch).
|
|
189
|
+
*
|
|
190
|
+
* ### Example
|
|
191
|
+
*
|
|
192
|
+
* ```ts
|
|
193
|
+
* const getData = (id: string): Awaitable<Data> => {
|
|
194
|
+
* const cached = cache.get(id);
|
|
195
|
+
* if (cached) return cached; // Sync path
|
|
196
|
+
* return fetchData(id); // Async path
|
|
197
|
+
* };
|
|
198
|
+
*
|
|
199
|
+
* // Always works
|
|
200
|
+
* const data = await getData(id);
|
|
201
|
+
*
|
|
202
|
+
* // Or optimize for sync path
|
|
203
|
+
* const result = getData(id);
|
|
204
|
+
* const data = isPromiseLike(result) ? await result : result;
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
export type Awaitable<T> = T | PromiseLike<T>;
|
|
208
|
+
/**
|
|
209
|
+
* Type guard to check if a value is a {@link PromiseLike}.
|
|
210
|
+
*
|
|
211
|
+
* Use with {@link Awaitable} to conditionally `await` only when necessary,
|
|
212
|
+
* avoiding microtask overhead for synchronous values.
|
|
213
|
+
*
|
|
214
|
+
* ### Example
|
|
215
|
+
*
|
|
216
|
+
* ```ts
|
|
217
|
+
* const validate = (id: string): Awaitable<boolean> => {
|
|
218
|
+
* const cached = cache.get(id);
|
|
219
|
+
* if (cached !== undefined) return cached; // Sync path
|
|
220
|
+
* return fetchValidation(id); // Async path
|
|
221
|
+
* };
|
|
222
|
+
*
|
|
223
|
+
* const result = validate(id);
|
|
224
|
+
* const isValid = isPromiseLike(result) ? await result : result;
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
export declare const isPromiseLike: <T>(value: Awaitable<T>) => value is PromiseLike<T>;
|
|
228
|
+
/** Single digit 0-9. Useful for template literal type validation. */
|
|
229
|
+
export type Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
230
|
+
/** Digit 1-9. Useful for template literal type validation. */
|
|
231
|
+
export type Digit1To9 = Exclude<Digit, "0">;
|
|
232
|
+
/** Numeric string 1-6. Useful for days validation. */
|
|
233
|
+
export type Digit1To6 = "1" | "2" | "3" | "4" | "5" | "6";
|
|
234
|
+
/** Numeric string 1-23. Useful for hours validation. */
|
|
235
|
+
export type Digit1To23 = Digit1To9 | `1${Digit}` | `2${"0" | "1" | "2" | "3"}`;
|
|
236
|
+
/** Numeric string 1-51. Useful for weeks validation. */
|
|
237
|
+
export type Digit1To51 = Digit1To9 | `${"1" | "2" | "3" | "4"}${Digit}` | `5${"0" | "1"}`;
|
|
238
|
+
/** Numeric string 1-99. Useful for years validation. */
|
|
239
|
+
export type Digit1To99 = Digit1To9 | `${Digit1To9}${Digit}`;
|
|
240
|
+
/** Numeric string 1-59. Useful for minutes, seconds validation. */
|
|
241
|
+
export type Digit1To59 = Digit1To9 | `1${Digit}` | `2${Digit}` | `3${Digit}` | `4${Digit}` | `5${Digit}`;
|
|
242
|
+
/** Numeric literal 1-99. */
|
|
243
|
+
export type Int1To99 = NumberFromString<Digit1To99>;
|
|
244
|
+
/** Numeric literal 1-100. */
|
|
245
|
+
export type Int1To100 = Int1To99 | 100;
|
|
246
|
+
/**
|
|
247
|
+
* Parses a numeric literal type from a string literal.
|
|
248
|
+
*
|
|
249
|
+
* Used by {@link Int1To99}.
|
|
250
|
+
*/
|
|
251
|
+
export type NumberFromString<T extends string> = T extends `${infer N extends number}` ? N : never;
|
|
252
|
+
/** Converts a union to an intersection. */
|
|
253
|
+
export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
254
|
+
/**
|
|
255
|
+
* Removes keys from each member of a union.
|
|
256
|
+
*
|
|
257
|
+
* Use when {@link Omit} would collapse a discriminated union into a single
|
|
258
|
+
* shared shape.
|
|
259
|
+
*
|
|
260
|
+
* ### Example
|
|
261
|
+
*
|
|
262
|
+
* ```ts
|
|
263
|
+
* type Event =
|
|
264
|
+
* | { type: "a"; a: string; shared: number }
|
|
265
|
+
* | { type: "b"; b: number; shared: number };
|
|
266
|
+
*
|
|
267
|
+
* type Payload = DistributiveOmit<Event, "shared">;
|
|
268
|
+
* // { type: "a"; a: string } | { type: "b"; b: number }
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
export type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
272
|
+
/**
|
|
273
|
+
* Extracts members of a discriminated union by their `type` literal.
|
|
274
|
+
*
|
|
275
|
+
* Constrains `TType` to valid `type` values, so typos fail at the type argument
|
|
276
|
+
* instead of silently producing `never`.
|
|
277
|
+
*
|
|
278
|
+
* ### Example
|
|
279
|
+
*
|
|
280
|
+
* ```ts
|
|
281
|
+
* type Message =
|
|
282
|
+
* | { readonly type: "Create"; readonly id: string }
|
|
283
|
+
* | { readonly type: "Delete"; readonly id: string };
|
|
284
|
+
*
|
|
285
|
+
* type CreateMessage = ExtractType<Message, "Create">;
|
|
286
|
+
* // { readonly type: "Create"; readonly id: string }
|
|
287
|
+
*
|
|
288
|
+
* // Type error: "Cretae" is not a valid Message type
|
|
289
|
+
* type _Typo = ExtractType<Message, "Cretae">;
|
|
290
|
+
* ```
|
|
291
|
+
*/
|
|
292
|
+
export type ExtractType<TUnion extends {
|
|
293
|
+
readonly type: TypeName;
|
|
294
|
+
}, TType extends TUnion["type"]> = Extract<TUnion, {
|
|
295
|
+
readonly type: TType;
|
|
296
|
+
}>;
|
|
297
|
+
/**
|
|
298
|
+
* Constrains `T` to only contain keys not present in `Existing`.
|
|
299
|
+
*
|
|
300
|
+
* Use as a generic constraint to prevent overriding existing properties.
|
|
301
|
+
*/
|
|
302
|
+
export type NewKeys<T, Existing> = {
|
|
303
|
+
[K in keyof T]: K extends keyof Existing ? never : T[K];
|
|
304
|
+
};
|
|
151
305
|
//# sourceMappingURL=Types.d.ts.map
|
package/dist/src/Types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAExE;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;AAEjD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;AAEzE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,CACvD,CAAC,EAAE,CAAC,EACJ,KAAK,EAAE,MAAM,KACV,CAAC,IAAI,CAAC,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;;GAqBG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TypeScript utility types.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
import * as Kysely from "kysely";
|
|
7
|
+
/**
|
|
8
|
+
* Type guard to check if a value is a {@link PromiseLike}.
|
|
9
|
+
*
|
|
10
|
+
* Use with {@link Awaitable} to conditionally `await` only when necessary,
|
|
11
|
+
* avoiding microtask overhead for synchronous values.
|
|
12
|
+
*
|
|
13
|
+
* ### Example
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const validate = (id: string): Awaitable<boolean> => {
|
|
17
|
+
* const cached = cache.get(id);
|
|
18
|
+
* if (cached !== undefined) return cached; // Sync path
|
|
19
|
+
* return fetchValidation(id); // Async path
|
|
20
|
+
* };
|
|
21
|
+
*
|
|
22
|
+
* const result = validate(id);
|
|
23
|
+
* const isValid = isPromiseLike(result) ? await result : result;
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export const isPromiseLike = (value) => typeof value?.then === "function";
|
package/dist/src/WebSocket.d.ts
CHANGED
|
@@ -1,7 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* WebSocket with auto-reconnect.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { Result } from "./Result.js";
|
|
7
|
+
import type { Schedule } from "./Schedule.js";
|
|
8
|
+
import type { RetryError, Task } from "./Task.js";
|
|
9
|
+
import type { Millis } from "./Time.js";
|
|
10
|
+
import { type Typed } from "./Type.js";
|
|
11
|
+
/**
|
|
12
|
+
* WebSocket with auto-reconnect.
|
|
13
|
+
*
|
|
14
|
+
* The API mirrors native
|
|
15
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/WebSocket | WebSocket}
|
|
16
|
+
* but retries connections indefinitely by default. This design accounts for the
|
|
17
|
+
* fact that browser and React Native online/offline detection APIs are
|
|
18
|
+
* unreliable — they may report online status incorrectly, so the only reliable
|
|
19
|
+
* approach is to keep attempting reconnection.
|
|
20
|
+
*
|
|
21
|
+
* Created via {@link createWebSocket} which returns a {@link Task}.
|
|
22
|
+
*
|
|
23
|
+
* Disposing the WebSocket closes the connection.
|
|
24
|
+
*
|
|
25
|
+
* ## How Binary Messages Work
|
|
26
|
+
*
|
|
27
|
+
* The Server Chooses the Message Type:
|
|
28
|
+
*
|
|
29
|
+
* - Text (0x1) → Sent as UTF-8 encoded text (always received as a string in the
|
|
30
|
+
* browser).
|
|
31
|
+
* - Binary (0x2) → Sent as raw binary data (received as a Blob or ArrayBuffer,
|
|
32
|
+
* depending on binaryType).
|
|
33
|
+
*
|
|
34
|
+
* The Client's binaryType Controls How Binary Data is Processed:
|
|
35
|
+
*
|
|
36
|
+
* - If the server sends a text frame (0x1), the browser always delivers
|
|
37
|
+
* event.data as a string, regardless of binaryType.
|
|
38
|
+
* - If the server sends a binary frame (0x2), the browser delivers event.data as:
|
|
39
|
+
*
|
|
40
|
+
* - A Blob (default: "blob")
|
|
41
|
+
* - An ArrayBuffer ("arraybuffer")
|
|
42
|
+
*
|
|
43
|
+
* ### Example
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* const ws = await run(
|
|
47
|
+
* createWebSocket("wss://example.com", {
|
|
48
|
+
* onMessage: (data) => console.log("Received:", data),
|
|
49
|
+
* onOpen: () => console.log("Connected"),
|
|
50
|
+
* onClose: () => console.log("Disconnected"),
|
|
51
|
+
* }),
|
|
52
|
+
* );
|
|
53
|
+
* if (ws.ok) {
|
|
54
|
+
* ws.value.send("Hello");
|
|
55
|
+
* // Later: await ws.value[Symbol.asyncDispose]();
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export interface WebSocket extends AsyncDisposable {
|
|
5
60
|
/**
|
|
6
61
|
* Send data through the WebSocket connection. Returns {@link Result} with an
|
|
7
62
|
* error if the data couldn't be sent.
|
|
@@ -17,94 +72,94 @@ export interface WebSocket extends Disposable {
|
|
|
17
72
|
*
|
|
18
73
|
* https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send
|
|
19
74
|
*/
|
|
20
|
-
export interface WebSocketSendError {
|
|
21
|
-
readonly type: "WebSocketSendError";
|
|
75
|
+
export interface WebSocketSendError extends Typed<"WebSocketSendError"> {
|
|
22
76
|
}
|
|
23
77
|
/** WebSocket connection states. */
|
|
24
78
|
export type WebSocketReadyState = "connecting" | "open" | "closing" | "closed";
|
|
25
|
-
|
|
79
|
+
/** {@link Task} that creates a {@link WebSocket}. */
|
|
80
|
+
export type CreateWebSocket = (url: string, options?: WebSocketOptions) => Task<WebSocket>;
|
|
26
81
|
export interface CreateWebSocketDep {
|
|
27
82
|
readonly createWebSocket: CreateWebSocket;
|
|
28
83
|
}
|
|
29
|
-
/** Options for creating {@link WebSocket} */
|
|
84
|
+
/** Options for creating {@link WebSocket}. */
|
|
30
85
|
export interface WebSocketOptions {
|
|
31
86
|
/** Protocol(s) to use with the WebSocket connection. */
|
|
32
|
-
protocols?: string |
|
|
87
|
+
readonly protocols?: string | ReadonlyArray<string>;
|
|
33
88
|
/** Sets the binary type for the data being received. */
|
|
34
|
-
binaryType?: "blob" | "arraybuffer";
|
|
89
|
+
readonly binaryType?: "blob" | "arraybuffer";
|
|
35
90
|
/** Callback when the connection is established. */
|
|
36
|
-
onOpen?: () => void;
|
|
91
|
+
readonly onOpen?: () => void;
|
|
37
92
|
/** Callback when an error occurs. */
|
|
38
|
-
onError?: (error: WebSocketError) => void;
|
|
93
|
+
readonly onError?: (error: WebSocketError) => void;
|
|
39
94
|
/** Callback when the connection is closed. */
|
|
40
|
-
onClose?: (event: CloseEvent) => void;
|
|
95
|
+
readonly onClose?: (event: CloseEvent) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Determines whether a closed connection should trigger a retry.
|
|
98
|
+
*
|
|
99
|
+
* Return false to stop retrying, for example on auth errors or maintenance.
|
|
100
|
+
*/
|
|
101
|
+
readonly shouldRetryOnClose?: (event: CloseEvent) => boolean;
|
|
41
102
|
/** Callback when message data is received. */
|
|
42
|
-
onMessage?: (data: string | ArrayBuffer | Blob) => void;
|
|
43
|
-
/**
|
|
44
|
-
|
|
103
|
+
readonly onMessage?: (data: string | ArrayBuffer | Blob) => void;
|
|
104
|
+
/**
|
|
105
|
+
* Retry schedule for reconnection. Defaults to:
|
|
106
|
+
*
|
|
107
|
+
* ```ts
|
|
108
|
+
* // A jittered, capped, unlimited exponential backoff.
|
|
109
|
+
* jitter(1)(maxDelay("30s")(exponential("100ms")));
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
readonly schedule?: Schedule<Millis, WebSocketRetryError>;
|
|
45
113
|
/**
|
|
46
114
|
* For custom WebSocket implementations.
|
|
47
115
|
*
|
|
48
|
-
* This
|
|
116
|
+
* This supports blob:
|
|
49
117
|
*
|
|
50
118
|
* https://github.com/callstackincubator/react-native-fast-io
|
|
51
119
|
*/
|
|
52
|
-
WebSocketConstructor?: typeof globalThis.WebSocket;
|
|
120
|
+
readonly WebSocketConstructor?: typeof globalThis.WebSocket;
|
|
53
121
|
}
|
|
54
122
|
export type WebSocketError = WebSocketConnectError | WebSocketConnectionError | RetryError<WebSocketRetryError>;
|
|
55
123
|
/**
|
|
56
124
|
* An error that occurs when a connection cannot be established due to a network
|
|
57
|
-
* error.
|
|
125
|
+
* error. Fires before `onclose`.
|
|
58
126
|
*/
|
|
59
|
-
export interface WebSocketConnectError {
|
|
60
|
-
readonly type: "WebSocketConnectError";
|
|
127
|
+
export interface WebSocketConnectError extends Typed<"WebSocketConnectError"> {
|
|
61
128
|
readonly event: Event;
|
|
62
129
|
}
|
|
63
130
|
/**
|
|
64
|
-
* An error that occurs when
|
|
65
|
-
* failure to send
|
|
131
|
+
* An error that occurs when an established connection encounters an issue
|
|
132
|
+
* (e.g., failure to send data). Fires before `onclose`.
|
|
133
|
+
*
|
|
134
|
+
* Note: Only Node.js and WebKit fire this error on abrupt server termination.
|
|
135
|
+
* Chromium and Firefox only fire `onclose` without a preceding error event.
|
|
66
136
|
*
|
|
67
137
|
* https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event
|
|
68
138
|
*/
|
|
69
|
-
export interface WebSocketConnectionError {
|
|
70
|
-
readonly type: "WebSocketConnectionError";
|
|
139
|
+
export interface WebSocketConnectionError extends Typed<"WebSocketConnectionError"> {
|
|
71
140
|
readonly event: Event;
|
|
72
141
|
}
|
|
73
142
|
export type WebSocketRetryError = WebSocketConnectError | WebSocketConnectionCloseError;
|
|
74
|
-
|
|
75
|
-
|
|
143
|
+
/** An error that occurs when the connection is closed by the server. */
|
|
144
|
+
export interface WebSocketConnectionCloseError extends Typed<"WebSocketConnectionCloseError"> {
|
|
76
145
|
readonly event: CloseEvent;
|
|
77
146
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Create a new {@link WebSocket}.
|
|
80
|
-
*
|
|
81
|
-
* The default behavior is that WebSocket tries to reconnect repeatedly in case
|
|
82
|
-
* the application is offline, because online events (both web and native) are
|
|
83
|
-
* not reliable. Once it connects and the connection is closed, it tries to
|
|
84
|
-
* reconnect again. Retrying the connection can be controlled using the
|
|
85
|
-
* retryOptions retryable predicate.
|
|
86
|
-
*
|
|
87
|
-
* ### How Binary Messages Work in WebSockets
|
|
88
|
-
*
|
|
89
|
-
* The Server Chooses the Message Type:
|
|
90
|
-
*
|
|
91
|
-
* - Text (0x1) → Sent as UTF-8 encoded text (always received as a string in the
|
|
92
|
-
* browser).
|
|
93
|
-
* - Binary (0x2) → Sent as raw binary data (received as a Blob or ArrayBuffer,
|
|
94
|
-
* depending on binaryType).
|
|
95
|
-
*
|
|
96
|
-
* The Client's binaryType Controls How Binary Data is Processed:
|
|
97
|
-
*
|
|
98
|
-
* - If the server sends a text frame (0x1), the browser always delivers
|
|
99
|
-
* event.data as a string, regardless of binaryType.
|
|
100
|
-
* - If the server sends a binary frame (0x2), the browser delivers event.data as:
|
|
101
|
-
*
|
|
102
|
-
* - A Blob (default: "blob")
|
|
103
|
-
* - An ArrayBuffer ("arraybuffer")
|
|
104
|
-
*
|
|
105
|
-
* ### Example
|
|
106
|
-
*
|
|
107
|
-
* TODO:
|
|
108
|
-
*/
|
|
147
|
+
/** Create a new {@link WebSocket}. */
|
|
109
148
|
export declare const createWebSocket: CreateWebSocket;
|
|
149
|
+
/** Creates a deterministic in-memory {@link CreateWebSocket} for testing. */
|
|
150
|
+
export interface TestCreateWebSocket extends CreateWebSocket {
|
|
151
|
+
readonly createdUrls: Array<string>;
|
|
152
|
+
readonly sentMessages: Array<{
|
|
153
|
+
readonly url: string;
|
|
154
|
+
readonly data: string | ArrayBufferLike | Blob | ArrayBufferView;
|
|
155
|
+
}>;
|
|
156
|
+
readonly message: (url: string, data: string | ArrayBuffer | Blob) => void;
|
|
157
|
+
readonly open: (url: string) => void;
|
|
158
|
+
}
|
|
159
|
+
export declare const testCreateWebSocket: (options?: {
|
|
160
|
+
/** Throw immediately when a socket is created. */
|
|
161
|
+
readonly throwOnCreate?: boolean;
|
|
162
|
+
/** Initial open state of created sockets. Defaults to true. */
|
|
163
|
+
readonly isOpen?: boolean;
|
|
164
|
+
}) => TestCreateWebSocket;
|
|
110
165
|
//# sourceMappingURL=WebSocket.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebSocket.d.ts","sourceRoot":"","sources":["../../src/WebSocket.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WebSocket.d.ts","sourceRoot":"","sources":["../../src/WebSocket.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAU,KAAK,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