@effect/platform-browser 4.0.0-beta.70 → 4.0.0-beta.72

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 (91) hide show
  1. package/dist/BrowserCrypto.d.ts +67 -4
  2. package/dist/BrowserCrypto.d.ts.map +1 -1
  3. package/dist/BrowserCrypto.js +67 -4
  4. package/dist/BrowserCrypto.js.map +1 -1
  5. package/dist/BrowserHttpClient.d.ts +16 -3
  6. package/dist/BrowserHttpClient.d.ts.map +1 -1
  7. package/dist/BrowserHttpClient.js +16 -3
  8. package/dist/BrowserHttpClient.js.map +1 -1
  9. package/dist/BrowserKeyValueStore.d.ts +20 -0
  10. package/dist/BrowserKeyValueStore.d.ts.map +1 -1
  11. package/dist/BrowserKeyValueStore.js +70 -15
  12. package/dist/BrowserKeyValueStore.js.map +1 -1
  13. package/dist/BrowserPersistence.d.ts +19 -0
  14. package/dist/BrowserPersistence.d.ts.map +1 -1
  15. package/dist/BrowserPersistence.js +19 -0
  16. package/dist/BrowserPersistence.js.map +1 -1
  17. package/dist/BrowserRuntime.d.ts +48 -0
  18. package/dist/BrowserRuntime.d.ts.map +1 -1
  19. package/dist/BrowserRuntime.js +16 -0
  20. package/dist/BrowserRuntime.js.map +1 -1
  21. package/dist/BrowserSocket.d.ts +55 -22
  22. package/dist/BrowserSocket.d.ts.map +1 -1
  23. package/dist/BrowserSocket.js +55 -22
  24. package/dist/BrowserSocket.js.map +1 -1
  25. package/dist/BrowserStream.d.ts +36 -21
  26. package/dist/BrowserStream.d.ts.map +1 -1
  27. package/dist/BrowserStream.js +36 -21
  28. package/dist/BrowserStream.js.map +1 -1
  29. package/dist/BrowserWorker.d.ts +17 -0
  30. package/dist/BrowserWorker.d.ts.map +1 -1
  31. package/dist/BrowserWorker.js +50 -18
  32. package/dist/BrowserWorker.js.map +1 -1
  33. package/dist/BrowserWorkerRunner.d.ts +19 -0
  34. package/dist/BrowserWorkerRunner.d.ts.map +1 -1
  35. package/dist/BrowserWorkerRunner.js +45 -14
  36. package/dist/BrowserWorkerRunner.js.map +1 -1
  37. package/dist/Clipboard.d.ts +55 -18
  38. package/dist/Clipboard.d.ts.map +1 -1
  39. package/dist/Clipboard.js +39 -15
  40. package/dist/Clipboard.js.map +1 -1
  41. package/dist/Geolocation.d.ts +63 -19
  42. package/dist/Geolocation.d.ts.map +1 -1
  43. package/dist/Geolocation.js +42 -18
  44. package/dist/Geolocation.js.map +1 -1
  45. package/dist/IndexedDb.d.ts +12 -0
  46. package/dist/IndexedDb.d.ts.map +1 -1
  47. package/dist/IndexedDb.js +12 -0
  48. package/dist/IndexedDb.js.map +1 -1
  49. package/dist/IndexedDbDatabase.d.ts +19 -0
  50. package/dist/IndexedDbDatabase.d.ts.map +1 -1
  51. package/dist/IndexedDbDatabase.js +19 -0
  52. package/dist/IndexedDbDatabase.js.map +1 -1
  53. package/dist/IndexedDbQueryBuilder.d.ts +8 -0
  54. package/dist/IndexedDbQueryBuilder.d.ts.map +1 -1
  55. package/dist/IndexedDbQueryBuilder.js +8 -0
  56. package/dist/IndexedDbQueryBuilder.js.map +1 -1
  57. package/dist/IndexedDbTable.d.ts +55 -17
  58. package/dist/IndexedDbTable.d.ts.map +1 -1
  59. package/dist/IndexedDbTable.js +55 -17
  60. package/dist/IndexedDbTable.js.map +1 -1
  61. package/dist/IndexedDbVersion.d.ts +14 -0
  62. package/dist/IndexedDbVersion.d.ts.map +1 -1
  63. package/dist/IndexedDbVersion.js +14 -0
  64. package/dist/IndexedDbVersion.js.map +1 -1
  65. package/dist/Permissions.d.ts +48 -18
  66. package/dist/Permissions.d.ts.map +1 -1
  67. package/dist/Permissions.js +48 -18
  68. package/dist/Permissions.js.map +1 -1
  69. package/dist/index.d.ts +0 -319
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +0 -319
  72. package/dist/index.js.map +1 -1
  73. package/package.json +3 -3
  74. package/src/BrowserCrypto.ts +67 -4
  75. package/src/BrowserHttpClient.ts +16 -3
  76. package/src/BrowserKeyValueStore.ts +70 -15
  77. package/src/BrowserPersistence.ts +66 -9
  78. package/src/BrowserRuntime.ts +48 -0
  79. package/src/BrowserSocket.ts +55 -22
  80. package/src/BrowserStream.ts +33 -18
  81. package/src/BrowserWorker.ts +50 -18
  82. package/src/BrowserWorkerRunner.ts +45 -14
  83. package/src/Clipboard.ts +55 -18
  84. package/src/Geolocation.ts +63 -19
  85. package/src/IndexedDb.ts +12 -0
  86. package/src/IndexedDbDatabase.ts +19 -0
  87. package/src/IndexedDbQueryBuilder.ts +8 -0
  88. package/src/IndexedDbTable.ts +55 -17
  89. package/src/IndexedDbVersion.ts +14 -0
  90. package/src/Permissions.ts +48 -18
  91. package/src/index.ts +0 -319
