brumate 0.8.1 → 0.9.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 (122) hide show
  1. package/dist/{boot-DQuAhAd5.d.ts → boot-ej-9NRT3.d.ts} +20 -2
  2. package/dist/cli.js +88 -82
  3. package/dist/cli.js.map +1 -1
  4. package/dist/{client-CwVcmymi.js → client-B-ww-PQ7.js} +304 -48
  5. package/dist/client-B-ww-PQ7.js.map +1 -0
  6. package/dist/{client-4eabQtYJ.d.ts → client-Do6IBIhI.d.ts} +35 -9
  7. package/dist/{defer-BaXWydb0.js → defer-JD2FK9mV.js} +5 -3
  8. package/dist/defer-JD2FK9mV.js.map +1 -0
  9. package/dist/{devtools-calls-DGW6nLZ2.js → devtools-calls-DCjuSkim.js} +3 -3
  10. package/dist/{devtools-calls-DGW6nLZ2.js.map → devtools-calls-DCjuSkim.js.map} +1 -1
  11. package/dist/{devtools-panel-Cq8LpsyW.js → devtools-panel-DLeWTPhU.js} +4 -4
  12. package/dist/{devtools-panel-Cq8LpsyW.js.map → devtools-panel-DLeWTPhU.js.map} +1 -1
  13. package/dist/{devtools-CMuj12yR.js → devtools-tuq7ATGN.js} +10 -7
  14. package/dist/devtools-tuq7ATGN.js.map +1 -0
  15. package/dist/{error-catalog-DakxjSgj.js → error-catalog-BBWB7w-E.js} +11 -4
  16. package/dist/error-catalog-BBWB7w-E.js.map +1 -0
  17. package/dist/{error-catalog-VxLbz-6p.js → error-catalog-CbmQqfat.js} +1 -1
  18. package/dist/{events-LgLdp1R7.js → events-BDVITj3P.js} +3 -5
  19. package/dist/events-BDVITj3P.js.map +1 -0
  20. package/dist/{features-DwMYKBIC.js → features-Cte5aj20.js} +8 -2
  21. package/dist/features-Cte5aj20.js.map +1 -0
  22. package/dist/{files-DXS8RAtZ.js → files-Bz0lAQzD.js} +2 -2
  23. package/dist/{files-DXS8RAtZ.js.map → files-Bz0lAQzD.js.map} +1 -1
  24. package/dist/{html-Cf5uKhLs.js → html-BYuHDvxy.js} +10 -3
  25. package/dist/html-BYuHDvxy.js.map +1 -0
  26. package/dist/index.d.ts +71 -19
  27. package/dist/index.js +3 -3
  28. package/dist/{inspect-B5AoHh5O.js → inspect-fpaBJ5pm.js} +1247 -62
  29. package/dist/inspect-fpaBJ5pm.js.map +1 -0
  30. package/dist/{loader-CTeT6ie9.js → loader-DMxuZ6He.js} +14 -6
  31. package/dist/loader-DMxuZ6He.js.map +1 -0
  32. package/dist/{navigate-Bj73X4ZS.js → navigate-C5PjwYMh.js} +101 -20
  33. package/dist/navigate-C5PjwYMh.js.map +1 -0
  34. package/dist/{produce-CLABZ8k2.d.ts → produce-BDkCsGH7.d.ts} +3 -3
  35. package/dist/{rpc-kVB0Ujdx.js → rpc-DOdrekhP.js} +23 -13
  36. package/dist/rpc-DOdrekhP.js.map +1 -0
  37. package/dist/runtime/bundles.d.ts +1 -1
  38. package/dist/runtime/bundles.js +6 -2
  39. package/dist/runtime/bundles.js.map +1 -1
  40. package/dist/runtime/client.d.ts +4 -3
  41. package/dist/runtime/client.js +5 -5
  42. package/dist/runtime/devtools.d.ts +3 -1
  43. package/dist/runtime/devtools.js +1 -1
  44. package/dist/runtime/events.js +1 -1
  45. package/dist/runtime/hot.d.ts +1 -1
  46. package/dist/runtime/html.js +1 -1
  47. package/dist/runtime/loader.d.ts +2 -2
  48. package/dist/runtime/loader.js +2 -2
  49. package/dist/runtime/otel.d.ts +18 -0
  50. package/dist/runtime/otel.js +127 -0
  51. package/dist/runtime/otel.js.map +1 -0
  52. package/dist/runtime/server.d.ts +4 -3
  53. package/dist/runtime/server.js +5 -5
  54. package/dist/runtime/signals.d.ts +2 -2
  55. package/dist/runtime/signals.js +4 -1
  56. package/dist/runtime/signals.js.map +1 -1
  57. package/dist/runtime/static-loader.d.ts +2 -2
  58. package/dist/runtime/static-loader.js +1 -1
  59. package/dist/runtime/store.d.ts +2 -2
  60. package/dist/runtime/store.js +1 -1
  61. package/dist/runtime/testing.d.ts +2 -2
  62. package/dist/runtime/testing.js +2 -2
  63. package/dist/search-params-qGERTLi3.js +382 -0
  64. package/dist/search-params-qGERTLi3.js.map +1 -0
  65. package/dist/{serial-ribg9NAj.js → serial-B2AJ9VGx.js} +1 -1
  66. package/dist/{serial-ioa17MuY.js → serial-Cj6pDGOq.js} +6 -6
  67. package/dist/{serial-ioa17MuY.js.map → serial-Cj6pDGOq.js.map} +1 -1
  68. package/dist/{server-DesBZv5g.d.ts → server-2-LS_KFo.d.ts} +125 -9
  69. package/dist/{server-BUuf7XPZ.js → server-CRGZMWnK.js} +545 -236
  70. package/dist/server-CRGZMWnK.js.map +1 -0
  71. package/dist/{shared-CX_YacDm.js → shared-CUBWrbiM.js} +4 -4
  72. package/dist/{shared-CX_YacDm.js.map → shared-CUBWrbiM.js.map} +1 -1
  73. package/dist/sheets-B9Zr50mf.js +105 -0
  74. package/dist/sheets-B9Zr50mf.js.map +1 -0
  75. package/dist/{signals-7VVD9C_H.d.ts → signals-BgsJK-uT.d.ts} +16 -6
  76. package/dist/{static-loader-BM0-wdIc.js → static-loader-BDBtWsdg.js} +107 -19
  77. package/dist/static-loader-BDBtWsdg.js.map +1 -0
  78. package/dist/{static-loader-BSAyFqG0.d.ts → static-loader-CAFn6p0l.d.ts} +2 -2
  79. package/dist/{store-9_oa0HG1.d.ts → store-BwWg-Iei.d.ts} +79 -2
  80. package/dist/store-DNr24Z8L.js +950 -0
  81. package/dist/store-DNr24Z8L.js.map +1 -0
  82. package/dist/{stream-read-BTsYstJY.js → stream-read-CiLDH60b.js} +2 -2
  83. package/dist/{stream-read-BTsYstJY.js.map → stream-read-CiLDH60b.js.map} +1 -1
  84. package/dist/{stream-read-Dek3HnqO.js → stream-read-DVoregpA.js} +1 -1
  85. package/dist/trace-DT7RGRAV.d.ts +52 -0
  86. package/dist/trace-browser-C7MFMove.js +170 -0
  87. package/dist/trace-browser-C7MFMove.js.map +1 -0
  88. package/dist/trace-flag-Dy267snx.js +7 -0
  89. package/dist/trace-flag-Dy267snx.js.map +1 -0
  90. package/dist/{trusted-g_zUJbh2.js → trusted-Bmwg4_hf.js} +12 -5
  91. package/dist/trusted-Bmwg4_hf.js.map +1 -0
  92. package/dist/view-transitions-BpnVwtS4.js +141 -0
  93. package/dist/view-transitions-BpnVwtS4.js.map +1 -0
  94. package/dist/vite.d.ts +8 -1
  95. package/dist/vite.js +356 -46
  96. package/dist/vite.js.map +1 -1
  97. package/elements.d.ts +8 -0
  98. package/package.json +13 -1
  99. package/skills/brumate/SKILL.md +9 -5
  100. package/skills/brumate/references/errors.md +95 -14
  101. package/skills/brumate/references/events.md +27 -1
  102. package/skills/brumate/references/signals.md +4 -4
  103. package/skills/brumate/references/state.md +79 -4
  104. package/skills/brumate/references/syntax.md +58 -9
  105. package/dist/client-CwVcmymi.js.map +0 -1
  106. package/dist/defer-BaXWydb0.js.map +0 -1
  107. package/dist/devtools-CMuj12yR.js.map +0 -1
  108. package/dist/error-catalog-DakxjSgj.js.map +0 -1
  109. package/dist/events-LgLdp1R7.js.map +0 -1
  110. package/dist/features-DwMYKBIC.js.map +0 -1
  111. package/dist/html-Cf5uKhLs.js.map +0 -1
  112. package/dist/inspect-B5AoHh5O.js.map +0 -1
  113. package/dist/loader-CTeT6ie9.js.map +0 -1
  114. package/dist/navigate-Bj73X4ZS.js.map +0 -1
  115. package/dist/rpc-kVB0Ujdx.js.map +0 -1
  116. package/dist/search-params-Wg-0FsMj.js +0 -148
  117. package/dist/search-params-Wg-0FsMj.js.map +0 -1
  118. package/dist/server-BUuf7XPZ.js.map +0 -1
  119. package/dist/static-loader-BM0-wdIc.js.map +0 -1
  120. package/dist/store-Cy4EEyZ7.js +0 -439
  121. package/dist/store-Cy4EEyZ7.js.map +0 -1
  122. package/dist/trusted-g_zUJbh2.js.map +0 -1
