@northtalk/ts 0.0.0-stage → 0.2.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.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -2
  3. package/UNICODE-LICENSE.txt +39 -0
  4. package/base64-DORMd3Hv.js +6621 -0
  5. package/binary-value-CEmh60GC.d.ts +15 -0
  6. package/capabilities-CH0FkRMq.js +1301 -0
  7. package/checker-Dc1jl2WH.js +6657 -0
  8. package/core-DptnvQT9.d.ts +14 -0
  9. package/debug-CQBxKnJB.d.ts +3065 -0
  10. package/debug.d.ts +3 -0
  11. package/debug.js +2 -0
  12. package/driver.d.ts +41 -0
  13. package/driver.js +152 -0
  14. package/encoding-nlrpj-Pb.js +99 -0
  15. package/engine-BGaJ9dAk.js +326 -0
  16. package/engine-vbYInVYF.d.ts +86 -0
  17. package/errors-LYJZ_c8h.js +3735 -0
  18. package/group-B742gg4T.js +10170 -0
  19. package/http-capability-CSTkw1Yt.js +728 -0
  20. package/http.d.ts +59 -0
  21. package/http.js +465 -0
  22. package/index.d.ts +651 -0
  23. package/index.js +44 -0
  24. package/manifest-BscyH_rW.d.ts +70 -0
  25. package/manifest-DjsxDSuB.js +129 -0
  26. package/message-layer.d.ts +12 -0
  27. package/message-layer.js +4 -0
  28. package/notify.d.ts +3 -0
  29. package/notify.js +2 -0
  30. package/objects-DJ3QtCCs.d.ts +640 -0
  31. package/objects-Db7IB5vQ.js +91 -0
  32. package/operation-promises-EgZXG5N_.js +23 -0
  33. package/package.json +70 -4
  34. package/readers-BFPuosPk.d.ts +25 -0
  35. package/readers-CjJHKHvH.js +482 -0
  36. package/request-pump-binary-DdY3X-yl.js +2246 -0
  37. package/router--71qvxtY.js +343 -0
  38. package/router-Zhrw5l__.d.ts +55 -0
  39. package/session.d.ts +9 -0
  40. package/session.js +3510 -0
  41. package/setup.d.ts +3 -0
  42. package/setup.js +193 -0
  43. package/sha256-B_kyYw3Z.js +124 -0
  44. package/sqlite.d.ts +74 -0
  45. package/sqlite.js +529 -0
  46. package/store-capability-OZp4hXmj.js +390 -0
  47. package/store-hJrRULMx.js +60 -0
  48. package/store.d.ts +21 -0
  49. package/store.js +4 -0
  50. package/user-capability-BK4Asg7D.js +276 -0
  51. package/wasm.d.ts +243 -0
  52. package/wasm.js +1737 -0
@@ -0,0 +1,86 @@
1
+
2
+ import { kt as GrantContext, nn as StoreImpl, q as Value, wt as EffectResult, yt as Call, zt as SegmentContext } from "./debug-CQBxKnJB.js";
3
+ import { i as WatchLimits, n as RouterOptions, t as NotificationRouter } from "./router-Zhrw5l__.js";
4
+ //#region src/store/engine.d.ts
5
+ /** A Store's limits, each counted by logical size (chapter 8). */
6
+ type StoreQuotas = {
7
+ /** The most keys it holds. */
8
+ keys: number;
9
+ /** The most its keys and values may total. */
10
+ size: number;
11
+ /** The largest value. */
12
+ value: number;
13
+ };
14
+ /** The Session Store's quotas (chapter 12, The Session Store). */
15
+ declare const sessionQuotas: StoreQuotas;
16
+ /** The Session Store's notification limits (Store Notifications, The Session Host). */
17
+ declare const sessionWatchLimits: WatchLimits;
18
+ /** Where Stores' committed contents are kept, by Store name. */
19
+ type StoreBackend = {
20
+ /** Every key and value of a Store, read once, when the Store is first used. */
21
+ load(store: string): Iterable<readonly [string, Value]>;
22
+ /**
23
+ * Applies one commit's changes to every Store it wrote at once: by Store
24
+ * name, each key's new value, with Nothing deleting it. Throws, leaving
25
+ * every Store unchanged, if it can't; throws `StoreStateUnknownError` if
26
+ * it can't tell whether some Stores changed.
27
+ */
28
+ save(changes: ReadonlyMap<string, ReadonlyMap<string, Value>>): void;
29
+ };
30
+ /** A backend's commit that may have changed some of its Stores. */
31
+ declare class StoreStateUnknownError extends Error {
32
+ name: string;
33
+ }
34
+ /** Why a Host command on a Store's contents was refused. */
35
+ declare class StoreContentsError extends Error {
36
+ name: string;
37
+ }
38
+ /** A Store's contents as one JSON object, in key order, with no white space. */
39
+ declare const encodeContents: (entries: readonly (readonly [string, Value])[]) => string;
40
+ /** Contents written by `encodeContents`. Throws on anything else. */
41
+ declare const decodeContents: (source: string) => [string, Value][];
42
+ /** Every Store a Host keeps through one backend, as one `StoreImpl`. */
43
+ declare class Stores implements StoreImpl {
44
+ private readonly backend;
45
+ readonly quotas: StoreQuotas;
46
+ readonly router: NotificationRouter;
47
+ private readonly revisions;
48
+ private readonly contents;
49
+ private readonly segments;
50
+ private readonly groups;
51
+ private nextGroup;
52
+ constructor(backend: StoreBackend, quotas: StoreQuotas, watchLimits?: WatchLimits, admitted?: RouterOptions['admitted']);
53
+ watch(call: Call<string>, name: string, prefix: string, message: string): void;
54
+ unwatch(call: Call<string>, name: string): void;
55
+ release(context: GrantContext<string>): void;
56
+ begin(context: SegmentContext<string>): EffectResult;
57
+ commit(context: SegmentContext<string>): EffectResult;
58
+ rollback(context: SegmentContext<string>): EffectResult;
59
+ get(call: Call<string>, key: string, fallback?: Value): Value;
60
+ keys(call: Call<string>, prefix?: string): Value;
61
+ set(call: Call<string>, key: string, value: Value): void;
62
+ delete(call: Call<string>, key: string): void;
63
+ swap(call: Call<string>, key: string, expected: Value, replacement: Value): boolean;
64
+ increment(call: Call<string>, key: string, by?: Value): Value;
65
+ /** A Store's committed contents, in key order. */
66
+ entries(store: string): [string, Value][];
67
+ /** Replaces a Store's contents, between Pumps. */
68
+ replace(store: string, entries: readonly (readonly [string, Value])[]): void;
69
+ /** Empties a Store, between Pumps. */
70
+ clear(store: string): void;
71
+ private bump;
72
+ private committed;
73
+ private put;
74
+ private changesTo;
75
+ private segmentKey;
76
+ private own;
77
+ private others;
78
+ private segment;
79
+ private seen;
80
+ private storable;
81
+ private unreserved;
82
+ private write;
83
+ private grows;
84
+ }
85
+ //#endregion
86
+ export { Stores as a, sessionQuotas as c, StoreStateUnknownError as i, sessionWatchLimits as l, StoreContentsError as n, decodeContents as o, StoreQuotas as r, encodeContents as s, StoreBackend as t };