@@ -1,21 +1,33 @@
1
1
  /**
2
- * Browser runtime support for Effect worker runners.
2
+ * Runner-side browser platform for Effect worker handlers.
3
3
  *
4
- * This module is intended for code that is already executing in a browser
5
- * worker context, or for tests and adapters that supply a `MessagePort` or
6
- * `Window` endpoint directly. It provides the `WorkerRunnerPlatform` used by
7
- * `WorkerRunner` and `RpcServer.layerProtocolWorkerRunner` to receive parent
8
- * or client requests, run Effect handlers, and send responses through the
9
- * browser `postMessage` channel.
4
+ * This module is for code already executing inside a browser worker, or for
5
+ * tests and adapters that pass a `MessagePort` or `Window` endpoint directly.
6
+ * It provides the `WorkerRunnerPlatform` used by `WorkerRunner` and protocols
7
+ * such as `RpcServer.layerProtocolWorkerRunner` to receive parent or client
8
+ * requests, run Effect handlers, and post responses back through the browser
9
+ * messaging channel.
10
10
  *
11
- * Use it with `BrowserWorker` when a browser application needs to move RPC
11
+ * **Mental model**
12
+ *
13
+ * Dedicated workers use the ambient `self` endpoint. Shared workers receive one
14
+ * `MessagePort` per `onconnect` event, and this module caches ports that arrive
15
+ * before the runner layer starts. `layer` reads from the global worker `self`;
16
+ * `make` and `layerMessagePort` are for explicit endpoints supplied by tests,
17
+ * custom channels, or adapter code.
18
+ *
19
+ * **Common tasks**
20
+ *
21
+ * Pair this module with `BrowserWorker` in the parent page when moving RPC
12
22
  * handlers, CPU-bound computations, or browser-only services into a dedicated
13
- * worker or shared worker. Dedicated workers communicate through the current
14
- * `self` endpoint; shared workers accept multiple `onconnect` ports and cache
15
- * ports that connect before the runner layer starts. Messages still use the
16
- * browser structured-clone algorithm, so payload schemas, transfer lists,
17
- * `messageerror` events, and the lifetime of each `MessagePort` must be
18
- * considered when crossing worker boundaries.
23
+ * worker or shared worker. Use `layer` in normal worker entry points and
24
+ * `layerMessagePort` when a test or integration already owns the transport.
25
+ *
26
+ * **Gotchas**
27
+ *
28
+ * Payloads and transfer lists must satisfy the browser structured-clone
29
+ * algorithm. `messageerror` and `error` events fail the runner, and each
30
+ * connected `MessagePort` is closed when its scope finalizes.
19
31
  *
20
32
  * @since 4.0.0
21
33
  */
