@open-e2ee/signal-protocol-sdk 0.2.2 → 0.3.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 (601) hide show
  1. package/ADAPTERS.md +4 -4
  2. package/ARCHITECTURE.md +17 -16
  3. package/CHANGELOG.md +49 -0
  4. package/COMMERCIAL.md +6 -6
  5. package/NOTICE +1 -1
  6. package/README.md +44 -34
  7. package/SECURITY.md +16 -13
  8. package/TROUBLESHOOTING.md +5 -5
  9. package/blocking/README.md +6 -5
  10. package/client/README.md +5 -5
  11. package/device/README.md +8 -8
  12. package/dist/blocking/types.d.ts +2 -2
  13. package/dist/blocking/types.js +2 -2
  14. package/dist/client/client.d.ts +46 -45
  15. package/dist/client/client.d.ts.map +1 -1
  16. package/dist/client/client.js +61 -60
  17. package/dist/client/client.js.map +1 -1
  18. package/dist/client/config.d.ts +32 -32
  19. package/dist/client/constants.d.ts +7 -6
  20. package/dist/client/constants.d.ts.map +1 -1
  21. package/dist/client/constants.js +5 -4
  22. package/dist/client/constants.js.map +1 -1
  23. package/dist/client/dual-store.d.ts +2 -2
  24. package/dist/client/dual-store.js +2 -2
  25. package/dist/client/endorsement-manager.d.ts +14 -14
  26. package/dist/client/endorsement-manager.d.ts.map +1 -1
  27. package/dist/client/endorsement-manager.js +15 -15
  28. package/dist/client/endorsement-manager.js.map +1 -1
  29. package/dist/client/event-hooks.d.ts +16 -16
  30. package/dist/client/event-hooks.d.ts.map +1 -1
  31. package/dist/client/event-hooks.js +1 -1
  32. package/dist/client/event-hooks.js.map +1 -1
  33. package/dist/client/files.js +4 -4
  34. package/dist/client/files.js.map +1 -1
  35. package/dist/client/headless.d.ts +7 -7
  36. package/dist/client/headless.d.ts.map +1 -1
  37. package/dist/client/headless.js +4 -4
  38. package/dist/client/key-rotation-core.d.ts +19 -17
  39. package/dist/client/key-rotation-core.d.ts.map +1 -1
  40. package/dist/client/key-rotation-core.js +35 -31
  41. package/dist/client/key-rotation-core.js.map +1 -1
  42. package/dist/client/key-rotation.d.ts +8 -8
  43. package/dist/client/key-rotation.js +8 -8
  44. package/dist/client/media.d.ts +1 -1
  45. package/dist/client/messages.d.ts.map +1 -1
  46. package/dist/client/messages.js +13 -11
  47. package/dist/client/messages.js.map +1 -1
  48. package/dist/client/multi-device.d.ts +5 -4
  49. package/dist/client/multi-device.d.ts.map +1 -1
  50. package/dist/client/multi-device.js.map +1 -1
  51. package/dist/client/prekeys.d.ts +7 -7
  52. package/dist/client/prekeys.js +10 -10
  53. package/dist/client/prekeys.js.map +1 -1
  54. package/dist/client/relay-subscription.d.ts +3 -0
  55. package/dist/client/relay-subscription.d.ts.map +1 -1
  56. package/dist/client/relay-subscription.js +7 -4
  57. package/dist/client/relay-subscription.js.map +1 -1
  58. package/dist/client/retry-utils.d.ts +5 -6
  59. package/dist/client/retry-utils.d.ts.map +1 -1
  60. package/dist/client/retry-utils.js +5 -12
  61. package/dist/client/retry-utils.js.map +1 -1
  62. package/dist/client/retry.js +7 -7
  63. package/dist/client/retry.js.map +1 -1
  64. package/dist/client/sealed-sender-ops.d.ts +3 -3
  65. package/dist/client/sealed-sender-ops.js +5 -5
  66. package/dist/client/sealed-sender-ops.js.map +1 -1
  67. package/dist/client/sessions.d.ts +2 -2
  68. package/dist/client/sessions.js +2 -2
  69. package/dist/client/signal-service-cipher.d.ts +9 -9
  70. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  71. package/dist/client/signal-service-cipher.js +41 -40
  72. package/dist/client/signal-service-cipher.js.map +1 -1
  73. package/dist/client/state.d.ts +1 -1
  74. package/dist/client/state.js +1 -1
  75. package/dist/client/types.d.ts +19 -19
  76. package/dist/client/types.d.ts.map +1 -1
  77. package/dist/device/connection.d.ts +1 -1
  78. package/dist/device/connection.js +2 -2
  79. package/dist/device/connection.js.map +1 -1
  80. package/dist/device/constants.d.ts +4 -4
  81. package/dist/device/constants.js +3 -3
  82. package/dist/device/device-id.d.ts +4 -4
  83. package/dist/device/device-id.js +4 -4
  84. package/dist/device/expo-metadata.d.ts +13 -11
  85. package/dist/device/expo-metadata.d.ts.map +1 -1
  86. package/dist/device/expo-metadata.js +13 -11
  87. package/dist/device/expo-metadata.js.map +1 -1
  88. package/dist/device/lifecycle/manager.d.ts +6 -6
  89. package/dist/device/lifecycle/manager.js +7 -7
  90. package/dist/device/lifecycle/types.d.ts +13 -13
  91. package/dist/device/lifecycle/types.d.ts.map +1 -1
  92. package/dist/device/lifecycle/utils.d.ts +2 -2
  93. package/dist/device/lifecycle/utils.js +5 -5
  94. package/dist/device/lifecycle/utils.js.map +1 -1
  95. package/dist/device/provisioning.d.ts +5 -4
  96. package/dist/device/provisioning.d.ts.map +1 -1
  97. package/dist/device/provisioning.js +5 -4
  98. package/dist/device/provisioning.js.map +1 -1
  99. package/dist/device/transfer.d.ts +2 -2
  100. package/dist/device/transfer.js +3 -3
  101. package/dist/device/transfer.js.map +1 -1
  102. package/dist/encoding/index.d.ts +3 -4
  103. package/dist/encoding/index.d.ts.map +1 -1
  104. package/dist/encoding/index.js.map +1 -1
  105. package/dist/files/index.d.ts +1 -1
  106. package/dist/files/index.js +1 -1
  107. package/dist/hooks/use-connection-presence.d.ts +1 -1
  108. package/dist/hooks/use-connection-presence.js +7 -7
  109. package/dist/hooks/use-connection-presence.js.map +1 -1
  110. package/dist/hooks/use-group-membership.d.ts +2 -2
  111. package/dist/hooks/use-group-membership.d.ts.map +1 -1
  112. package/dist/hooks/use-group-membership.js +6 -6
  113. package/dist/hooks/use-group-membership.js.map +1 -1
  114. package/dist/hooks/use-key-rotation.js +3 -3
  115. package/dist/hooks/use-key-rotation.js.map +1 -1
  116. package/dist/hooks/use-single-flight.d.ts +2 -2
  117. package/dist/hooks/use-single-flight.js +1 -1
  118. package/dist/index.d.ts +4 -3
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +22 -4
  121. package/dist/index.js.map +1 -1
  122. package/dist/internal/crypto/ec/ed25519.d.ts +6 -6
  123. package/dist/internal/crypto/ec/ed25519.js +6 -6
  124. package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
  125. package/dist/internal/crypto/ec/x25519-validation.js +4 -2
  126. package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
  127. package/dist/internal/crypto/index.d.ts +2 -0
  128. package/dist/internal/crypto/index.d.ts.map +1 -1
  129. package/dist/internal/crypto/index.js +2 -0
  130. package/dist/internal/crypto/index.js.map +1 -1
  131. package/dist/internal/crypto/kdf/hkdf.d.ts +9 -8
  132. package/dist/internal/crypto/kdf/hkdf.d.ts.map +1 -1
  133. package/dist/internal/crypto/kdf/hkdf.js +11 -10
  134. package/dist/internal/crypto/kdf/hkdf.js.map +1 -1
  135. package/dist/internal/crypto/key-prefix.d.ts +3 -3
  136. package/dist/internal/crypto/key-prefix.js +3 -3
  137. package/dist/internal/crypto/pq/kyber.d.ts +7 -7
  138. package/dist/internal/crypto/pq/kyber.js +10 -10
  139. package/dist/internal/crypto/pq/kyber.js.map +1 -1
  140. package/dist/internal/crypto/random.d.ts +1 -1
  141. package/dist/internal/crypto/random.js +1 -1
  142. package/dist/internal/crypto/symmetric/aes-gcm-siv.js +1 -1
  143. package/dist/internal/crypto/symmetric/aes.js +4 -4
  144. package/dist/internal/crypto/symmetric/aes.js.map +1 -1
  145. package/dist/internal/crypto/symmetric/mac.d.ts +1 -1
  146. package/dist/internal/crypto/symmetric/mac.js +3 -3
  147. package/dist/internal/crypto/symmetric/padding.js +1 -1
  148. package/dist/internal/crypto/symmetric/padding.js.map +1 -1
  149. package/dist/internal/crypto/symmetric/streaming-aead.d.ts +7 -1
  150. package/dist/internal/crypto/symmetric/streaming-aead.d.ts.map +1 -1
  151. package/dist/internal/crypto/symmetric/streaming-aead.js +10 -4
  152. package/dist/internal/crypto/symmetric/streaming-aead.js.map +1 -1
  153. package/dist/internal/crypto/utils.d.ts +2 -2
  154. package/dist/internal/crypto/utils.d.ts.map +1 -1
  155. package/dist/internal/crypto/utils.js +16 -14
  156. package/dist/internal/crypto/utils.js.map +1 -1
  157. package/dist/internal/crypto/validation.d.ts +4 -4
  158. package/dist/internal/crypto/validation.js +2 -2
  159. package/dist/internal/encoding/proto/envelope.d.ts +1 -1
  160. package/dist/internal/encoding/proto/envelope.js +1 -1
  161. package/dist/internal/encoding/proto/index.d.ts +4 -4
  162. package/dist/internal/encoding/proto/index.js +4 -4
  163. package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts +28 -16
  164. package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts.map +1 -1
  165. package/dist/internal/encoding/proto/pq-ratchet-serialize.js +30 -18
  166. package/dist/internal/encoding/proto/pq-ratchet-serialize.js.map +1 -1
  167. package/dist/internal/encoding/proto/primitives.d.ts +45 -35
  168. package/dist/internal/encoding/proto/primitives.d.ts.map +1 -1
  169. package/dist/internal/encoding/proto/primitives.js +54 -43
  170. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  171. package/dist/internal/encoding/proto/sender-key-message.d.ts +2 -2
  172. package/dist/internal/encoding/proto/sender-key-message.js +2 -2
  173. package/dist/internal/encoding/proto/signal-message.d.ts +13 -13
  174. package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
  175. package/dist/internal/encoding/proto/signal-message.js +13 -13
  176. package/dist/internal/encoding/proto/signal-message.js.map +1 -1
  177. package/dist/internal/groups/access-control.d.ts +5 -5
  178. package/dist/internal/groups/access-control.js +6 -6
  179. package/dist/internal/groups/access-control.js.map +1 -1
  180. package/dist/internal/groups/change-actions.d.ts +4 -4
  181. package/dist/internal/groups/change-actions.js +3 -3
  182. package/dist/internal/groups/encrypted-state.js +1 -1
  183. package/dist/internal/groups/encrypted-state.js.map +1 -1
  184. package/dist/internal/groups/group-id.d.ts +1 -1
  185. package/dist/internal/groups/manager.d.ts +24 -23
  186. package/dist/internal/groups/manager.d.ts.map +1 -1
  187. package/dist/internal/groups/manager.js +40 -36
  188. package/dist/internal/groups/manager.js.map +1 -1
  189. package/dist/internal/groups/server-engine.d.ts +29 -21
  190. package/dist/internal/groups/server-engine.d.ts.map +1 -1
  191. package/dist/internal/groups/server-engine.js +55 -50
  192. package/dist/internal/groups/server-engine.js.map +1 -1
  193. package/dist/internal/groups/trust-root.d.ts +2 -2
  194. package/dist/internal/groups/trust-root.js +2 -2
  195. package/dist/internal/groups/types.d.ts +4 -4
  196. package/dist/internal/groups/types.d.ts.map +1 -1
  197. package/dist/internal/groups/wire.d.ts +6 -7
  198. package/dist/internal/groups/wire.d.ts.map +1 -1
  199. package/dist/internal/groups/wire.js +6 -7
  200. package/dist/internal/groups/wire.js.map +1 -1
  201. package/dist/internal/manager/manager.d.ts +14 -12
  202. package/dist/internal/manager/manager.d.ts.map +1 -1
  203. package/dist/internal/manager/manager.js +47 -41
  204. package/dist/internal/manager/manager.js.map +1 -1
  205. package/dist/internal/protocol/double-ratchet/chains.d.ts +8 -6
  206. package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
  207. package/dist/internal/protocol/double-ratchet/chains.js +10 -8
  208. package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
  209. package/dist/internal/protocol/double-ratchet/index.d.ts +2 -2
  210. package/dist/internal/protocol/double-ratchet/index.js +2 -2
  211. package/dist/internal/protocol/double-ratchet/ratchet.d.ts +4 -4
  212. package/dist/internal/protocol/double-ratchet/ratchet.js +6 -6
  213. package/dist/internal/protocol/pqxdh/pqxdh.d.ts +21 -18
  214. package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
  215. package/dist/internal/protocol/pqxdh/pqxdh.js +48 -42
  216. package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
  217. package/dist/internal/protocol/sealed-sender/decryption-v2.js +5 -5
  218. package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +1 -1
  219. package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -1
  220. package/dist/internal/protocol/sealed-sender/decryption.js +11 -8
  221. package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
  222. package/dist/internal/protocol/sealed-sender/delivery-token.d.ts +2 -2
  223. package/dist/internal/protocol/sealed-sender/delivery-token.js +2 -2
  224. package/dist/internal/protocol/sealed-sender/encryption-v2.js +1 -1
  225. package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +1 -1
  226. package/dist/internal/protocol/sealed-sender/encryption.d.ts +2 -2
  227. package/dist/internal/protocol/sealed-sender/encryption.js +2 -2
  228. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +25 -23
  229. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  230. package/dist/internal/protocol/sealed-sender/proto/index.js +32 -30
  231. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  232. package/dist/internal/protocol/sealed-sender/trust-root.d.ts +10 -9
  233. package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +1 -1
  234. package/dist/internal/protocol/sealed-sender/trust-root.js +10 -9
  235. package/dist/internal/protocol/sealed-sender/trust-root.js.map +1 -1
  236. package/dist/internal/protocol/sealed-sender/types.d.ts +13 -14
  237. package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
  238. package/dist/internal/protocol/sealed-sender/types.js +7 -8
  239. package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
  240. package/dist/internal/protocol/sealed-sender/v2-binary.d.ts +1 -1
  241. package/dist/internal/protocol/sealed-sender/v2-binary.js +2 -2
  242. package/dist/internal/protocol/sealed-sender/v2-binary.js.map +1 -1
  243. package/dist/internal/protocol/sender-keys/manager.d.ts +16 -14
  244. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  245. package/dist/internal/protocol/sender-keys/manager.js +37 -34
  246. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  247. package/dist/internal/protocol/spqr/braid-serialize.d.ts +6 -6
  248. package/dist/internal/protocol/spqr/braid-serialize.js +5 -5
  249. package/dist/internal/protocol/spqr/braid-serialize.js.map +1 -1
  250. package/dist/internal/protocol/spqr/braid.d.ts +3 -3
  251. package/dist/internal/protocol/spqr/braid.js +7 -7
  252. package/dist/internal/protocol/spqr/braid.js.map +1 -1
  253. package/dist/internal/protocol/spqr/index.js +1 -1
  254. package/dist/internal/protocol/spqr/index.js.map +1 -1
  255. package/dist/internal/protocol/spqr/ml-kem-braid/chunk-domain.d.ts +3 -3
  256. package/dist/internal/protocol/spqr/ml-kem-braid/chunk-domain.js +3 -3
  257. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js +1 -1
  258. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js.map +1 -1
  259. package/dist/internal/protocol/spqr/ml-kem-braid/kdf.d.ts +1 -1
  260. package/dist/internal/protocol/spqr/ml-kem-braid/kdf.js +1 -1
  261. package/dist/internal/protocol/spqr/ml-kem-braid/kdf.js.map +1 -1
  262. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.d.ts +4 -3
  263. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.d.ts.map +1 -1
  264. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.js +4 -3
  265. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.js.map +1 -1
  266. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js +2 -2
  267. package/dist/internal/protocol/spqr/ml-kem-braid/progress.d.ts +1 -1
  268. package/dist/internal/protocol/spqr/ml-kem-braid/progress.js +1 -1
  269. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts +15 -7
  270. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts.map +1 -1
  271. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js +15 -7
  272. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js.map +1 -1
  273. package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/field.js +1 -1
  274. package/dist/internal/protocol/spqr/ml-kem-braid/rs/polynomial.d.ts +3 -3
  275. package/dist/internal/protocol/spqr/ml-kem-braid/rs/polynomial.js +1 -1
  276. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts +7 -7
  277. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js +11 -11
  278. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js.map +1 -1
  279. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts +1 -1
  280. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +6 -6
  281. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
  282. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +2 -2
  283. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
  284. package/dist/internal/protocol/spqr/ml-kem-braid/types.js.map +1 -1
  285. package/dist/internal/protocol/spqr/serialize.d.ts +12 -12
  286. package/dist/internal/protocol/spqr/serialize.js +5 -5
  287. package/dist/internal/protocol/spqr/spqr.d.ts +6 -6
  288. package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
  289. package/dist/internal/protocol/spqr/spqr.js +47 -42
  290. package/dist/internal/protocol/spqr/spqr.js.map +1 -1
  291. package/dist/internal/protocol/spqr/validate.d.ts +1 -1
  292. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +12 -12
  293. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +1 -1
  294. package/dist/internal/protocol/triple-ratchet/ratchet.js +11 -11
  295. package/dist/internal/protocol/triple-ratchet/ratchet.js.map +1 -1
  296. package/dist/internal/protocol/username/hash.d.ts.map +1 -1
  297. package/dist/internal/protocol/username/hash.js +6 -4
  298. package/dist/internal/protocol/username/hash.js.map +1 -1
  299. package/dist/internal/protocol/version.d.ts +3 -3
  300. package/dist/internal/protocol/version.js +1 -1
  301. package/dist/internal/protocol/x3dh/x3dh.d.ts +16 -16
  302. package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
  303. package/dist/internal/protocol/x3dh/x3dh.js +15 -15
  304. package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
  305. package/dist/internal/protocol/zk/credentials/attributes.d.ts +7 -7
  306. package/dist/internal/protocol/zk/credentials/attributes.js +7 -7
  307. package/dist/internal/protocol/zk/credentials/credentials.d.ts +1 -1
  308. package/dist/internal/protocol/zk/credentials/credentials.js +1 -1
  309. package/dist/internal/protocol/zk/credentials/endorsements.d.ts +11 -11
  310. package/dist/internal/protocol/zk/credentials/endorsements.js +14 -14
  311. package/dist/internal/protocol/zk/credentials/issuance.d.ts +5 -1
  312. package/dist/internal/protocol/zk/credentials/issuance.d.ts.map +1 -1
  313. package/dist/internal/protocol/zk/credentials/issuance.js +5 -1
  314. package/dist/internal/protocol/zk/credentials/issuance.js.map +1 -1
  315. package/dist/internal/protocol/zk/credentials/presentation.d.ts +16 -16
  316. package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -1
  317. package/dist/internal/protocol/zk/credentials/presentation.js +18 -18
  318. package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -1
  319. package/dist/internal/protocol/zk/groups/auth-credential.d.ts +22 -16
  320. package/dist/internal/protocol/zk/groups/auth-credential.d.ts.map +1 -1
  321. package/dist/internal/protocol/zk/groups/auth-credential.js +19 -14
  322. package/dist/internal/protocol/zk/groups/auth-credential.js.map +1 -1
  323. package/dist/internal/protocol/zk/groups/client-zk-group-cipher.d.ts +4 -4
  324. package/dist/internal/protocol/zk/groups/client-zk-group-cipher.js +4 -4
  325. package/dist/internal/protocol/zk/groups/group-params.d.ts +2 -2
  326. package/dist/internal/protocol/zk/groups/group-params.js +2 -2
  327. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts +10 -9
  328. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts.map +1 -1
  329. package/dist/internal/protocol/zk/groups/group-send-endorsement.js +9 -8
  330. package/dist/internal/protocol/zk/groups/group-send-endorsement.js.map +1 -1
  331. package/dist/internal/protocol/zk/groups/lizard.d.ts +1 -1
  332. package/dist/internal/protocol/zk/groups/lizard.js +4 -4
  333. package/dist/internal/protocol/zk/groups/lizard.js.map +1 -1
  334. package/dist/internal/protocol/zk/groups/profile-key-commitment.d.ts +3 -3
  335. package/dist/internal/protocol/zk/groups/profile-key-commitment.js +3 -3
  336. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts +11 -11
  337. package/dist/internal/protocol/zk/groups/profile-key-credential.js +7 -7
  338. package/dist/internal/protocol/zk/groups/profile-key-encryption.d.ts +2 -2
  339. package/dist/internal/protocol/zk/groups/profile-key-encryption.js +2 -2
  340. package/dist/internal/protocol/zk/groups/profile-key-struct.d.ts +2 -2
  341. package/dist/internal/protocol/zk/groups/profile-key-struct.js +2 -2
  342. package/dist/internal/protocol/zk/groups/profile-key-version.d.ts +2 -2
  343. package/dist/internal/protocol/zk/groups/profile-key-version.js +2 -2
  344. package/dist/internal/protocol/zk/groups/server-params.d.ts +1 -1
  345. package/dist/internal/protocol/zk/groups/server-params.js +1 -1
  346. package/dist/internal/protocol/zk/groups/uid-encryption.d.ts +4 -4
  347. package/dist/internal/protocol/zk/groups/uid-encryption.js +4 -4
  348. package/dist/internal/protocol/zk/groups/uid-struct.d.ts +2 -2
  349. package/dist/internal/protocol/zk/groups/uid-struct.js +3 -3
  350. package/dist/internal/protocol/zk/groups/uid-struct.js.map +1 -1
  351. package/dist/internal/protocol/zk/proofs/args.d.ts +3 -3
  352. package/dist/internal/protocol/zk/proofs/args.js +3 -3
  353. package/dist/internal/protocol/zk/proofs/sho-sha256.d.ts +3 -3
  354. package/dist/internal/protocol/zk/proofs/sho-sha256.js +3 -3
  355. package/dist/internal/protocol/zk/proofs/sho.d.ts +8 -7
  356. package/dist/internal/protocol/zk/proofs/sho.d.ts.map +1 -1
  357. package/dist/internal/protocol/zk/proofs/sho.js +8 -7
  358. package/dist/internal/protocol/zk/proofs/sho.js.map +1 -1
  359. package/dist/internal/protocol/zk/proofs/statement.d.ts +8 -6
  360. package/dist/internal/protocol/zk/proofs/statement.d.ts.map +1 -1
  361. package/dist/internal/protocol/zk/proofs/statement.js +8 -6
  362. package/dist/internal/protocol/zk/proofs/statement.js.map +1 -1
  363. package/dist/internal/sesame/manager.d.ts +23 -19
  364. package/dist/internal/sesame/manager.d.ts.map +1 -1
  365. package/dist/internal/sesame/manager.js +64 -54
  366. package/dist/internal/sesame/manager.js.map +1 -1
  367. package/dist/internal/sesame/types.d.ts +28 -25
  368. package/dist/internal/sesame/types.d.ts.map +1 -1
  369. package/dist/internal/sesame/types.js +2 -2
  370. package/dist/internal/sesame/types.js.map +1 -1
  371. package/dist/internal/sesame/validation.d.ts +2 -2
  372. package/dist/internal/sesame/validation.js +3 -3
  373. package/dist/internal/sesame/validation.js.map +1 -1
  374. package/dist/internal/session/builder.d.ts +8 -8
  375. package/dist/internal/session/builder.js +22 -22
  376. package/dist/internal/session/builder.js.map +1 -1
  377. package/dist/internal/session/cipher.d.ts +3 -3
  378. package/dist/internal/session/cipher.d.ts.map +1 -1
  379. package/dist/internal/session/cipher.js +51 -40
  380. package/dist/internal/session/cipher.js.map +1 -1
  381. package/dist/internal/session/decryption.js +11 -9
  382. package/dist/internal/session/decryption.js.map +1 -1
  383. package/dist/internal/session/factory.js +1 -1
  384. package/dist/internal/session/factory.js.map +1 -1
  385. package/dist/internal/session/handshake.d.ts +4 -4
  386. package/dist/internal/session/handshake.js +4 -4
  387. package/dist/internal/session/keys.d.ts +3 -4
  388. package/dist/internal/session/keys.d.ts.map +1 -1
  389. package/dist/internal/session/keys.js.map +1 -1
  390. package/dist/internal/session/ratchet.d.ts +8 -8
  391. package/dist/internal/session/ratchet.js +10 -10
  392. package/dist/internal/session/ratchet.js.map +1 -1
  393. package/dist/internal/session/session-resolver.d.ts +6 -6
  394. package/dist/internal/session/session-resolver.js +6 -6
  395. package/dist/internal/session/state.d.ts +12 -12
  396. package/dist/internal/session/state.d.ts.map +1 -1
  397. package/dist/internal/session/state.js +7 -7
  398. package/dist/internal/session/types.d.ts +20 -20
  399. package/dist/internal/session/types.d.ts.map +1 -1
  400. package/dist/internal/session/types.js +3 -3
  401. package/dist/internal/session/validation.d.ts +1 -1
  402. package/dist/internal/session/validation.js +4 -4
  403. package/dist/internal/session/validation.js.map +1 -1
  404. package/dist/keys/branded.d.ts +12 -12
  405. package/dist/keys/branded.js +3 -3
  406. package/dist/keys/generation.d.ts +4 -4
  407. package/dist/keys/generation.js +4 -4
  408. package/dist/keys/identity.d.ts +7 -7
  409. package/dist/keys/identity.d.ts.map +1 -1
  410. package/dist/keys/identity.js +7 -7
  411. package/dist/keys/identity.js.map +1 -1
  412. package/dist/keys/types.d.ts +16 -16
  413. package/dist/keys/types.d.ts.map +1 -1
  414. package/dist/layers.d.ts +1 -1
  415. package/dist/layers.js +1 -1
  416. package/dist/local/store/expo/adapter.d.ts +8 -8
  417. package/dist/local/store/expo/adapter.js +10 -10
  418. package/dist/local/store/expo/adapter.js.map +1 -1
  419. package/dist/local/store/expo/database-key.d.ts +7 -7
  420. package/dist/local/store/expo/database-key.js +7 -7
  421. package/dist/local/store/expo/key-storage.d.ts +1 -1
  422. package/dist/local/store/expo/key-storage.js +4 -4
  423. package/dist/local/store/expo/key-storage.js.map +1 -1
  424. package/dist/local/store/expo/models/kyber-prekey-used.d.ts +6 -6
  425. package/dist/local/store/expo/models/kyber-prekey-used.js +3 -3
  426. package/dist/local/store/expo/models/kyber-prekey.d.ts +1 -1
  427. package/dist/local/store/expo/models/kyber-prekey.js +1 -1
  428. package/dist/local/store/expo/models/message-record.d.ts +2 -2
  429. package/dist/local/store/expo/models/message-record.d.ts.map +1 -1
  430. package/dist/local/store/expo/models/message-record.js +1 -1
  431. package/dist/local/store/expo/models/message-record.js.map +1 -1
  432. package/dist/local/store/expo/models/sender-key.d.ts +11 -10
  433. package/dist/local/store/expo/models/sender-key.d.ts.map +1 -1
  434. package/dist/local/store/expo/models/sender-key.js +11 -10
  435. package/dist/local/store/expo/models/sender-key.js.map +1 -1
  436. package/dist/local/store/expo/schema.d.ts +2 -2
  437. package/dist/local/store/expo/schema.js +2 -2
  438. package/dist/local/store/expo/secure-store-options.d.ts +1 -1
  439. package/dist/local/store/memory/adapter.d.ts +2 -2
  440. package/dist/local/store/memory/adapter.js +12 -12
  441. package/dist/local/store/memory/adapter.js.map +1 -1
  442. package/dist/local/store/node/adapter.d.ts.map +1 -1
  443. package/dist/local/store/node/adapter.js +5 -4
  444. package/dist/local/store/node/adapter.js.map +1 -1
  445. package/dist/local/store/node/database-key.d.ts +8 -8
  446. package/dist/local/store/node/database-key.js +10 -10
  447. package/dist/local/store/node/database-key.js.map +1 -1
  448. package/dist/local/store/node/database.d.ts +5 -5
  449. package/dist/local/store/node/database.js +11 -11
  450. package/dist/local/store/node/database.js.map +1 -1
  451. package/dist/local/store/react-native/adapter.d.ts +6 -6
  452. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  453. package/dist/local/store/react-native/adapter.js +35 -32
  454. package/dist/local/store/react-native/adapter.js.map +1 -1
  455. package/dist/local/store/react-native/backend-conformance.d.ts +11 -10
  456. package/dist/local/store/react-native/backend-conformance.d.ts.map +1 -1
  457. package/dist/local/store/react-native/backend-conformance.js +13 -12
  458. package/dist/local/store/react-native/backend-conformance.js.map +1 -1
  459. package/dist/local/store/react-native/index.d.ts +1 -1
  460. package/dist/local/store/react-native/reference-backend.d.ts +14 -13
  461. package/dist/local/store/react-native/reference-backend.d.ts.map +1 -1
  462. package/dist/local/store/react-native/reference-backend.js +15 -14
  463. package/dist/local/store/react-native/reference-backend.js.map +1 -1
  464. package/dist/local/store/react-native/storage.d.ts +3 -3
  465. package/dist/local/store/web/adapter.d.ts +3 -3
  466. package/dist/local/store/web/adapter.d.ts.map +1 -1
  467. package/dist/local/store/web/adapter.js +30 -31
  468. package/dist/local/store/web/adapter.js.map +1 -1
  469. package/dist/local/store/web/index.d.ts +1 -1
  470. package/dist/local/vault/index.d.ts +2 -2
  471. package/dist/media/index.d.ts +11 -11
  472. package/dist/media/index.js +9 -9
  473. package/dist/profile/contact-state.d.ts +1 -1
  474. package/dist/profile/contact-state.js +1 -1
  475. package/dist/profile/profile-key.d.ts +2 -2
  476. package/dist/profile/profile-key.js +7 -6
  477. package/dist/profile/profile-key.js.map +1 -1
  478. package/dist/remote/object-store/index.d.ts +1 -1
  479. package/dist/remote/object-store/s3/storage.d.ts +1 -1
  480. package/dist/remote/object-store/types.d.ts +4 -4
  481. package/dist/remote/object-store/types.d.ts.map +1 -1
  482. package/dist/remote/relay/convex/backend.d.ts +4 -4
  483. package/dist/remote/relay/convex/backend.js +3 -3
  484. package/dist/remote/relay/convex/backend.js.map +1 -1
  485. package/dist/remote/relay/convex/component/accounts.d.ts +15 -13
  486. package/dist/remote/relay/convex/component/accounts.d.ts.map +1 -1
  487. package/dist/remote/relay/convex/component/accounts.js +31 -28
  488. package/dist/remote/relay/convex/component/accounts.js.map +1 -1
  489. package/dist/remote/relay/convex/component/certificates.js +1 -1
  490. package/dist/remote/relay/convex/component/cleanup.js +7 -7
  491. package/dist/remote/relay/convex/component/cleanup.js.map +1 -1
  492. package/dist/remote/relay/convex/component/convex.config.d.ts.map +1 -1
  493. package/dist/remote/relay/convex/component/convex.config.js +10 -8
  494. package/dist/remote/relay/convex/component/convex.config.js.map +1 -1
  495. package/dist/remote/relay/convex/component/devices.d.ts +21 -20
  496. package/dist/remote/relay/convex/component/devices.d.ts.map +1 -1
  497. package/dist/remote/relay/convex/component/devices.js +24 -23
  498. package/dist/remote/relay/convex/component/devices.js.map +1 -1
  499. package/dist/remote/relay/convex/component/groups.js +6 -6
  500. package/dist/remote/relay/convex/component/groups.js.map +1 -1
  501. package/dist/remote/relay/convex/component/messages.d.ts.map +1 -1
  502. package/dist/remote/relay/convex/component/messages.js +89 -82
  503. package/dist/remote/relay/convex/component/messages.js.map +1 -1
  504. package/dist/remote/relay/convex/component/provisioning.d.ts +3 -3
  505. package/dist/remote/relay/convex/component/provisioning.d.ts.map +1 -1
  506. package/dist/remote/relay/convex/component/provisioning.js +17 -16
  507. package/dist/remote/relay/convex/component/provisioning.js.map +1 -1
  508. package/dist/remote/relay/convex/component/runtime.d.ts.map +1 -1
  509. package/dist/remote/relay/convex/component/runtime.js +4 -2
  510. package/dist/remote/relay/convex/component/runtime.js.map +1 -1
  511. package/dist/remote/relay/convex/component/schema.js +25 -24
  512. package/dist/remote/relay/convex/component/schema.js.map +1 -1
  513. package/dist/remote/relay/convex/group-server.d.ts +3 -3
  514. package/dist/remote/relay/convex/group-server.js +3 -3
  515. package/dist/remote/relay/convex/relay.d.ts +3 -3
  516. package/dist/remote/relay/convex/relay.d.ts.map +1 -1
  517. package/dist/remote/relay/convex/relay.js +18 -17
  518. package/dist/remote/relay/convex/relay.js.map +1 -1
  519. package/dist/remote/relay/convex/types.d.ts +7 -7
  520. package/dist/remote/relay/convex/types.js +4 -4
  521. package/dist/remote/relay/memory/adapter.js +9 -9
  522. package/dist/remote/relay/memory/adapter.js.map +1 -1
  523. package/dist/remote/relay/types.d.ts +27 -27
  524. package/dist/remote/relay/types.d.ts.map +1 -1
  525. package/dist/safety/fingerprint.d.ts +7 -6
  526. package/dist/safety/fingerprint.d.ts.map +1 -1
  527. package/dist/safety/fingerprint.js +5 -4
  528. package/dist/safety/fingerprint.js.map +1 -1
  529. package/dist/safety/index.d.ts +6 -5
  530. package/dist/safety/index.d.ts.map +1 -1
  531. package/dist/safety/index.js +7 -6
  532. package/dist/safety/index.js.map +1 -1
  533. package/dist/safety/protobuf.js +2 -2
  534. package/dist/safety/protobuf.js.map +1 -1
  535. package/dist/safety/url.d.ts +5 -5
  536. package/dist/safety/url.js +6 -6
  537. package/dist/types/address.d.ts +2 -2
  538. package/dist/types/address.js +2 -2
  539. package/dist/types/api.d.ts +78 -73
  540. package/dist/types/api.d.ts.map +1 -1
  541. package/dist/types/errors.d.ts +63 -403
  542. package/dist/types/errors.d.ts.map +1 -1
  543. package/dist/types/errors.js +62 -537
  544. package/dist/types/errors.js.map +1 -1
  545. package/dist/types/messages.d.ts +16 -16
  546. package/dist/types/messages.d.ts.map +1 -1
  547. package/dist/types/messages.js +7 -7
  548. package/dist/types/messages.js.map +1 -1
  549. package/dist/types/protocol-config.d.ts +52 -49
  550. package/dist/types/protocol-config.d.ts.map +1 -1
  551. package/dist/types/protocol-config.js +36 -34
  552. package/dist/types/protocol-config.js.map +1 -1
  553. package/dist/types/protocol-constants.d.ts +2 -2
  554. package/dist/types/protocol-constants.js +2 -2
  555. package/dist/types/session.d.ts +62 -61
  556. package/dist/types/session.d.ts.map +1 -1
  557. package/dist/types/session.js +13 -14
  558. package/dist/types/session.js.map +1 -1
  559. package/dist/types/trust.d.ts +8 -8
  560. package/dist/types/trust.js +3 -3
  561. package/dist/utils/retry.d.ts.map +1 -1
  562. package/dist/utils/retry.js +2 -4
  563. package/dist/utils/retry.js.map +1 -1
  564. package/docs/ASSURANCE.md +82 -74
  565. package/docs/CLIENT_COMPOSITION.md +19 -15
  566. package/docs/DEVIATIONS.md +507 -425
  567. package/docs/DOCUMENTATION_STANDARDS.md +24 -24
  568. package/docs/E2EE.md +45 -42
  569. package/docs/ERROR_HANDLING.md +29 -105
  570. package/docs/GETTING_STARTED.md +24 -25
  571. package/docs/INTERFACES.md +27 -18
  572. package/docs/PACKAGE_SURFACE.md +23 -21
  573. package/docs/PROTOCOL_POLICY.md +19 -13
  574. package/docs/RECIPES.md +4 -4
  575. package/docs/SECURITY.md +72 -60
  576. package/encoding/README.md +2 -2
  577. package/files/README.md +1 -1
  578. package/groups/README.md +4 -3
  579. package/hooks/README.md +2 -2
  580. package/keys/README.md +15 -14
  581. package/local/store/README.md +82 -67
  582. package/local/store/expo/README.md +17 -12
  583. package/local/store/memory/README.md +4 -3
  584. package/local/store/node/README.md +8 -6
  585. package/local/store/react-native/README.md +14 -12
  586. package/local/store/web/README.md +31 -26
  587. package/local/vault/README.md +4 -4
  588. package/media/README.md +6 -5
  589. package/package.json +2 -2
  590. package/profile/README.md +7 -7
  591. package/remote/README.md +20 -18
  592. package/remote/object-store/README.md +8 -4
  593. package/remote/object-store/convex-r2/README.md +3 -3
  594. package/remote/object-store/s3/README.md +10 -5
  595. package/remote/relay/convex/README.md +5 -5
  596. package/remote/relay/convex/component/README.md +145 -124
  597. package/remote/relay/memory/README.md +6 -5
  598. package/safety/README.md +1 -1
  599. package/sealed-sender/README.md +3 -2
  600. package/types/README.md +1 -1
  601. package/utils/README.md +4 -4