@@ -79,6 +79,83 @@ type StoresValues<S> = S extends StoreLike<infer U> ? U : { [K in keyof S]: S[K]
79
79
  */
80
80
  declare function derived<S extends Stores, T>(sources: S, fn: (values: StoresValues<S>, set: (value: T) => void, update: (change: (value: T) => T) => void) => (() => void) | void, initial?: T): StoreLike<T>;
81
81
  declare function derived<S extends Stores, T>(sources: S, fn: (values: StoresValues<S>) => T, initial?: T): StoreLike<T>;
82
+ /** The key of a store that holds the error of a run, which `$store` reads again on each notice. */
83
+ declare const HOLDS: unique symbol;
84
+ /**
85
+ * The key of the pending state of a store, which a store of a module can hold, as a memo that
86
+ * loads is pending. `$isPending` and `$resolve` read it in a component.
87
+ */
88
+ declare const PENDING: unique symbol;
89
+ /** The pending state: `n` is true while the store waits, and `q` holds the functions that hear of it. */
90
+ interface Pendable {
91
+ n?: boolean;
92
+ q?: Set<(pending: boolean) => void>;
93
+ }
94
+ /** The pending state of a store, when it has one. */
95
+ declare function pendingOf(store: unknown): Pendable | undefined;
96
+ /** True on the server, or in a test while server code runs. */
97
+ declare function onServer(): boolean;
98
+ /** Thrown by a read of a memo of a module whose first value still loads. It carries the load. */
99
+ declare class Waiting extends Error {
100
+ /** The load, which settles when the memo has its value or its error. */
101
+ readonly load: Promise<unknown>;
102
+ constructor(load: Promise<unknown>);
103
+ }
104
+ /** The store that a component that imports a memo of a module reads with `$store`. */
105
+ interface MemoFace extends StoreLike<unknown> {
106
+ /** The value that the server rendered, which the browser takes on resume. */
107
+ s(value: unknown): void;
108
+ [HOLDS]: true;
109
+ }
110
+ /** The options of the forms other than `$memo`. */
111
+ interface MemoOptions<T> {
112
+ /** `$gate`: keeps the value while a subscriber holds the store and this returns false. */
113
+ g?: (prev: T, next: T) => boolean;
114
+ /** `$debounced` and `$throttled`: the wait in milliseconds, in the browser. */
115
+ m?: number;
116
+ /** `$throttled`: at most one value per wait, in place of the value after the last change. */
117
+ t?: boolean;
118
+ /** The names of the sources, which the page state sends for a value that loaded. */
119
+ n?: string[];
120
+ }
121
+ /** The store of a memo of a module. */
122
+ interface MemoStore<T> extends StoreLike<T> {
123
+ /**
124
+ * The store that a component that imports the memo reads with `$store`. On the server it gives
125
+ * the value, or a promise of it when the value loads, which the page state sends. In the browser
126
+ * it takes that value on resume, and sends on each change, so the memo of the importer computes
127
+ * again.
128
+ */
129
+ i: MemoFace;
130
+ /** The value, or a promise of it while the memo loads. Throws the error of the memo. */
131
+ p(): unknown;
132
+ /** Follows the sources without computing, for a memo that reads this one. */
133
+ f(listener: (value: T) => void): () => void;
134
+ /** An object that changes with each value or error; brought up to date first, unless `raw`. */
135
+ t(raw?: boolean): object;
136
+ /** True when the value loads, or a memo that it reads loads. */
137
+ a(): boolean;
138
+ /** The values of the sources by name, through the memos that it reads, without computing. */
139
+ r(): Record<string, unknown>;
140
+ /** The number of renders of the server that the store holds, which a test reads. */
141
+ h(): number;
142
+ /** The listeners of the value, so a store that reads this one computes after them. */
143
+ l: Set<(value: T) => void>;
144
+ /** The number of derived stores below it. */
145
+ d: number;
146
+ [PENDING]: Pendable;
147
+ [HOLDS]: true;
148
+ }
149
+ /**
150
+ * The store of `$memo(expr)` at the top level of a module, and of `$gate`, `$debounced` and
151
+ * `$throttled` with `options`. It computes when it is read, and again when a source changes: while
152
+ * it has subscribers, at once, and otherwise at the next read, which compares the sources. A
153
+ * promise or an async iterable loads: a read gives the last value, and `p` the load, and only the
154
+ * latest run is written. A throw or a rejection is held until the memo computes again; on the
155
+ * server only for the renders that read that run. A memo that reads one with no value yet waits for
156
+ * it.
157
+ */
158
+ declare function memoStore<S extends Stores, T>(sources: S, fn: (values: StoresValues<S>) => T | PromiseLike<T> | AsyncIterable<T>, options?: MemoOptions<T>): MemoStore<T>;
82
159
  /** What `bridge` takes. */
83
160
  interface BridgeOptions<S, T> {
84
161
  /**
@@ -180,5 +257,5 @@ declare class Bridged<S, T> implements BridgedStore<S, T> {
180
257
  private make;
181
258
  }
182
259
  //#endregion
183
- export { setBridgeLoader as C, sentForeignStore as S, isForeignStore as _, Store as a, sameData as b, Stores as c, canSet as d, derived as f, isContract as g, isContext as h, BridgedStore as i, StoresValues as l, isBridged as m, BridgeOptions as n, StoreLike as o, findStored as p, Bridged as r, StoreOrigin as s, Bridge as t, bridge as u, isStore as v, store as w, sendStore as x, nameBridge as y };
184
- //# sourceMappingURL=store-9_oa0HG1.d.ts.map
260
+ export { sameData as A, isContract as C, nameBridge as D, memoStore as E, sentForeignStore as M, setBridgeLoader as N, onServer as O, store as P, isContext as S, isStore as T, bridge as _, HOLDS as a, findStored as b, MemoStore as c, Store as d, StoreLike as f, Waiting as g, StoresValues as h, BridgedStore as i, sendStore as j, pendingOf as k, PENDING as l, Stores as m, BridgeOptions as n, MemoFace as o, StoreOrigin as p, Bridged as r, MemoOptions as s, Bridge as t, Pendable as u, canSet as v, isForeignStore as w, isBridged as x, derived as y };
261
+ //# sourceMappingURL=store-BwWg-Iei.d.ts.map