@@ -153,6 +165,25 @@ export const make = self => ({
153
165
  /**
154
166
  * Layer that provides a browser `WorkerRunnerPlatform` using the global `self` worker context.
155
167
  *
168
+ * **When to use**
169
+ *
170
+ * Use when a browser worker entry point uses the ambient `self` object as the
171
+ * worker transport.
172
+ *
173
+ * **Details**
174
+ *
175
+ * Delegates to `make(self)` and provides the runner-side platform used by
176
+ * protocols such as `RpcServer.layerProtocolWorkerRunner`.
177
+ *
178
+ * **Gotchas**
179
+ *
180
+ * This layer depends on the browser worker global `self`. Use
181
+ * `layerMessagePort` when the transport is an explicit `MessagePort` or
182
+ * `Window`.
183
+ *
184
+ * @see {@link make} for constructing a runner platform from an explicit endpoint
185
+ * @see {@link layerMessagePort} for providing a platform from an explicit endpoint
186
+ *
156
187
  * @category layers
157
188
  * @since 4.0.0
158
189
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","identity","Layer","Queue","Scope","WorkerError","WorkerReceiveError","WorkerRunner","cachedPorts","Set","globalHandleConnect","event","add","ports","self","onconnect","make","start","fnUntraced","disconnects","currentPortId","Map","sendUnsafe","portId","message","transfer","get","postMessage","send","sync","run","handler","scopedWith","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","context","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","onMessage","data","result","isEffect","fiber","addObserver","port","size","doneUnsafe","void","delete","close","onMessageError","error","reason","onError","handlePort","portScope","forkUnsafe","set","onMsg","addEventListener","runSync","addFinalizer","removeEventListener","prevOnConnect","clear","await","layer","WorkerRunnerPlatform","layerMessagePort","succeed"],"sources":["../src/BrowserWorkerRunner.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,SAASC,WAAW,EAAEC,kBAAkB,QAAQ,qCAAqC;AACrF,OAAO,KAAKC,YAAY,MAAM,sCAAsC;AAEpE,MAAMC,WAAW,gBAAG,IAAIC,GAAG,EAAe;AAC1C,SAASC,mBAAmBA,CAACC,KAAmB;EAC9CH,WAAW,CAACI,GAAG,CAAED,KAAsB,CAACE,KAAK,CAAC,CAAC,CAAC,CAAC;AACnD;AACA,IAAI,OAAOC,IAAI,KAAK,WAAW,IAAI,WAAW,IAAIA,IAAI,EAAE;EACtDA,IAAI,CAACC,SAAS,GAAGL,mBAAmB;AACtC;AAEA;;;;;;AAMA,OAAO,MAAMM,IAAI,GAAIF,IAA0B,KAAoD;EACjGG,KAAK,EAAEnB,MAAM,CAACoB,UAAU,CAAC,aAAS;IAChC,MAAMC,WAAW,GAAG,OAAOhB,KAAK,CAACa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D,UAAU,CAACV,IAAI,CAAC;QAClB;QACA9C,WAAW,CAACkE,KAAK,EAAE;MACrB,CAAC,MAAM;QACLV,UAAU,CAAClD,IAAW,CAAC;MACzB;MACA,OAAOV,KAAK,CAACmE,YAAY,CACvBtC,KAAK,EACLnC,MAAM,CAAC+B,IAAI,CAAC,MAAK;QACff,IAAI,CAAC0D,mBAAmB,CAAC,OAAO,EAAET,OAAO,CAAC;QAC1C,IAAI,WAAW,IAAIjD,IAAI,EAAE;UACvBA,IAAI,CAAC6C,KAAK,EAAE;UACZ7C,IAAI,CAACC,SAAS,GAAG0D,aAAa;QAChC;MACF,CAAC,CAAC,CACH;MAED,OAAO5E,QAAQ,CAAC8E,KAAK,CAACzC,UAAU,CAAC;IACnC,CAAC,CAAC,CAAC;IAEL,OAAOjC,QAAQ,CAAkC;MAAE6B,GAAG;MAAEF,IAAI;MAAEN,UAAU;MAAEH;IAAW,CAAE,CAAC;EAC1F,CAAC;CACF,CAAC;AAEF;;;;;;AAMA,OAAO,MAAMyD,KAAK,gBAAmD1E,KAAK,CAAC2B,IAAI,CAACtB,YAAY,CAACsE,oBAAoB,CAAC,CAAC,MACjH7D,IAAI,CAACF,IAAI,CAAC,CACX;AAED;;;;;;AAMA,OAAO,MAAMgE,gBAAgB,GAAIxB,IAA0B,IACzDpD,KAAK,CAAC6E,OAAO,CAACxE,YAAY,CAACsE,oBAAoB,CAAC,CAAC7D,IAAI,CAACsC,IAAI,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"BrowserWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","identity","Layer","Queue","Scope","WorkerError","WorkerReceiveError","WorkerRunner","cachedPorts","Set","globalHandleConnect","event","add","ports","self","onconnect","make","start","fnUntraced","disconnects","currentPortId","Map","sendUnsafe","portId","message","transfer","get","postMessage","send","sync","run","handler","scopedWith","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","context","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","onMessage","data","result","isEffect","fiber","addObserver","port","size","doneUnsafe","void","delete","close","onMessageError","error","reason","onError","handlePort","portScope","forkUnsafe","set","onMsg","addEventListener","runSync","addFinalizer","removeEventListener","prevOnConnect","clear","await","layer","WorkerRunnerPlatform","layerMessagePort","succeed"],"sources":["../src/BrowserWorkerRunner.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,SAASC,WAAW,EAAEC,kBAAkB,QAAQ,qCAAqC;AACrF,OAAO,KAAKC,YAAY,MAAM,sCAAsC;AAEpE,MAAMC,WAAW,gBAAG,IAAIC,GAAG,EAAe;AAC1C,SAASC,mBAAmBA,CAACC,KAAmB;EAC9CH,WAAW,CAACI,GAAG,CAAED,KAAsB,CAACE,KAAK,CAAC,CAAC,CAAC,CAAC;AACnD;AACA,IAAI,OAAOC,IAAI,KAAK,WAAW,IAAI,WAAW,IAAIA,IAAI,EAAE;EACtDA,IAAI,CAACC,SAAS,GAAGL,mBAAmB;AACtC;AAEA;;;;;;AAMA,OAAO,MAAMM,IAAI,GAAIF,IAA0B,KAAoD;EACjGG,KAAK,EAAEnB,MAAM,CAACoB,UAAU,CAAC,aAAS;IAChC,MAAMC,WAAW,GAAG,OAAOhB,KAAK,CAACa,IAAI,EAAU;IAC/C,IAAII,aAAa,GAAG,CAAC;IAErB,MAAMP,KAAK,GAAG,IAAIQ,GAAG,EAAmD;IACxE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AAClD,IAAW,CAAC;MACzB;MACA,OAAOV,KAAK,CAACmE,YAAY,CACvBtC,KAAK,EACLnC,MAAM,CAAC+B,IAAI,CAAC,MAAK;QACff,IAAI,CAAC0D,mBAAmB,CAAC,OAAO,EAAET,OAAO,CAAC;QAC1C,IAAI,WAAW,IAAIjD,IAAI,EAAE;UACvBA,IAAI,CAAC6C,KAAK,EAAE;UACZ7C,IAAI,CAACC,SAAS,GAAG0D,aAAa;QAChC;MACF,CAAC,CAAC,CACH;MAED,OAAO5E,QAAQ,CAAC8E,KAAK,CAACzC,UAAU,CAAC;IACnC,CAAC,CAAC,CAAC;IAEL,OAAOjC,QAAQ,CAAkC;MAAE6B,GAAG;MAAEF,IAAI;MAAEN,UAAU;MAAEH;IAAW,CAAE,CAAC;EAC1F,CAAC;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,MAAMyD,KAAK,gBAAmD1E,KAAK,CAAC2B,IAAI,CAACtB,YAAY,CAACsE,oBAAoB,CAAC,CAAC,MACjH7D,IAAI,CAACF,IAAI,CAAC,CACX;AAED;;;;;;AAMA,OAAO,MAAMgE,gBAAgB,GAAIxB,IAA0B,IACzDpD,KAAK,CAAC6E,OAAO,CAACxE,YAAY,CAACsE,oBAAoB,CAAC,CAAC7D,IAAI,CAACsC,IAAI,CAAC,CAAC","ignoreList":[]}
@@ -1,19 +1,35 @@
1
1
  /**
2
- * Browser clipboard service for Effect programs.
3
- *
4
- * This module wraps the browser `navigator.clipboard` API in a `Clipboard`
5
- * service so client-side applications can read, write, and clear clipboard
6
- * contents as typed Effects. It is useful for common UI workflows such as copy
7
- * buttons, paste/import actions, sharing generated text, and moving rich
8
- * clipboard payloads like `Blob`-backed `ClipboardItem`s through an Effect
9
- * environment.
10
- *
11
- * Browser clipboard rules still apply. Clipboard access generally requires a
12
- * secure context, and browsers may require a user gesture, permission prompt, or
13
- * active focused document before reads or writes are allowed. Support also
14
- * varies by operation and payload type: text helpers are the most portable,
15
- * while `ClipboardItem` and non-text MIME types may be unavailable or restricted
16
- * in some browsers. Failed browser operations are surfaced as `ClipboardError`.
2
+ * Browser clipboard integration for Effect programs.
3
+ *
4
+ * This module provides a `Clipboard` service backed by `navigator.clipboard`.
5
+ * It keeps copy, paste, clear, and rich clipboard operations inside the Effect
6
+ * environment so browser UI code can require clipboard capability without
7
+ * calling the global API directly. Text helpers cover portable copy and paste
8
+ * flows, while `read`, `write`, and `writeBlob` expose `ClipboardItem` payloads
9
+ * for browsers that support richer MIME types.
10
+ *
11
+ * **Mental model**
12
+ *
13
+ * `Clipboard` is a capability service. Application code depends on the service
14
+ * tag, {@link layer} supplies the live browser implementation, and {@link make}
15
+ * builds custom implementations for tests, unsupported browsers, or constrained
16
+ * capabilities. Browser failures are converted to {@link ClipboardError}.
17
+ *
18
+ * **Common tasks**
19
+ *
20
+ * - Provide {@link layer} near the browser application edge.
21
+ * - Use `writeString` for copy buttons and generated text.
22
+ * - Use `readString` for paste or import workflows.
23
+ * - Use `write` or `writeBlob` for rich clipboard payloads when
24
+ * `ClipboardItem` is available.
25
+ * - Use `clear` to replace the clipboard with an empty string.
26
+ *
27
+ * **Gotchas**
28
+ *
29
+ * Clipboard access requires a secure context in modern browsers and may also
30
+ * require user activation, permissions, and a focused document. Support differs
31
+ * between reads, writes, text, and custom MIME payloads, so feature detection or
32
+ * graceful fallback is often needed around `ClipboardItem` usage.
17
33
  *
18
34
  * @since 4.0.0
19
35
  */
@@ -23,7 +39,20 @@ import * as Layer from "effect/Layer";
23
39
  declare const TypeId = "~@effect/platform-browser/Clipboard";
24
40
  declare const ErrorTypeId = "~@effect/platform-browser/Clipboard/ClipboardError";
25
41
  /**
26
- * Service interface for reading from, writing to, and clearing the browser clipboard.
42
+ * Defines the service interface for reading from, writing to, and clearing the browser clipboard.
43
+ *
44
+ * **Details**
45
+ *
46
+ * `read` and `write` work with `ClipboardItem` arrays. `readString` and
47
+ * `writeString` use text, `writeBlob` writes one `Blob`, and `clear` writes an
48
+ * empty string.
49
+ *
50
+ * **Gotchas**
51
+ *
52
+ * Clipboard access generally requires a secure context and may require user
53
+ * activation, permissions, or a focused document. `ClipboardItem` and non-text
54
+ * MIME type support varies by browser. Failed browser operations are surfaced
55
+ * as `ClipboardError`.
27
56
  *
28
57
  * @category models
29
58
  * @since 4.0.0
@@ -53,7 +82,15 @@ export declare class ClipboardError extends ClipboardError_base<{
53
82
  readonly [ErrorTypeId] = "~@effect/platform-browser/Clipboard/ClipboardError";
54
83
  }
55
84
  /**
56
- * Service tag for the browser `Clipboard` service.
85
+ * Service tag for browser clipboard capabilities.
86
+ *
87
+ * **When to use**
88
+ *
89
+ * Use when an Effect needs to require or provide clipboard capabilities through
90
+ * the context.
91
+ *
92
+ * @see {@link make} for building a custom clipboard service
93
+ * @see {@link layer} for providing the browser-backed clipboard service
57
94
  *
58
95
  * @category services
59
96
  * @since 4.0.0
@@ -67,7 +104,7 @@ export declare const Clipboard: Context.Service<Clipboard, Clipboard>;
67
104
  */
68
105
  export declare const make: (impl: Omit<Clipboard, "clear" | "writeBlob" | typeof TypeId>) => Clipboard;
69
106
  /**
70
- * A layer that directly interfaces with the navigator.clipboard api
107
+ * Layer that directly interfaces with the browser Clipboard API.
71
108
  *
72
109
  * @category layers
73
110
  * @since 4.0.0
@@ -1 +1 @@
1
- {"version":3,"file":"Clipboard.d.ts","sourceRoot":"","sources":["../src/Clipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,QAAA,MAAM,MAAM,wCAAwC,CAAA;AACpD,QAAA,MAAM,WAAW,uDAAuD,CAAA;AAExE;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,MAAM,CAAA;IAChC,Q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AAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAsC,CAAA;AAElG;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GACf,MAAM,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,WAAW,GAAG,OAAO,MAAM,CAAC,KAC3D,SAMC,CAAA;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAsCxC,CAAA"}
package/dist/Clipboard.js CHANGED
@@ -1,19 +1,35 @@
1
1
  /**
2
- * Browser clipboard service for Effect programs.
2
+ * Browser clipboard integration for Effect programs.
3
3
  *
4
- * This module wraps the browser `navigator.clipboard` API in a `Clipboard`
5
- * service so client-side applications can read, write, and clear clipboard
6
- * contents as typed Effects. It is useful for common UI workflows such as copy
7
- * buttons, paste/import actions, sharing generated text, and moving rich
8
- * clipboard payloads like `Blob`-backed `ClipboardItem`s through an Effect
9
- * environment.
4
+ * This module provides a `Clipboard` service backed by `navigator.clipboard`.
5
+ * It keeps copy, paste, clear, and rich clipboard operations inside the Effect
6
+ * environment so browser UI code can require clipboard capability without
7
+ * calling the global API directly. Text helpers cover portable copy and paste
8
+ * flows, while `read`, `write`, and `writeBlob` expose `ClipboardItem` payloads
9
+ * for browsers that support richer MIME types.
10
10
  *
11
- * Browser clipboard rules still apply. Clipboard access generally requires a
12
- * secure context, and browsers may require a user gesture, permission prompt, or
13
- * active focused document before reads or writes are allowed. Support also
14
- * varies by operation and payload type: text helpers are the most portable,
15
- * while `ClipboardItem` and non-text MIME types may be unavailable or restricted
16
- * in some browsers. Failed browser operations are surfaced as `ClipboardError`.
11
+ * **Mental model**
12
+ *
13
+ * `Clipboard` is a capability service. Application code depends on the service
14
+ * tag, {@link layer} supplies the live browser implementation, and {@link make}
15
+ * builds custom implementations for tests, unsupported browsers, or constrained
16
+ * capabilities. Browser failures are converted to {@link ClipboardError}.
17
+ *
18
+ * **Common tasks**
19
+ *
20
+ * - Provide {@link layer} near the browser application edge.
21
+ * - Use `writeString` for copy buttons and generated text.
22
+ * - Use `readString` for paste or import workflows.
23
+ * - Use `write` or `writeBlob` for rich clipboard payloads when
24
+ * `ClipboardItem` is available.
25
+ * - Use `clear` to replace the clipboard with an empty string.
26
+ *
27
+ * **Gotchas**
28
+ *
29
+ * Clipboard access requires a secure context in modern browsers and may also
30
+ * require user activation, permissions, and a focused document. Support differs
31
+ * between reads, writes, text, and custom MIME payloads, so feature detection or
32
+ * graceful fallback is often needed around `ClipboardItem` usage.
17
33
  *
18
34
  * @since 4.0.0
19
35
  */
@@ -33,7 +49,15 @@ export class ClipboardError extends /*#__PURE__*/Data.TaggedError("ClipboardErro
33
49
  [ErrorTypeId] = ErrorTypeId;
34
50
  }
35
51
  /**
36
- * Service tag for the browser `Clipboard` service.
52
+ * Service tag for browser clipboard capabilities.
53
+ *
54
+ * **When to use**
55
+ *
56
+ * Use when an Effect needs to require or provide clipboard capabilities through
57
+ * the context.
58
+ *
59
+ * @see {@link make} for building a custom clipboard service
60
+ * @see {@link layer} for providing the browser-backed clipboard service
37
61
  *
38
62
  * @category services
39
63
  * @since 4.0.0
@@ -54,7 +78,7 @@ export const make = impl => Clipboard.of({
54
78
  })])
55
79
  });
56
80
  /**
57
- * A layer that directly interfaces with the navigator.clipboard api
81
+ * Layer that directly interfaces with the browser Clipboard API.
58
82
  *
59
83
  * @category layers
60
84
  * @since 4.0.0
@@ -1 +1 @@
1
- {"version":3,"file":"Clipboard.js","names":["Context","Data","Effect","Layer","TypeId","ErrorTypeId","ClipboardError","TaggedError","Clipboard","Service","make","impl","of","clear","writeString","writeBlob","blob","write","ClipboardItem","type","layer","succeed","read","tryPromise","try","navigator","clipboard","catch","cause","s","readString","readText","text","writeText"],"sources":["../src/Clipboard.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;AAmBA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,MA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JE,UAAU,eAAE5B,MAAM,CAACqB,UAAU,CAAC;IAC5BC,GAAG,EAAEA,CAAA,KAAMC,SAAS,CAACC,SAAS,CAACK,QAAQ,EAAE;IACzCJ,KAAK,EAAGC,KAAK,IACX,IAAItB,cAAc,CAAC;MACjBsB,KAAK;MACL,SAAS,EAAE;KACZ;GACJ,CAAC;EACFd,WAAW,EAAGkB,IAAY,IACxB9B,MAAM,CAACqB,UAAU,CAAC;IAChBC,GAAG,EAAEA,CAAA,KAAMC,SAAS,CAACC,SAAS,CAACO,SAAS,CAACD,IAAI,CAAC;IAC9CL,KAAK,EAAGC,KAAK,IACX,IAAItB,cAAc,CAAC;MACjBsB,KAAK;MACL,SAAS,EAAE;KACZ;GACJ;CACJ,CAAC,CACH","ignoreList":[]}
1
+ {"version":3,"file":"Clipboard.js","names":["Context","Data","Effect","Layer","TypeId","ErrorTypeId","ClipboardError","TaggedError","Clipboard","Service","make","impl","of","clear","writeString","writeBlob","blob","write","ClipboardItem","type","layer","succeed","read","tryPromise","try","navigator","clipboard","catch","cause","s","readString","readText","text","writeText"],"sources":["../src/Clipboard.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AAErC,MAAMC,MAAM,GAAG,qCAAqC;AACpD,MAAMC,WAAW,GAAG,oDAAoD;AA+BxE;;;;;;AAMA,OAAM,MAAOC,cAAe,sBAAQL,IAAI,CAACM,WAAW,CAAC,gBAAgB,CAGnE;EACS,CAACF,WAAW,IAAIA,WAAW;;AAGtC;;;;;;;;;;;;;;AAcA,OAAO,MAAMG,SAAS,gBAA0CR,OAAO,CAACS,OAAO,CAAYL,MAAM,CAAC;AAElG;;;;;;AAMA,OAAO,MAAMM,IAAI,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9CL,KAAK,EAAGC,KAAK,IACX,IAAItB,cAAc,CAAC;MACjBsB,KAAK;MACL,SAAS,EAAE;KACZ;GACJ;CACJ,CAAC,CACH","ignoreList":[]}
@@ -1,19 +1,35 @@
1
1
  /**
2
- * Browser geolocation support for Effect programs.
3
- *
4
- * This module provides a `Geolocation` service and browser-backed layer for
5
- * reading device location through `navigator.geolocation`. Use
6
- * `getCurrentPosition` when an application needs one location fix, such as a
7
- * nearby-search, check-in, or delivery estimate, and `watchPosition` when it
8
- * needs a stream of updates for navigation, tracking, or location-aware UI.
9
- *
10
- * The implementation is browser-only and relies on the browser permission and
11
- * policy model for geolocation. Calls may prompt the user, fail when permission
12
- * is denied, time out, or report that position data is unavailable because of
13
- * device, browser, privacy, origin, or secure-context restrictions. Watched
14
- * positions are scoped so the underlying browser watch is cleared when the
15
- * stream is finalized, and slow consumers should account for the sliding
16
- * buffer used by `watchPosition`.
2
+ * Browser geolocation integration for Effect programs.
3
+ *
4
+ * This module exposes a `Geolocation` service backed by
5
+ * `navigator.geolocation`. Use it for browser features that need a single
6
+ * position fix, such as nearby search or delivery estimates, or a stream of
7
+ * position updates for navigation, tracking, and location-aware interfaces.
8
+ * Browser failures are represented as typed `GeolocationError` values instead
9
+ * of raw callback errors.
10
+ *
11
+ * **Mental model**
12
+ *
13
+ * - The service delegates to the browser Geolocation API and follows the
14
+ * browser's permission, privacy, origin, and secure-context rules.
15
+ * - `getCurrentPosition` reads one position fix from the service.
16
+ * - {@link watchPosition} turns browser position callbacks into a `Stream` and
17
+ * clears the underlying browser watch when the stream is finalized.
18
+ *
19
+ * **Common tasks**
20
+ *
21
+ * - Provide the live browser implementation with {@link layer}.
22
+ * - Read a one-shot position from the `Geolocation` service.
23
+ * - Stream position updates with {@link watchPosition}.
24
+ * - Handle denied permissions, timeouts, and unavailable position data with
25
+ * {@link GeolocationError}.
26
+ *
27
+ * **Gotchas**
28
+ *
29
+ * - Browsers may prompt the user, reject access outside secure contexts, block
30
+ * access by permissions policy, or report that position data is unavailable.
31
+ * - {@link watchPosition} uses a sliding buffer; increase `bufferSize` if slow
32
+ * consumers must not skip older positions.
17
33
  *
18
34
  * @since 4.0.0
19
35
  */
@@ -25,7 +41,27 @@ import * as Stream from "effect/Stream";
25
41
  declare const TypeId = "~@effect/platform-browser/Geolocation";
26
42
  declare const ErrorTypeId = "~@effect/platform-browser/Geolocation/GeolocationError";
27
43
  /**
28
- * Service interface for browser geolocation, providing effects for the current position and streams of watched positions.
44
+ * Defines the service interface for browser geolocation, providing effects for the current position and streams of watched positions.
45
+ *
46
+ * **When to use**
47
+ *
48
+ * Use when browser code needs a typed Effect service for one-shot location
49
+ * reads or streamed location updates.
50
+ *
51
+ * **Details**
52
+ *
53
+ * `getCurrentPosition` returns one position effect. `watchPosition` returns a
54
+ * stream and accepts the browser `PositionOptions` plus an optional sliding
55
+ * `bufferSize`.
56
+ *
57
+ * **Gotchas**
58
+ *
59
+ * Browser permission prompts, denied permissions, timeouts, unavailable
60
+ * position data, secure-context restrictions, and policy restrictions are
61
+ * surfaced as `GeolocationError`.
62
+ *
63
+ * @see {@link GeolocationError} for represented browser geolocation failures
64
+ * @see {@link layer} for the browser-backed service implementation
29
65
  *
30
66
  * @category models
31
67
  * @since 4.0.0
@@ -38,7 +74,14 @@ export interface Geolocation {
38
74
  } | undefined) => Stream.Stream<GeolocationPosition, GeolocationError>;
39
75
  }
40
76
  /**
41
- * Service tag for the browser `Geolocation` service.
77
+ * Service tag for browser geolocation capabilities.
78
+ *
79
+ * **When to use**
80
+ *
81
+ * Use when an Effect needs to access or provide geolocation capabilities
82
+ * through the context.
83
+ *
84
+ * @see {@link layer} for providing the browser-backed geolocation service
42
85
  *
43
86
  * @category services
44
87
  * @since 4.0.0
@@ -119,9 +162,10 @@ export type GeolocationErrorReason = PositionUnavailable | PermissionDenied | Ti
119
162
  */
120
163
  export declare const layer: Layer.Layer<Geolocation>;
121
164
  /**
122
- * Streams positions from the `Geolocation` service using `watchPosition`, with an optional sliding buffer size.
165
+ * Reads geolocation positions from the `Geolocation` service as a stream, with
166
+ * an optional sliding buffer size.
123
167
  *
124
- * @category Accessors
168
+ * @category accessors
125
169
  * @since 4.0.0
126
170
  */
127
171
  export declare const watchPosition: (options?: (PositionOptions & {
@@ -1 +1 @@
1
- {"version":3,"file":"Geolocation.d.ts","sourceRoot":"","sources":["../src/Geolocation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,QAAA,MAAM,MAAM,0CAA0C,CAAA;AACtD,QAAA,MAAM,WAAW,2DAA2D,CAAA;AAE5E;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,MAAM,CAAA;IAChC,QAAQ,CAAC,kBAAkB,EAAE,CAC3B,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,KAClC,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAA;IACzD,QAAQ,CAAC,aAAa,EAAE,CACtB,OAAO,CAAC,EACJ,eAAe,GAAG;QAClB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KACzC,GACC,SAAS,KACV,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAA;CAC1D;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAwC,CAAA;;;;AAE1G;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,sBAAqC;IACzE,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CA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7B;CACF;;;;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,sBAAqC;IACzE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;AAED;;;;;GAKG;AACH,qBAAa,OAAQ,SAAQ,aAA4B;IACvD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GAAG,gBAAgB,GAAG,OAAO,CAAA;AAyCrF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAe1C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACxB,UACE,CAAE,eAAe,GAAG;IAClB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACzC,IACC,SAAS,KACZ,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,CAI/D,CAAA"}
@@ -1,19 +1,35 @@
1
1
  /**
2
- * Browser geolocation support for Effect programs.
3
- *
4
- * This module provides a `Geolocation` service and browser-backed layer for
5
- * reading device location through `navigator.geolocation`. Use
6
- * `getCurrentPosition` when an application needs one location fix, such as a
7
- * nearby-search, check-in, or delivery estimate, and `watchPosition` when it
8
- * needs a stream of updates for navigation, tracking, or location-aware UI.
9
- *
10
- * The implementation is browser-only and relies on the browser permission and
11
- * policy model for geolocation. Calls may prompt the user, fail when permission
12
- * is denied, time out, or report that position data is unavailable because of
13
- * device, browser, privacy, origin, or secure-context restrictions. Watched
14
- * positions are scoped so the underlying browser watch is cleared when the
15
- * stream is finalized, and slow consumers should account for the sliding
16
- * buffer used by `watchPosition`.
2
+ * Browser geolocation integration for Effect programs.
3
+ *
4
+ * This module exposes a `Geolocation` service backed by
5
+ * `navigator.geolocation`. Use it for browser features that need a single
6
+ * position fix, such as nearby search or delivery estimates, or a stream of
7
+ * position updates for navigation, tracking, and location-aware interfaces.
8
+ * Browser failures are represented as typed `GeolocationError` values instead
9
+ * of raw callback errors.
10
+ *
11
+ * **Mental model**
12
+ *
13
+ * - The service delegates to the browser Geolocation API and follows the
14
+ * browser's permission, privacy, origin, and secure-context rules.
15
+ * - `getCurrentPosition` reads one position fix from the service.
16
+ * - {@link watchPosition} turns browser position callbacks into a `Stream` and
17
+ * clears the underlying browser watch when the stream is finalized.
18
+ *
19
+ * **Common tasks**
20
+ *
21
+ * - Provide the live browser implementation with {@link layer}.
22
+ * - Read a one-shot position from the `Geolocation` service.
23
+ * - Stream position updates with {@link watchPosition}.
24
+ * - Handle denied permissions, timeouts, and unavailable position data with
25
+ * {@link GeolocationError}.
26
+ *
27
+ * **Gotchas**
28
+ *
29
+ * - Browsers may prompt the user, reject access outside secure contexts, block
30
+ * access by permissions policy, or report that position data is unavailable.
31
+ * - {@link watchPosition} uses a sliding buffer; increase `bufferSize` if slow
32
+ * consumers must not skip older positions.
17
33
  *
18
34
  * @since 4.0.0
19
35
  */
@@ -27,7 +43,14 @@ import * as Stream from "effect/Stream";
27
43
  const TypeId = "~@effect/platform-browser/Geolocation";
28
44
  const ErrorTypeId = "~@effect/platform-browser/Geolocation/GeolocationError";
29
45
  /**
30
- * Service tag for the browser `Geolocation` service.
46
+ * Service tag for browser geolocation capabilities.
47
+ *
48
+ * **When to use**
49
+ *
50
+ * Use when an Effect needs to access or provide geolocation capabilities
51
+ * through the context.
52
+ *
53
+ * @see {@link layer} for providing the browser-backed geolocation service
31
54
  *
32
55
  * @category services
33
56
  * @since 4.0.0
@@ -120,9 +143,10 @@ export const layer = /*#__PURE__*/Layer.succeed(Geolocation, /*#__PURE__*/Geoloc
120
143
  watchPosition: options => makeQueue(options).pipe(Effect.map(Stream.fromQueue), Stream.unwrap)
121
144
  }));
122
145
  /**
123
- * Streams positions from the `Geolocation` service using `watchPosition`, with an optional sliding buffer size.
146
+ * Reads geolocation positions from the `Geolocation` service as a stream, with
147
+ * an optional sliding buffer size.
124
148
  *
125
- * @category Accessors
149
+ * @category accessors
126
150
  * @since 4.0.0
127
151
  */
128
152
  export const watchPosition = options => Stream.unwrap(Effect.map(Effect.service(Geolocation), geolocation => geolocation.watchPosition(options)));
@@ -1 +1 @@
1
- {"version":3,"file":"Geolocation.js","names":["Cause","Context","Data","Effect","Layer","Queue","Stream","TypeId","ErrorTypeId","Geolocation","Service","GeolocationError","TaggedError","constructor","props","cause","reason","message","PositionUnavailable","_tag","PermissionDenied","Timeout","makeQueue","options","sliding","bufferSize","pipe","tap","queue","acquireRelease","sync","navigator","geolocation","watchPosition","position","offerUnsafe","code","PERMISSION_DENIED","error","failCauseUnsafe","fail","TIMEOUT","POSITION_UNAVAILABLE","handleId","clearWatch","layer","succeed","of","getCurrentPosition","flatMap","take","scoped","map","fromQueue","unwrap","service"],"sources":["../src/Geolocation.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;AAmBA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAEvC,MAAMC,MAAM,GAAG,uCAAuC;AACtD,MAAMC,WAAW,GAAG,wDAAwD;AAsB5E;;;;;;AAMA,OAAO,MAAMC,WAAW,gBAA8CR,OAAO,CAACS,OAAO,CAAcH,MAAM,CAAC;AAE1G;;;;;;AAMA,OAAM,MAAOI,gBAAiB,sBAAQT,IAAI,CAACU,WAAW,CAAC,kBAAkB,CAEvE;EACAC,YAAYC,KAEX;IACC,KAAK,CAAC;MACJ,GAAGA,KAAK;MACRC,KAAK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CAElB,CAAC,CACH;AAED;;;;;;AAMA,OAAO,MAAMrB,aAAa,GACxBV,OAIa,IAEbjB,MAAM,CAACgD,MAAM,CAACnD,MAAM,CAACiD,GAAG,CACtBjD,MAAM,CAACoD,OAAO,CAAC9C,WAAW,CAAC,EAC1BuB,WAAW,IAAKA,WAAW,CAACC,aAAa,CAACV,OAAO,CAAC,CACpD,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Geolocation.js","names":["Cause","Context","Data","Effect","Layer","Queue","Stream","TypeId","ErrorTypeId","Geolocation","Service","GeolocationError","TaggedError","constructor","props","cause","reason","message","PositionUnavailable","_tag","PermissionDenied","Timeout","makeQueue","options","sliding","bufferSize","pipe","tap","queue","acquireRelease","sync","navigator","geolocation","watchPosition","position","offerUnsafe","code","PERMISSION_DENIED","error","failCauseUnsafe","fail","TIMEOUT","POSITION_UNAVAILABLE","handleId","clearWatch","layer","succeed","of","getCurrentPosition","flatMap","take","scoped","map","fromQueue","unwrap","service"],"sources":["../src/Geolocation.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAEvC,MAAMC,MAAM,GAAG,uCAAuC;AACtD,MAAMC,WAAW,GAAG,wDAAwD;AA0C5E;;;;;;;;;;;;;AAaA,OAAO,MAAMC,WAAW,gBAA8CR,OAAO,CAACS,OAAO,CAAcH,MAAM,CAAC;AAE1G;;;;;;AAMA,OAAM,MAAOI,gBAAiB,sBAAQT,IAAI,CAACU,WAAW,CAAC,kBAAkB,CAEvE;EACAC,YAAYC,KA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,CAAC+C,SAAS,CAAC,EAC5B/C,MAAM,CAACgD,MAAM;CAElB,CAAC,CACH;AAED;;;;;;;AAOA,OAAO,MAAMrB,aAAa,GACxBV,OAIa,IAEbjB,MAAM,CAACgD,MAAM,CAACnD,MAAM,CAACiD,GAAG,CACtBjD,MAAM,CAACoD,OAAO,CAAC9C,WAAW,CAAC,EAC1BuB,WAAW,IAAKA,WAAW,CAACC,aAAa,CAACV,OAAO,CAAC,CACpD,CAAC","ignoreList":[]}
@@ -55,6 +55,18 @@ export declare const IDBValidKey: Schema.Union<readonly [Schema.Union<readonly [
55
55
  /**
56
56
  * Schema for auto-incremented IndexedDB keys, accepting integers from 1 through `2 ** 53`.
57
57
  *
58
+ * **When to use**
59
+ *
60
+ * Use when defining numeric key-path fields for `IndexedDbTable` definitions
61
+ * that use IndexedDB auto-increment keys.
62
+ *
63
+ * **Details**
64
+ *
65
+ * The schema accepts integer values from `1` through `2 ** 53`, matching the
66
+ * range used for generated IndexedDB auto-increment keys.
67
+ *
68
+ * @see {@link IDBValidKey} for the broader IndexedDB key schema
69
+ *
58
70
  * @category schemas
59
71
  * @since 4.0.0
60
72
  */
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedDb.d.ts","sourceRoot":"","sources":["../src/IndexedDb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAEzC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,QAAA,MAAM,MAAM,wCAAwC,CAAA;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,MAAM,CAAA;IAChC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,UAAU,CAAA;IACzC,QAAQ,CAAC,WAAW,EAAE,OAAO,UAAU,CAAC,WAAW,CAAA;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,OAAO,MAAM,CAAC,KAAG,SAAwD,CAAA;AAEpH;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAc9C,CAAA"}
package/dist/IndexedDb.js CHANGED
@@ -47,6 +47,18 @@ export const IDBValidKey = /*#__PURE__*/Schema.Union([IDBFlatKey, /*#__PURE__*/S
47
47
  /**
48
48
  * Schema for auto-incremented IndexedDB keys, accepting integers from 1 through `2 ** 53`.
49
49
  *
50
+ * **When to use**
51
+ *
52
+ * Use when defining numeric key-path fields for `IndexedDbTable` definitions
53
+ * that use IndexedDB auto-increment keys.
54
+ *
55
+ * **Details**
56
+ *
57
+ * The schema accepts integer values from `1` through `2 ** 53`, matching the
58
+ * range used for generated IndexedDB auto-increment keys.
59
+ *
60
+ * @see {@link IDBValidKey} for the broader IndexedDB key schema
61
+ *
50
62
  * @category schemas
51
63
  * @since 4.0.0
52
64
  */
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedDb.js","names":["Context","Effect","Layer","Schema","TypeId","IndexedDb","Service","IDBFlatKey","Union","String","Number","check","makeFilter","input","isNaN","DateValid","declare","ArrayBuffer","isView","buffer","IDBValidKey","Array","AutoIncrement","Int","isBetween","minimum","maximum","annotate","identifier","title","description","make","impl","of","layerWindow","effect","suspend","window","indexedDB","IDBKeyRange","succeed","die","Error"],"sources":["../src/IndexedDb.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAEvC,MAAMC,MAAM,GAAG,qCAAqC;AAcpD;;;;;;AAMA,OAAO,MAAMC,SAAS,gBAA0CL,OAAO,CAACM,OAAO,CAAuBF,MAAM,CAAC;AAE7G;AACA,MAAMG,UAAU,gBAAGJ,MAAM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AC3BC,WAAW,EAAEF,MAAM,CAACE;KACrB,CAAC,CACH;EACH,CAAC,MAAM;IACL,OAAOtC,MAAM,CAACwC,GAAG,CAAC,IAAIC,KAAK,CAAC,mCAAmC,CAAC,CAAC;EACnE;AACF,CAAC,CAAC,CACH","ignoreList":[]}
1
+ {"version":3,"file":"IndexedDb.js","names":["Context","Effect","Layer","Schema","TypeId","IndexedDb","Service","IDBFlatKey","Union","String","Number","check","makeFilter","input","isNaN","DateValid","declare","ArrayBuffer","isView","buffer","IDBValidKey","Array","AutoIncrement","Int","isBetween","minimum","maximum","annotate","identifier","title","description","make","impl","of","layerWindow","effect","suspend","window","indexedDB","IDBKeyRange","succeed","die","Error"],"sources":["../src/IndexedDb.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAEvC,MAAMC,MAAM,GAAG,qCAAqC;AAcpD;;;;;;AAMA,OAAO,MAAMC,SAAS,gBAA0CL,OAAO,CAACM,OAAO,CAAuBF,MAAM,CAAC;AAE7G;AACA,MAAMG,UAAU,gBAAGJ,MAAM,CAACK,KAAK,CAAC,CAC9BL,MAAM,CAACM,MAAM,eACbN,MAAM,CAACO,MAAM,CAACC,KAAK,cAACR,MAAM,CAACS,UAAU,CAAEC,KAAK,IAAK,CAACH,MAAM,CAACI,KAAK,CAACD,KAAK,CAAC,CAAC,CAAC,EACvEV,MAAM,CAACY,SAAS,eAChBZ,MAAM,CAACa,OAAO,CACXH,KAAK,IACJA,KAAK,YAAYI,WAAW,IAC3BA,WAAW,CAACC,MAAM,CAACL,KAAK,CAAC,IAAIA,KAAK,CAACM,MAAM,YAAYF,WAAY,CACrE,CACF,CAAC;AAEF;;;;;;AAMA,OAAO,MAAMG,WAAW,gBAAGjB,MAAM,CAACK,KAAK,CAAC,CAACD,UAAU,eAAEJ,MAAM,CAACkB,KAAK,CAACd,UAAU,CAAC,CAAC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;AAkBA,OAAO,MAAMe,aAAa,gBAAGnB,MAAM,CAACoB,GAAG,CAACZ,KAAK,CAC3CR,MAAM,CAACqB,SAAS,CAAC;EAAEC,OAAO,EAAE,CAAC;EAAEC,OAAO,EAAE,CAAC,IAAI;AAAE,CAAE,CAAC,CACnD,CAACC,QAAQ,CAAC;EACTC,UAAU,EAAE,eAAe;EAC3BC,KAAK,EAAE,eAAe;EACtBC,WAAW,EAAE;CACd,CAAC;AAEF;;;;;;AAMA,OAAO,MAAMC,IAAI,GAAIC,IAAoC,IAAgB3B,SAAS,CAAC4B,EAAE,CAAC;EAAE,CAAC7B,MAAM,GAAGA,MAAM;EAAE,GAAG4B;AAAI,CAAE,CAAC;AAEpH;;;;;;AAMA,OAAO,MAAME,WAAW,gBAA2BhC,KAAK,CAACiC,MAAM,CAC7D9B,SAAS,eACTJ,MAAM,CAACmC,OAAO,CAAC,MAAK;EAClB,IAAIC,MAAM,CAACC,SAAS,IAAID,MAAM,CAACE,WAAW,EAAE;IAC1C,OAAOtC,MAAM,CAACuC,OAAO,CACnBT,IAAI,CAAC;MACHO,SAAS,EAAED,MAAM,CAACC,SAAS;MAC3BC,WAAW,EAAEF,MAAM,CAACE;KACrB,CAAC,CACH;EACH,CAAC,MAAM;IACL,OAAOtC,MAAM,CAACwC,GAAG,CAAC,IAAIC,KAAK,CAAC,mCAAmC,CAAC,CAAC;EACnE;AACF,CAAC,CAAC,CACH","ignoreList":[]}
@@ -73,6 +73,25 @@ declare const IndexedDbDatabase_base: Context.ServiceClass<IndexedDbDatabase, "~
73
73
  /**
74
74
  * Service tag for an open IndexedDB database, its `IDBKeyRange` constructor, reactivity service, and rebuild effect.
75
75
  *
76
+ * **When to use**
77
+ *
78
+ * Use when an effect needs access to the live database service after an
79
+ * `IndexedDbSchema` layer has been provided, especially for `rebuild` or
80
+ * lower-level database primitives.
81
+ *
82
+ * **Details**
83
+ *
84
+ * `database` is a mutable reference to the current `IDBDatabase`. `IDBKeyRange`
85
+ * and `reactivity` are shared with query builders created from the schema.
86
+ *
87
+ * **Gotchas**
88
+ *
89
+ * `rebuild` closes and deletes the browser database, then reopens it and reruns
90
+ * migrations. Records not recreated by migrations are removed.
91
+ *
92
+ * @see {@link IndexedDb.IndexedDb} for the lower-level browser IndexedDB primitives
93
+ * @see {@link make} for creating a schema that provides this service as a layer
94
+ *
76
95
  * @category models
77
96
  * @since 4.0.0
78
97
  */