@@ -1,29 +1,27 @@
1
1
  /**
2
- * Error type definitions for Signal Protocol
2
+ * Error type definitions for Signal Protocol.
3
3
  *
4
- * Implements a tiered error system aligned with the layered architecture:
4
+ * Every error the SDK throws is an `EncryptionError` carrying an
5
+ * `EncryptionErrorCode`. A subclass exists only where the caller needs typed
6
+ * data off the error to recover. Examples are the peer's address and identity
7
+ * to verify a safety number, and the counter and epoch of a duplicate. Each
8
+ * subclass fixes its own code in its constructor.
5
9
  *
6
10
  * ```
7
- * Layer Error Class Use Case
8
- * ──────────────────────────────────────────────────────
9
- * Layer 1 CryptoError Low-level crypto failures
10
- * Layer 5 SessionError Session operations
11
- * Layer 6 ProtocolError Protocol-level errors
12
- * Client ClientError User-facing errors
13
- * Base EncryptionError Generic encryption errors
14
- * ```
15
- *
16
- * Error Hierarchy:
17
- * ```
18
11
  * Error
19
- * └── EncryptionError (base for all Signal Protocol errors)
20
- * ├── CryptoError (Layer 1)
21
- * ├── SessionError (Layer 5)
22
- * ├── ProtocolError (Layer 6)
23
- * ├── ClientError (User-facing)
24
- * └── Specialized errors (UntrustedIdentityError, etc.)
12
+ * └── EncryptionError code + context, thrown directly for most failures
13
+ * ├── UntrustedIdentityError address + identity, for safety-number verification
14
+ * ├── DuplicatedMessageError counter + epoch of the replayed message
15
+ * ├── SealedSenderAuthError the rejected sealed-sender credential
16
+ * ├── PQXDHRequiredError which post-quantum key the peer is missing
17
+ * └── StorageQuotaExceededError the store that ran out of room
25
18
  * ```
26
19
  *
20
+ * A code or a subclass belongs here only if production code can produce it. An
21
+ * error-surface check in the engineering repository parses for the construction
22
+ * sites that decide that. It fails the build when this module declares
23
+ * something nothing throws. A `switch` arm or a non-retryable set only reads a
24
+ * code. It does not produce one, so it does not keep a code alive.
27
25
  */
28
26
  import type { ProtocolAddress } from './address.js';
29
27
  import type { CompositeIdentityV1, PublicKey } from '../keys/index.js';
@@ -37,7 +35,7 @@ export {};
37
35
  export interface EncryptionErrorContext {
38
36
  /** The protocol address involved in the error (if applicable) */
39
37
  address?: ProtocolAddress;
40
- /** The operation being performed when the error occurred */
38
+ /** The operation in progress when the error occurred */
41
39
  operation?: string;
42
40
  /** The identity key involved (for trust/verification errors) */
43
41
  identityKey?: PublicKey;
@@ -83,20 +81,13 @@ export declare class EncryptionError extends Error {
83
81
  export declare enum EncryptionErrorCode {
84
82
  /** Session not found for the given address */
85
83
  SESSION_NOT_FOUND = "SESSION_NOT_FOUND",
86
- /** Session data is corrupted or invalid */
84
+ /** Damaged or invalid session data */
87
85
  SESSION_CORRUPTED = "SESSION_CORRUPTED",
88
- /**
89
- * Multiple active sessions detected (race condition).
90
- *
91
- * Occurs when both parties try to establish sessions simultaneously.
92
- * Requires session archiving and convergence.
93
- */
94
- SESSION_CONFLICT = "SESSION_CONFLICT",
95
86
  /**
96
87
  * Recipient has not registered encryption keys.
97
88
  *
98
89
  * The target user has no prekey bundle available on the server.
99
- * They may not have completed encryption setup.
90
+ * Their encryption setup may be incomplete.
100
91
  */
101
92
  RECIPIENT_NOT_REGISTERED = "RECIPIENT_NOT_REGISTERED",
102
93
  /**
@@ -121,15 +112,9 @@ export declare enum EncryptionErrorCode {
121
112
  /**
122
113
  * Duplicate message detected (replay attack).
123
114
  *
124
- * Message number has already been processed.
115
+ * The session already processed this message number.
125
116
  */
126
117
  MESSAGE_DUPLICATE = "MESSAGE_DUPLICATE",
127
- /**
128
- * Message arrived too old to decrypt.
129
- *
130
- * Message keys have been deleted due to age or count limits.
131
- */
132
- MESSAGE_TOO_OLD = "MESSAGE_TOO_OLD",
133
118
  /**
134
119
  * Too many messages skipped (DoS protection).
135
120
  *
@@ -138,7 +123,7 @@ export declare enum EncryptionErrorCode {
138
123
  */
139
124
  TOO_MANY_SKIPPED_MESSAGES = "TOO_MANY_SKIPPED_MESSAGES",
140
125
  /**
141
- * Replay attack detected: envelope.timestamp doesn't match dataMessage.timestamp.
126
+ * Replay attack detected: envelope.timestamp does not match dataMessage.timestamp.
142
127
  *
143
128
  * After decryption, the envelope timestamp must match the timestamp inside the encrypted
144
129
  * content. A mismatch indicates an attacker may have re-sent old encrypted content
@@ -147,13 +132,7 @@ export declare enum EncryptionErrorCode {
147
132
  */
148
133
  REPLAY_DETECTED = "REPLAY_DETECTED",
149
134
  /**
150
- * Invalid message version or protocol mismatch.
151
- *
152
- * Message was encrypted with an incompatible protocol version.
153
- */
154
- INVALID_MESSAGE_VERSION = "INVALID_MESSAGE_VERSION",
155
- /**
156
- * Sender key has expired based on time-based rotation policy.
135
+ * The sender key expired under the time-based rotation policy.
157
136
  *
158
137
  * The default policy rotates sender keys every two weeks.
159
138
  * The caller should auto-rotate the sender key and redistribute to group members.
@@ -162,20 +141,14 @@ export declare enum EncryptionErrorCode {
162
141
  /**
163
142
  * Identity key is not trusted.
164
143
  *
165
- * User has not verified the identity or it has changed without confirmation.
144
+ * The user did not verify the identity, or the identity changed without
145
+ * confirmation.
166
146
  */
167
147
  UNTRUSTED_IDENTITY = "UNTRUSTED_IDENTITY",
168
- /**
169
- * Identity key changed (possible MITM attack).
170
- *
171
- * Remote party's identity key differs from previously saved value.
172
- * Could be legitimate (reinstall) or an attack.
173
- */
174
- IDENTITY_KEY_CHANGED = "IDENTITY_KEY_CHANGED",
175
148
  /**
176
149
  * Sender identity mismatch.
177
150
  *
178
- * The sender address in the message doesn't match the expected address.
151
+ * The sender address in the message does not match the expected address.
179
152
  * This indicates a session hijacking attempt where an attacker tries to
180
153
  * inject their messages under a different identity.
181
154
  */
@@ -189,60 +162,33 @@ export declare enum EncryptionErrorCode {
189
162
  /**
190
163
  * PreKey rotation required before sending.
191
164
  *
192
- * Signed prekeys or Kyber prekeys have exceeded the maximum allowed age
193
- * (14 days by default). Message sending is blocked until rotation succeeds
194
- * to maintain forward-secrecy guarantees.
165
+ * Signed prekeys or Kyber prekeys are past the maximum allowed age
166
+ * (14 days by default). The client blocks message sending until rotation
167
+ * succeeds, which maintains the forward-secrecy guarantees.
195
168
  *
196
169
  * @see https://signal.org/docs/specifications/pqxdh/#publishing-keys
197
170
  */
198
171
  PREKEY_ROTATION_REQUIRED = "PREKEY_ROTATION_REQUIRED",
199
- /**
200
- * Invalid registration ID.
201
- *
202
- * Registration ID is 0 or doesn't match expected format.
203
- */
204
- INVALID_REGISTRATION_ID = "INVALID_REGISTRATION_ID",
205
- /**
206
- * Registration ID changed (session reset detected).
207
- *
208
- * Remote party's registration ID changed, indicating app reinstall.
209
- * Old sessions should be archived.
210
- */
211
- REGISTRATION_ID_CHANGED = "REGISTRATION_ID_CHANGED",
212
- /**
213
- * DH ratchet error.
214
- *
215
- * Diffie-Hellman key exchange failed or produced invalid output.
216
- */
217
- RATCHET_ERROR = "RATCHET_ERROR",
218
172
  /**
219
173
  * Message counter overflow.
220
174
  *
221
- * Counter has reached MAX_SAFE_INTEGER - session must be rotated.
175
+ * The counter reached MAX_SAFE_INTEGER, so the caller must rotate the session.
222
176
  * This is a safety check to prevent cryptographic issues from counter wrap-around.
223
177
  */
224
178
  COUNTER_OVERFLOW = "COUNTER_OVERFLOW",
225
179
  /**
226
180
  * Invalid DH public key.
227
181
  *
228
- * DH public key is malformed or fails validation.
182
+ * A malformed DH public key, or one that fails validation.
229
183
  */
230
184
  INVALID_DH_KEY = "INVALID_DH_KEY",
231
185
  /** Key storage operation failed */
232
186
  KEY_STORAGE_ERROR = "KEY_STORAGE_ERROR",
233
- /** Database operation failed */
234
- DATABASE_ERROR = "DATABASE_ERROR",
235
- /**
236
- * Database is locked or unavailable.
237
- *
238
- * Encrypted database cannot be accessed (wrong password, corruption, etc.)
239
- */
240
- DATABASE_LOCKED = "DATABASE_LOCKED",
241
187
  /**
242
- * The storage backend rejected a write because the origin's storage
243
- * quota is exhausted.
188
+ * The storage backend rejected a write because the origin ran out of
189
+ * storage quota.
244
190
  *
245
- * The rejected write did not persist: storage adapters commit each
191
+ * The rejected write did not persist. Storage adapters commit each
246
192
  * write in an atomic transaction, so quota exhaustion rolls the whole
247
193
  * transaction back instead of leaving a subset. The application should
248
194
  * free space or request more from the platform, then retry.
@@ -250,24 +196,22 @@ export declare enum EncryptionErrorCode {
250
196
  STORAGE_QUOTA_EXCEEDED = "STORAGE_QUOTA_EXCEEDED",
251
197
  /** Signal Protocol initialization failed */
252
198
  INITIALIZATION_FAILED = "INITIALIZATION_FAILED",
253
- /** Identity key pair generation or loading failed */
254
- IDENTITY_KEY_ERROR = "IDENTITY_KEY_ERROR",
255
199
  /**
256
- * PQXDH (post-quantum key exchange) is required but partner lacks Kyber keys.
200
+ * PQXDH (post-quantum key exchange) applies, but the partner lacks Kyber keys.
257
201
  *
258
- * Thrown when partner doesn't support the required PQXDH handshake.
202
+ * Thrown when partner does not support the required PQXDH handshake.
259
203
  * Application can catch this to notify user or queue message for retry.
260
204
  */
261
205
  PQXDH_REQUIRED = "PQXDH_REQUIRED",
262
206
  /**
263
207
  * PQXDH key exchange failed during handshake.
264
208
  *
265
- * The post-quantum key exchange encountered an error. The session is aborted
266
- * rather than downgraded to classical X3DH.
209
+ * The post-quantum key exchange encountered an error. The SDK aborts the
210
+ * session instead of a downgrade to classical X3DH.
267
211
  */
268
212
  PQXDH_FAILED = "PQXDH_FAILED",
269
213
  /**
270
- * Triple Ratchet is required but PQXDH was not used.
214
+ * Triple Ratchet applies, but the session did not use PQXDH.
271
215
  *
272
216
  * Triple Ratchet requires post-quantum material from PQXDH.
273
217
  * Cannot enable Triple Ratchet with classical X3DH handshake.
@@ -287,18 +231,10 @@ export declare enum EncryptionErrorCode {
287
231
  * `SPQR`'s the profile uses `max_jump` of 25,000.
288
232
  */
289
233
  SPQR_MESSAGE_JUMP_TOO_LARGE = "SPQR_MESSAGE_JUMP_TOO_LARGE",
290
- /**
291
- * Attempted to use a message key that was already consumed.
292
- *
293
- * Indicates replay attack or duplicate message.
294
- *
295
- * Reserved: Reserved for future use when replay detection is implemented.
296
- */
297
- SPQR_KEY_ALREADY_USED = "SPQR_KEY_ALREADY_USED",
298
234
  /**
299
235
  * SPQR message counter overflow.
300
236
  *
301
- * Counter has reached maximum value - epoch must be rotated.
237
+ * The counter reached its maximum value, so the caller must rotate the epoch.
302
238
  */
303
239
  SPQR_COUNTER_OVERFLOW = "SPQR_COUNTER_OVERFLOW",
304
240
  /**
@@ -307,15 +243,6 @@ export declare enum EncryptionErrorCode {
307
243
  * Ciphertext has wrong size or format for ML-KEM-1024.
308
244
  */
309
245
  SPQR_INVALID_CIPHERTEXT = "SPQR_INVALID_CIPHERTEXT",
310
- /**
311
- * SPQR epoch regression detected.
312
- *
313
- * Received message claims an epoch earlier than current - possible replay.
314
- *
315
- * Reserved: Reserved for future use. Currently epoch regression is handled
316
- * via SPQR_EPOCH_OUT_OF_RANGE with oldestEpoch context.
317
- */
318
- SPQR_EPOCH_REGRESSION = "SPQR_EPOCH_REGRESSION",
319
246
  /**
320
247
  * SPQR version negotiation failed.
321
248
  *
@@ -323,23 +250,15 @@ export declare enum EncryptionErrorCode {
323
250
  * For example, peer only supports V0 but we require V1.
324
251
  */
325
252
  SPQR_VERSION_MISMATCH = "SPQR_VERSION_MISMATCH",
326
- /** Post-quantum (Kyber) operation failed */
327
- KYBER_ERROR = "KYBER_ERROR",
328
- /** Key derivation function failed */
329
- KDF_ERROR = "KDF_ERROR",
330
- /** HMAC verification failed (message tampering detected) */
331
- HMAC_VERIFICATION_FAILED = "HMAC_VERIFICATION_FAILED",
332
253
  /**
333
254
  * Sealed sender authentication failed.
334
255
  *
335
- * The unidentified access key was rejected by the server. This may trigger
256
+ * The server rejected the unidentified access key. This may trigger
336
257
  * fallback to identified sender delivery.
337
258
  */
338
259
  SEALED_SENDER_AUTH_FAILED = "SEALED_SENDER_AUTH_FAILED",
339
260
  /** Invalid operation or state */
340
- INVALID_STATE = "INVALID_STATE",
341
- /** Unknown or unexpected error */
342
- UNKNOWN_ERROR = "UNKNOWN_ERROR"
261
+ INVALID_STATE = "INVALID_STATE"
343
262
  }
344
263
  /**
345
264
  * Error thrown when an identity key is not trusted.
@@ -358,47 +277,12 @@ export declare class UntrustedIdentityError extends EncryptionError {
358
277
  constructor(address: ProtocolAddress, identity: CompositeIdentityV1);
359
278
  }
360
279
  /**
361
- * Error thrown when an identity key has changed.
362
- *
363
- * This could indicate:
364
- * - Legitimate: Device reinstall, new device, backup restoration
365
- * - Attack: Man-in-the-middle attack
366
- *
367
- * Requires prominent user warning and safety number verification.
368
- *
369
- * @example
370
- * ```typescript
371
- * throw new IdentityKeyChangedError(address, oldKey, newKey);
372
- * ```
373
- */
374
- export declare class IdentityKeyChangedError extends EncryptionError {
375
- readonly changedAddress: ProtocolAddress;
376
- readonly oldIdentityKey: PublicKey;
377
- readonly newIdentityKey: PublicKey;
378
- constructor(address: ProtocolAddress, oldIdentityKey: PublicKey, newIdentityKey: PublicKey);
379
- }
380
- /**
381
- * Error thrown when multiple active sessions are detected (race condition).
382
- *
383
- * Occurs when both parties try to establish sessions simultaneously.
384
- * Requires session archiving and convergence using Sesame algorithm.
385
- *
386
- * @example
387
- * ```typescript
388
- * throw new SessionConflictError(address);
389
- * ```
390
- */
391
- export declare class SessionConflictError extends EncryptionError {
392
- readonly conflictAddress: ProtocolAddress;
393
- constructor(address: ProtocolAddress);
394
- }
395
- /**
396
- * Error thrown when a duplicate message is detected (replay attack).
280
+ * Error thrown when the session detects a duplicate message (replay attack).
397
281
  *
398
282
  * This is a security-critical error indicating:
399
283
  * - Network replay (attacker re-sent a captured message)
400
284
  * - Client bug (accidentally decrypting same message twice)
401
- * - Storage corruption (message key index was corrupted)
285
+ * - Storage corruption (a damaged message key index)
402
286
  *
403
287
  * Metadata should support diagnostics without exposing secret material.
404
288
  *
@@ -409,9 +293,9 @@ export declare class SessionConflictError extends EncryptionError {
409
293
  */
410
294
  export declare class DuplicatedMessageError extends EncryptionError {
411
295
  readonly duplicatedAddress: ProtocolAddress;
412
- /** Message counter that was duplicated (if known) - matches the reference implementation's proto field name */
296
+ /** The duplicate message counter (if known) - matches the reference implementation's proto field name */
413
297
  readonly counter?: number;
414
- /** Epoch (for Triple Ratchet) where duplicate was detected */
298
+ /** Epoch (for Triple Ratchet) of the duplicate */
415
299
  readonly epoch?: number;
416
300
  /** Fingerprint of the duplicate ciphertext (truncated for logging) */
417
301
  readonly fingerprintPreview?: string;
@@ -428,28 +312,11 @@ export declare class DuplicatedMessageError extends EncryptionError {
428
312
  * @returns true if error is DuplicatedMessageError
429
313
  */
430
314
  export declare function isDuplicatedMessageError(error: unknown): error is DuplicatedMessageError;
431
- /**
432
- * Error thrown when registration ID has changed (session reset).
433
- *
434
- * Indicates the remote party has reinstalled their app.
435
- * Old sessions should be archived and new session established.
436
- *
437
- * @example
438
- * ```typescript
439
- * throw new RegistrationIdChangedError(address, oldId, newId);
440
- * ```
441
- */
442
- export declare class RegistrationIdChangedError extends EncryptionError {
443
- readonly resetAddress: ProtocolAddress;
444
- readonly oldRegistrationId: number;
445
- readonly newRegistrationId: number;
446
- constructor(address: ProtocolAddress, oldRegistrationId: number, newRegistrationId: number);
447
- }
448
315
  /**
449
316
  * Error thrown when sealed sender (anonymous delivery) authentication fails.
450
317
  *
451
- * The unidentified access key was rejected by the server, either because:
452
- * - The access key doesn't match the recipient's stored key
318
+ * The server rejected the unidentified access key, for one of these reasons:
319
+ * - The access key does not match the recipient's stored key
453
320
  * - The recipient's account was not found
454
321
  * - The recipient disabled unrestricted unidentified access
455
322
  *
@@ -481,7 +348,7 @@ export declare function isSealedSenderAuthError(error: unknown): error is Sealed
481
348
  * Fallback type categories for PQXDH errors.
482
349
  *
483
350
  * Distinguishes between different types of fallback scenarios:
484
- * - `missing_keys`: Partner doesn't have Kyber prekeys (expected compatibility issue)
351
+ * - `missing_keys`: Partner does not have Kyber prekeys (expected compatibility issue)
485
352
  * - `crypto_failure`: Kyber operation failed (decapsulation, signature, etc.)
486
353
  * - `protocol_mismatch`: Version or format incompatibility
487
354
  */
@@ -490,7 +357,7 @@ export type PQXDHFallbackType = 'missing_keys' | 'crypto_failure' | 'protocol_mi
490
357
  * Options for PQXDHRequiredError constructor.
491
358
  */
492
359
  export interface PQXDHRequiredErrorOptions {
493
- /** Whether the operation can be retried (e.g., after partner updates keys) */
360
+ /** Whether the caller can retry the operation (e.g., after partner updates keys) */
494
361
  retryable?: boolean;
495
362
  /** Suggested delay before retry in milliseconds */
496
363
  suggestedRetryDelay?: number;
@@ -500,7 +367,7 @@ export interface PQXDHRequiredErrorOptions {
500
367
  originalError?: Error;
501
368
  }
502
369
  /**
503
- * Error thrown when PQXDH is required but partner lacks Kyber keys.
370
+ * Error thrown when PQXDH applies, but the partner lacks Kyber keys.
504
371
  *
505
372
  * This is a recoverable error - applications can:
506
373
  * - Notify user that partner needs to update their app
@@ -508,7 +375,7 @@ export interface PQXDHRequiredErrorOptions {
508
375
  * - Fall back to classical encryption with user consent
509
376
  *
510
377
  * Recovery metadata:
511
- * - `retryable`: Whether the operation can be retried
378
+ * - `retryable`: Whether the caller can retry the operation
512
379
  * - `suggestedRetryDelay`: Recommended delay before retry (ms)
513
380
  * - `fallbackType`: Category of fallback for analytics
514
381
  *
@@ -539,7 +406,7 @@ export interface PQXDHRequiredErrorOptions {
539
406
  export declare class PQXDHRequiredError extends EncryptionError {
540
407
  readonly remoteAddress: string;
541
408
  readonly reason: 'no_kyber_prekey' | 'pqxdh_failed';
542
- /** Whether the operation can be retried */
409
+ /** Whether the caller can retry the operation */
543
410
  readonly retryable: boolean;
544
411
  /** Suggested delay before retry in milliseconds */
545
412
  readonly suggestedRetryDelay?: number;
@@ -548,10 +415,10 @@ export declare class PQXDHRequiredError extends EncryptionError {
548
415
  constructor(remoteAddress: string, reason: 'no_kyber_prekey' | 'pqxdh_failed', options?: PQXDHRequiredErrorOptions);
549
416
  }
550
417
  /**
551
- * Error thrown when the storage backend rejects a write because the
552
- * origin's storage quota is exhausted.
418
+ * Error thrown when the storage backend rejects a write because the origin
419
+ * ran out of storage quota.
553
420
  *
554
- * The rejected write did not persist: storage adapters commit each write
421
+ * The rejected write did not persist. Storage adapters commit each write
555
422
  * in an atomic transaction, so quota exhaustion rolls the whole
556
423
  * transaction back instead of leaving a subset. The application should
557
424
  * free space or request more from the platform, then retry the write.
@@ -570,6 +437,13 @@ export declare class PQXDHRequiredError extends EncryptionError {
570
437
  export declare class StorageQuotaExceededError extends EncryptionError {
571
438
  constructor(operation: string, originalError?: Error);
572
439
  }
440
+ /**
441
+ * Type guard to check if an error is a StorageQuotaExceededError.
442
+ *
443
+ * @param error - Error to check
444
+ * @returns true if error is StorageQuotaExceededError
445
+ */
446
+ export declare function isStorageQuotaExceededError(error: unknown): error is StorageQuotaExceededError;
573
447
  /**
574
448
  * Type guard to check if an error is a PQXDHRequiredError.
575
449
  *
@@ -584,220 +458,6 @@ export declare function isPQXDHRequiredError(error: unknown): error is PQXDHRequ
584
458
  * @returns true if error is UntrustedIdentityError
585
459
  */
586
460
  export declare function isUntrustedIdentityError(error: unknown): error is UntrustedIdentityError;
587
- /**
588
- * Type guard to check if an error is an IdentityKeyChangedError.
589
- *
590
- * @param error - Error to check
591
- * @returns true if error is IdentityKeyChangedError
592
- */
593
- export declare function isIdentityKeyChangedError(error: unknown): error is IdentityKeyChangedError;
594
- /**
595
- * Type guard to check if an error is a SessionConflictError.
596
- *
597
- * @param error - Error to check
598
- * @returns true if error is SessionConflictError
599
- */
600
- export declare function isSessionConflictError(error: unknown): error is SessionConflictError;
601
- /**
602
- * Type guard to check if an error is a RegistrationIdChangedError.
603
- *
604
- * @param error - Error to check
605
- * @returns true if error is RegistrationIdChangedError
606
- */
607
- export declare function isRegistrationIdChangedError(error: unknown): error is RegistrationIdChangedError;
608
- /**
609
- * Error codes for cryptographic layer (Layer 1) errors.
610
- *
611
- * These errors occur in low-level cryptographic operations.
612
- */
613
- export declare enum CryptoErrorCode {
614
- /** Random number generation failed */
615
- RNG_FAILURE = "CRYPTO_RNG_FAILURE",
616
- /** ECDH key agreement failed */
617
- ECDH_FAILURE = "CRYPTO_ECDH_FAILURE",
618
- /** Kyber (ML-KEM) operation failed */
619
- KYBER_FAILURE = "CRYPTO_KYBER_FAILURE",
620
- /** Key derivation function failed */
621
- KDF_FAILURE = "CRYPTO_KDF_FAILURE",
622
- /** AES encryption/decryption failed */
623
- AES_FAILURE = "CRYPTO_AES_FAILURE",
624
- /** HMAC computation or verification failed */
625
- HMAC_FAILURE = "CRYPTO_HMAC_FAILURE",
626
- /** Digital signature failed */
627
- SIGNATURE_FAILURE = "CRYPTO_SIGNATURE_FAILURE",
628
- /** Hash computation failed */
629
- HASH_FAILURE = "CRYPTO_HASH_FAILURE",
630
- /** Invalid key format or length */
631
- INVALID_KEY = "CRYPTO_INVALID_KEY",
632
- /** Invalid ciphertext format */
633
- INVALID_CIPHERTEXT = "CRYPTO_INVALID_CIPHERTEXT"
634
- }
635
- /**
636
- * Cryptographic layer error (Layer 1).
637
- *
638
- * Thrown when low-level cryptographic operations fail.
639
- * These errors are typically unrecoverable and indicate
640
- * fundamental issues with crypto primitives.
641
- *
642
- * @example
643
- * ```typescript
644
- * throw new CryptoError(
645
- * 'ECDH key agreement produced invalid output',
646
- * CryptoErrorCode.ECDH_FAILURE,
647
- * { operation: 'computeSharedSecret' }
648
- * );
649
- * ```
650
- */
651
- export declare class CryptoError extends EncryptionError {
652
- readonly cryptoCode: CryptoErrorCode;
653
- constructor(message: string, code: CryptoErrorCode, context?: EncryptionErrorContext);
654
- }
655
- /**
656
- * Error codes for session layer (Layer 5) errors.
657
- *
658
- * These errors occur during session operations.
659
- */
660
- export declare enum SessionErrorCode {
661
- /** Session not found */
662
- NOT_FOUND = "SESSION_NOT_FOUND",
663
- /** Session is corrupted or invalid */
664
- CORRUPTED = "SESSION_CORRUPTED",
665
- /** Session has expired */
666
- EXPIRED = "SESSION_EXPIRED",
667
- /** Session conflict (race condition) */
668
- CONFLICT = "SESSION_CONFLICT",
669
- /** Invalid session state for operation */
670
- INVALID_STATE = "SESSION_INVALID_STATE",
671
- /** Session ratchet step failed */
672
- RATCHET_FAILED = "SESSION_RATCHET_FAILED",
673
- /** Too many skipped messages */
674
- TOO_MANY_SKIPPED = "SESSION_TOO_MANY_SKIPPED",
675
- /** Message key not found (message too old) */
676
- MESSAGE_KEY_NOT_FOUND = "SESSION_MESSAGE_KEY_NOT_FOUND",
677
- /** Session establishment failed */
678
- ESTABLISHMENT_FAILED = "SESSION_ESTABLISHMENT_FAILED"
679
- }
680
- /**
681
- * Session layer error (Layer 5).
682
- *
683
- * Thrown when session operations fail. Includes session ID
684
- * for debugging and potentially recovery.
685
- *
686
- * @example
687
- * ```typescript
688
- * throw new SessionError(
689
- * 'Session not found for decryption',
690
- * SessionErrorCode.NOT_FOUND,
691
- * 'session-123',
692
- * { operation: 'decrypt' }
693
- * );
694
- * ```
695
- */
696
- export declare class SessionError extends EncryptionError {
697
- readonly sessionCode: SessionErrorCode;
698
- readonly sessionId?: string;
699
- constructor(message: string, code: SessionErrorCode, sessionId?: string, context?: EncryptionErrorContext);
700
- }
701
- /**
702
- * Error codes for protocol layer (Layer 6) errors.
703
- *
704
- * These errors occur at the protocol level (Sesame, message routing).
705
- */
706
- export declare enum ProtocolErrorCode {
707
- /** Invalid message format */
708
- INVALID_MESSAGE = "PROTOCOL_INVALID_MESSAGE",
709
- /** Invalid prekey bundle */
710
- INVALID_BUNDLE = "PROTOCOL_INVALID_BUNDLE",
711
- /** Protocol version mismatch */
712
- VERSION_MISMATCH = "PROTOCOL_VERSION_MISMATCH",
713
- /** Device not found in device list */
714
- DEVICE_NOT_FOUND = "PROTOCOL_DEVICE_NOT_FOUND",
715
- /** Stale device list */
716
- STALE_DEVICE_LIST = "PROTOCOL_STALE_DEVICE_LIST",
717
- /** Retry request required */
718
- RETRY_REQUIRED = "PROTOCOL_RETRY_REQUIRED",
719
- /** Sender key distribution failed */
720
- SENDER_KEY_FAILED = "PROTOCOL_SENDER_KEY_FAILED"
721
- }
722
- /**
723
- * Protocol layer error (Layer 6).
724
- *
725
- * Thrown for protocol-level issues like message format errors,
726
- * version mismatches, or multi-device coordination failures.
727
- *
728
- * @example
729
- * ```typescript
730
- * throw new ProtocolError(
731
- * 'Device list is stale, retry required',
732
- * ProtocolErrorCode.STALE_DEVICE_LIST,
733
- * { operation: 'sendGroupMessage', context: { groupId } }
734
- * );
735
- * ```
736
- */
737
- export declare class ProtocolError extends EncryptionError {
738
- readonly protocolCode: ProtocolErrorCode;
739
- readonly protocolContext?: object;
740
- constructor(message: string, code: ProtocolErrorCode, context?: EncryptionErrorContext & {
741
- protocolContext?: object;
742
- });
743
- }
744
- /**
745
- * Error codes for client-facing errors.
746
- *
747
- * These errors should be displayed to users (with appropriate messaging).
748
- */
749
- export declare enum ClientErrorCode {
750
- /** Network error during key exchange */
751
- NETWORK_ERROR = "CLIENT_NETWORK_ERROR",
752
- /** User identity verification required */
753
- VERIFICATION_REQUIRED = "CLIENT_VERIFICATION_REQUIRED",
754
- /** Recipient not found */
755
- RECIPIENT_NOT_FOUND = "CLIENT_RECIPIENT_NOT_FOUND",
756
- /** Message delivery failed */
757
- DELIVERY_FAILED = "CLIENT_DELIVERY_FAILED",
758
- /** Encryption unavailable (keys not initialized) */
759
- ENCRYPTION_UNAVAILABLE = "CLIENT_ENCRYPTION_UNAVAILABLE",
760
- /** Session needs reset */
761
- SESSION_RESET_NEEDED = "CLIENT_SESSION_RESET_NEEDED"
762
- }
763
- /**
764
- * Client-facing error.
765
- *
766
- * These errors are intended to be shown to users with
767
- * appropriate messaging. Includes optional user-facing
768
- * message that can be displayed directly in UI.
769
- *
770
- * @example
771
- * ```typescript
772
- * throw new ClientError(
773
- * 'Failed to send encrypted message',
774
- * ClientErrorCode.DELIVERY_FAILED,
775
- * 'Message could not be delivered. Please try again.',
776
- * { operation: 'sendMessage' }
777
- * );
778
- * ```
779
- */
780
- export declare class ClientError extends EncryptionError {
781
- readonly clientCode: ClientErrorCode;
782
- readonly userFacingMessage?: string;
783
- constructor(message: string, code: ClientErrorCode, userFacingMessage?: string, context?: EncryptionErrorContext);
784
- }
785
- /**
786
- * Type guard to check if an error is a CryptoError.
787
- */
788
- export declare function isCryptoError(error: unknown): error is CryptoError;
789
- /**
790
- * Type guard to check if an error is a SessionError.
791
- */
792
- export declare function isSessionError(error: unknown): error is SessionError;
793
- /**
794
- * Type guard to check if an error is a ProtocolError.
795
- */
796
- export declare function isProtocolError(error: unknown): error is ProtocolError;
797
- /**
798
- * Type guard to check if an error is a ClientError.
799
- */
800
- export declare function isClientError(error: unknown): error is ClientError;
801
461
  /**
802
462
  * Type guard to check if an error is any Signal Protocol error.
803
463
  */