@unwanted/matrix-sdk-mini 34.12.0-1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +5910 -0
- package/LICENSE +177 -0
- package/README.md +459 -0
- package/git-revision.txt +1 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts +14 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts.map +1 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.js +1 -0
- package/lib/@types/AESEncryptedSecretStoragePayload.js.map +1 -0
- package/lib/@types/IIdentityServerProvider.d.ts +9 -0
- package/lib/@types/IIdentityServerProvider.d.ts.map +1 -0
- package/lib/@types/IIdentityServerProvider.js +1 -0
- package/lib/@types/IIdentityServerProvider.js.map +1 -0
- package/lib/@types/PushRules.d.ts +140 -0
- package/lib/@types/PushRules.d.ts.map +1 -0
- package/lib/@types/PushRules.js +94 -0
- package/lib/@types/PushRules.js.map +1 -0
- package/lib/@types/another-json.d.js +0 -0
- package/lib/@types/another-json.d.js.map +1 -0
- package/lib/@types/auth.d.ts +208 -0
- package/lib/@types/auth.d.ts.map +1 -0
- package/lib/@types/auth.js +99 -0
- package/lib/@types/auth.js.map +1 -0
- package/lib/@types/beacon.d.ts +106 -0
- package/lib/@types/beacon.d.ts.map +1 -0
- package/lib/@types/beacon.js +119 -0
- package/lib/@types/beacon.js.map +1 -0
- package/lib/@types/common.d.ts +9 -0
- package/lib/@types/common.d.ts.map +1 -0
- package/lib/@types/common.js +1 -0
- package/lib/@types/common.js.map +1 -0
- package/lib/@types/crypto.d.ts +47 -0
- package/lib/@types/crypto.d.ts.map +1 -0
- package/lib/@types/crypto.js +1 -0
- package/lib/@types/crypto.js.map +1 -0
- package/lib/@types/event.d.ts +258 -0
- package/lib/@types/event.d.ts.map +1 -0
- package/lib/@types/event.js +239 -0
- package/lib/@types/event.js.map +1 -0
- package/lib/@types/events.d.ts +92 -0
- package/lib/@types/events.d.ts.map +1 -0
- package/lib/@types/events.js +1 -0
- package/lib/@types/events.js.map +1 -0
- package/lib/@types/extensible_events.d.ts +98 -0
- package/lib/@types/extensible_events.d.ts.map +1 -0
- package/lib/@types/extensible_events.js +116 -0
- package/lib/@types/extensible_events.js.map +1 -0
- package/lib/@types/global.d.js +20 -0
- package/lib/@types/global.d.js.map +1 -0
- package/lib/@types/local_notifications.d.ts +4 -0
- package/lib/@types/local_notifications.d.ts.map +1 -0
- package/lib/@types/local_notifications.js +1 -0
- package/lib/@types/local_notifications.js.map +1 -0
- package/lib/@types/location.d.ts +60 -0
- package/lib/@types/location.d.ts.map +1 -0
- package/lib/@types/location.js +67 -0
- package/lib/@types/location.js.map +1 -0
- package/lib/@types/matrix-sdk-crypto-wasm.d.js +1 -0
- package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +1 -0
- package/lib/@types/media.d.ts +220 -0
- package/lib/@types/media.d.ts.map +1 -0
- package/lib/@types/media.js +1 -0
- package/lib/@types/media.js.map +1 -0
- package/lib/@types/membership.d.ts +41 -0
- package/lib/@types/membership.d.ts.map +1 -0
- package/lib/@types/membership.js +37 -0
- package/lib/@types/membership.js.map +1 -0
- package/lib/@types/oidc-client-ts.d.js +18 -0
- package/lib/@types/oidc-client-ts.d.js.map +1 -0
- package/lib/@types/partials.d.ts +39 -0
- package/lib/@types/partials.d.ts.map +1 -0
- package/lib/@types/partials.js +53 -0
- package/lib/@types/partials.js.map +1 -0
- package/lib/@types/polls.d.ts +88 -0
- package/lib/@types/polls.d.ts.map +1 -0
- package/lib/@types/polls.js +86 -0
- package/lib/@types/polls.js.map +1 -0
- package/lib/@types/read_receipts.d.ts +36 -0
- package/lib/@types/read_receipts.d.ts.map +1 -0
- package/lib/@types/read_receipts.js +27 -0
- package/lib/@types/read_receipts.js.map +1 -0
- package/lib/@types/registration.d.ts +85 -0
- package/lib/@types/registration.d.ts.map +1 -0
- package/lib/@types/registration.js +1 -0
- package/lib/@types/registration.js.map +1 -0
- package/lib/@types/requests.d.ts +241 -0
- package/lib/@types/requests.d.ts.map +1 -0
- package/lib/@types/requests.js +28 -0
- package/lib/@types/requests.js.map +1 -0
- package/lib/@types/search.d.ts +90 -0
- package/lib/@types/search.d.ts.map +1 -0
- package/lib/@types/search.js +30 -0
- package/lib/@types/search.js.map +1 -0
- package/lib/@types/signed.d.ts +9 -0
- package/lib/@types/signed.d.ts.map +1 -0
- package/lib/@types/signed.js +1 -0
- package/lib/@types/signed.js.map +1 -0
- package/lib/@types/spaces.d.ts +16 -0
- package/lib/@types/spaces.d.ts.map +1 -0
- package/lib/@types/spaces.js +1 -0
- package/lib/@types/spaces.js.map +1 -0
- package/lib/@types/state_events.d.ts +116 -0
- package/lib/@types/state_events.d.ts.map +1 -0
- package/lib/@types/state_events.js +1 -0
- package/lib/@types/state_events.js.map +1 -0
- package/lib/@types/synapse.d.ts +19 -0
- package/lib/@types/synapse.d.ts.map +1 -0
- package/lib/@types/synapse.js +1 -0
- package/lib/@types/synapse.js.map +1 -0
- package/lib/@types/sync.d.ts +8 -0
- package/lib/@types/sync.d.ts.map +1 -0
- package/lib/@types/sync.js +25 -0
- package/lib/@types/sync.js.map +1 -0
- package/lib/@types/threepids.d.ts +12 -0
- package/lib/@types/threepids.d.ts.map +1 -0
- package/lib/@types/threepids.js +24 -0
- package/lib/@types/threepids.js.map +1 -0
- package/lib/@types/topic.d.ts +48 -0
- package/lib/@types/topic.d.ts.map +1 -0
- package/lib/@types/topic.js +57 -0
- package/lib/@types/topic.js.map +1 -0
- package/lib/@types/uia.d.ts +12 -0
- package/lib/@types/uia.d.ts.map +1 -0
- package/lib/@types/uia.js +1 -0
- package/lib/@types/uia.js.map +1 -0
- package/lib/NamespacedValue.d.ts +33 -0
- package/lib/NamespacedValue.d.ts.map +1 -0
- package/lib/NamespacedValue.js +113 -0
- package/lib/NamespacedValue.js.map +1 -0
- package/lib/ReEmitter.d.ts +15 -0
- package/lib/ReEmitter.d.ts.map +1 -0
- package/lib/ReEmitter.js +87 -0
- package/lib/ReEmitter.js.map +1 -0
- package/lib/ToDeviceMessageQueue.d.ts +28 -0
- package/lib/ToDeviceMessageQueue.d.ts.map +1 -0
- package/lib/ToDeviceMessageQueue.js +135 -0
- package/lib/ToDeviceMessageQueue.js.map +1 -0
- package/lib/autodiscovery.d.ts +136 -0
- package/lib/autodiscovery.d.ts.map +1 -0
- package/lib/autodiscovery.js +464 -0
- package/lib/autodiscovery.js.map +1 -0
- package/lib/base64.d.ts +28 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +88 -0
- package/lib/base64.js.map +1 -0
- package/lib/browser-index.d.ts +8 -0
- package/lib/browser-index.d.ts.map +1 -0
- package/lib/browser-index.js +35 -0
- package/lib/browser-index.js.map +1 -0
- package/lib/client.d.ts +4232 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +8622 -0
- package/lib/client.js.map +1 -0
- package/lib/common-crypto/CryptoBackend.d.ts +240 -0
- package/lib/common-crypto/CryptoBackend.d.ts.map +1 -0
- package/lib/common-crypto/CryptoBackend.js +73 -0
- package/lib/common-crypto/CryptoBackend.js.map +1 -0
- package/lib/common-crypto/key-passphrase.d.ts +14 -0
- package/lib/common-crypto/key-passphrase.d.ts.map +1 -0
- package/lib/common-crypto/key-passphrase.js +33 -0
- package/lib/common-crypto/key-passphrase.js.map +1 -0
- package/lib/content-helpers.d.ts +90 -0
- package/lib/content-helpers.d.ts.map +1 -0
- package/lib/content-helpers.js +250 -0
- package/lib/content-helpers.js.map +1 -0
- package/lib/content-repo.d.ts +24 -0
- package/lib/content-repo.d.ts.map +1 -0
- package/lib/content-repo.js +104 -0
- package/lib/content-repo.js.map +1 -0
- package/lib/crypto/CrossSigning.d.ts +184 -0
- package/lib/crypto/CrossSigning.d.ts.map +1 -0
- package/lib/crypto/CrossSigning.js +718 -0
- package/lib/crypto/CrossSigning.js.map +1 -0
- package/lib/crypto/DeviceList.d.ts +216 -0
- package/lib/crypto/DeviceList.d.ts.map +1 -0
- package/lib/crypto/DeviceList.js +892 -0
- package/lib/crypto/DeviceList.js.map +1 -0
- package/lib/crypto/EncryptionSetup.d.ts +152 -0
- package/lib/crypto/EncryptionSetup.d.ts.map +1 -0
- package/lib/crypto/EncryptionSetup.js +356 -0
- package/lib/crypto/EncryptionSetup.js.map +1 -0
- package/lib/crypto/OlmDevice.d.ts +457 -0
- package/lib/crypto/OlmDevice.d.ts.map +1 -0
- package/lib/crypto/OlmDevice.js +1241 -0
- package/lib/crypto/OlmDevice.js.map +1 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts +109 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts.map +1 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.js +415 -0
- package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +1 -0
- package/lib/crypto/RoomList.d.ts +26 -0
- package/lib/crypto/RoomList.d.ts.map +1 -0
- package/lib/crypto/RoomList.js +71 -0
- package/lib/crypto/RoomList.js.map +1 -0
- package/lib/crypto/SecretSharing.d.ts +24 -0
- package/lib/crypto/SecretSharing.d.ts.map +1 -0
- package/lib/crypto/SecretSharing.js +194 -0
- package/lib/crypto/SecretSharing.js.map +1 -0
- package/lib/crypto/SecretStorage.d.ts +55 -0
- package/lib/crypto/SecretStorage.d.ts.map +1 -0
- package/lib/crypto/SecretStorage.js +118 -0
- package/lib/crypto/SecretStorage.js.map +1 -0
- package/lib/crypto/aes.d.ts +6 -0
- package/lib/crypto/aes.d.ts.map +1 -0
- package/lib/crypto/aes.js +24 -0
- package/lib/crypto/aes.js.map +1 -0
- package/lib/crypto/algorithms/base.d.ts +156 -0
- package/lib/crypto/algorithms/base.d.ts.map +1 -0
- package/lib/crypto/algorithms/base.js +187 -0
- package/lib/crypto/algorithms/base.js.map +1 -0
- package/lib/crypto/algorithms/index.d.ts +4 -0
- package/lib/crypto/algorithms/index.d.ts.map +1 -0
- package/lib/crypto/algorithms/index.js +20 -0
- package/lib/crypto/algorithms/index.js.map +1 -0
- package/lib/crypto/algorithms/megolm.d.ts +385 -0
- package/lib/crypto/algorithms/megolm.d.ts.map +1 -0
- package/lib/crypto/algorithms/megolm.js +1822 -0
- package/lib/crypto/algorithms/megolm.js.map +1 -0
- package/lib/crypto/algorithms/olm.d.ts +5 -0
- package/lib/crypto/algorithms/olm.d.ts.map +1 -0
- package/lib/crypto/algorithms/olm.js +299 -0
- package/lib/crypto/algorithms/olm.js.map +1 -0
- package/lib/crypto/api.d.ts +32 -0
- package/lib/crypto/api.d.ts.map +1 -0
- package/lib/crypto/api.js +22 -0
- package/lib/crypto/api.js.map +1 -0
- package/lib/crypto/backup.d.ts +227 -0
- package/lib/crypto/backup.d.ts.map +1 -0
- package/lib/crypto/backup.js +824 -0
- package/lib/crypto/backup.js.map +1 -0
- package/lib/crypto/crypto.d.ts +3 -0
- package/lib/crypto/crypto.d.ts.map +1 -0
- package/lib/crypto/crypto.js +19 -0
- package/lib/crypto/crypto.js.map +1 -0
- package/lib/crypto/dehydration.d.ts +34 -0
- package/lib/crypto/dehydration.d.ts.map +1 -0
- package/lib/crypto/dehydration.js +252 -0
- package/lib/crypto/dehydration.js.map +1 -0
- package/lib/crypto/device-converter.d.ts +9 -0
- package/lib/crypto/device-converter.d.ts.map +1 -0
- package/lib/crypto/device-converter.js +42 -0
- package/lib/crypto/device-converter.js.map +1 -0
- package/lib/crypto/deviceinfo.d.ts +99 -0
- package/lib/crypto/deviceinfo.d.ts.map +1 -0
- package/lib/crypto/deviceinfo.js +148 -0
- package/lib/crypto/deviceinfo.js.map +1 -0
- package/lib/crypto/index.d.ts +1209 -0
- package/lib/crypto/index.d.ts.map +1 -0
- package/lib/crypto/index.js +4097 -0
- package/lib/crypto/index.js.map +1 -0
- package/lib/crypto/key_passphrase.d.ts +14 -0
- package/lib/crypto/key_passphrase.d.ts.map +1 -0
- package/lib/crypto/key_passphrase.js +44 -0
- package/lib/crypto/key_passphrase.js.map +1 -0
- package/lib/crypto/keybackup.d.ts +18 -0
- package/lib/crypto/keybackup.d.ts.map +1 -0
- package/lib/crypto/keybackup.js +1 -0
- package/lib/crypto/keybackup.js.map +1 -0
- package/lib/crypto/olmlib.d.ts +129 -0
- package/lib/crypto/olmlib.d.ts.map +1 -0
- package/lib/crypto/olmlib.js +492 -0
- package/lib/crypto/olmlib.js.map +1 -0
- package/lib/crypto/recoverykey.d.ts +2 -0
- package/lib/crypto/recoverykey.d.ts.map +1 -0
- package/lib/crypto/recoverykey.js +19 -0
- package/lib/crypto/recoverykey.js.map +1 -0
- package/lib/crypto/store/base.d.ts +252 -0
- package/lib/crypto/store/base.d.ts.map +1 -0
- package/lib/crypto/store/base.js +64 -0
- package/lib/crypto/store/base.js.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +187 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +1145 -0
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store.d.ts +432 -0
- package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/indexeddb-crypto-store.js +728 -0
- package/lib/crypto/store/indexeddb-crypto-store.js.map +1 -0
- package/lib/crypto/store/localStorage-crypto-store.d.ts +119 -0
- package/lib/crypto/store/localStorage-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/localStorage-crypto-store.js +531 -0
- package/lib/crypto/store/localStorage-crypto-store.js.map +1 -0
- package/lib/crypto/store/memory-crypto-store.d.ts +215 -0
- package/lib/crypto/store/memory-crypto-store.d.ts.map +1 -0
- package/lib/crypto/store/memory-crypto-store.js +622 -0
- package/lib/crypto/store/memory-crypto-store.js.map +1 -0
- package/lib/crypto/verification/Base.d.ts +105 -0
- package/lib/crypto/verification/Base.d.ts.map +1 -0
- package/lib/crypto/verification/Base.js +372 -0
- package/lib/crypto/verification/Base.js.map +1 -0
- package/lib/crypto/verification/Error.d.ts +35 -0
- package/lib/crypto/verification/Error.d.ts.map +1 -0
- package/lib/crypto/verification/Error.js +86 -0
- package/lib/crypto/verification/Error.js.map +1 -0
- package/lib/crypto/verification/IllegalMethod.d.ts +15 -0
- package/lib/crypto/verification/IllegalMethod.d.ts.map +1 -0
- package/lib/crypto/verification/IllegalMethod.js +43 -0
- package/lib/crypto/verification/IllegalMethod.js.map +1 -0
- package/lib/crypto/verification/QRCode.d.ts +51 -0
- package/lib/crypto/verification/QRCode.d.ts.map +1 -0
- package/lib/crypto/verification/QRCode.js +277 -0
- package/lib/crypto/verification/QRCode.js.map +1 -0
- package/lib/crypto/verification/SAS.d.ts +27 -0
- package/lib/crypto/verification/SAS.d.ts.map +1 -0
- package/lib/crypto/verification/SAS.js +485 -0
- package/lib/crypto/verification/SAS.js.map +1 -0
- package/lib/crypto/verification/SASDecimal.d.ts +8 -0
- package/lib/crypto/verification/SASDecimal.d.ts.map +1 -0
- package/lib/crypto/verification/SASDecimal.js +34 -0
- package/lib/crypto/verification/SASDecimal.js.map +1 -0
- package/lib/crypto/verification/request/Channel.d.ts +18 -0
- package/lib/crypto/verification/request/Channel.d.ts.map +1 -0
- package/lib/crypto/verification/request/Channel.js +1 -0
- package/lib/crypto/verification/request/Channel.js.map +1 -0
- package/lib/crypto/verification/request/InRoomChannel.d.ts +113 -0
- package/lib/crypto/verification/request/InRoomChannel.d.ts.map +1 -0
- package/lib/crypto/verification/request/InRoomChannel.js +351 -0
- package/lib/crypto/verification/request/InRoomChannel.js.map +1 -0
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts +105 -0
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts.map +1 -0
- package/lib/crypto/verification/request/ToDeviceChannel.js +328 -0
- package/lib/crypto/verification/request/ToDeviceChannel.js.map +1 -0
- package/lib/crypto/verification/request/VerificationRequest.d.ts +227 -0
- package/lib/crypto/verification/request/VerificationRequest.d.ts.map +1 -0
- package/lib/crypto/verification/request/VerificationRequest.js +937 -0
- package/lib/crypto/verification/request/VerificationRequest.js.map +1 -0
- package/lib/crypto-api/CryptoEvent.d.ts +69 -0
- package/lib/crypto-api/CryptoEvent.d.ts.map +1 -0
- package/lib/crypto-api/CryptoEvent.js +33 -0
- package/lib/crypto-api/CryptoEvent.js.map +1 -0
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts +16 -0
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +1 -0
- package/lib/crypto-api/CryptoEventHandlerMap.js +22 -0
- package/lib/crypto-api/CryptoEventHandlerMap.js.map +1 -0
- package/lib/crypto-api/index.d.ts +978 -0
- package/lib/crypto-api/index.d.ts.map +1 -0
- package/lib/crypto-api/index.js +304 -0
- package/lib/crypto-api/index.js.map +1 -0
- package/lib/crypto-api/key-passphrase.d.ts +11 -0
- package/lib/crypto-api/key-passphrase.d.ts.map +1 -0
- package/lib/crypto-api/key-passphrase.js +51 -0
- package/lib/crypto-api/key-passphrase.js.map +1 -0
- package/lib/crypto-api/keybackup.d.ts +88 -0
- package/lib/crypto-api/keybackup.d.ts.map +1 -0
- package/lib/crypto-api/keybackup.js +1 -0
- package/lib/crypto-api/keybackup.js.map +1 -0
- package/lib/crypto-api/recovery-key.d.ts +11 -0
- package/lib/crypto-api/recovery-key.d.ts.map +1 -0
- package/lib/crypto-api/recovery-key.js +65 -0
- package/lib/crypto-api/recovery-key.js.map +1 -0
- package/lib/crypto-api/verification.d.ts +344 -0
- package/lib/crypto-api/verification.d.ts.map +1 -0
- package/lib/crypto-api/verification.js +91 -0
- package/lib/crypto-api/verification.js.map +1 -0
- package/lib/digest.d.ts +10 -0
- package/lib/digest.d.ts.map +1 -0
- package/lib/digest.js +40 -0
- package/lib/digest.js.map +1 -0
- package/lib/embedded.d.ts +143 -0
- package/lib/embedded.d.ts.map +1 -0
- package/lib/embedded.js +567 -0
- package/lib/embedded.js.map +1 -0
- package/lib/errors.d.ts +24 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +51 -0
- package/lib/errors.js.map +1 -0
- package/lib/event-mapper.d.ts +10 -0
- package/lib/event-mapper.d.ts.map +1 -0
- package/lib/event-mapper.js +81 -0
- package/lib/event-mapper.js.map +1 -0
- package/lib/extensible_events_v1/ExtensibleEvent.d.ts +38 -0
- package/lib/extensible_events_v1/ExtensibleEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/ExtensibleEvent.js +57 -0
- package/lib/extensible_events_v1/ExtensibleEvent.js.map +1 -0
- package/lib/extensible_events_v1/InvalidEventError.d.ts +7 -0
- package/lib/extensible_events_v1/InvalidEventError.d.ts.map +1 -0
- package/lib/extensible_events_v1/InvalidEventError.js +25 -0
- package/lib/extensible_events_v1/InvalidEventError.js.map +1 -0
- package/lib/extensible_events_v1/MessageEvent.d.ts +45 -0
- package/lib/extensible_events_v1/MessageEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/MessageEvent.js +134 -0
- package/lib/extensible_events_v1/MessageEvent.js.map +1 -0
- package/lib/extensible_events_v1/PollEndEvent.d.ts +33 -0
- package/lib/extensible_events_v1/PollEndEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/PollEndEvent.js +88 -0
- package/lib/extensible_events_v1/PollEndEvent.js.map +1 -0
- package/lib/extensible_events_v1/PollResponseEvent.d.ts +49 -0
- package/lib/extensible_events_v1/PollResponseEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/PollResponseEvent.js +135 -0
- package/lib/extensible_events_v1/PollResponseEvent.js.map +1 -0
- package/lib/extensible_events_v1/PollStartEvent.d.ts +71 -0
- package/lib/extensible_events_v1/PollStartEvent.d.ts.map +1 -0
- package/lib/extensible_events_v1/PollStartEvent.js +185 -0
- package/lib/extensible_events_v1/PollStartEvent.js.map +1 -0
- package/lib/extensible_events_v1/utilities.d.ts +14 -0
- package/lib/extensible_events_v1/utilities.d.ts.map +1 -0
- package/lib/extensible_events_v1/utilities.js +34 -0
- package/lib/extensible_events_v1/utilities.js.map +1 -0
- package/lib/feature.d.ts +20 -0
- package/lib/feature.d.ts.map +1 -0
- package/lib/feature.js +85 -0
- package/lib/feature.js.map +1 -0
- package/lib/filter-component.d.ts +64 -0
- package/lib/filter-component.d.ts.map +1 -0
- package/lib/filter-component.js +167 -0
- package/lib/filter-component.js.map +1 -0
- package/lib/filter.d.ts +97 -0
- package/lib/filter.d.ts.map +1 -0
- package/lib/filter.js +207 -0
- package/lib/filter.js.map +1 -0
- package/lib/http-api/errors.d.ts +80 -0
- package/lib/http-api/errors.d.ts.map +1 -0
- package/lib/http-api/errors.js +185 -0
- package/lib/http-api/errors.js.map +1 -0
- package/lib/http-api/fetch.d.ts +114 -0
- package/lib/http-api/fetch.d.ts.map +1 -0
- package/lib/http-api/fetch.js +346 -0
- package/lib/http-api/fetch.js.map +1 -0
- package/lib/http-api/index.d.ts +33 -0
- package/lib/http-api/index.d.ts.map +1 -0
- package/lib/http-api/index.js +180 -0
- package/lib/http-api/index.js.map +1 -0
- package/lib/http-api/interface.d.ts +142 -0
- package/lib/http-api/interface.d.ts.map +1 -0
- package/lib/http-api/interface.js +35 -0
- package/lib/http-api/interface.js.map +1 -0
- package/lib/http-api/method.d.ts +10 -0
- package/lib/http-api/method.d.ts.map +1 -0
- package/lib/http-api/method.js +27 -0
- package/lib/http-api/method.js.map +1 -0
- package/lib/http-api/prefix.d.ts +31 -0
- package/lib/http-api/prefix.d.ts.map +1 -0
- package/lib/http-api/prefix.js +32 -0
- package/lib/http-api/prefix.js.map +1 -0
- package/lib/http-api/utils.d.ts +37 -0
- package/lib/http-api/utils.d.ts.map +1 -0
- package/lib/http-api/utils.js +178 -0
- package/lib/http-api/utils.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/indexeddb-helpers.d.ts +10 -0
- package/lib/indexeddb-helpers.d.ts.map +1 -0
- package/lib/indexeddb-helpers.js +51 -0
- package/lib/indexeddb-helpers.js.map +1 -0
- package/lib/indexeddb-worker.d.ts +7 -0
- package/lib/indexeddb-worker.d.ts.map +1 -0
- package/lib/indexeddb-worker.js +25 -0
- package/lib/indexeddb-worker.js.map +1 -0
- package/lib/interactive-auth.d.ts +337 -0
- package/lib/interactive-auth.d.ts.map +1 -0
- package/lib/interactive-auth.js +557 -0
- package/lib/interactive-auth.js.map +1 -0
- package/lib/logger.d.ts +81 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +139 -0
- package/lib/logger.js.map +1 -0
- package/lib/matrix.d.ts +118 -0
- package/lib/matrix.d.ts.map +1 -0
- package/lib/matrix.js +146 -0
- package/lib/matrix.js.map +1 -0
- package/lib/matrixrtc/CallMembership.d.ts +66 -0
- package/lib/matrixrtc/CallMembership.d.ts.map +1 -0
- package/lib/matrixrtc/CallMembership.js +197 -0
- package/lib/matrixrtc/CallMembership.js.map +1 -0
- package/lib/matrixrtc/LivekitFocus.d.ts +16 -0
- package/lib/matrixrtc/LivekitFocus.d.ts.map +1 -0
- package/lib/matrixrtc/LivekitFocus.js +20 -0
- package/lib/matrixrtc/LivekitFocus.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts +295 -0
- package/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSession.js +1043 -0
- package/lib/matrixrtc/MatrixRTCSession.js.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts +40 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +1 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js +146 -0
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -0
- package/lib/matrixrtc/focus.d.ts +10 -0
- package/lib/matrixrtc/focus.d.ts.map +1 -0
- package/lib/matrixrtc/focus.js +1 -0
- package/lib/matrixrtc/focus.js.map +1 -0
- package/lib/matrixrtc/index.d.ts +7 -0
- package/lib/matrixrtc/index.d.ts.map +1 -0
- package/lib/matrixrtc/index.js +21 -0
- package/lib/matrixrtc/index.js.map +1 -0
- package/lib/matrixrtc/types.d.ts +19 -0
- package/lib/matrixrtc/types.d.ts.map +1 -0
- package/lib/matrixrtc/types.js +1 -0
- package/lib/matrixrtc/types.js.map +1 -0
- package/lib/models/MSC3089Branch.d.ts +98 -0
- package/lib/models/MSC3089Branch.d.ts.map +1 -0
- package/lib/models/MSC3089Branch.js +240 -0
- package/lib/models/MSC3089Branch.js.map +1 -0
- package/lib/models/MSC3089TreeSpace.d.ts +165 -0
- package/lib/models/MSC3089TreeSpace.d.ts.map +1 -0
- package/lib/models/MSC3089TreeSpace.js +520 -0
- package/lib/models/MSC3089TreeSpace.js.map +1 -0
- package/lib/models/ToDeviceMessage.d.ts +17 -0
- package/lib/models/ToDeviceMessage.d.ts.map +1 -0
- package/lib/models/ToDeviceMessage.js +1 -0
- package/lib/models/ToDeviceMessage.js.map +1 -0
- package/lib/models/beacon.d.ts +53 -0
- package/lib/models/beacon.d.ts.map +1 -0
- package/lib/models/beacon.js +174 -0
- package/lib/models/beacon.js.map +1 -0
- package/lib/models/compare-event-ordering.d.ts +24 -0
- package/lib/models/compare-event-ordering.d.ts.map +1 -0
- package/lib/models/compare-event-ordering.js +120 -0
- package/lib/models/compare-event-ordering.js.map +1 -0
- package/lib/models/device.d.ts +45 -0
- package/lib/models/device.d.ts.map +1 -0
- package/lib/models/device.js +77 -0
- package/lib/models/device.js.map +1 -0
- package/lib/models/event-context.d.ts +62 -0
- package/lib/models/event-context.d.ts.map +1 -0
- package/lib/models/event-context.js +113 -0
- package/lib/models/event-context.js.map +1 -0
- package/lib/models/event-status.d.ts +19 -0
- package/lib/models/event-status.d.ts.map +1 -0
- package/lib/models/event-status.js +30 -0
- package/lib/models/event-status.js.map +1 -0
- package/lib/models/event-timeline-set.d.ts +312 -0
- package/lib/models/event-timeline-set.d.ts.map +1 -0
- package/lib/models/event-timeline-set.js +813 -0
- package/lib/models/event-timeline-set.js.map +1 -0
- package/lib/models/event-timeline.d.ts +219 -0
- package/lib/models/event-timeline.d.ts.map +1 -0
- package/lib/models/event-timeline.js +455 -0
- package/lib/models/event-timeline.js.map +1 -0
- package/lib/models/event.d.ts +811 -0
- package/lib/models/event.d.ts.map +1 -0
- package/lib/models/event.js +1520 -0
- package/lib/models/event.js.map +1 -0
- package/lib/models/invites-ignorer.d.ts +136 -0
- package/lib/models/invites-ignorer.d.ts.map +1 -0
- package/lib/models/invites-ignorer.js +382 -0
- package/lib/models/invites-ignorer.js.map +1 -0
- package/lib/models/poll.d.ts +67 -0
- package/lib/models/poll.d.ts.map +1 -0
- package/lib/models/poll.js +241 -0
- package/lib/models/poll.js.map +1 -0
- package/lib/models/profile-keys.d.ts +8 -0
- package/lib/models/profile-keys.d.ts.map +1 -0
- package/lib/models/profile-keys.js +8 -0
- package/lib/models/profile-keys.js.map +1 -0
- package/lib/models/read-receipt.d.ts +115 -0
- package/lib/models/read-receipt.d.ts.map +1 -0
- package/lib/models/read-receipt.js +366 -0
- package/lib/models/read-receipt.js.map +1 -0
- package/lib/models/related-relations.d.ts +11 -0
- package/lib/models/related-relations.d.ts.map +1 -0
- package/lib/models/related-relations.js +33 -0
- package/lib/models/related-relations.js.map +1 -0
- package/lib/models/relations-container.d.ts +44 -0
- package/lib/models/relations-container.d.ts.map +1 -0
- package/lib/models/relations-container.js +132 -0
- package/lib/models/relations-container.js.map +1 -0
- package/lib/models/relations.d.ts +114 -0
- package/lib/models/relations.d.ts.map +1 -0
- package/lib/models/relations.js +354 -0
- package/lib/models/relations.js.map +1 -0
- package/lib/models/room-member.d.ts +204 -0
- package/lib/models/room-member.d.ts.map +1 -0
- package/lib/models/room-member.js +360 -0
- package/lib/models/room-member.js.map +1 -0
- package/lib/models/room-receipts.d.ts +39 -0
- package/lib/models/room-receipts.d.ts.map +1 -0
- package/lib/models/room-receipts.js +392 -0
- package/lib/models/room-receipts.js.map +1 -0
- package/lib/models/room-state.d.ts +468 -0
- package/lib/models/room-state.d.ts.map +1 -0
- package/lib/models/room-state.js +984 -0
- package/lib/models/room-state.js.map +1 -0
- package/lib/models/room-summary.d.ts +29 -0
- package/lib/models/room-summary.d.ts.map +1 -0
- package/lib/models/room-summary.js +28 -0
- package/lib/models/room-summary.js.map +1 -0
- package/lib/models/room.d.ts +1203 -0
- package/lib/models/room.d.ts.map +1 -0
- package/lib/models/room.js +3336 -0
- package/lib/models/room.js.map +1 -0
- package/lib/models/search-result.d.ts +20 -0
- package/lib/models/search-result.d.ts.map +1 -0
- package/lib/models/search-result.js +52 -0
- package/lib/models/search-result.js.map +1 -0
- package/lib/models/thread.d.ts +246 -0
- package/lib/models/thread.d.ts.map +1 -0
- package/lib/models/thread.js +861 -0
- package/lib/models/thread.js.map +1 -0
- package/lib/models/typed-event-emitter.d.ts +157 -0
- package/lib/models/typed-event-emitter.d.ts.map +1 -0
- package/lib/models/typed-event-emitter.js +227 -0
- package/lib/models/typed-event-emitter.js.map +1 -0
- package/lib/models/user.d.ts +195 -0
- package/lib/models/user.d.ts.map +1 -0
- package/lib/models/user.js +218 -0
- package/lib/models/user.js.map +1 -0
- package/lib/oidc/authorize.d.ts +90 -0
- package/lib/oidc/authorize.d.ts.map +1 -0
- package/lib/oidc/authorize.js +278 -0
- package/lib/oidc/authorize.js.map +1 -0
- package/lib/oidc/discovery.d.ts +14 -0
- package/lib/oidc/discovery.d.ts.map +1 -0
- package/lib/oidc/discovery.js +66 -0
- package/lib/oidc/discovery.js.map +1 -0
- package/lib/oidc/error.d.ts +18 -0
- package/lib/oidc/error.d.ts.map +1 -0
- package/lib/oidc/error.js +35 -0
- package/lib/oidc/error.js.map +1 -0
- package/lib/oidc/index.d.ts +17 -0
- package/lib/oidc/index.d.ts.map +1 -0
- package/lib/oidc/index.js +29 -0
- package/lib/oidc/index.js.map +1 -0
- package/lib/oidc/register.d.ts +43 -0
- package/lib/oidc/register.d.ts.map +1 -0
- package/lib/oidc/register.js +96 -0
- package/lib/oidc/register.js.map +1 -0
- package/lib/oidc/tokenRefresher.d.ts +69 -0
- package/lib/oidc/tokenRefresher.d.ts.map +1 -0
- package/lib/oidc/tokenRefresher.js +148 -0
- package/lib/oidc/tokenRefresher.js.map +1 -0
- package/lib/oidc/validate.d.ts +90 -0
- package/lib/oidc/validate.d.ts.map +1 -0
- package/lib/oidc/validate.js +194 -0
- package/lib/oidc/validate.js.map +1 -0
- package/lib/pushprocessor.d.ts +128 -0
- package/lib/pushprocessor.d.ts.map +1 -0
- package/lib/pushprocessor.js +685 -0
- package/lib/pushprocessor.js.map +1 -0
- package/lib/randomstring.d.ts +5 -0
- package/lib/randomstring.d.ts.map +1 -0
- package/lib/randomstring.js +43 -0
- package/lib/randomstring.js.map +1 -0
- package/lib/realtime-callbacks.d.ts +18 -0
- package/lib/realtime-callbacks.d.ts.map +1 -0
- package/lib/realtime-callbacks.js +177 -0
- package/lib/realtime-callbacks.js.map +1 -0
- package/lib/receipt-accumulator.d.ts +51 -0
- package/lib/receipt-accumulator.d.ts.map +1 -0
- package/lib/receipt-accumulator.js +164 -0
- package/lib/receipt-accumulator.js.map +1 -0
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts +112 -0
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +1 -0
- package/lib/rendezvous/MSC4108SignInWithQR.js +392 -0
- package/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -0
- package/lib/rendezvous/RendezvousChannel.d.ts +27 -0
- package/lib/rendezvous/RendezvousChannel.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousChannel.js +1 -0
- package/lib/rendezvous/RendezvousChannel.js.map +1 -0
- package/lib/rendezvous/RendezvousCode.d.ts +9 -0
- package/lib/rendezvous/RendezvousCode.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousCode.js +1 -0
- package/lib/rendezvous/RendezvousCode.js.map +1 -0
- package/lib/rendezvous/RendezvousError.d.ts +6 -0
- package/lib/rendezvous/RendezvousError.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousError.js +23 -0
- package/lib/rendezvous/RendezvousError.js.map +1 -0
- package/lib/rendezvous/RendezvousFailureReason.d.ts +31 -0
- package/lib/rendezvous/RendezvousFailureReason.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousFailureReason.js +38 -0
- package/lib/rendezvous/RendezvousFailureReason.js.map +1 -0
- package/lib/rendezvous/RendezvousIntent.d.ts +5 -0
- package/lib/rendezvous/RendezvousIntent.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousIntent.js +22 -0
- package/lib/rendezvous/RendezvousIntent.js.map +1 -0
- package/lib/rendezvous/RendezvousTransport.d.ts +36 -0
- package/lib/rendezvous/RendezvousTransport.d.ts.map +1 -0
- package/lib/rendezvous/RendezvousTransport.js +1 -0
- package/lib/rendezvous/RendezvousTransport.js.map +1 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts +58 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +1 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.js +246 -0
- package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +1 -0
- package/lib/rendezvous/channels/index.d.ts +2 -0
- package/lib/rendezvous/channels/index.d.ts.map +1 -0
- package/lib/rendezvous/channels/index.js +18 -0
- package/lib/rendezvous/channels/index.js.map +1 -0
- package/lib/rendezvous/index.d.ts +10 -0
- package/lib/rendezvous/index.d.ts.map +1 -0
- package/lib/rendezvous/index.js +23 -0
- package/lib/rendezvous/index.js.map +1 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +61 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +1 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js +253 -0
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +1 -0
- package/lib/rendezvous/transports/index.d.ts +2 -0
- package/lib/rendezvous/transports/index.d.ts.map +1 -0
- package/lib/rendezvous/transports/index.js +18 -0
- package/lib/rendezvous/transports/index.js.map +1 -0
- package/lib/room-hierarchy.d.ts +35 -0
- package/lib/room-hierarchy.d.ts.map +1 -0
- package/lib/room-hierarchy.js +136 -0
- package/lib/room-hierarchy.js.map +1 -0
- package/lib/rust-crypto/CrossSigningIdentity.d.ts +33 -0
- package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +1 -0
- package/lib/rust-crypto/CrossSigningIdentity.js +157 -0
- package/lib/rust-crypto/CrossSigningIdentity.js.map +1 -0
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts +98 -0
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +1 -0
- package/lib/rust-crypto/DehydratedDeviceManager.js +285 -0
- package/lib/rust-crypto/DehydratedDeviceManager.js.map +1 -0
- package/lib/rust-crypto/KeyClaimManager.d.ts +33 -0
- package/lib/rust-crypto/KeyClaimManager.d.ts.map +1 -0
- package/lib/rust-crypto/KeyClaimManager.js +82 -0
- package/lib/rust-crypto/KeyClaimManager.js.map +1 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts +43 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +1 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.js +195 -0
- package/lib/rust-crypto/OutgoingRequestProcessor.js.map +1 -0
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts +47 -0
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +1 -0
- package/lib/rust-crypto/OutgoingRequestsManager.js +148 -0
- package/lib/rust-crypto/OutgoingRequestsManager.js.map +1 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +120 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +1 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +467 -0
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +1 -0
- package/lib/rust-crypto/RoomEncryptor.d.ts +98 -0
- package/lib/rust-crypto/RoomEncryptor.d.ts.map +1 -0
- package/lib/rust-crypto/RoomEncryptor.js +299 -0
- package/lib/rust-crypto/RoomEncryptor.js.map +1 -0
- package/lib/rust-crypto/backup.d.ts +254 -0
- package/lib/rust-crypto/backup.d.ts.map +1 -0
- package/lib/rust-crypto/backup.js +837 -0
- package/lib/rust-crypto/backup.js.map +1 -0
- package/lib/rust-crypto/constants.d.ts +3 -0
- package/lib/rust-crypto/constants.d.ts.map +1 -0
- package/lib/rust-crypto/constants.js +19 -0
- package/lib/rust-crypto/constants.js.map +1 -0
- package/lib/rust-crypto/device-converter.d.ts +28 -0
- package/lib/rust-crypto/device-converter.d.ts.map +1 -0
- package/lib/rust-crypto/device-converter.js +123 -0
- package/lib/rust-crypto/device-converter.js.map +1 -0
- package/lib/rust-crypto/index.d.ts +61 -0
- package/lib/rust-crypto/index.d.ts.map +1 -0
- package/lib/rust-crypto/index.js +152 -0
- package/lib/rust-crypto/index.js.map +1 -0
- package/lib/rust-crypto/libolm_migration.d.ts +81 -0
- package/lib/rust-crypto/libolm_migration.d.ts.map +1 -0
- package/lib/rust-crypto/libolm_migration.js +459 -0
- package/lib/rust-crypto/libolm_migration.js.map +1 -0
- package/lib/rust-crypto/rust-crypto.d.ts +556 -0
- package/lib/rust-crypto/rust-crypto.d.ts.map +1 -0
- package/lib/rust-crypto/rust-crypto.js +2016 -0
- package/lib/rust-crypto/rust-crypto.js.map +1 -0
- package/lib/rust-crypto/secret-storage.d.ts +22 -0
- package/lib/rust-crypto/secret-storage.d.ts.map +1 -0
- package/lib/rust-crypto/secret-storage.js +63 -0
- package/lib/rust-crypto/secret-storage.js.map +1 -0
- package/lib/rust-crypto/verification.d.ts +319 -0
- package/lib/rust-crypto/verification.d.ts.map +1 -0
- package/lib/rust-crypto/verification.js +816 -0
- package/lib/rust-crypto/verification.js.map +1 -0
- package/lib/scheduler.d.ts +132 -0
- package/lib/scheduler.d.ts.map +1 -0
- package/lib/scheduler.js +259 -0
- package/lib/scheduler.js.map +1 -0
- package/lib/secret-storage.d.ts +370 -0
- package/lib/secret-storage.d.ts.map +1 -0
- package/lib/secret-storage.js +466 -0
- package/lib/secret-storage.js.map +1 -0
- package/lib/serverCapabilities.d.ts +72 -0
- package/lib/serverCapabilities.d.ts.map +1 -0
- package/lib/serverCapabilities.js +105 -0
- package/lib/serverCapabilities.js.map +1 -0
- package/lib/service-types.d.ts +5 -0
- package/lib/service-types.d.ts.map +1 -0
- package/lib/service-types.js +22 -0
- package/lib/service-types.js.map +1 -0
- package/lib/sliding-sync-sdk.d.ts +107 -0
- package/lib/sliding-sync-sdk.d.ts.map +1 -0
- package/lib/sliding-sync-sdk.js +903 -0
- package/lib/sliding-sync-sdk.js.map +1 -0
- package/lib/sliding-sync.d.ts +343 -0
- package/lib/sliding-sync.d.ts.map +1 -0
- package/lib/sliding-sync.js +817 -0
- package/lib/sliding-sync.js.map +1 -0
- package/lib/store/index.d.ts +201 -0
- package/lib/store/index.d.ts.map +1 -0
- package/lib/store/index.js +1 -0
- package/lib/store/index.js.map +1 -0
- package/lib/store/indexeddb-backend.d.ts +24 -0
- package/lib/store/indexeddb-backend.d.ts.map +1 -0
- package/lib/store/indexeddb-backend.js +1 -0
- package/lib/store/indexeddb-backend.js.map +1 -0
- package/lib/store/indexeddb-local-backend.d.ts +129 -0
- package/lib/store/indexeddb-local-backend.d.ts.map +1 -0
- package/lib/store/indexeddb-local-backend.js +597 -0
- package/lib/store/indexeddb-local-backend.js.map +1 -0
- package/lib/store/indexeddb-remote-backend.d.ts +79 -0
- package/lib/store/indexeddb-remote-backend.d.ts.map +1 -0
- package/lib/store/indexeddb-remote-backend.js +210 -0
- package/lib/store/indexeddb-remote-backend.js.map +1 -0
- package/lib/store/indexeddb-store-worker.d.ts +35 -0
- package/lib/store/indexeddb-store-worker.d.ts.map +1 -0
- package/lib/store/indexeddb-store-worker.js +146 -0
- package/lib/store/indexeddb-store-worker.js.map +1 -0
- package/lib/store/indexeddb.d.ts +142 -0
- package/lib/store/indexeddb.d.ts.map +1 -0
- package/lib/store/indexeddb.js +347 -0
- package/lib/store/indexeddb.js.map +1 -0
- package/lib/store/local-storage-events-emitter.d.ts +30 -0
- package/lib/store/local-storage-events-emitter.d.ts.map +1 -0
- package/lib/store/local-storage-events-emitter.js +37 -0
- package/lib/store/local-storage-events-emitter.js.map +1 -0
- package/lib/store/memory.d.ts +209 -0
- package/lib/store/memory.d.ts.map +1 -0
- package/lib/store/memory.js +432 -0
- package/lib/store/memory.js.map +1 -0
- package/lib/store/stub.d.ts +161 -0
- package/lib/store/stub.d.ts.map +1 -0
- package/lib/store/stub.js +268 -0
- package/lib/store/stub.js.map +1 -0
- package/lib/sync-accumulator.d.ts +172 -0
- package/lib/sync-accumulator.d.ts.map +1 -0
- package/lib/sync-accumulator.js +532 -0
- package/lib/sync-accumulator.js.map +1 -0
- package/lib/sync.d.ts +260 -0
- package/lib/sync.d.ts.map +1 -0
- package/lib/sync.js +1686 -0
- package/lib/sync.js.map +1 -0
- package/lib/testing.d.ts +81 -0
- package/lib/testing.d.ts.map +1 -0
- package/lib/testing.js +162 -0
- package/lib/testing.js.map +1 -0
- package/lib/thread-utils.d.ts +10 -0
- package/lib/thread-utils.d.ts.map +1 -0
- package/lib/thread-utils.js +31 -0
- package/lib/thread-utils.js.map +1 -0
- package/lib/timeline-window.d.ts +168 -0
- package/lib/timeline-window.d.ts.map +1 -0
- package/lib/timeline-window.js +494 -0
- package/lib/timeline-window.js.map +1 -0
- package/lib/types.d.ts +33 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +33 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/decryptAESSecretStorageItem.d.ts +12 -0
- package/lib/utils/decryptAESSecretStorageItem.d.ts.map +1 -0
- package/lib/utils/decryptAESSecretStorageItem.js +50 -0
- package/lib/utils/decryptAESSecretStorageItem.js.map +1 -0
- package/lib/utils/encryptAESSecretStorageItem.d.ts +16 -0
- package/lib/utils/encryptAESSecretStorageItem.d.ts.map +1 -0
- package/lib/utils/encryptAESSecretStorageItem.js +68 -0
- package/lib/utils/encryptAESSecretStorageItem.js.map +1 -0
- package/lib/utils/internal/deriveKeys.d.ts +10 -0
- package/lib/utils/internal/deriveKeys.d.ts.map +1 -0
- package/lib/utils/internal/deriveKeys.js +60 -0
- package/lib/utils/internal/deriveKeys.js.map +1 -0
- package/lib/utils.d.ts +267 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +749 -0
- package/lib/utils.js.map +1 -0
- package/lib/version-support.d.ts +19 -0
- package/lib/version-support.d.ts.map +1 -0
- package/lib/version-support.js +37 -0
- package/lib/version-support.js.map +1 -0
- package/lib/webrtc/audioContext.d.ts +15 -0
- package/lib/webrtc/audioContext.d.ts.map +1 -0
- package/lib/webrtc/audioContext.js +46 -0
- package/lib/webrtc/audioContext.js.map +1 -0
- package/lib/webrtc/call.d.ts +560 -0
- package/lib/webrtc/call.d.ts.map +1 -0
- package/lib/webrtc/call.js +2541 -0
- package/lib/webrtc/call.js.map +1 -0
- package/lib/webrtc/callEventHandler.d.ts +37 -0
- package/lib/webrtc/callEventHandler.d.ts.map +1 -0
- package/lib/webrtc/callEventHandler.js +344 -0
- package/lib/webrtc/callEventHandler.js.map +1 -0
- package/lib/webrtc/callEventTypes.d.ts +73 -0
- package/lib/webrtc/callEventTypes.d.ts.map +1 -0
- package/lib/webrtc/callEventTypes.js +13 -0
- package/lib/webrtc/callEventTypes.js.map +1 -0
- package/lib/webrtc/callFeed.d.ts +128 -0
- package/lib/webrtc/callFeed.d.ts.map +1 -0
- package/lib/webrtc/callFeed.js +289 -0
- package/lib/webrtc/callFeed.js.map +1 -0
- package/lib/webrtc/groupCall.d.ts +323 -0
- package/lib/webrtc/groupCall.d.ts.map +1 -0
- package/lib/webrtc/groupCall.js +1337 -0
- package/lib/webrtc/groupCall.js.map +1 -0
- package/lib/webrtc/groupCallEventHandler.d.ts +31 -0
- package/lib/webrtc/groupCallEventHandler.d.ts.map +1 -0
- package/lib/webrtc/groupCallEventHandler.js +178 -0
- package/lib/webrtc/groupCallEventHandler.js.map +1 -0
- package/lib/webrtc/mediaHandler.d.ts +89 -0
- package/lib/webrtc/mediaHandler.d.ts.map +1 -0
- package/lib/webrtc/mediaHandler.js +437 -0
- package/lib/webrtc/mediaHandler.js.map +1 -0
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts +8 -0
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts.map +1 -0
- package/lib/webrtc/stats/callFeedStatsReporter.js +82 -0
- package/lib/webrtc/stats/callFeedStatsReporter.js.map +1 -0
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts +25 -0
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts.map +1 -0
- package/lib/webrtc/stats/callStatsReportGatherer.js +199 -0
- package/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -0
- package/lib/webrtc/stats/callStatsReportSummary.d.ts +17 -0
- package/lib/webrtc/stats/callStatsReportSummary.d.ts.map +1 -0
- package/lib/webrtc/stats/callStatsReportSummary.js +1 -0
- package/lib/webrtc/stats/callStatsReportSummary.js.map +1 -0
- package/lib/webrtc/stats/connectionStats.d.ts +28 -0
- package/lib/webrtc/stats/connectionStats.d.ts.map +1 -0
- package/lib/webrtc/stats/connectionStats.js +26 -0
- package/lib/webrtc/stats/connectionStats.js.map +1 -0
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts +5 -0
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/connectionStatsBuilder.js +27 -0
- package/lib/webrtc/stats/connectionStatsBuilder.js.map +1 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts +7 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.js +121 -0
- package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +1 -0
- package/lib/webrtc/stats/groupCallStats.d.ts +22 -0
- package/lib/webrtc/stats/groupCallStats.d.ts.map +1 -0
- package/lib/webrtc/stats/groupCallStats.js +78 -0
- package/lib/webrtc/stats/groupCallStats.js.map +1 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts +10 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.js +57 -0
- package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts +12 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.js +62 -0
- package/lib/webrtc/stats/media/mediaTrackHandler.js.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts +86 -0
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStats.js +142 -0
- package/lib/webrtc/stats/media/mediaTrackStats.js.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts +22 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts.map +1 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +76 -0
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -0
- package/lib/webrtc/stats/statsReport.d.ts +99 -0
- package/lib/webrtc/stats/statsReport.d.ts.map +1 -0
- package/lib/webrtc/stats/statsReport.js +32 -0
- package/lib/webrtc/stats/statsReport.js.map +1 -0
- package/lib/webrtc/stats/statsReportEmitter.d.ts +15 -0
- package/lib/webrtc/stats/statsReportEmitter.d.ts.map +1 -0
- package/lib/webrtc/stats/statsReportEmitter.js +33 -0
- package/lib/webrtc/stats/statsReportEmitter.js.map +1 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts +16 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts.map +1 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.js +116 -0
- package/lib/webrtc/stats/summaryStatsReportGatherer.js.map +1 -0
- package/lib/webrtc/stats/trackStatsBuilder.d.ts +19 -0
- package/lib/webrtc/stats/trackStatsBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/trackStatsBuilder.js +168 -0
- package/lib/webrtc/stats/trackStatsBuilder.js.map +1 -0
- package/lib/webrtc/stats/transportStats.d.ts +11 -0
- package/lib/webrtc/stats/transportStats.d.ts.map +1 -0
- package/lib/webrtc/stats/transportStats.js +1 -0
- package/lib/webrtc/stats/transportStats.js.map +1 -0
- package/lib/webrtc/stats/transportStatsBuilder.d.ts +5 -0
- package/lib/webrtc/stats/transportStatsBuilder.d.ts.map +1 -0
- package/lib/webrtc/stats/transportStatsBuilder.js +34 -0
- package/lib/webrtc/stats/transportStatsBuilder.js.map +1 -0
- package/lib/webrtc/stats/valueFormatter.d.ts +4 -0
- package/lib/webrtc/stats/valueFormatter.d.ts.map +1 -0
- package/lib/webrtc/stats/valueFormatter.js +25 -0
- package/lib/webrtc/stats/valueFormatter.js.map +1 -0
- package/package.json +134 -0
- package/src/@types/AESEncryptedSecretStoragePayload.ts +29 -0
- package/src/@types/IIdentityServerProvider.ts +24 -0
- package/src/@types/PushRules.ts +209 -0
- package/src/@types/another-json.d.ts +19 -0
- package/src/@types/auth.ts +252 -0
- package/src/@types/beacon.ts +140 -0
- package/src/@types/common.ts +22 -0
- package/src/@types/crypto.ts +73 -0
- package/src/@types/event.ts +370 -0
- package/src/@types/events.ts +119 -0
- package/src/@types/extensible_events.ts +150 -0
- package/src/@types/global.d.ts +70 -0
- package/src/@types/local_notifications.ts +19 -0
- package/src/@types/location.ts +92 -0
- package/src/@types/matrix-sdk-crypto-wasm.d.ts +44 -0
- package/src/@types/media.ts +245 -0
- package/src/@types/membership.ts +57 -0
- package/src/@types/oidc-client-ts.d.ts +24 -0
- package/src/@types/partials.ts +67 -0
- package/src/@types/polls.ts +119 -0
- package/src/@types/read_receipts.ts +61 -0
- package/src/@types/registration.ts +102 -0
- package/src/@types/requests.ts +314 -0
- package/src/@types/search.ts +119 -0
- package/src/@types/signed.ts +25 -0
- package/src/@types/spaces.ts +37 -0
- package/src/@types/state_events.ts +147 -0
- package/src/@types/synapse.ts +40 -0
- package/src/@types/sync.ts +27 -0
- package/src/@types/threepids.ts +29 -0
- package/src/@types/topic.ts +63 -0
- package/src/@types/uia.ts +29 -0
- package/src/NamespacedValue.ts +123 -0
- package/src/ReEmitter.ts +93 -0
- package/src/ToDeviceMessageQueue.ts +153 -0
- package/src/autodiscovery.ts +505 -0
- package/src/base64.ts +88 -0
- package/src/browser-index.ts +44 -0
- package/src/client.ts +10474 -0
- package/src/common-crypto/CryptoBackend.ts +302 -0
- package/src/common-crypto/README.md +4 -0
- package/src/common-crypto/key-passphrase.ts +43 -0
- package/src/content-helpers.ts +288 -0
- package/src/content-repo.ts +117 -0
- package/src/crypto/CrossSigning.ts +773 -0
- package/src/crypto/DeviceList.ts +989 -0
- package/src/crypto/EncryptionSetup.ts +351 -0
- package/src/crypto/OlmDevice.ts +1500 -0
- package/src/crypto/OutgoingRoomKeyRequestManager.ts +485 -0
- package/src/crypto/RoomList.ts +70 -0
- package/src/crypto/SecretSharing.ts +240 -0
- package/src/crypto/SecretStorage.ts +136 -0
- package/src/crypto/aes.ts +23 -0
- package/src/crypto/algorithms/base.ts +236 -0
- package/src/crypto/algorithms/index.ts +20 -0
- package/src/crypto/algorithms/megolm.ts +2216 -0
- package/src/crypto/algorithms/olm.ts +381 -0
- package/src/crypto/api.ts +70 -0
- package/src/crypto/backup.ts +922 -0
- package/src/crypto/crypto.ts +18 -0
- package/src/crypto/dehydration.ts +272 -0
- package/src/crypto/device-converter.ts +45 -0
- package/src/crypto/deviceinfo.ts +158 -0
- package/src/crypto/index.ts +4414 -0
- package/src/crypto/key_passphrase.ts +42 -0
- package/src/crypto/keybackup.ts +47 -0
- package/src/crypto/olmlib.ts +539 -0
- package/src/crypto/recoverykey.ts +18 -0
- package/src/crypto/store/base.ts +348 -0
- package/src/crypto/store/indexeddb-crypto-store-backend.ts +1250 -0
- package/src/crypto/store/indexeddb-crypto-store.ts +845 -0
- package/src/crypto/store/localStorage-crypto-store.ts +579 -0
- package/src/crypto/store/memory-crypto-store.ts +680 -0
- package/src/crypto/verification/Base.ts +409 -0
- package/src/crypto/verification/Error.ts +76 -0
- package/src/crypto/verification/IllegalMethod.ts +50 -0
- package/src/crypto/verification/QRCode.ts +310 -0
- package/src/crypto/verification/SAS.ts +494 -0
- package/src/crypto/verification/SASDecimal.ts +37 -0
- package/src/crypto/verification/request/Channel.ts +34 -0
- package/src/crypto/verification/request/InRoomChannel.ts +371 -0
- package/src/crypto/verification/request/ToDeviceChannel.ts +354 -0
- package/src/crypto/verification/request/VerificationRequest.ts +976 -0
- package/src/crypto-api/CryptoEvent.ts +93 -0
- package/src/crypto-api/CryptoEventHandlerMap.ts +32 -0
- package/src/crypto-api/index.ts +1175 -0
- package/src/crypto-api/key-passphrase.ts +58 -0
- package/src/crypto-api/keybackup.ts +115 -0
- package/src/crypto-api/recovery-key.ts +69 -0
- package/src/crypto-api/verification.ts +408 -0
- package/src/digest.ts +34 -0
- package/src/embedded.ts +631 -0
- package/src/errors.ts +54 -0
- package/src/event-mapper.ts +97 -0
- package/src/extensible_events_v1/ExtensibleEvent.ts +58 -0
- package/src/extensible_events_v1/InvalidEventError.ts +24 -0
- package/src/extensible_events_v1/MessageEvent.ts +145 -0
- package/src/extensible_events_v1/PollEndEvent.ts +97 -0
- package/src/extensible_events_v1/PollResponseEvent.ts +148 -0
- package/src/extensible_events_v1/PollStartEvent.ts +207 -0
- package/src/extensible_events_v1/utilities.ts +35 -0
- package/src/feature.ts +87 -0
- package/src/filter-component.ts +207 -0
- package/src/filter.ts +245 -0
- package/src/http-api/errors.ts +199 -0
- package/src/http-api/fetch.ts +383 -0
- package/src/http-api/index.ts +191 -0
- package/src/http-api/interface.ts +178 -0
- package/src/http-api/method.ts +25 -0
- package/src/http-api/prefix.ts +48 -0
- package/src/http-api/utils.ts +200 -0
- package/src/index.ts +25 -0
- package/src/indexeddb-helpers.ts +50 -0
- package/src/indexeddb-worker.ts +24 -0
- package/src/interactive-auth.ts +694 -0
- package/src/logger.ts +185 -0
- package/src/matrix.ts +177 -0
- package/src/matrixrtc/CallMembership.ts +247 -0
- package/src/matrixrtc/LivekitFocus.ts +39 -0
- package/src/matrixrtc/MatrixRTCSession.ts +1319 -0
- package/src/matrixrtc/MatrixRTCSessionManager.ts +166 -0
- package/src/matrixrtc/focus.ts +25 -0
- package/src/matrixrtc/index.ts +22 -0
- package/src/matrixrtc/types.ts +36 -0
- package/src/models/MSC3089Branch.ts +272 -0
- package/src/models/MSC3089TreeSpace.ts +565 -0
- package/src/models/ToDeviceMessage.ts +38 -0
- package/src/models/beacon.ts +214 -0
- package/src/models/compare-event-ordering.ts +139 -0
- package/src/models/device.ts +85 -0
- package/src/models/event-context.ts +110 -0
- package/src/models/event-status.ts +39 -0
- package/src/models/event-timeline-set.ts +979 -0
- package/src/models/event-timeline.ts +476 -0
- package/src/models/event.ts +1751 -0
- package/src/models/invites-ignorer.ts +376 -0
- package/src/models/poll.ts +285 -0
- package/src/models/profile-keys.ts +7 -0
- package/src/models/read-receipt.ts +422 -0
- package/src/models/related-relations.ts +39 -0
- package/src/models/relations-container.ts +149 -0
- package/src/models/relations.ts +368 -0
- package/src/models/room-member.ts +457 -0
- package/src/models/room-receipts.ts +439 -0
- package/src/models/room-state.ts +1130 -0
- package/src/models/room-summary.ts +47 -0
- package/src/models/room.ts +3822 -0
- package/src/models/search-result.ts +57 -0
- package/src/models/thread.ts +923 -0
- package/src/models/typed-event-emitter.ts +246 -0
- package/src/models/user.ts +302 -0
- package/src/oidc/authorize.ts +274 -0
- package/src/oidc/discovery.ts +60 -0
- package/src/oidc/error.ts +33 -0
- package/src/oidc/index.ts +34 -0
- package/src/oidc/register.ts +123 -0
- package/src/oidc/tokenRefresher.ts +149 -0
- package/src/oidc/validate.ts +282 -0
- package/src/pushprocessor.ts +837 -0
- package/src/randomstring.ts +51 -0
- package/src/realtime-callbacks.ts +191 -0
- package/src/receipt-accumulator.ts +189 -0
- package/src/rendezvous/MSC4108SignInWithQR.ts +444 -0
- package/src/rendezvous/RendezvousChannel.ts +48 -0
- package/src/rendezvous/RendezvousCode.ts +25 -0
- package/src/rendezvous/RendezvousError.ts +26 -0
- package/src/rendezvous/RendezvousFailureReason.ts +49 -0
- package/src/rendezvous/RendezvousIntent.ts +20 -0
- package/src/rendezvous/RendezvousTransport.ts +58 -0
- package/src/rendezvous/channels/MSC4108SecureChannel.ts +270 -0
- package/src/rendezvous/channels/index.ts +17 -0
- package/src/rendezvous/index.ts +25 -0
- package/src/rendezvous/transports/MSC4108RendezvousSession.ts +270 -0
- package/src/rendezvous/transports/index.ts +17 -0
- package/src/room-hierarchy.ts +152 -0
- package/src/rust-crypto/CrossSigningIdentity.ts +183 -0
- package/src/rust-crypto/DehydratedDeviceManager.ts +306 -0
- package/src/rust-crypto/KeyClaimManager.ts +86 -0
- package/src/rust-crypto/OutgoingRequestProcessor.ts +236 -0
- package/src/rust-crypto/OutgoingRequestsManager.ts +143 -0
- package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +501 -0
- package/src/rust-crypto/RoomEncryptor.ts +352 -0
- package/src/rust-crypto/backup.ts +881 -0
- package/src/rust-crypto/constants.ts +18 -0
- package/src/rust-crypto/device-converter.ts +128 -0
- package/src/rust-crypto/index.ts +237 -0
- package/src/rust-crypto/libolm_migration.ts +530 -0
- package/src/rust-crypto/rust-crypto.ts +2205 -0
- package/src/rust-crypto/secret-storage.ts +60 -0
- package/src/rust-crypto/verification.ts +830 -0
- package/src/scheduler.ts +309 -0
- package/src/secret-storage.ts +693 -0
- package/src/serverCapabilities.ts +139 -0
- package/src/service-types.ts +20 -0
- package/src/sliding-sync-sdk.ts +1026 -0
- package/src/sliding-sync.ts +965 -0
- package/src/store/index.ts +261 -0
- package/src/store/indexeddb-backend.ts +41 -0
- package/src/store/indexeddb-local-backend.ts +610 -0
- package/src/store/indexeddb-remote-backend.ts +213 -0
- package/src/store/indexeddb-store-worker.ts +157 -0
- package/src/store/indexeddb.ts +397 -0
- package/src/store/local-storage-events-emitter.ts +46 -0
- package/src/store/memory.ts +448 -0
- package/src/store/stub.ts +280 -0
- package/src/sync-accumulator.ts +689 -0
- package/src/sync.ts +1920 -0
- package/src/testing.ts +191 -0
- package/src/thread-utils.ts +31 -0
- package/src/timeline-window.ts +536 -0
- package/src/types.ts +59 -0
- package/src/utils/decryptAESSecretStorageItem.ts +54 -0
- package/src/utils/encryptAESSecretStorageItem.ts +73 -0
- package/src/utils/internal/deriveKeys.ts +63 -0
- package/src/utils.ts +763 -0
- package/src/version-support.ts +36 -0
- package/src/webrtc/audioContext.ts +44 -0
- package/src/webrtc/call.ts +3074 -0
- package/src/webrtc/callEventHandler.ts +425 -0
- package/src/webrtc/callEventTypes.ts +93 -0
- package/src/webrtc/callFeed.ts +364 -0
- package/src/webrtc/groupCall.ts +1735 -0
- package/src/webrtc/groupCallEventHandler.ts +234 -0
- package/src/webrtc/mediaHandler.ts +484 -0
- package/src/webrtc/stats/callFeedStatsReporter.ts +94 -0
- package/src/webrtc/stats/callStatsReportGatherer.ts +219 -0
- package/src/webrtc/stats/callStatsReportSummary.ts +30 -0
- package/src/webrtc/stats/connectionStats.ts +47 -0
- package/src/webrtc/stats/connectionStatsBuilder.ts +28 -0
- package/src/webrtc/stats/connectionStatsReportBuilder.ts +140 -0
- package/src/webrtc/stats/groupCallStats.ts +93 -0
- package/src/webrtc/stats/media/mediaSsrcHandler.ts +57 -0
- package/src/webrtc/stats/media/mediaTrackHandler.ts +76 -0
- package/src/webrtc/stats/media/mediaTrackStats.ts +176 -0
- package/src/webrtc/stats/media/mediaTrackStatsHandler.ts +90 -0
- package/src/webrtc/stats/statsReport.ts +133 -0
- package/src/webrtc/stats/statsReportEmitter.ts +49 -0
- package/src/webrtc/stats/summaryStatsReportGatherer.ts +148 -0
- package/src/webrtc/stats/trackStatsBuilder.ts +207 -0
- package/src/webrtc/stats/transportStats.ts +26 -0
- package/src/webrtc/stats/transportStatsBuilder.ts +48 -0
- package/src/webrtc/stats/valueFormatter.ts +27 -0
package/lib/client.d.ts
ADDED
@@ -0,0 +1,4232 @@
|
|
1
|
+
/**
|
2
|
+
* This is an internal module. See {@link MatrixClient} for the public class.
|
3
|
+
*/
|
4
|
+
import { Optional } from "matrix-events-sdk";
|
5
|
+
import type { IDeviceKeys, IMegolmSessionData, IOneTimeKey } from "./@types/crypto.ts";
|
6
|
+
import { ISyncStateData, SetPresence, SyncApi, SyncApiOptions, SyncState } from "./sync.ts";
|
7
|
+
import { EventStatus, IContent, IDecryptOptions, IEvent, MatrixEvent, MatrixEventEvent, MatrixEventHandlerMap, PushDetails } from "./models/event.ts";
|
8
|
+
import { CallEvent, CallEventHandlerMap, MatrixCall } from "./webrtc/call.ts";
|
9
|
+
import { Filter, IFilterDefinition } from "./filter.ts";
|
10
|
+
import { CallEventHandler, CallEventHandlerEvent, CallEventHandlerEventHandlerMap } from "./webrtc/callEventHandler.ts";
|
11
|
+
import { GroupCallEventHandler, GroupCallEventHandlerEvent, GroupCallEventHandlerEventHandlerMap } from "./webrtc/groupCallEventHandler.ts";
|
12
|
+
import { QueryDict } from "./utils.ts";
|
13
|
+
import { Direction, EventTimeline } from "./models/event-timeline.ts";
|
14
|
+
import { IActionsObject, PushProcessor } from "./pushprocessor.ts";
|
15
|
+
import { AutoDiscoveryAction } from "./autodiscovery.ts";
|
16
|
+
import { IExportedDevice as IExportedOlmDevice } from "./crypto/OlmDevice.ts";
|
17
|
+
import { IOlmDevice } from "./crypto/algorithms/megolm.ts";
|
18
|
+
import { TypedReEmitter } from "./ReEmitter.ts";
|
19
|
+
import { IRoomEncryption } from "./crypto/RoomList.ts";
|
20
|
+
import { Logger } from "./logger.ts";
|
21
|
+
import { SERVICE_TYPES } from "./service-types.ts";
|
22
|
+
import { FileType, HttpApiEvent, HttpApiEventHandlerMap, IHttpOpts, IRequestOpts, MatrixError, MatrixHttpApi, TokenRefreshFunction, Upload, UploadOpts, UploadResponse } from "./http-api/index.ts";
|
23
|
+
import { Crypto, CryptoEvent as LegacyCryptoEvent, CryptoEventHandlerMap as LegacyCryptoEventHandlerMap, ICheckOwnCrossSigningTrustOpts } from "./crypto/index.ts";
|
24
|
+
import { DeviceInfo } from "./crypto/deviceinfo.ts";
|
25
|
+
import { User, UserEvent, UserEventHandlerMap } from "./models/user.ts";
|
26
|
+
import { IDehydratedDevice, IDehydratedDeviceKeyInfo } from "./crypto/dehydration.ts";
|
27
|
+
import { IKeyBackupInfo, IKeyBackupPrepareOpts, IKeyBackupRestoreOpts, IKeyBackupRestoreResult } from "./crypto/keybackup.ts";
|
28
|
+
import { IIdentityServerProvider } from "./@types/IIdentityServerProvider.ts";
|
29
|
+
import { MatrixScheduler } from "./scheduler.ts";
|
30
|
+
import { BeaconEvent, BeaconEventHandlerMap } from "./models/beacon.ts";
|
31
|
+
import { AuthDict } from "./interactive-auth.ts";
|
32
|
+
import { IMinimalEvent, IRoomEvent, IStateEvent } from "./sync-accumulator.ts";
|
33
|
+
import { CrossSigningKey, ICreateSecretStorageOpts, IEncryptedEventInfo, IRecoveryKey } from "./crypto/api.ts";
|
34
|
+
import { EventTimelineSet } from "./models/event-timeline-set.ts";
|
35
|
+
import { VerificationRequest } from "./crypto/verification/request/VerificationRequest.ts";
|
36
|
+
import { VerificationBase as Verification } from "./crypto/verification/Base.ts";
|
37
|
+
import { CrossSigningInfo, DeviceTrustLevel, ICacheCallbacks, UserTrustLevel } from "./crypto/CrossSigning.ts";
|
38
|
+
import { Room, RoomEvent, RoomEventHandlerMap, RoomNameState } from "./models/room.ts";
|
39
|
+
import { RoomMemberEvent, RoomMemberEventHandlerMap } from "./models/room-member.ts";
|
40
|
+
import { RoomStateEvent, RoomStateEventHandlerMap } from "./models/room-state.ts";
|
41
|
+
import { DelayedEventInfo, IAddThreePidOnlyBody, IBindThreePidBody, ICreateRoomOpts, IEventSearchOpts, IGuestAccessOpts, IJoinRoomOpts, IPaginateOpts, IPresenceOpts, IRedactOpts, IRelationsRequestOpts, IRelationsResponse, IRoomDirectoryOptions, ISearchOpts, ISendEventResponse, IStatusResponse, ITagsResponse, KnockRoomOpts, SendDelayedEventRequestOpts, SendDelayedEventResponse, UpdateDelayedEventAction } from "./@types/requests.ts";
|
42
|
+
import { EventType, RelationType, RoomType, StateEvents, TimelineEvents } from "./@types/event.ts";
|
43
|
+
import { IdServerUnbindResult, JoinRule, Preset, Visibility } from "./@types/partials.ts";
|
44
|
+
import { EventMapper, MapperOpts } from "./event-mapper.ts";
|
45
|
+
import { IKeyBackup, IKeyBackupCheck, IPreparedKeyBackupVersion, TrustInfo } from "./crypto/backup.ts";
|
46
|
+
import { MSC3089TreeSpace } from "./models/MSC3089TreeSpace.ts";
|
47
|
+
import { ISignatures } from "./@types/signed.ts";
|
48
|
+
import { IStore } from "./store/index.ts";
|
49
|
+
import { ISecretRequest } from "./crypto/SecretStorage.ts";
|
50
|
+
import { IEventWithRoomId, ISearchRequestBody, ISearchResponse, ISearchResults, IStateEventWithRoomId } from "./@types/search.ts";
|
51
|
+
import { ISynapseAdminDeactivateResponse, ISynapseAdminWhoisResponse } from "./@types/synapse.ts";
|
52
|
+
import { IHierarchyRoom } from "./@types/spaces.ts";
|
53
|
+
import { IPusher, IPusherRequest, IPushRule, IPushRules, PushRuleAction, PushRuleKind, RuleId } from "./@types/PushRules.ts";
|
54
|
+
import { IThreepid } from "./@types/threepids.ts";
|
55
|
+
import { CryptoStore, OutgoingRoomKeyRequest } from "./crypto/store/base.ts";
|
56
|
+
import { GroupCall, GroupCallIntent, GroupCallType, IGroupCallDataChannelOptions } from "./webrtc/groupCall.ts";
|
57
|
+
import { MediaHandler } from "./webrtc/mediaHandler.ts";
|
58
|
+
import { ILoginFlowsResponse, IRefreshTokenResponse, LoginRequest, LoginResponse, LoginTokenPostResponse, SSOAction } from "./@types/auth.ts";
|
59
|
+
import { TypedEventEmitter } from "./models/typed-event-emitter.ts";
|
60
|
+
import { ReceiptType } from "./@types/read_receipts.ts";
|
61
|
+
import { MSC3575SlidingSyncRequest, MSC3575SlidingSyncResponse, SlidingSync } from "./sliding-sync.ts";
|
62
|
+
import { SlidingSyncSdk } from "./sliding-sync-sdk.ts";
|
63
|
+
import { FeatureSupport, ThreadFilterType } from "./models/thread.ts";
|
64
|
+
import { MBeaconInfoEventContent } from "./@types/beacon.ts";
|
65
|
+
import { NamespacedValue, UnstableValue } from "./NamespacedValue.ts";
|
66
|
+
import { ToDeviceBatch } from "./models/ToDeviceMessage.ts";
|
67
|
+
import { IgnoredInvites } from "./models/invites-ignorer.ts";
|
68
|
+
import { UIAResponse } from "./@types/uia.ts";
|
69
|
+
import { LocalNotificationSettings } from "./@types/local_notifications.ts";
|
70
|
+
import { Feature, ServerSupport } from "./feature.ts";
|
71
|
+
import { BootstrapCrossSigningOpts, CrossSigningKeyInfo, CryptoApi, ImportRoomKeysOpts, CryptoEvent, CryptoEventHandlerMap, CryptoCallbacks } from "./crypto-api/index.ts";
|
72
|
+
import { DeviceInfoMap } from "./crypto/DeviceList.ts";
|
73
|
+
import { AddSecretStorageKeyOpts, SecretStorageKeyDescription, ServerSideSecretStorage } from "./secret-storage.ts";
|
74
|
+
import { RegisterRequest, RegisterResponse } from "./@types/registration.ts";
|
75
|
+
import { MatrixRTCSessionManager } from "./matrixrtc/MatrixRTCSessionManager.ts";
|
76
|
+
import { Membership } from "./@types/membership.ts";
|
77
|
+
import { RoomMessageEventContent } from "./@types/events.ts";
|
78
|
+
import { ImageInfo } from "./@types/media.ts";
|
79
|
+
import { Capabilities } from "./serverCapabilities.ts";
|
80
|
+
export type Store = IStore;
|
81
|
+
export type ResetTimelineCallback = (roomId: string) => boolean;
|
82
|
+
export declare const UNSTABLE_MSC3852_LAST_SEEN_UA: UnstableValue<"last_seen_user_agent", "org.matrix.msc3852.last_seen_user_agent">;
|
83
|
+
interface IExportedDevice {
|
84
|
+
olmDevice: IExportedOlmDevice;
|
85
|
+
userId: string;
|
86
|
+
deviceId: string;
|
87
|
+
}
|
88
|
+
export interface IKeysUploadResponse {
|
89
|
+
one_time_key_counts: {
|
90
|
+
[algorithm: string]: number;
|
91
|
+
};
|
92
|
+
}
|
93
|
+
export interface ICreateClientOpts {
|
94
|
+
baseUrl: string;
|
95
|
+
idBaseUrl?: string;
|
96
|
+
/**
|
97
|
+
* The data store used for sync data from the homeserver. If not specified,
|
98
|
+
* this client will not store any HTTP responses. The `createClient` helper
|
99
|
+
* will create a default store if needed.
|
100
|
+
*/
|
101
|
+
store?: Store;
|
102
|
+
/**
|
103
|
+
* A store to be used for end-to-end crypto session data.
|
104
|
+
* The `createClient` helper will create a default store if needed. Calls the factory supplied to
|
105
|
+
* {@link setCryptoStoreFactory} if unspecified; or if no factory has been
|
106
|
+
* specified, uses a default implementation (indexeddb in the browser,
|
107
|
+
* in-memory otherwise).
|
108
|
+
*
|
109
|
+
* This is only used for the legacy crypto implementation (as used by {@link MatrixClient#initCrypto}),
|
110
|
+
* but if you use the rust crypto implementation ({@link MatrixClient#initRustCrypto}) and the device
|
111
|
+
* previously used legacy crypto (so must be migrated), then this must still be provided, so that the
|
112
|
+
* data can be migrated from the legacy store.
|
113
|
+
*/
|
114
|
+
cryptoStore?: CryptoStore;
|
115
|
+
/**
|
116
|
+
* The scheduler to use. If not
|
117
|
+
* specified, this client will not retry requests on failure. This client
|
118
|
+
* will supply its own processing function to
|
119
|
+
* {@link MatrixScheduler#setProcessFunction}.
|
120
|
+
*/
|
121
|
+
scheduler?: MatrixScheduler;
|
122
|
+
/**
|
123
|
+
* The function to invoke for HTTP requests.
|
124
|
+
* Most supported environments have a global `fetch` registered to which this will fall back.
|
125
|
+
*/
|
126
|
+
fetchFn?: typeof globalThis.fetch;
|
127
|
+
userId?: string;
|
128
|
+
/**
|
129
|
+
* A unique identifier for this device; used for tracking things like crypto
|
130
|
+
* keys and access tokens. If not specified, end-to-end encryption will be
|
131
|
+
* disabled.
|
132
|
+
*/
|
133
|
+
deviceId?: string;
|
134
|
+
accessToken?: string;
|
135
|
+
refreshToken?: string;
|
136
|
+
/**
|
137
|
+
* Function used to attempt refreshing access and refresh tokens
|
138
|
+
* Called by http-api when a possibly expired token is encountered
|
139
|
+
* and a refreshToken is found
|
140
|
+
*/
|
141
|
+
tokenRefreshFunction?: TokenRefreshFunction;
|
142
|
+
/**
|
143
|
+
* Identity server provider to retrieve the user's access token when accessing
|
144
|
+
* the identity server. See also https://github.com/vector-im/element-web/issues/10615
|
145
|
+
* which seeks to replace the previous approach of manual access tokens params
|
146
|
+
* with this callback throughout the SDK.
|
147
|
+
*/
|
148
|
+
identityServer?: IIdentityServerProvider;
|
149
|
+
/**
|
150
|
+
* The default maximum amount of
|
151
|
+
* time to wait before timing out HTTP requests. If not specified, there is no timeout.
|
152
|
+
*/
|
153
|
+
localTimeoutMs?: number;
|
154
|
+
/**
|
155
|
+
* Set to false to send the access token to the server via a query parameter rather
|
156
|
+
* than the Authorization HTTP header.
|
157
|
+
*
|
158
|
+
* Note that as of v1.11 of the Matrix spec, sending the access token via a query
|
159
|
+
* is deprecated.
|
160
|
+
*
|
161
|
+
* Default true.
|
162
|
+
*/
|
163
|
+
useAuthorizationHeader?: boolean;
|
164
|
+
/**
|
165
|
+
* Set to true to enable
|
166
|
+
* improved timeline support, see {@link MatrixClient#getEventTimeline}.
|
167
|
+
* It is disabled by default for compatibility with older clients - in particular to
|
168
|
+
* maintain support for back-paginating the live timeline after a '/sync'
|
169
|
+
* result with a gap.
|
170
|
+
*/
|
171
|
+
timelineSupport?: boolean;
|
172
|
+
/**
|
173
|
+
* Extra query parameters to append
|
174
|
+
* to all requests with this client. Useful for application services which require
|
175
|
+
* `?user_id=`.
|
176
|
+
*/
|
177
|
+
queryParams?: Record<string, string>;
|
178
|
+
/**
|
179
|
+
* Device data exported with
|
180
|
+
* "exportDevice" method that must be imported to recreate this device.
|
181
|
+
* Should only be useful for devices with end-to-end crypto enabled.
|
182
|
+
* If provided, deviceId and userId should **NOT** be provided at the top
|
183
|
+
* level (they are present in the exported data).
|
184
|
+
*/
|
185
|
+
deviceToImport?: IExportedDevice;
|
186
|
+
/**
|
187
|
+
* Encryption key used for encrypting sensitive data (such as e2ee keys) in {@link ICreateClientOpts#cryptoStore}.
|
188
|
+
*
|
189
|
+
* This must be set to the same value every time the client is initialised for the same device.
|
190
|
+
*
|
191
|
+
* This is only used for the legacy crypto implementation (as used by {@link MatrixClient#initCrypto}),
|
192
|
+
* but if you use the rust crypto implementation ({@link MatrixClient#initRustCrypto}) and the device
|
193
|
+
* previously used legacy crypto (so must be migrated), then this must still be provided, so that the
|
194
|
+
* data can be migrated from the legacy store.
|
195
|
+
*/
|
196
|
+
pickleKey?: string;
|
197
|
+
/**
|
198
|
+
* Verification methods we should offer to the other side when performing an interactive verification.
|
199
|
+
* If unset, we will offer all known methods. Currently these are: showing a QR code, scanning a QR code, and SAS
|
200
|
+
* (aka "emojis").
|
201
|
+
*
|
202
|
+
* See {@link types.VerificationMethod} for a set of useful constants for this parameter.
|
203
|
+
*/
|
204
|
+
verificationMethods?: Array<string>;
|
205
|
+
/**
|
206
|
+
* Whether relaying calls through a TURN server should be forced. Default false.
|
207
|
+
*/
|
208
|
+
forceTURN?: boolean;
|
209
|
+
/**
|
210
|
+
* Up to this many ICE candidates will be gathered when an incoming call arrives.
|
211
|
+
* Gathering does not send data to the caller, but will communicate with the configured TURN
|
212
|
+
* server. Default 0.
|
213
|
+
*/
|
214
|
+
iceCandidatePoolSize?: number;
|
215
|
+
/**
|
216
|
+
* True to advertise support for call transfers to other parties on Matrix calls. Default false.
|
217
|
+
*/
|
218
|
+
supportsCallTransfer?: boolean;
|
219
|
+
/**
|
220
|
+
* Whether to allow a fallback ICE server should be used for negotiating a
|
221
|
+
* WebRTC connection if the homeserver doesn't provide any servers. Defaults to false.
|
222
|
+
*/
|
223
|
+
fallbackICEServerAllowed?: boolean;
|
224
|
+
/**
|
225
|
+
* If true, to-device signalling for group calls will be encrypted
|
226
|
+
* with Olm. Default: true.
|
227
|
+
*/
|
228
|
+
useE2eForGroupCall?: boolean;
|
229
|
+
livekitServiceURL?: string;
|
230
|
+
/**
|
231
|
+
* Crypto callbacks provided by the application
|
232
|
+
*/
|
233
|
+
cryptoCallbacks?: CryptoCallbacks;
|
234
|
+
/**
|
235
|
+
* Method to generate room names for empty rooms and rooms names based on membership.
|
236
|
+
* Defaults to a built-in English handler with basic pluralisation.
|
237
|
+
*/
|
238
|
+
roomNameGenerator?: (roomId: string, state: RoomNameState) => string | null;
|
239
|
+
/**
|
240
|
+
* If true, participant can join group call without video and audio this has to be allowed. By default, a local
|
241
|
+
* media stream is needed to establish a group call.
|
242
|
+
* Default: false.
|
243
|
+
*/
|
244
|
+
isVoipWithNoMediaAllowed?: boolean;
|
245
|
+
/**
|
246
|
+
* If true, group calls will not establish media connectivity and only create the signaling events,
|
247
|
+
* so that livekit media can be used in the application layert (js-sdk contains no livekit code).
|
248
|
+
*/
|
249
|
+
useLivekitForGroupCalls?: boolean;
|
250
|
+
/**
|
251
|
+
* A logger to associate with this MatrixClient.
|
252
|
+
* Defaults to the built-in global logger.
|
253
|
+
*/
|
254
|
+
logger?: Logger;
|
255
|
+
}
|
256
|
+
export interface IMatrixClientCreateOpts extends ICreateClientOpts {
|
257
|
+
/**
|
258
|
+
* Whether to allow sending messages to encrypted rooms when encryption
|
259
|
+
* is not available internally within this SDK. This is useful if you are using an external
|
260
|
+
* E2E proxy, for example. Defaults to false.
|
261
|
+
*/
|
262
|
+
usingExternalCrypto?: boolean;
|
263
|
+
}
|
264
|
+
export declare enum PendingEventOrdering {
|
265
|
+
Chronological = "chronological",
|
266
|
+
Detached = "detached"
|
267
|
+
}
|
268
|
+
export interface IStartClientOpts {
|
269
|
+
/**
|
270
|
+
* The event `limit=` to apply to initial sync. Default: 8.
|
271
|
+
*/
|
272
|
+
initialSyncLimit?: number;
|
273
|
+
/**
|
274
|
+
* True to put `archived=true</code> on the <code>/initialSync` request. Default: false.
|
275
|
+
*/
|
276
|
+
includeArchivedRooms?: boolean;
|
277
|
+
/**
|
278
|
+
* True to do /profile requests on every invite event if the displayname/avatar_url is not known for this user ID. Default: false.
|
279
|
+
*/
|
280
|
+
resolveInvitesToProfiles?: boolean;
|
281
|
+
/**
|
282
|
+
* Controls where pending messages appear in a room's timeline. If "<b>chronological</b>", messages will
|
283
|
+
* appear in the timeline when the call to `sendEvent` was made. If "<b>detached</b>",
|
284
|
+
* pending messages will appear in a separate list, accessbile via {@link Room#getPendingEvents}.
|
285
|
+
* Default: "chronological".
|
286
|
+
*/
|
287
|
+
pendingEventOrdering?: PendingEventOrdering;
|
288
|
+
/**
|
289
|
+
* The number of milliseconds to wait on /sync. Default: 30000 (30 seconds).
|
290
|
+
*/
|
291
|
+
pollTimeout?: number;
|
292
|
+
/**
|
293
|
+
* The filter to apply to /sync calls.
|
294
|
+
*/
|
295
|
+
filter?: Filter;
|
296
|
+
/**
|
297
|
+
* True to perform syncing without automatically updating presence.
|
298
|
+
*/
|
299
|
+
disablePresence?: boolean;
|
300
|
+
/**
|
301
|
+
* True to not load all membership events during initial sync but fetch them when needed by calling
|
302
|
+
* `loadOutOfBandMembers` This will override the filter option at this moment.
|
303
|
+
*/
|
304
|
+
lazyLoadMembers?: boolean;
|
305
|
+
/**
|
306
|
+
* The number of seconds between polls to /.well-known/matrix/client, undefined to disable.
|
307
|
+
* This should be in the order of hours. Default: undefined.
|
308
|
+
*/
|
309
|
+
clientWellKnownPollPeriod?: number;
|
310
|
+
/**
|
311
|
+
* Will organises events in threaded conversations when
|
312
|
+
* a thread relation is encountered
|
313
|
+
*/
|
314
|
+
threadSupport?: boolean;
|
315
|
+
/**
|
316
|
+
* @experimental
|
317
|
+
*/
|
318
|
+
slidingSync?: SlidingSync;
|
319
|
+
}
|
320
|
+
export interface IStoredClientOpts extends IStartClientOpts {
|
321
|
+
}
|
322
|
+
export declare const GET_LOGIN_TOKEN_CAPABILITY: NamespacedValue<"m.get_login_token", "org.matrix.msc3882.get_login_token">;
|
323
|
+
export declare const UNSTABLE_MSC2666_SHARED_ROOMS = "uk.half-shot.msc2666";
|
324
|
+
export declare const UNSTABLE_MSC2666_MUTUAL_ROOMS = "uk.half-shot.msc2666.mutual_rooms";
|
325
|
+
export declare const UNSTABLE_MSC2666_QUERY_MUTUAL_ROOMS = "uk.half-shot.msc2666.query_mutual_rooms";
|
326
|
+
export declare const UNSTABLE_MSC4140_DELAYED_EVENTS = "org.matrix.msc4140";
|
327
|
+
export declare const UNSTABLE_MSC4133_EXTENDED_PROFILES = "uk.tcpip.msc4133";
|
328
|
+
declare enum CrossSigningKeyType {
|
329
|
+
MasterKey = "master_key",
|
330
|
+
SelfSigningKey = "self_signing_key",
|
331
|
+
UserSigningKey = "user_signing_key"
|
332
|
+
}
|
333
|
+
export type CrossSigningKeys = Record<CrossSigningKeyType, CrossSigningKeyInfo>;
|
334
|
+
export type SendToDeviceContentMap = Map<string, Map<string, Record<string, any>>>;
|
335
|
+
export interface ISignedKey {
|
336
|
+
keys: Record<string, string>;
|
337
|
+
signatures: ISignatures;
|
338
|
+
user_id: string;
|
339
|
+
algorithms: string[];
|
340
|
+
device_id: string;
|
341
|
+
}
|
342
|
+
export type KeySignatures = Record<string, Record<string, CrossSigningKeyInfo | ISignedKey>>;
|
343
|
+
export interface IUploadKeySignaturesResponse {
|
344
|
+
failures: Record<string, Record<string, {
|
345
|
+
errcode: string;
|
346
|
+
error: string;
|
347
|
+
}>>;
|
348
|
+
}
|
349
|
+
export interface IPreviewUrlResponse {
|
350
|
+
[key: string]: undefined | string | number;
|
351
|
+
"og:title": string;
|
352
|
+
"og:type": string;
|
353
|
+
"og:url": string;
|
354
|
+
"og:image"?: string;
|
355
|
+
"og:image:type"?: string;
|
356
|
+
"og:image:height"?: number;
|
357
|
+
"og:image:width"?: number;
|
358
|
+
"og:description"?: string;
|
359
|
+
"matrix:image:size"?: number;
|
360
|
+
}
|
361
|
+
export interface ITurnServerResponse {
|
362
|
+
uris: string[];
|
363
|
+
username: string;
|
364
|
+
password: string;
|
365
|
+
ttl: number;
|
366
|
+
}
|
367
|
+
export interface ITurnServer {
|
368
|
+
urls: string[];
|
369
|
+
username: string;
|
370
|
+
credential: string;
|
371
|
+
}
|
372
|
+
export interface IServerVersions {
|
373
|
+
versions: string[];
|
374
|
+
unstable_features: Record<string, boolean>;
|
375
|
+
}
|
376
|
+
export interface IClientWellKnown {
|
377
|
+
[key: string]: any;
|
378
|
+
"m.homeserver"?: IWellKnownConfig;
|
379
|
+
"m.identity_server"?: IWellKnownConfig;
|
380
|
+
}
|
381
|
+
export interface IWellKnownConfig<T = IClientWellKnown> {
|
382
|
+
raw?: T;
|
383
|
+
action?: AutoDiscoveryAction;
|
384
|
+
reason?: string;
|
385
|
+
error?: Error | string;
|
386
|
+
base_url?: string | null;
|
387
|
+
server_name?: string;
|
388
|
+
}
|
389
|
+
interface IMediaConfig {
|
390
|
+
[key: string]: any;
|
391
|
+
"m.upload.size"?: number;
|
392
|
+
}
|
393
|
+
interface ITagMetadata {
|
394
|
+
[key: string]: any;
|
395
|
+
order?: number;
|
396
|
+
}
|
397
|
+
interface IMessagesResponse {
|
398
|
+
start?: string;
|
399
|
+
end?: string;
|
400
|
+
chunk: IRoomEvent[];
|
401
|
+
state?: IStateEvent[];
|
402
|
+
}
|
403
|
+
export interface IRequestTokenResponse {
|
404
|
+
sid: string;
|
405
|
+
submit_url?: string;
|
406
|
+
}
|
407
|
+
export interface IRequestMsisdnTokenResponse extends IRequestTokenResponse {
|
408
|
+
msisdn: string;
|
409
|
+
success: boolean;
|
410
|
+
intl_fmt: string;
|
411
|
+
}
|
412
|
+
export interface IUploadKeysRequest {
|
413
|
+
"device_keys"?: Required<IDeviceKeys>;
|
414
|
+
"one_time_keys"?: Record<string, IOneTimeKey>;
|
415
|
+
"org.matrix.msc2732.fallback_keys"?: Record<string, IOneTimeKey>;
|
416
|
+
}
|
417
|
+
export interface IQueryKeysRequest {
|
418
|
+
device_keys: {
|
419
|
+
[userId: string]: string[];
|
420
|
+
};
|
421
|
+
timeout?: number;
|
422
|
+
token?: string;
|
423
|
+
}
|
424
|
+
export interface IClaimKeysRequest {
|
425
|
+
one_time_keys: {
|
426
|
+
[userId: string]: {
|
427
|
+
[deviceId: string]: string;
|
428
|
+
};
|
429
|
+
};
|
430
|
+
timeout?: number;
|
431
|
+
}
|
432
|
+
export interface IOpenIDToken {
|
433
|
+
access_token: string;
|
434
|
+
token_type: "Bearer" | string;
|
435
|
+
matrix_server_name: string;
|
436
|
+
expires_in: number;
|
437
|
+
}
|
438
|
+
interface IRoomInitialSyncResponse {
|
439
|
+
room_id: string;
|
440
|
+
membership: Membership;
|
441
|
+
messages?: {
|
442
|
+
start?: string;
|
443
|
+
end?: string;
|
444
|
+
chunk: IEventWithRoomId[];
|
445
|
+
};
|
446
|
+
state?: IStateEventWithRoomId[];
|
447
|
+
visibility: Visibility;
|
448
|
+
account_data?: IMinimalEvent[];
|
449
|
+
presence: Partial<IEvent>;
|
450
|
+
}
|
451
|
+
interface IJoinedRoomsResponse {
|
452
|
+
joined_rooms: string[];
|
453
|
+
}
|
454
|
+
interface IJoinedMembersResponse {
|
455
|
+
joined: {
|
456
|
+
[userId: string]: {
|
457
|
+
display_name: string;
|
458
|
+
avatar_url: string;
|
459
|
+
};
|
460
|
+
};
|
461
|
+
}
|
462
|
+
export type IRegisterRequestParams = RegisterRequest;
|
463
|
+
export interface IPublicRoomsChunkRoom {
|
464
|
+
room_id: string;
|
465
|
+
name?: string;
|
466
|
+
avatar_url?: string;
|
467
|
+
topic?: string;
|
468
|
+
canonical_alias?: string;
|
469
|
+
aliases?: string[];
|
470
|
+
world_readable: boolean;
|
471
|
+
guest_can_join: boolean;
|
472
|
+
num_joined_members: number;
|
473
|
+
room_type?: RoomType | string;
|
474
|
+
join_rule?: JoinRule.Knock | JoinRule.Public;
|
475
|
+
}
|
476
|
+
interface IPublicRoomsResponse {
|
477
|
+
chunk: IPublicRoomsChunkRoom[];
|
478
|
+
next_batch?: string;
|
479
|
+
prev_batch?: string;
|
480
|
+
total_room_count_estimate?: number;
|
481
|
+
}
|
482
|
+
interface IUserDirectoryResponse {
|
483
|
+
results: {
|
484
|
+
user_id: string;
|
485
|
+
display_name?: string;
|
486
|
+
avatar_url?: string;
|
487
|
+
}[];
|
488
|
+
limited: boolean;
|
489
|
+
}
|
490
|
+
export interface IMyDevice {
|
491
|
+
"device_id": string;
|
492
|
+
"display_name"?: string;
|
493
|
+
"last_seen_ip"?: string;
|
494
|
+
"last_seen_ts"?: number;
|
495
|
+
"last_seen_user_agent"?: string;
|
496
|
+
"org.matrix.msc3852.last_seen_user_agent"?: string;
|
497
|
+
}
|
498
|
+
export interface Keys {
|
499
|
+
keys: {
|
500
|
+
[keyId: string]: string;
|
501
|
+
};
|
502
|
+
usage: string[];
|
503
|
+
user_id: string;
|
504
|
+
}
|
505
|
+
export interface SigningKeys extends Keys {
|
506
|
+
signatures: ISignatures;
|
507
|
+
}
|
508
|
+
export interface DeviceKeys {
|
509
|
+
[deviceId: string]: IDeviceKeys & {
|
510
|
+
unsigned?: {
|
511
|
+
device_display_name: string;
|
512
|
+
};
|
513
|
+
};
|
514
|
+
}
|
515
|
+
export interface IDownloadKeyResult {
|
516
|
+
failures: {
|
517
|
+
[serverName: string]: object;
|
518
|
+
};
|
519
|
+
device_keys: {
|
520
|
+
[userId: string]: DeviceKeys;
|
521
|
+
};
|
522
|
+
master_keys?: {
|
523
|
+
[userId: string]: Keys;
|
524
|
+
};
|
525
|
+
self_signing_keys?: {
|
526
|
+
[userId: string]: SigningKeys;
|
527
|
+
};
|
528
|
+
user_signing_keys?: {
|
529
|
+
[userId: string]: SigningKeys;
|
530
|
+
};
|
531
|
+
}
|
532
|
+
export interface IClaimOTKsResult {
|
533
|
+
failures: {
|
534
|
+
[serverName: string]: object;
|
535
|
+
};
|
536
|
+
one_time_keys: {
|
537
|
+
[userId: string]: {
|
538
|
+
[deviceId: string]: {
|
539
|
+
[keyId: string]: {
|
540
|
+
key: string;
|
541
|
+
signatures: ISignatures;
|
542
|
+
};
|
543
|
+
};
|
544
|
+
};
|
545
|
+
};
|
546
|
+
}
|
547
|
+
export interface IFieldType {
|
548
|
+
regexp: string;
|
549
|
+
placeholder: string;
|
550
|
+
}
|
551
|
+
export interface IInstance {
|
552
|
+
desc: string;
|
553
|
+
icon?: string;
|
554
|
+
fields: object;
|
555
|
+
network_id: string;
|
556
|
+
instance_id: string;
|
557
|
+
}
|
558
|
+
export interface IProtocol {
|
559
|
+
user_fields: string[];
|
560
|
+
location_fields: string[];
|
561
|
+
icon: string;
|
562
|
+
field_types: Record<string, IFieldType>;
|
563
|
+
instances: IInstance[];
|
564
|
+
}
|
565
|
+
interface IThirdPartyLocation {
|
566
|
+
alias: string;
|
567
|
+
protocol: string;
|
568
|
+
fields: object;
|
569
|
+
}
|
570
|
+
interface IThirdPartyUser {
|
571
|
+
userid: string;
|
572
|
+
protocol: string;
|
573
|
+
fields: object;
|
574
|
+
}
|
575
|
+
/**
|
576
|
+
* The summary of a room as defined by an initial version of MSC3266 and implemented in Synapse
|
577
|
+
* Proposed at https://github.com/matrix-org/matrix-doc/pull/3266
|
578
|
+
*/
|
579
|
+
export interface RoomSummary extends Omit<IPublicRoomsChunkRoom, "canonical_alias" | "aliases"> {
|
580
|
+
/**
|
581
|
+
* The current membership of this user in the room.
|
582
|
+
* Usually "leave" if the room is fetched over federation.
|
583
|
+
*/
|
584
|
+
"membership"?: Membership;
|
585
|
+
/**
|
586
|
+
* Version of the room.
|
587
|
+
*/
|
588
|
+
"im.nheko.summary.room_version"?: string;
|
589
|
+
/**
|
590
|
+
* The encryption algorithm used for this room, if the room is encrypted.
|
591
|
+
*/
|
592
|
+
"im.nheko.summary.encryption"?: string;
|
593
|
+
}
|
594
|
+
interface IRoomHierarchy {
|
595
|
+
rooms: IHierarchyRoom[];
|
596
|
+
next_batch?: string;
|
597
|
+
}
|
598
|
+
export interface TimestampToEventResponse {
|
599
|
+
event_id: string;
|
600
|
+
origin_server_ts: number;
|
601
|
+
}
|
602
|
+
interface IWhoamiResponse {
|
603
|
+
user_id: string;
|
604
|
+
device_id?: string;
|
605
|
+
is_guest?: boolean;
|
606
|
+
}
|
607
|
+
export declare enum ClientEvent {
|
608
|
+
Sync = "sync",
|
609
|
+
Event = "event",
|
610
|
+
ToDeviceEvent = "toDeviceEvent",
|
611
|
+
AccountData = "accountData",
|
612
|
+
Room = "Room",
|
613
|
+
DeleteRoom = "deleteRoom",
|
614
|
+
SyncUnexpectedError = "sync.unexpectedError",
|
615
|
+
ClientWellKnown = "WellKnown.client",
|
616
|
+
ReceivedVoipEvent = "received_voip_event",
|
617
|
+
UndecryptableToDeviceEvent = "toDeviceEvent.undecryptable",
|
618
|
+
TurnServers = "turnServers",
|
619
|
+
TurnServersError = "turnServers.error"
|
620
|
+
}
|
621
|
+
type RoomEvents = RoomEvent.Name | RoomEvent.Redaction | RoomEvent.RedactionCancelled | RoomEvent.Receipt | RoomEvent.Tags | RoomEvent.LocalEchoUpdated | RoomEvent.HistoryImportedWithinTimeline | RoomEvent.AccountData | RoomEvent.MyMembership | RoomEvent.Timeline | RoomEvent.TimelineReset;
|
622
|
+
type RoomStateEvents = RoomStateEvent.Events | RoomStateEvent.Members | RoomStateEvent.NewMember | RoomStateEvent.Update | RoomStateEvent.Marker;
|
623
|
+
type LegacyCryptoEvents = LegacyCryptoEvent.KeySignatureUploadFailure | LegacyCryptoEvent.KeyBackupStatus | LegacyCryptoEvent.KeyBackupFailed | LegacyCryptoEvent.KeyBackupSessionsRemaining | LegacyCryptoEvent.KeyBackupDecryptionKeyCached | LegacyCryptoEvent.RoomKeyRequest | LegacyCryptoEvent.RoomKeyRequestCancellation | LegacyCryptoEvent.VerificationRequest | LegacyCryptoEvent.VerificationRequestReceived | LegacyCryptoEvent.DeviceVerificationChanged | LegacyCryptoEvent.UserTrustStatusChanged | LegacyCryptoEvent.KeysChanged | LegacyCryptoEvent.Warning | LegacyCryptoEvent.DevicesUpdated | LegacyCryptoEvent.WillUpdateDevices | LegacyCryptoEvent.LegacyCryptoStoreMigrationProgress;
|
624
|
+
type CryptoEvents = (typeof CryptoEvent)[keyof typeof CryptoEvent];
|
625
|
+
type MatrixEventEvents = MatrixEventEvent.Decrypted | MatrixEventEvent.Replaced | MatrixEventEvent.VisibilityChange;
|
626
|
+
type RoomMemberEvents = RoomMemberEvent.Name | RoomMemberEvent.Typing | RoomMemberEvent.PowerLevel | RoomMemberEvent.Membership;
|
627
|
+
type UserEvents = UserEvent.AvatarUrl | UserEvent.DisplayName | UserEvent.Presence | UserEvent.CurrentlyActive | UserEvent.LastPresenceTs;
|
628
|
+
export type EmittedEvents = ClientEvent | RoomEvents | RoomStateEvents | LegacyCryptoEvents | CryptoEvents | MatrixEventEvents | RoomMemberEvents | UserEvents | CallEvent | CallEventHandlerEvent.Incoming | GroupCallEventHandlerEvent.Incoming | GroupCallEventHandlerEvent.Outgoing | GroupCallEventHandlerEvent.Ended | GroupCallEventHandlerEvent.Participants | HttpApiEvent.SessionLoggedOut | HttpApiEvent.NoConsent | BeaconEvent;
|
629
|
+
export type ClientEventHandlerMap = {
|
630
|
+
/**
|
631
|
+
* Fires whenever the SDK's syncing state is updated. The state can be one of:
|
632
|
+
* <ul>
|
633
|
+
*
|
634
|
+
* <li>PREPARED: The client has synced with the server at least once and is
|
635
|
+
* ready for methods to be called on it. This will be immediately followed by
|
636
|
+
* a state of SYNCING. <i>This is the equivalent of "syncComplete" in the
|
637
|
+
* previous API.</i></li>
|
638
|
+
*
|
639
|
+
* <li>CATCHUP: The client has detected the connection to the server might be
|
640
|
+
* available again and will now try to do a sync again. As this sync might take
|
641
|
+
* a long time (depending how long ago was last synced, and general server
|
642
|
+
* performance) the client is put in this mode so the UI can reflect trying
|
643
|
+
* to catch up with the server after losing connection.</li>
|
644
|
+
*
|
645
|
+
* <li>SYNCING : The client is currently polling for new events from the server.
|
646
|
+
* This will be called <i>after</i> processing latest events from a sync.</li>
|
647
|
+
*
|
648
|
+
* <li>ERROR : The client has had a problem syncing with the server. If this is
|
649
|
+
* called <i>before</i> PREPARED then there was a problem performing the initial
|
650
|
+
* sync. If this is called <i>after</i> PREPARED then there was a problem polling
|
651
|
+
* the server for updates. This may be called multiple times even if the state is
|
652
|
+
* already ERROR. <i>This is the equivalent of "syncError" in the previous
|
653
|
+
* API.</i></li>
|
654
|
+
*
|
655
|
+
* <li>RECONNECTING: The sync connection has dropped, but not (yet) in a way that
|
656
|
+
* should be considered erroneous.
|
657
|
+
* </li>
|
658
|
+
*
|
659
|
+
* <li>STOPPED: The client has stopped syncing with server due to stopClient
|
660
|
+
* being called.
|
661
|
+
* </li>
|
662
|
+
* </ul>
|
663
|
+
* State transition diagram:
|
664
|
+
* ```
|
665
|
+
* +---->STOPPED
|
666
|
+
* |
|
667
|
+
* +----->PREPARED -------> SYNCING <--+
|
668
|
+
* | ^ | ^ |
|
669
|
+
* | CATCHUP ----------+ | | |
|
670
|
+
* | ^ V | |
|
671
|
+
* null ------+ | +------- RECONNECTING |
|
672
|
+
* | V V |
|
673
|
+
* +------->ERROR ---------------------+
|
674
|
+
*
|
675
|
+
* NB: 'null' will never be emitted by this event.
|
676
|
+
*
|
677
|
+
* ```
|
678
|
+
* Transitions:
|
679
|
+
* <ul>
|
680
|
+
*
|
681
|
+
* <li>`null -> PREPARED` : Occurs when the initial sync is completed
|
682
|
+
* first time. This involves setting up filters and obtaining push rules.
|
683
|
+
*
|
684
|
+
* <li>`null -> ERROR` : Occurs when the initial sync failed first time.
|
685
|
+
*
|
686
|
+
* <li>`ERROR -> PREPARED` : Occurs when the initial sync succeeds
|
687
|
+
* after previously failing.
|
688
|
+
*
|
689
|
+
* <li>`PREPARED -> SYNCING` : Occurs immediately after transitioning
|
690
|
+
* to PREPARED. Starts listening for live updates rather than catching up.
|
691
|
+
*
|
692
|
+
* <li>`SYNCING -> RECONNECTING` : Occurs when the live update fails.
|
693
|
+
*
|
694
|
+
* <li>`RECONNECTING -> RECONNECTING` : Can occur if the update calls
|
695
|
+
* continue to fail, but the keepalive calls (to /versions) succeed.
|
696
|
+
*
|
697
|
+
* <li>`RECONNECTING -> ERROR` : Occurs when the keepalive call also fails
|
698
|
+
*
|
699
|
+
* <li>`ERROR -> SYNCING` : Occurs when the client has performed a
|
700
|
+
* live update after having previously failed.
|
701
|
+
*
|
702
|
+
* <li>`ERROR -> ERROR` : Occurs when the client has failed to keepalive
|
703
|
+
* for a second time or more.</li>
|
704
|
+
*
|
705
|
+
* <li>`SYNCING -> SYNCING` : Occurs when the client has performed a live
|
706
|
+
* update. This is called <i>after</i> processing.</li>
|
707
|
+
*
|
708
|
+
* <li>`* -> STOPPED` : Occurs once the client has stopped syncing or
|
709
|
+
* trying to sync after stopClient has been called.</li>
|
710
|
+
* </ul>
|
711
|
+
*
|
712
|
+
* @param state - An enum representing the syncing state. One of "PREPARED",
|
713
|
+
* "SYNCING", "ERROR", "STOPPED".
|
714
|
+
*
|
715
|
+
* @param prevState - An enum representing the previous syncing state.
|
716
|
+
* One of "PREPARED", "SYNCING", "ERROR", "STOPPED" <b>or null</b>.
|
717
|
+
*
|
718
|
+
* @param data - Data about this transition.
|
719
|
+
*
|
720
|
+
* @example
|
721
|
+
* ```
|
722
|
+
* matrixClient.on("sync", function(state, prevState, data) {
|
723
|
+
* switch (state) {
|
724
|
+
* case "ERROR":
|
725
|
+
* // update UI to say "Connection Lost"
|
726
|
+
* break;
|
727
|
+
* case "SYNCING":
|
728
|
+
* // update UI to remove any "Connection Lost" message
|
729
|
+
* break;
|
730
|
+
* case "PREPARED":
|
731
|
+
* // the client instance is ready to be queried.
|
732
|
+
* var rooms = matrixClient.getRooms();
|
733
|
+
* break;
|
734
|
+
* }
|
735
|
+
* });
|
736
|
+
* ```
|
737
|
+
*/
|
738
|
+
[ClientEvent.Sync]: (state: SyncState, prevState: SyncState | null, data?: ISyncStateData) => void;
|
739
|
+
/**
|
740
|
+
* Fires whenever the SDK receives a new event.
|
741
|
+
* <p>
|
742
|
+
* This is only fired for live events received via /sync - it is not fired for
|
743
|
+
* events received over context, search, or pagination APIs.
|
744
|
+
*
|
745
|
+
* @param event - The matrix event which caused this event to fire.
|
746
|
+
* @example
|
747
|
+
* ```
|
748
|
+
* matrixClient.on("event", function(event){
|
749
|
+
* var sender = event.getSender();
|
750
|
+
* });
|
751
|
+
* ```
|
752
|
+
*/
|
753
|
+
[ClientEvent.Event]: (event: MatrixEvent) => void;
|
754
|
+
/**
|
755
|
+
* Fires whenever the SDK receives a new to-device event.
|
756
|
+
* @param event - The matrix event which caused this event to fire.
|
757
|
+
* @example
|
758
|
+
* ```
|
759
|
+
* matrixClient.on("toDeviceEvent", function(event){
|
760
|
+
* var sender = event.getSender();
|
761
|
+
* });
|
762
|
+
* ```
|
763
|
+
*/
|
764
|
+
[ClientEvent.ToDeviceEvent]: (event: MatrixEvent) => void;
|
765
|
+
/**
|
766
|
+
* Fires if a to-device event is received that cannot be decrypted.
|
767
|
+
* Encrypted to-device events will (generally) use plain Olm encryption,
|
768
|
+
* in which case decryption failures are fatal: the event will never be
|
769
|
+
* decryptable, unlike Megolm encrypted events where the key may simply
|
770
|
+
* arrive later.
|
771
|
+
*
|
772
|
+
* An undecryptable to-device event is therefore likley to indicate problems.
|
773
|
+
*
|
774
|
+
* @param event - The undecyptable to-device event
|
775
|
+
*/
|
776
|
+
[ClientEvent.UndecryptableToDeviceEvent]: (event: MatrixEvent) => void;
|
777
|
+
/**
|
778
|
+
* Fires whenever new user-scoped account_data is added.
|
779
|
+
* @param event - The event describing the account_data just added
|
780
|
+
* @param event - The previous account data, if known.
|
781
|
+
* @example
|
782
|
+
* ```
|
783
|
+
* matrixClient.on("accountData", function(event, oldEvent){
|
784
|
+
* myAccountData[event.type] = event.content;
|
785
|
+
* });
|
786
|
+
* ```
|
787
|
+
*/
|
788
|
+
[ClientEvent.AccountData]: (event: MatrixEvent, lastEvent?: MatrixEvent) => void;
|
789
|
+
/**
|
790
|
+
* Fires whenever a new Room is added. This will fire when you are invited to a
|
791
|
+
* room, as well as when you join a room. <strong>This event is experimental and
|
792
|
+
* may change.</strong>
|
793
|
+
* @param room - The newly created, fully populated room.
|
794
|
+
* @example
|
795
|
+
* ```
|
796
|
+
* matrixClient.on("Room", function(room){
|
797
|
+
* var roomId = room.roomId;
|
798
|
+
* });
|
799
|
+
* ```
|
800
|
+
*/
|
801
|
+
[ClientEvent.Room]: (room: Room) => void;
|
802
|
+
/**
|
803
|
+
* Fires whenever a Room is removed. This will fire when you forget a room.
|
804
|
+
* <strong>This event is experimental and may change.</strong>
|
805
|
+
* @param roomId - The deleted room ID.
|
806
|
+
* @example
|
807
|
+
* ```
|
808
|
+
* matrixClient.on("deleteRoom", function(roomId){
|
809
|
+
* // update UI from getRooms()
|
810
|
+
* });
|
811
|
+
* ```
|
812
|
+
*/
|
813
|
+
[ClientEvent.DeleteRoom]: (roomId: string) => void;
|
814
|
+
[ClientEvent.SyncUnexpectedError]: (error: Error) => void;
|
815
|
+
/**
|
816
|
+
* Fires when the client .well-known info is fetched.
|
817
|
+
*
|
818
|
+
* @param data - The JSON object returned by the server
|
819
|
+
*/
|
820
|
+
[ClientEvent.ClientWellKnown]: (data: IClientWellKnown) => void;
|
821
|
+
[ClientEvent.ReceivedVoipEvent]: (event: MatrixEvent) => void;
|
822
|
+
[ClientEvent.TurnServers]: (servers: ITurnServer[]) => void;
|
823
|
+
[ClientEvent.TurnServersError]: (error: Error, fatal: boolean) => void;
|
824
|
+
} & RoomEventHandlerMap & RoomStateEventHandlerMap & LegacyCryptoEventHandlerMap & CryptoEventHandlerMap & MatrixEventHandlerMap & RoomMemberEventHandlerMap & UserEventHandlerMap & CallEventHandlerEventHandlerMap & GroupCallEventHandlerEventHandlerMap & CallEventHandlerMap & HttpApiEventHandlerMap & BeaconEventHandlerMap;
|
825
|
+
/**
|
826
|
+
* Represents a Matrix Client. Only directly construct this if you want to use
|
827
|
+
* custom modules. Normally, {@link createClient} should be used
|
828
|
+
* as it specifies 'sensible' defaults for these modules.
|
829
|
+
*/
|
830
|
+
export declare class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHandlerMap> {
|
831
|
+
static readonly RESTORE_BACKUP_ERROR_BAD_KEY = "RESTORE_BACKUP_ERROR_BAD_KEY";
|
832
|
+
private readonly logger;
|
833
|
+
reEmitter: TypedReEmitter<EmittedEvents, ClientEventHandlerMap>;
|
834
|
+
olmVersion: [number, number, number] | null;
|
835
|
+
usingExternalCrypto: boolean;
|
836
|
+
private _store;
|
837
|
+
deviceId: string | null;
|
838
|
+
credentials: {
|
839
|
+
userId: string | null;
|
840
|
+
};
|
841
|
+
/**
|
842
|
+
* Encryption key used for encrypting sensitive data (such as e2ee keys) in storage.
|
843
|
+
*
|
844
|
+
* As supplied in the constructor via {@link IMatrixClientCreateOpts#pickleKey}.
|
845
|
+
*
|
846
|
+
* If unset, either a hardcoded key or no encryption at all is used, depending on the Crypto implementation.
|
847
|
+
*
|
848
|
+
* @deprecated this should be a private property.
|
849
|
+
*/
|
850
|
+
pickleKey?: string;
|
851
|
+
scheduler?: MatrixScheduler;
|
852
|
+
clientRunning: boolean;
|
853
|
+
timelineSupport: boolean;
|
854
|
+
urlPreviewCache: {
|
855
|
+
[key: string]: Promise<IPreviewUrlResponse>;
|
856
|
+
};
|
857
|
+
identityServer?: IIdentityServerProvider;
|
858
|
+
http: MatrixHttpApi<IHttpOpts & {
|
859
|
+
onlyData: true;
|
860
|
+
}>;
|
861
|
+
/**
|
862
|
+
* The libolm crypto implementation, if it is in use.
|
863
|
+
*
|
864
|
+
* @deprecated This should not be used. Instead, use the methods exposed directly on this class or
|
865
|
+
* (where they are available) via {@link getCrypto}.
|
866
|
+
*/
|
867
|
+
crypto?: Crypto;
|
868
|
+
private cryptoBackend?;
|
869
|
+
cryptoCallbacks: CryptoCallbacks;
|
870
|
+
callEventHandler?: CallEventHandler;
|
871
|
+
groupCallEventHandler?: GroupCallEventHandler;
|
872
|
+
supportsCallTransfer: boolean;
|
873
|
+
forceTURN: boolean;
|
874
|
+
iceCandidatePoolSize: number;
|
875
|
+
idBaseUrl?: string;
|
876
|
+
baseUrl: string;
|
877
|
+
readonly isVoipWithNoMediaAllowed: boolean;
|
878
|
+
useLivekitForGroupCalls: boolean;
|
879
|
+
protected canSupportVoip: boolean;
|
880
|
+
protected peekSync: SyncApi | null;
|
881
|
+
protected isGuestAccount: boolean;
|
882
|
+
protected ongoingScrollbacks: {
|
883
|
+
[roomId: string]: {
|
884
|
+
promise?: Promise<Room>;
|
885
|
+
errorTs?: number;
|
886
|
+
};
|
887
|
+
};
|
888
|
+
protected notifTimelineSet: EventTimelineSet | null;
|
889
|
+
protected cryptoStore?: CryptoStore;
|
890
|
+
protected verificationMethods?: string[];
|
891
|
+
protected fallbackICEServerAllowed: boolean;
|
892
|
+
protected syncApi?: SlidingSyncSdk | SyncApi;
|
893
|
+
roomNameGenerator?: ICreateClientOpts["roomNameGenerator"];
|
894
|
+
pushRules?: IPushRules;
|
895
|
+
protected syncLeftRoomsPromise?: Promise<Room[]>;
|
896
|
+
protected syncedLeftRooms: boolean;
|
897
|
+
protected clientOpts?: IStoredClientOpts;
|
898
|
+
protected clientWellKnownIntervalID?: ReturnType<typeof setInterval>;
|
899
|
+
protected canResetTimelineCallback?: ResetTimelineCallback;
|
900
|
+
canSupport: Map<Feature, ServerSupport>;
|
901
|
+
protected pushProcessor: PushProcessor;
|
902
|
+
protected serverVersionsPromise?: Promise<IServerVersions>;
|
903
|
+
protected clientWellKnown?: IClientWellKnown;
|
904
|
+
protected clientWellKnownPromise?: Promise<IClientWellKnown>;
|
905
|
+
protected turnServers: ITurnServer[];
|
906
|
+
protected turnServersExpiry: number;
|
907
|
+
protected checkTurnServersIntervalID?: ReturnType<typeof setInterval>;
|
908
|
+
protected exportedOlmDeviceToImport?: IExportedOlmDevice;
|
909
|
+
protected txnCtr: number;
|
910
|
+
protected mediaHandler: MediaHandler;
|
911
|
+
protected sessionId: string;
|
912
|
+
/** IDs of events which are currently being encrypted.
|
913
|
+
*
|
914
|
+
* This is part of the cancellation mechanism: if the event is no longer listed here when encryption completes,
|
915
|
+
* that tells us that it has been cancelled, and we should not send it.
|
916
|
+
*/
|
917
|
+
private eventsBeingEncrypted;
|
918
|
+
private useE2eForGroupCall;
|
919
|
+
private toDeviceMessageQueue;
|
920
|
+
livekitServiceURL?: string;
|
921
|
+
private _secretStorage;
|
922
|
+
readonly ignoredInvites: IgnoredInvites;
|
923
|
+
readonly matrixRTC: MatrixRTCSessionManager;
|
924
|
+
private serverCapabilitiesService;
|
925
|
+
constructor(opts: IMatrixClientCreateOpts);
|
926
|
+
set store(newStore: Store);
|
927
|
+
get store(): Store;
|
928
|
+
/**
|
929
|
+
* High level helper method to begin syncing and poll for new events. To listen for these
|
930
|
+
* events, add a listener for {@link ClientEvent.Event}
|
931
|
+
* via {@link MatrixClient#on}. Alternatively, listen for specific
|
932
|
+
* state change events.
|
933
|
+
* @param opts - Options to apply when syncing.
|
934
|
+
*/
|
935
|
+
startClient(opts?: IStartClientOpts): Promise<void>;
|
936
|
+
/**
|
937
|
+
* Construct a SyncApiOptions for this client, suitable for passing into the SyncApi constructor
|
938
|
+
*/
|
939
|
+
protected buildSyncApiOptions(): SyncApiOptions;
|
940
|
+
/**
|
941
|
+
* High level helper method to stop the client from polling and allow a
|
942
|
+
* clean shutdown.
|
943
|
+
*/
|
944
|
+
stopClient(): void;
|
945
|
+
/**
|
946
|
+
* Try to rehydrate a device if available. The client must have been
|
947
|
+
* initialized with a `cryptoCallback.getDehydrationKey` option, and this
|
948
|
+
* function must be called before initCrypto and startClient are called.
|
949
|
+
*
|
950
|
+
* @returns Promise which resolves to undefined if a device could not be dehydrated, or
|
951
|
+
* to the new device ID if the dehydration was successful.
|
952
|
+
* @returns Rejects: with an error response.
|
953
|
+
*
|
954
|
+
* @deprecated MSC2697 device dehydration is not supported for rust cryptography.
|
955
|
+
*/
|
956
|
+
rehydrateDevice(): Promise<string | undefined>;
|
957
|
+
/**
|
958
|
+
* Get the current dehydrated device, if any
|
959
|
+
* @returns A promise of an object containing the dehydrated device
|
960
|
+
*
|
961
|
+
* @deprecated MSC2697 device dehydration is not supported for rust cryptography.
|
962
|
+
*/
|
963
|
+
getDehydratedDevice(): Promise<IDehydratedDevice | undefined>;
|
964
|
+
/**
|
965
|
+
* Set the dehydration key. This will also periodically dehydrate devices to
|
966
|
+
* the server.
|
967
|
+
*
|
968
|
+
* @param key - the dehydration key
|
969
|
+
* @param keyInfo - Information about the key. Primarily for
|
970
|
+
* information about how to generate the key from a passphrase.
|
971
|
+
* @param deviceDisplayName - The device display name for the
|
972
|
+
* dehydrated device.
|
973
|
+
* @returns A promise that resolves when the dehydrated device is stored.
|
974
|
+
*
|
975
|
+
* @deprecated Not supported for Rust Cryptography.
|
976
|
+
*/
|
977
|
+
setDehydrationKey(key: Uint8Array, keyInfo: IDehydratedDeviceKeyInfo, deviceDisplayName?: string): Promise<void>;
|
978
|
+
/**
|
979
|
+
* Creates a new MSC2967 dehydrated device (without queuing periodic dehydration)
|
980
|
+
* @param key - the dehydration key
|
981
|
+
* @param keyInfo - Information about the key. Primarily for
|
982
|
+
* information about how to generate the key from a passphrase.
|
983
|
+
* @param deviceDisplayName - The device display name for the
|
984
|
+
* dehydrated device.
|
985
|
+
* @returns the device id of the newly created dehydrated device
|
986
|
+
*
|
987
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi.startDehydration}.
|
988
|
+
*/
|
989
|
+
createDehydratedDevice(key: Uint8Array, keyInfo: IDehydratedDeviceKeyInfo, deviceDisplayName?: string): Promise<string | undefined>;
|
990
|
+
/** @deprecated Not supported for Rust Cryptography. */
|
991
|
+
exportDevice(): Promise<IExportedDevice | undefined>;
|
992
|
+
/**
|
993
|
+
* Clear any data out of the persistent stores used by the client.
|
994
|
+
*
|
995
|
+
* @returns Promise which resolves when the stores have been cleared.
|
996
|
+
*/
|
997
|
+
clearStores(): Promise<void>;
|
998
|
+
/**
|
999
|
+
* Get the user-id of the logged-in user
|
1000
|
+
*
|
1001
|
+
* @returns MXID for the logged-in user, or null if not logged in
|
1002
|
+
*/
|
1003
|
+
getUserId(): string | null;
|
1004
|
+
/**
|
1005
|
+
* Get the user-id of the logged-in user
|
1006
|
+
*
|
1007
|
+
* @returns MXID for the logged-in user
|
1008
|
+
* @throws Error if not logged in
|
1009
|
+
*/
|
1010
|
+
getSafeUserId(): string;
|
1011
|
+
/**
|
1012
|
+
* Get the domain for this client's MXID
|
1013
|
+
* @returns Domain of this MXID
|
1014
|
+
*/
|
1015
|
+
getDomain(): string | null;
|
1016
|
+
/**
|
1017
|
+
* Get the local part of the current user ID e.g. "foo" in "\@foo:bar".
|
1018
|
+
* @returns The user ID localpart or null.
|
1019
|
+
*/
|
1020
|
+
getUserIdLocalpart(): string | null;
|
1021
|
+
/**
|
1022
|
+
* Get the device ID of this client
|
1023
|
+
* @returns device ID
|
1024
|
+
*/
|
1025
|
+
getDeviceId(): string | null;
|
1026
|
+
/**
|
1027
|
+
* Get the session ID of this client
|
1028
|
+
* @returns session ID
|
1029
|
+
*/
|
1030
|
+
getSessionId(): string;
|
1031
|
+
/**
|
1032
|
+
* Check if the runtime environment supports VoIP calling.
|
1033
|
+
* @returns True if VoIP is supported.
|
1034
|
+
*/
|
1035
|
+
supportsVoip(): boolean;
|
1036
|
+
/**
|
1037
|
+
* @returns
|
1038
|
+
*/
|
1039
|
+
getMediaHandler(): MediaHandler;
|
1040
|
+
/**
|
1041
|
+
* Set whether VoIP calls are forced to use only TURN
|
1042
|
+
* candidates. This is the same as the forceTURN option
|
1043
|
+
* when creating the client.
|
1044
|
+
* @param force - True to force use of TURN servers
|
1045
|
+
*/
|
1046
|
+
setForceTURN(force: boolean): void;
|
1047
|
+
/**
|
1048
|
+
* Set whether to advertise transfer support to other parties on Matrix calls.
|
1049
|
+
* @param support - True to advertise the 'm.call.transferee' capability
|
1050
|
+
*/
|
1051
|
+
setSupportsCallTransfer(support: boolean): void;
|
1052
|
+
/**
|
1053
|
+
* Returns true if to-device signalling for group calls will be encrypted with Olm.
|
1054
|
+
* If false, it will be sent unencrypted.
|
1055
|
+
* @returns boolean Whether group call signalling will be encrypted
|
1056
|
+
*/
|
1057
|
+
getUseE2eForGroupCall(): boolean;
|
1058
|
+
/**
|
1059
|
+
* Creates a new call.
|
1060
|
+
* The place*Call methods on the returned call can be used to actually place a call
|
1061
|
+
*
|
1062
|
+
* @param roomId - The room the call is to be placed in.
|
1063
|
+
* @returns the call or null if the browser doesn't support calling.
|
1064
|
+
*/
|
1065
|
+
createCall(roomId: string): MatrixCall | null;
|
1066
|
+
/**
|
1067
|
+
* Creates a new group call and sends the associated state event
|
1068
|
+
* to alert other members that the room now has a group call.
|
1069
|
+
*
|
1070
|
+
* @param roomId - The room the call is to be placed in.
|
1071
|
+
*/
|
1072
|
+
createGroupCall(roomId: string, type: GroupCallType, isPtt: boolean, intent: GroupCallIntent, dataChannelsEnabled?: boolean, dataChannelOptions?: IGroupCallDataChannelOptions): Promise<GroupCall>;
|
1073
|
+
getLivekitServiceURL(): string | undefined;
|
1074
|
+
setLivekitServiceURL(newURL: string): void;
|
1075
|
+
/**
|
1076
|
+
* Wait until an initial state for the given room has been processed by the
|
1077
|
+
* client and the client is aware of any ongoing group calls. Awaiting on
|
1078
|
+
* the promise returned by this method before calling getGroupCallForRoom()
|
1079
|
+
* avoids races where getGroupCallForRoom is called before the state for that
|
1080
|
+
* room has been processed. It does not, however, fix other races, eg. two
|
1081
|
+
* clients both creating a group call at the same time.
|
1082
|
+
* @param roomId - The room ID to wait for
|
1083
|
+
* @returns A promise that resolves once existing group calls in the room
|
1084
|
+
* have been processed.
|
1085
|
+
*/
|
1086
|
+
waitUntilRoomReadyForGroupCalls(roomId: string): Promise<void>;
|
1087
|
+
/**
|
1088
|
+
* Get an existing group call for the provided room.
|
1089
|
+
* @returns The group call or null if it doesn't already exist.
|
1090
|
+
*/
|
1091
|
+
getGroupCallForRoom(roomId: string): GroupCall | null;
|
1092
|
+
/**
|
1093
|
+
* Get the current sync state.
|
1094
|
+
* @returns the sync state, which may be null.
|
1095
|
+
* @see MatrixClient#event:"sync"
|
1096
|
+
*/
|
1097
|
+
getSyncState(): SyncState | null;
|
1098
|
+
/**
|
1099
|
+
* Returns the additional data object associated with
|
1100
|
+
* the current sync state, or null if there is no
|
1101
|
+
* such data.
|
1102
|
+
* Sync errors, if available, are put in the 'error' key of
|
1103
|
+
* this object.
|
1104
|
+
*/
|
1105
|
+
getSyncStateData(): ISyncStateData | null;
|
1106
|
+
/**
|
1107
|
+
* Whether the initial sync has completed.
|
1108
|
+
* @returns True if at least one sync has happened.
|
1109
|
+
*/
|
1110
|
+
isInitialSyncComplete(): boolean;
|
1111
|
+
/**
|
1112
|
+
* Return whether the client is configured for a guest account.
|
1113
|
+
* @returns True if this is a guest access_token (or no token is supplied).
|
1114
|
+
*/
|
1115
|
+
isGuest(): boolean;
|
1116
|
+
/**
|
1117
|
+
* Set whether this client is a guest account. <b>This method is experimental
|
1118
|
+
* and may change without warning.</b>
|
1119
|
+
* @param guest - True if this is a guest account.
|
1120
|
+
* @experimental if the token is a macaroon, it should be encoded in it that it is a 'guest'
|
1121
|
+
* access token, which means that the SDK can determine this entirely without
|
1122
|
+
* the dev manually flipping this flag.
|
1123
|
+
*/
|
1124
|
+
setGuest(guest: boolean): void;
|
1125
|
+
/**
|
1126
|
+
* Return the provided scheduler, if any.
|
1127
|
+
* @returns The scheduler or undefined
|
1128
|
+
*/
|
1129
|
+
getScheduler(): MatrixScheduler | undefined;
|
1130
|
+
/**
|
1131
|
+
* Retry a backed off syncing request immediately. This should only be used when
|
1132
|
+
* the user <b>explicitly</b> attempts to retry their lost connection.
|
1133
|
+
* Will also retry any outbound to-device messages currently in the queue to be sent
|
1134
|
+
* (retries of regular outgoing events are handled separately, per-event).
|
1135
|
+
* @returns True if this resulted in a request being retried.
|
1136
|
+
*/
|
1137
|
+
retryImmediately(): boolean;
|
1138
|
+
/**
|
1139
|
+
* Return the global notification EventTimelineSet, if any
|
1140
|
+
*
|
1141
|
+
* @returns the globl notification EventTimelineSet
|
1142
|
+
*/
|
1143
|
+
getNotifTimelineSet(): EventTimelineSet | null;
|
1144
|
+
/**
|
1145
|
+
* Set the global notification EventTimelineSet
|
1146
|
+
*
|
1147
|
+
*/
|
1148
|
+
setNotifTimelineSet(set: EventTimelineSet): void;
|
1149
|
+
/**
|
1150
|
+
* Gets the cached capabilities of the homeserver, returning cached ones if available.
|
1151
|
+
* If there are no cached capabilities and none can be fetched, throw an exception.
|
1152
|
+
*
|
1153
|
+
* @returns Promise resolving with The capabilities of the homeserver
|
1154
|
+
*/
|
1155
|
+
getCapabilities(): Promise<Capabilities>;
|
1156
|
+
/**
|
1157
|
+
* Gets the cached capabilities of the homeserver. If none have been fetched yet,
|
1158
|
+
* return undefined.
|
1159
|
+
*
|
1160
|
+
* @returns The capabilities of the homeserver
|
1161
|
+
*/
|
1162
|
+
getCachedCapabilities(): Capabilities | undefined;
|
1163
|
+
/**
|
1164
|
+
* Fetches the latest capabilities from the homeserver, ignoring any cached
|
1165
|
+
* versions. The newly returned version is cached.
|
1166
|
+
*
|
1167
|
+
* @returns A promise which resolves to the capabilities of the homeserver
|
1168
|
+
*/
|
1169
|
+
fetchCapabilities(): Promise<Capabilities>;
|
1170
|
+
/**
|
1171
|
+
* Initialise support for end-to-end encryption in this client, using libolm.
|
1172
|
+
*
|
1173
|
+
* You should call this method after creating the matrixclient, but *before*
|
1174
|
+
* calling `startClient`, if you want to support end-to-end encryption.
|
1175
|
+
*
|
1176
|
+
* It will return a Promise which will resolve when the crypto layer has been
|
1177
|
+
* successfully initialised.
|
1178
|
+
*
|
1179
|
+
* @deprecated libolm is deprecated. Prefer {@link initRustCrypto}.
|
1180
|
+
*/
|
1181
|
+
initCrypto(): Promise<void>;
|
1182
|
+
/**
|
1183
|
+
* Initialise support for end-to-end encryption in this client, using the rust matrix-sdk-crypto.
|
1184
|
+
*
|
1185
|
+
* An alternative to {@link initCrypto}.
|
1186
|
+
*
|
1187
|
+
* @param args.useIndexedDB - True to use an indexeddb store, false to use an in-memory store. Defaults to 'true'.
|
1188
|
+
* @param args.storageKey - A key with which to encrypt the indexeddb store. If provided, it must be exactly
|
1189
|
+
* 32 bytes of data, and must be the same each time the client is initialised for a given device.
|
1190
|
+
* If both this and `storagePassword` are unspecified, the store will be unencrypted.
|
1191
|
+
* @param args.storagePassword - An alternative to `storageKey`. A password which will be used to derive a key to
|
1192
|
+
* encrypt the store with. Deriving a key from a password is (deliberately) a slow operation, so prefer
|
1193
|
+
* to pass a `storageKey` directly where possible.
|
1194
|
+
*
|
1195
|
+
* @returns a Promise which will resolve when the crypto layer has been
|
1196
|
+
* successfully initialised.
|
1197
|
+
*/
|
1198
|
+
initRustCrypto(args?: {
|
1199
|
+
useIndexedDB?: boolean;
|
1200
|
+
storageKey?: Uint8Array;
|
1201
|
+
storagePassword?: string;
|
1202
|
+
}): Promise<void>;
|
1203
|
+
/**
|
1204
|
+
* Access the server-side secret storage API for this client.
|
1205
|
+
*/
|
1206
|
+
get secretStorage(): ServerSideSecretStorage;
|
1207
|
+
/**
|
1208
|
+
* Access the crypto API for this client.
|
1209
|
+
*
|
1210
|
+
* If end-to-end encryption has been enabled for this client (via {@link initCrypto} or {@link initRustCrypto}),
|
1211
|
+
* returns an object giving access to the crypto API. Otherwise, returns `undefined`.
|
1212
|
+
*/
|
1213
|
+
getCrypto(): CryptoApi | undefined;
|
1214
|
+
/**
|
1215
|
+
* Is end-to-end crypto enabled for this client.
|
1216
|
+
* @returns True if end-to-end is enabled.
|
1217
|
+
* @deprecated prefer {@link getCrypto}
|
1218
|
+
*/
|
1219
|
+
isCryptoEnabled(): boolean;
|
1220
|
+
/**
|
1221
|
+
* Get the Ed25519 key for this device
|
1222
|
+
*
|
1223
|
+
* @returns base64-encoded ed25519 key. Null if crypto is
|
1224
|
+
* disabled.
|
1225
|
+
*
|
1226
|
+
* @deprecated Not supported for Rust Cryptography.Prefer {@link CryptoApi.getOwnDeviceKeys}
|
1227
|
+
*/
|
1228
|
+
getDeviceEd25519Key(): string | null;
|
1229
|
+
/**
|
1230
|
+
* Get the Curve25519 key for this device
|
1231
|
+
*
|
1232
|
+
* @returns base64-encoded curve25519 key. Null if crypto is
|
1233
|
+
* disabled.
|
1234
|
+
*
|
1235
|
+
* @deprecated Not supported for Rust Cryptography. Use {@link CryptoApi.getOwnDeviceKeys}
|
1236
|
+
*/
|
1237
|
+
getDeviceCurve25519Key(): string | null;
|
1238
|
+
/**
|
1239
|
+
* @deprecated Does nothing.
|
1240
|
+
*/
|
1241
|
+
uploadKeys(): Promise<void>;
|
1242
|
+
/**
|
1243
|
+
* Download the keys for a list of users and stores the keys in the session
|
1244
|
+
* store.
|
1245
|
+
* @param userIds - The users to fetch.
|
1246
|
+
* @param forceDownload - Always download the keys even if cached.
|
1247
|
+
*
|
1248
|
+
* @returns A promise which resolves to a map userId-\>deviceId-\>`DeviceInfo`
|
1249
|
+
*
|
1250
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi.getUserDeviceInfo}
|
1251
|
+
*/
|
1252
|
+
downloadKeys(userIds: string[], forceDownload?: boolean): Promise<DeviceInfoMap>;
|
1253
|
+
/**
|
1254
|
+
* Get the stored device keys for a user id
|
1255
|
+
*
|
1256
|
+
* @param userId - the user to list keys for.
|
1257
|
+
*
|
1258
|
+
* @returns list of devices
|
1259
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi.getUserDeviceInfo}
|
1260
|
+
*/
|
1261
|
+
getStoredDevicesForUser(userId: string): DeviceInfo[];
|
1262
|
+
/**
|
1263
|
+
* Get the stored device key for a user id and device id
|
1264
|
+
*
|
1265
|
+
* @param userId - the user to list keys for.
|
1266
|
+
* @param deviceId - unique identifier for the device
|
1267
|
+
*
|
1268
|
+
* @returns device or null
|
1269
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi.getUserDeviceInfo}
|
1270
|
+
*/
|
1271
|
+
getStoredDevice(userId: string, deviceId: string): DeviceInfo | null;
|
1272
|
+
/**
|
1273
|
+
* Mark the given device as verified
|
1274
|
+
*
|
1275
|
+
* @param userId - owner of the device
|
1276
|
+
* @param deviceId - unique identifier for the device or user's
|
1277
|
+
* cross-signing public key ID.
|
1278
|
+
*
|
1279
|
+
* @param verified - whether to mark the device as verified. defaults
|
1280
|
+
* to 'true'.
|
1281
|
+
*
|
1282
|
+
* @returns
|
1283
|
+
*
|
1284
|
+
* @remarks
|
1285
|
+
* Fires {@link CryptoEvent#DeviceVerificationChanged}
|
1286
|
+
*/
|
1287
|
+
setDeviceVerified(userId: string, deviceId: string, verified?: boolean): Promise<void>;
|
1288
|
+
/**
|
1289
|
+
* Mark the given device as blocked/unblocked
|
1290
|
+
*
|
1291
|
+
* @param userId - owner of the device
|
1292
|
+
* @param deviceId - unique identifier for the device or user's
|
1293
|
+
* cross-signing public key ID.
|
1294
|
+
*
|
1295
|
+
* @param blocked - whether to mark the device as blocked. defaults
|
1296
|
+
* to 'true'.
|
1297
|
+
*
|
1298
|
+
* @returns
|
1299
|
+
*
|
1300
|
+
* @remarks
|
1301
|
+
* Fires {@link LegacyCryptoEvent.DeviceVerificationChanged}
|
1302
|
+
*
|
1303
|
+
* @deprecated Not supported for Rust Cryptography.
|
1304
|
+
*/
|
1305
|
+
setDeviceBlocked(userId: string, deviceId: string, blocked?: boolean): Promise<void>;
|
1306
|
+
/**
|
1307
|
+
* Mark the given device as known/unknown
|
1308
|
+
*
|
1309
|
+
* @param userId - owner of the device
|
1310
|
+
* @param deviceId - unique identifier for the device or user's
|
1311
|
+
* cross-signing public key ID.
|
1312
|
+
*
|
1313
|
+
* @param known - whether to mark the device as known. defaults
|
1314
|
+
* to 'true'.
|
1315
|
+
*
|
1316
|
+
* @returns
|
1317
|
+
*
|
1318
|
+
* @remarks
|
1319
|
+
* Fires {@link CryptoEvent#DeviceVerificationChanged}
|
1320
|
+
*
|
1321
|
+
* @deprecated Not supported for Rust Cryptography.
|
1322
|
+
*/
|
1323
|
+
setDeviceKnown(userId: string, deviceId: string, known?: boolean): Promise<void>;
|
1324
|
+
private setDeviceVerification;
|
1325
|
+
/**
|
1326
|
+
* Request a key verification from another user, using a DM.
|
1327
|
+
*
|
1328
|
+
* @param userId - the user to request verification with
|
1329
|
+
* @param roomId - the room to use for verification
|
1330
|
+
*
|
1331
|
+
* @returns resolves to a VerificationRequest
|
1332
|
+
* when the request has been sent to the other party.
|
1333
|
+
*
|
1334
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi.requestVerificationDM}.
|
1335
|
+
*/
|
1336
|
+
requestVerificationDM(userId: string, roomId: string): Promise<VerificationRequest>;
|
1337
|
+
/**
|
1338
|
+
* Finds a DM verification request that is already in progress for the given room id
|
1339
|
+
*
|
1340
|
+
* @param roomId - the room to use for verification
|
1341
|
+
*
|
1342
|
+
* @returns the VerificationRequest that is in progress, if any
|
1343
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi.findVerificationRequestDMInProgress}.
|
1344
|
+
*/
|
1345
|
+
findVerificationRequestDMInProgress(roomId: string): VerificationRequest | undefined;
|
1346
|
+
/**
|
1347
|
+
* Returns all to-device verification requests that are already in progress for the given user id
|
1348
|
+
*
|
1349
|
+
* @param userId - the ID of the user to query
|
1350
|
+
*
|
1351
|
+
* @returns the VerificationRequests that are in progress
|
1352
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi.getVerificationRequestsToDeviceInProgress}.
|
1353
|
+
*/
|
1354
|
+
getVerificationRequestsToDeviceInProgress(userId: string): VerificationRequest[];
|
1355
|
+
/**
|
1356
|
+
* Request a key verification from another user.
|
1357
|
+
*
|
1358
|
+
* @param userId - the user to request verification with
|
1359
|
+
* @param devices - array of device IDs to send requests to. Defaults to
|
1360
|
+
* all devices owned by the user
|
1361
|
+
*
|
1362
|
+
* @returns resolves to a VerificationRequest
|
1363
|
+
* when the request has been sent to the other party.
|
1364
|
+
*
|
1365
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi#requestOwnUserVerification} or {@link CryptoApi#requestDeviceVerification}.
|
1366
|
+
*/
|
1367
|
+
requestVerification(userId: string, devices?: string[]): Promise<VerificationRequest>;
|
1368
|
+
/**
|
1369
|
+
* Begin a key verification.
|
1370
|
+
*
|
1371
|
+
* @param method - the verification method to use
|
1372
|
+
* @param userId - the user to verify keys with
|
1373
|
+
* @param deviceId - the device to verify
|
1374
|
+
*
|
1375
|
+
* @returns a verification object
|
1376
|
+
* @deprecated Prefer {@link CryptoApi#requestOwnUserVerification} or {@link CryptoApi#requestDeviceVerification}.
|
1377
|
+
*/
|
1378
|
+
beginKeyVerification(method: string, userId: string, deviceId: string): Verification<any, any>;
|
1379
|
+
/**
|
1380
|
+
* @deprecated Use {@link MatrixClient#secretStorage} and {@link SecretStorage.ServerSideSecretStorage#checkKey}.
|
1381
|
+
*/
|
1382
|
+
checkSecretStorageKey(key: Uint8Array, info: SecretStorageKeyDescription): Promise<boolean>;
|
1383
|
+
/**
|
1384
|
+
* Set the global override for whether the client should ever send encrypted
|
1385
|
+
* messages to unverified devices. This provides the default for rooms which
|
1386
|
+
* do not specify a value.
|
1387
|
+
*
|
1388
|
+
* @param value - whether to blacklist all unverified devices by default
|
1389
|
+
*
|
1390
|
+
* @deprecated Prefer direct access to {@link CryptoApi.globalBlacklistUnverifiedDevices}:
|
1391
|
+
*
|
1392
|
+
* ```javascript
|
1393
|
+
* client.getCrypto().globalBlacklistUnverifiedDevices = value;
|
1394
|
+
* ```
|
1395
|
+
*/
|
1396
|
+
setGlobalBlacklistUnverifiedDevices(value: boolean): boolean;
|
1397
|
+
/**
|
1398
|
+
* @returns whether to blacklist all unverified devices by default
|
1399
|
+
*
|
1400
|
+
* @deprecated Prefer direct access to {@link CryptoApi.globalBlacklistUnverifiedDevices}:
|
1401
|
+
*
|
1402
|
+
* ```javascript
|
1403
|
+
* value = client.getCrypto().globalBlacklistUnverifiedDevices;
|
1404
|
+
* ```
|
1405
|
+
*/
|
1406
|
+
getGlobalBlacklistUnverifiedDevices(): boolean;
|
1407
|
+
/**
|
1408
|
+
* Set whether sendMessage in a room with unknown and unverified devices
|
1409
|
+
* should throw an error and not send them message. This has 'Global' for
|
1410
|
+
* symmetry with setGlobalBlacklistUnverifiedDevices but there is currently
|
1411
|
+
* no room-level equivalent for this setting.
|
1412
|
+
*
|
1413
|
+
* This API is currently UNSTABLE and may change or be removed without notice.
|
1414
|
+
*
|
1415
|
+
* It has no effect with the Rust crypto implementation.
|
1416
|
+
*
|
1417
|
+
* @param value - whether error on unknown devices
|
1418
|
+
*
|
1419
|
+
* ```ts
|
1420
|
+
* client.getCrypto().globalErrorOnUnknownDevices = value;
|
1421
|
+
* ```
|
1422
|
+
*/
|
1423
|
+
setGlobalErrorOnUnknownDevices(value: boolean): void;
|
1424
|
+
/**
|
1425
|
+
* @returns whether to error on unknown devices
|
1426
|
+
*
|
1427
|
+
* This API is currently UNSTABLE and may change or be removed without notice.
|
1428
|
+
*/
|
1429
|
+
getGlobalErrorOnUnknownDevices(): boolean;
|
1430
|
+
/**
|
1431
|
+
* Get the ID of one of the user's cross-signing keys
|
1432
|
+
*
|
1433
|
+
* @param type - The type of key to get the ID of. One of
|
1434
|
+
* "master", "self_signing", or "user_signing". Defaults to "master".
|
1435
|
+
*
|
1436
|
+
* @returns the key ID
|
1437
|
+
* @deprecated Not supported for Rust Cryptography. prefer {@link Crypto.CryptoApi#getCrossSigningKeyId}
|
1438
|
+
*/
|
1439
|
+
getCrossSigningId(type?: CrossSigningKey | string): string | null;
|
1440
|
+
/**
|
1441
|
+
* Get the cross signing information for a given user.
|
1442
|
+
*
|
1443
|
+
* The cross-signing API is currently UNSTABLE and may change without notice.
|
1444
|
+
*
|
1445
|
+
* @param userId - the user ID to get the cross-signing info for.
|
1446
|
+
*
|
1447
|
+
* @returns the cross signing information for the user.
|
1448
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi#userHasCrossSigningKeys}
|
1449
|
+
*/
|
1450
|
+
getStoredCrossSigningForUser(userId: string): CrossSigningInfo | null;
|
1451
|
+
/**
|
1452
|
+
* Check whether a given user is trusted.
|
1453
|
+
*
|
1454
|
+
* The cross-signing API is currently UNSTABLE and may change without notice.
|
1455
|
+
*
|
1456
|
+
* @param userId - The ID of the user to check.
|
1457
|
+
*
|
1458
|
+
* @deprecated Use {@link Crypto.CryptoApi.getUserVerificationStatus | `CryptoApi.getUserVerificationStatus`}
|
1459
|
+
*/
|
1460
|
+
checkUserTrust(userId: string): UserTrustLevel;
|
1461
|
+
/**
|
1462
|
+
* Check whether a given device is trusted.
|
1463
|
+
*
|
1464
|
+
* The cross-signing API is currently UNSTABLE and may change without notice.
|
1465
|
+
*
|
1466
|
+
* @param userId - The ID of the user whose devices is to be checked.
|
1467
|
+
* @param deviceId - The ID of the device to check
|
1468
|
+
*
|
1469
|
+
* @deprecated Use {@link Crypto.CryptoApi.getDeviceVerificationStatus | `CryptoApi.getDeviceVerificationStatus`}
|
1470
|
+
*/
|
1471
|
+
checkDeviceTrust(userId: string, deviceId: string): DeviceTrustLevel;
|
1472
|
+
/**
|
1473
|
+
* Check whether one of our own devices is cross-signed by our
|
1474
|
+
* user's stored keys, regardless of whether we trust those keys yet.
|
1475
|
+
*
|
1476
|
+
* @param deviceId - The ID of the device to check
|
1477
|
+
*
|
1478
|
+
* @returns true if the device is cross-signed
|
1479
|
+
*
|
1480
|
+
* @deprecated Not supported for Rust Cryptography.
|
1481
|
+
*/
|
1482
|
+
checkIfOwnDeviceCrossSigned(deviceId: string): boolean;
|
1483
|
+
/**
|
1484
|
+
* Check the copy of our cross-signing key that we have in the device list and
|
1485
|
+
* see if we can get the private key. If so, mark it as trusted.
|
1486
|
+
* @param opts - ICheckOwnCrossSigningTrustOpts object
|
1487
|
+
*
|
1488
|
+
* @deprecated Unneeded for the new crypto
|
1489
|
+
*/
|
1490
|
+
checkOwnCrossSigningTrust(opts?: ICheckOwnCrossSigningTrustOpts): Promise<void>;
|
1491
|
+
/**
|
1492
|
+
* Checks that a given cross-signing private key matches a given public key.
|
1493
|
+
* This can be used by the getCrossSigningKey callback to verify that the
|
1494
|
+
* private key it is about to supply is the one that was requested.
|
1495
|
+
* @param privateKey - The private key
|
1496
|
+
* @param expectedPublicKey - The public key
|
1497
|
+
* @returns true if the key matches, otherwise false
|
1498
|
+
*
|
1499
|
+
* @deprecated Not supported for Rust Cryptography.
|
1500
|
+
*/
|
1501
|
+
checkCrossSigningPrivateKey(privateKey: Uint8Array, expectedPublicKey: string): boolean;
|
1502
|
+
/**
|
1503
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi#requestDeviceVerification}.
|
1504
|
+
*/
|
1505
|
+
legacyDeviceVerification(userId: string, deviceId: string, method: string): Promise<VerificationRequest>;
|
1506
|
+
/**
|
1507
|
+
* Perform any background tasks that can be done before a message is ready to
|
1508
|
+
* send, in order to speed up sending of the message.
|
1509
|
+
* @param room - the room the event is in
|
1510
|
+
*
|
1511
|
+
* @deprecated Prefer {@link CryptoApi.prepareToEncrypt | `CryptoApi.prepareToEncrypt`}:
|
1512
|
+
*
|
1513
|
+
* ```javascript
|
1514
|
+
* client.getCrypto().prepareToEncrypt(room);
|
1515
|
+
* ```
|
1516
|
+
*/
|
1517
|
+
prepareToEncrypt(room: Room): void;
|
1518
|
+
/**
|
1519
|
+
* Checks if the user has previously published cross-signing keys
|
1520
|
+
*
|
1521
|
+
* This means downloading the devicelist for the user and checking if the list includes
|
1522
|
+
* the cross-signing pseudo-device.
|
1523
|
+
*
|
1524
|
+
* @deprecated Prefer {@link CryptoApi.userHasCrossSigningKeys | `CryptoApi.userHasCrossSigningKeys`}:
|
1525
|
+
*
|
1526
|
+
* ```javascript
|
1527
|
+
* result = client.getCrypto().userHasCrossSigningKeys();
|
1528
|
+
* ```
|
1529
|
+
*/
|
1530
|
+
userHasCrossSigningKeys(): Promise<boolean>;
|
1531
|
+
/**
|
1532
|
+
* Checks whether cross signing:
|
1533
|
+
* - is enabled on this account and trusted by this device
|
1534
|
+
* - has private keys either cached locally or stored in secret storage
|
1535
|
+
*
|
1536
|
+
* If this function returns false, bootstrapCrossSigning() can be used
|
1537
|
+
* to fix things such that it returns true. That is to say, after
|
1538
|
+
* bootstrapCrossSigning() completes successfully, this function should
|
1539
|
+
* return true.
|
1540
|
+
* @returns True if cross-signing is ready to be used on this device
|
1541
|
+
* @deprecated Prefer {@link CryptoApi.isCrossSigningReady | `CryptoApi.isCrossSigningReady`}:
|
1542
|
+
*/
|
1543
|
+
isCrossSigningReady(): Promise<boolean>;
|
1544
|
+
/**
|
1545
|
+
* Bootstrap cross-signing by creating keys if needed. If everything is already
|
1546
|
+
* set up, then no changes are made, so this is safe to run to ensure
|
1547
|
+
* cross-signing is ready for use.
|
1548
|
+
*
|
1549
|
+
* This function:
|
1550
|
+
* - creates new cross-signing keys if they are not found locally cached nor in
|
1551
|
+
* secret storage (if it has been set up)
|
1552
|
+
*
|
1553
|
+
* @deprecated Prefer {@link CryptoApi.bootstrapCrossSigning | `CryptoApi.bootstrapCrossSigning`}.
|
1554
|
+
*/
|
1555
|
+
bootstrapCrossSigning(opts: BootstrapCrossSigningOpts): Promise<void>;
|
1556
|
+
/**
|
1557
|
+
* Whether to trust a others users signatures of their devices.
|
1558
|
+
* If false, devices will only be considered 'verified' if we have
|
1559
|
+
* verified that device individually (effectively disabling cross-signing).
|
1560
|
+
*
|
1561
|
+
* Default: true
|
1562
|
+
*
|
1563
|
+
* @returns True if trusting cross-signed devices
|
1564
|
+
*
|
1565
|
+
* @deprecated Prefer {@link CryptoApi.getTrustCrossSignedDevices | `CryptoApi.getTrustCrossSignedDevices`}.
|
1566
|
+
*/
|
1567
|
+
getCryptoTrustCrossSignedDevices(): boolean;
|
1568
|
+
/**
|
1569
|
+
* See getCryptoTrustCrossSignedDevices
|
1570
|
+
*
|
1571
|
+
* @param val - True to trust cross-signed devices
|
1572
|
+
*
|
1573
|
+
* @deprecated Prefer {@link CryptoApi.setTrustCrossSignedDevices | `CryptoApi.setTrustCrossSignedDevices`}.
|
1574
|
+
*/
|
1575
|
+
setCryptoTrustCrossSignedDevices(val: boolean): void;
|
1576
|
+
/**
|
1577
|
+
* Counts the number of end to end session keys that are waiting to be backed up
|
1578
|
+
* @returns Promise which resolves to the number of sessions requiring backup
|
1579
|
+
*
|
1580
|
+
* @deprecated Not supported for Rust Cryptography.
|
1581
|
+
*/
|
1582
|
+
countSessionsNeedingBackup(): Promise<number>;
|
1583
|
+
/**
|
1584
|
+
* Get information about the encryption of an event
|
1585
|
+
*
|
1586
|
+
* @param event - event to be checked
|
1587
|
+
* @returns The event information.
|
1588
|
+
* @deprecated Prefer {@link Crypto.CryptoApi.getEncryptionInfoForEvent | `CryptoApi.getEncryptionInfoForEvent`}.
|
1589
|
+
*/
|
1590
|
+
getEventEncryptionInfo(event: MatrixEvent): IEncryptedEventInfo;
|
1591
|
+
/**
|
1592
|
+
* Create a recovery key from a user-supplied passphrase.
|
1593
|
+
*
|
1594
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1595
|
+
*
|
1596
|
+
* @param password - Passphrase string that can be entered by the user
|
1597
|
+
* when restoring the backup as an alternative to entering the recovery key.
|
1598
|
+
* Optional.
|
1599
|
+
* @returns Object with public key metadata, encoded private
|
1600
|
+
* recovery key which should be disposed of after displaying to the user,
|
1601
|
+
* and raw private key to avoid round tripping if needed.
|
1602
|
+
*
|
1603
|
+
* @deprecated Prefer {@link CryptoApi.createRecoveryKeyFromPassphrase | `CryptoApi.createRecoveryKeyFromPassphrase`}.
|
1604
|
+
*/
|
1605
|
+
createRecoveryKeyFromPassphrase(password?: string): Promise<IRecoveryKey>;
|
1606
|
+
/**
|
1607
|
+
* Checks whether secret storage:
|
1608
|
+
* - is enabled on this account
|
1609
|
+
* - is storing cross-signing private keys
|
1610
|
+
* - is storing session backup key (if enabled)
|
1611
|
+
*
|
1612
|
+
* If this function returns false, bootstrapSecretStorage() can be used
|
1613
|
+
* to fix things such that it returns true. That is to say, after
|
1614
|
+
* bootstrapSecretStorage() completes successfully, this function should
|
1615
|
+
* return true.
|
1616
|
+
*
|
1617
|
+
* @returns True if secret storage is ready to be used on this device
|
1618
|
+
* @deprecated Prefer {@link CryptoApi.isSecretStorageReady | `CryptoApi.isSecretStorageReady`}.
|
1619
|
+
*/
|
1620
|
+
isSecretStorageReady(): Promise<boolean>;
|
1621
|
+
/**
|
1622
|
+
* Bootstrap Secure Secret Storage if needed by creating a default key. If everything is
|
1623
|
+
* already set up, then no changes are made, so this is safe to run to ensure secret
|
1624
|
+
* storage is ready for use.
|
1625
|
+
*
|
1626
|
+
* This function
|
1627
|
+
* - creates a new Secure Secret Storage key if no default key exists
|
1628
|
+
* - if a key backup exists, it is migrated to store the key in the Secret
|
1629
|
+
* Storage
|
1630
|
+
* - creates a backup if none exists, and one is requested
|
1631
|
+
* - migrates Secure Secret Storage to use the latest algorithm, if an outdated
|
1632
|
+
* algorithm is found
|
1633
|
+
*
|
1634
|
+
* @deprecated Use {@link CryptoApi.bootstrapSecretStorage | `CryptoApi.bootstrapSecretStorage`}.
|
1635
|
+
*/
|
1636
|
+
bootstrapSecretStorage(opts: ICreateSecretStorageOpts): Promise<void>;
|
1637
|
+
/**
|
1638
|
+
* Add a key for encrypting secrets.
|
1639
|
+
*
|
1640
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1641
|
+
*
|
1642
|
+
* @param algorithm - the algorithm used by the key
|
1643
|
+
* @param opts - the options for the algorithm. The properties used
|
1644
|
+
* depend on the algorithm given.
|
1645
|
+
* @param keyName - the name of the key. If not given, a random name will be generated.
|
1646
|
+
*
|
1647
|
+
* @returns An object with:
|
1648
|
+
* keyId: the ID of the key
|
1649
|
+
* keyInfo: details about the key (iv, mac, passphrase)
|
1650
|
+
*
|
1651
|
+
* @deprecated Use {@link MatrixClient#secretStorage} and {@link SecretStorage.ServerSideSecretStorage#addKey}.
|
1652
|
+
*/
|
1653
|
+
addSecretStorageKey(algorithm: string, opts: AddSecretStorageKeyOpts, keyName?: string): Promise<{
|
1654
|
+
keyId: string;
|
1655
|
+
keyInfo: SecretStorageKeyDescription;
|
1656
|
+
}>;
|
1657
|
+
/**
|
1658
|
+
* Check whether we have a key with a given ID.
|
1659
|
+
*
|
1660
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1661
|
+
*
|
1662
|
+
* @param keyId - The ID of the key to check
|
1663
|
+
* for. Defaults to the default key ID if not provided.
|
1664
|
+
* @returns Whether we have the key.
|
1665
|
+
*
|
1666
|
+
* @deprecated Use {@link MatrixClient#secretStorage} and {@link SecretStorage.ServerSideSecretStorage#hasKey}.
|
1667
|
+
*/
|
1668
|
+
hasSecretStorageKey(keyId?: string): Promise<boolean>;
|
1669
|
+
/**
|
1670
|
+
* Store an encrypted secret on the server.
|
1671
|
+
*
|
1672
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1673
|
+
*
|
1674
|
+
* @param name - The name of the secret
|
1675
|
+
* @param secret - The secret contents.
|
1676
|
+
* @param keys - The IDs of the keys to use to encrypt the secret or null/undefined
|
1677
|
+
* to use the default (will throw if no default key is set).
|
1678
|
+
*
|
1679
|
+
* @deprecated Use {@link MatrixClient#secretStorage} and {@link SecretStorage.ServerSideSecretStorage#store}.
|
1680
|
+
*/
|
1681
|
+
storeSecret(name: string, secret: string, keys?: string[]): Promise<void>;
|
1682
|
+
/**
|
1683
|
+
* Get a secret from storage.
|
1684
|
+
*
|
1685
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1686
|
+
*
|
1687
|
+
* @param name - the name of the secret
|
1688
|
+
*
|
1689
|
+
* @returns the contents of the secret
|
1690
|
+
*
|
1691
|
+
* @deprecated Use {@link MatrixClient#secretStorage} and {@link SecretStorage.ServerSideSecretStorage#get}.
|
1692
|
+
*/
|
1693
|
+
getSecret(name: string): Promise<string | undefined>;
|
1694
|
+
/**
|
1695
|
+
* Check if a secret is stored on the server.
|
1696
|
+
*
|
1697
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1698
|
+
*
|
1699
|
+
* @param name - the name of the secret
|
1700
|
+
* @returns map of key name to key info the secret is encrypted
|
1701
|
+
* with, or null if it is not present or not encrypted with a trusted
|
1702
|
+
* key
|
1703
|
+
*
|
1704
|
+
* @deprecated Use {@link MatrixClient#secretStorage} and {@link SecretStorage.ServerSideSecretStorage#isStored}.
|
1705
|
+
*/
|
1706
|
+
isSecretStored(name: string): Promise<Record<string, SecretStorageKeyDescription> | null>;
|
1707
|
+
/**
|
1708
|
+
* Request a secret from another device.
|
1709
|
+
*
|
1710
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1711
|
+
*
|
1712
|
+
* @param name - the name of the secret to request
|
1713
|
+
* @param devices - the devices to request the secret from
|
1714
|
+
*
|
1715
|
+
* @returns the secret request object
|
1716
|
+
* @deprecated Not supported for Rust Cryptography.
|
1717
|
+
*/
|
1718
|
+
requestSecret(name: string, devices: string[]): ISecretRequest;
|
1719
|
+
/**
|
1720
|
+
* Get the current default key ID for encrypting secrets.
|
1721
|
+
*
|
1722
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1723
|
+
*
|
1724
|
+
* @returns The default key ID or null if no default key ID is set
|
1725
|
+
*
|
1726
|
+
* @deprecated Use {@link MatrixClient#secretStorage} and {@link SecretStorage.ServerSideSecretStorage#getDefaultKeyId}.
|
1727
|
+
*/
|
1728
|
+
getDefaultSecretStorageKeyId(): Promise<string | null>;
|
1729
|
+
/**
|
1730
|
+
* Set the current default key ID for encrypting secrets.
|
1731
|
+
*
|
1732
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1733
|
+
*
|
1734
|
+
* @param keyId - The new default key ID
|
1735
|
+
*
|
1736
|
+
* @deprecated Use {@link MatrixClient#secretStorage} and {@link SecretStorage.ServerSideSecretStorage#setDefaultKeyId}.
|
1737
|
+
*/
|
1738
|
+
setDefaultSecretStorageKeyId(keyId: string): Promise<void>;
|
1739
|
+
/**
|
1740
|
+
* Checks that a given secret storage private key matches a given public key.
|
1741
|
+
* This can be used by the getSecretStorageKey callback to verify that the
|
1742
|
+
* private key it is about to supply is the one that was requested.
|
1743
|
+
*
|
1744
|
+
* The Secure Secret Storage API is currently UNSTABLE and may change without notice.
|
1745
|
+
*
|
1746
|
+
* @param privateKey - The private key
|
1747
|
+
* @param expectedPublicKey - The public key
|
1748
|
+
* @returns true if the key matches, otherwise false
|
1749
|
+
*
|
1750
|
+
* @deprecated The use of asymmetric keys for SSSS is deprecated.
|
1751
|
+
* Use {@link SecretStorage.ServerSideSecretStorage#checkKey} for symmetric keys.
|
1752
|
+
*/
|
1753
|
+
checkSecretStoragePrivateKey(privateKey: Uint8Array, expectedPublicKey: string): boolean;
|
1754
|
+
/**
|
1755
|
+
* Get e2e information on the device that sent an event
|
1756
|
+
*
|
1757
|
+
* @param event - event to be checked
|
1758
|
+
* @deprecated Not supported for Rust Cryptography.
|
1759
|
+
*/
|
1760
|
+
getEventSenderDeviceInfo(event: MatrixEvent): Promise<DeviceInfo | null>;
|
1761
|
+
/**
|
1762
|
+
* Check if the sender of an event is verified
|
1763
|
+
*
|
1764
|
+
* @param event - event to be checked
|
1765
|
+
*
|
1766
|
+
* @returns true if the sender of this event has been verified using
|
1767
|
+
* {@link MatrixClient#setDeviceVerified}.
|
1768
|
+
*
|
1769
|
+
* @deprecated Not supported for Rust Cryptography.
|
1770
|
+
*/
|
1771
|
+
isEventSenderVerified(event: MatrixEvent): Promise<boolean>;
|
1772
|
+
/**
|
1773
|
+
* Get outgoing room key request for this event if there is one.
|
1774
|
+
* @param event - The event to check for
|
1775
|
+
*
|
1776
|
+
* @returns A room key request, or null if there is none
|
1777
|
+
*
|
1778
|
+
* @deprecated Not supported for Rust Cryptography.
|
1779
|
+
*/
|
1780
|
+
getOutgoingRoomKeyRequest(event: MatrixEvent): Promise<OutgoingRoomKeyRequest | null>;
|
1781
|
+
/**
|
1782
|
+
* Cancel a room key request for this event if one is ongoing and resend the
|
1783
|
+
* request.
|
1784
|
+
* @param event - event of which to cancel and resend the room
|
1785
|
+
* key request.
|
1786
|
+
* @returns A promise that will resolve when the key request is queued
|
1787
|
+
*
|
1788
|
+
* @deprecated Not supported for Rust Cryptography.
|
1789
|
+
*/
|
1790
|
+
cancelAndResendEventRoomKeyRequest(event: MatrixEvent): Promise<void>;
|
1791
|
+
/**
|
1792
|
+
* Enable end-to-end encryption for a room. This does not modify room state.
|
1793
|
+
* Any messages sent before the returned promise resolves will be sent unencrypted.
|
1794
|
+
* @param roomId - The room ID to enable encryption in.
|
1795
|
+
* @param config - The encryption config for the room.
|
1796
|
+
* @returns A promise that will resolve when encryption is set up.
|
1797
|
+
*
|
1798
|
+
* @deprecated Not supported for Rust Cryptography. To enable encryption in a room, send an `m.room.encryption`
|
1799
|
+
* state event.
|
1800
|
+
*/
|
1801
|
+
setRoomEncryption(roomId: string, config: IRoomEncryption): Promise<void>;
|
1802
|
+
/**
|
1803
|
+
* Whether encryption is enabled for a room.
|
1804
|
+
* @param roomId - the room id to query.
|
1805
|
+
* @returns whether encryption is enabled.
|
1806
|
+
*
|
1807
|
+
* @deprecated Not correctly supported for Rust Cryptography. Use {@link CryptoApi.isEncryptionEnabledInRoom} and/or
|
1808
|
+
* {@link Room.hasEncryptionStateEvent}.
|
1809
|
+
*/
|
1810
|
+
isRoomEncrypted(roomId: string): boolean;
|
1811
|
+
/**
|
1812
|
+
* Encrypts and sends a given object via Olm to-device messages to a given
|
1813
|
+
* set of devices.
|
1814
|
+
*
|
1815
|
+
* @param userDeviceInfoArr - list of deviceInfo objects representing the devices to send to
|
1816
|
+
*
|
1817
|
+
* @param payload - fields to include in the encrypted payload
|
1818
|
+
*
|
1819
|
+
* @returns Promise which
|
1820
|
+
* resolves once the message has been encrypted and sent to the given
|
1821
|
+
* userDeviceMap, and returns the `{ contentMap, deviceInfoByDeviceId }`
|
1822
|
+
* of the successfully sent messages.
|
1823
|
+
*
|
1824
|
+
* @deprecated Instead use {@link CryptoApi.encryptToDeviceMessages} followed by {@link queueToDevice}.
|
1825
|
+
*/
|
1826
|
+
encryptAndSendToDevices(userDeviceInfoArr: IOlmDevice<DeviceInfo>[], payload: object): Promise<void>;
|
1827
|
+
/**
|
1828
|
+
* Forces the current outbound group session to be discarded such
|
1829
|
+
* that another one will be created next time an event is sent.
|
1830
|
+
*
|
1831
|
+
* @param roomId - The ID of the room to discard the session for
|
1832
|
+
*
|
1833
|
+
* @deprecated Prefer {@link CryptoApi.forceDiscardSession | `CryptoApi.forceDiscardSession`}:
|
1834
|
+
*/
|
1835
|
+
forceDiscardSession(roomId: string): void;
|
1836
|
+
/**
|
1837
|
+
* Get a list containing all of the room keys
|
1838
|
+
*
|
1839
|
+
* This should be encrypted before returning it to the user.
|
1840
|
+
*
|
1841
|
+
* @returns a promise which resolves to a list of session export objects
|
1842
|
+
*
|
1843
|
+
* @deprecated Prefer {@link CryptoApi.exportRoomKeys | `CryptoApi.exportRoomKeys`}:
|
1844
|
+
*
|
1845
|
+
* ```javascript
|
1846
|
+
* sessionData = await client.getCrypto().exportRoomKeys();
|
1847
|
+
* ```
|
1848
|
+
*/
|
1849
|
+
exportRoomKeys(): Promise<IMegolmSessionData[]>;
|
1850
|
+
/**
|
1851
|
+
* Import a list of room keys previously exported by exportRoomKeys
|
1852
|
+
*
|
1853
|
+
* @param keys - a list of session export objects
|
1854
|
+
* @param opts - options object
|
1855
|
+
*
|
1856
|
+
* @returns a promise which resolves when the keys have been imported
|
1857
|
+
*
|
1858
|
+
* @deprecated Prefer {@link CryptoApi.importRoomKeys | `CryptoApi.importRoomKeys`}:
|
1859
|
+
* ```javascript
|
1860
|
+
* await client.getCrypto()?.importRoomKeys([..]);
|
1861
|
+
* ```
|
1862
|
+
*/
|
1863
|
+
importRoomKeys(keys: IMegolmSessionData[], opts?: ImportRoomKeysOpts): Promise<void>;
|
1864
|
+
/**
|
1865
|
+
* Force a re-check of the local key backup status against
|
1866
|
+
* what's on the server.
|
1867
|
+
*
|
1868
|
+
* @returns Object with backup info (as returned by
|
1869
|
+
* getKeyBackupVersion) in backupInfo and
|
1870
|
+
* trust information (as returned by isKeyBackupTrusted)
|
1871
|
+
* in trustInfo.
|
1872
|
+
*
|
1873
|
+
* @deprecated Prefer {@link Crypto.CryptoApi.checkKeyBackupAndEnable}.
|
1874
|
+
*/
|
1875
|
+
checkKeyBackup(): Promise<IKeyBackupCheck | null>;
|
1876
|
+
/**
|
1877
|
+
* Get information about the current key backup from the server.
|
1878
|
+
*
|
1879
|
+
* Performs some basic validity checks on the shape of the result, and raises an error if it is not as expected.
|
1880
|
+
*
|
1881
|
+
* **Note**: there is no (supported) way to distinguish between "failure to talk to the server" and "another client
|
1882
|
+
* uploaded a key backup version using an algorithm I don't understand.
|
1883
|
+
*
|
1884
|
+
* @returns Information object from API, or null if no backup is present on the server.
|
1885
|
+
*
|
1886
|
+
* @deprecated Prefer {@link CryptoApi.getKeyBackupInfo}.
|
1887
|
+
*/
|
1888
|
+
getKeyBackupVersion(): Promise<IKeyBackupInfo | null>;
|
1889
|
+
/**
|
1890
|
+
* @param info - key backup info dict from getKeyBackupVersion()
|
1891
|
+
*
|
1892
|
+
* @deprecated Not supported for Rust Cryptography. Prefer {@link CryptoApi.isKeyBackupTrusted | `CryptoApi.isKeyBackupTrusted`}.
|
1893
|
+
*/
|
1894
|
+
isKeyBackupTrusted(info: IKeyBackupInfo): Promise<TrustInfo>;
|
1895
|
+
/**
|
1896
|
+
* @returns true if the client is configured to back up keys to
|
1897
|
+
* the server, otherwise false. If we haven't completed a successful check
|
1898
|
+
* of key backup status yet, returns null.
|
1899
|
+
*
|
1900
|
+
* @deprecated Not supported for Rust Cryptography. Prefer direct access to {@link Crypto.CryptoApi.getActiveSessionBackupVersion}:
|
1901
|
+
*
|
1902
|
+
* ```javascript
|
1903
|
+
* let enabled = (await client.getCrypto().getActiveSessionBackupVersion()) !== null;
|
1904
|
+
* ```
|
1905
|
+
*/
|
1906
|
+
getKeyBackupEnabled(): boolean | null;
|
1907
|
+
/**
|
1908
|
+
* Enable backing up of keys, using data previously returned from
|
1909
|
+
* getKeyBackupVersion.
|
1910
|
+
*
|
1911
|
+
* @param info - Backup information object as returned by getKeyBackupVersion
|
1912
|
+
* @returns Promise which resolves when complete.
|
1913
|
+
*
|
1914
|
+
* @deprecated Do not call this directly. Instead call {@link Crypto.CryptoApi.checkKeyBackupAndEnable}.
|
1915
|
+
*/
|
1916
|
+
enableKeyBackup(info: IKeyBackupInfo): Promise<void>;
|
1917
|
+
/**
|
1918
|
+
* Disable backing up of keys.
|
1919
|
+
*
|
1920
|
+
* @deprecated Not supported for Rust Cryptography. It should be unnecessary to disable key backup.
|
1921
|
+
*/
|
1922
|
+
disableKeyBackup(): void;
|
1923
|
+
/**
|
1924
|
+
* Set up the data required to create a new backup version. The backup version
|
1925
|
+
* will not be created and enabled until createKeyBackupVersion is called.
|
1926
|
+
*
|
1927
|
+
* @param password - Passphrase string that can be entered by the user
|
1928
|
+
* when restoring the backup as an alternative to entering the recovery key.
|
1929
|
+
* Optional.
|
1930
|
+
*
|
1931
|
+
* @returns Object that can be passed to createKeyBackupVersion and
|
1932
|
+
* additionally has a 'recovery_key' member with the user-facing recovery key string.
|
1933
|
+
*
|
1934
|
+
* @deprecated Not supported for Rust cryptography. Use {@link Crypto.CryptoApi.resetKeyBackup | `CryptoApi.resetKeyBackup`}.
|
1935
|
+
*/
|
1936
|
+
prepareKeyBackupVersion(password?: string | Uint8Array | null, opts?: IKeyBackupPrepareOpts): Promise<Pick<IPreparedKeyBackupVersion, "algorithm" | "auth_data" | "recovery_key">>;
|
1937
|
+
/**
|
1938
|
+
* Check whether the key backup private key is stored in secret storage.
|
1939
|
+
* @returns map of key name to key info the secret is
|
1940
|
+
* encrypted with, or null if it is not present or not encrypted with a
|
1941
|
+
* trusted key
|
1942
|
+
*/
|
1943
|
+
isKeyBackupKeyStored(): Promise<Record<string, SecretStorageKeyDescription> | null>;
|
1944
|
+
/**
|
1945
|
+
* Create a new key backup version and enable it, using the information return
|
1946
|
+
* from prepareKeyBackupVersion.
|
1947
|
+
*
|
1948
|
+
* @param info - Info object from prepareKeyBackupVersion
|
1949
|
+
* @returns Object with 'version' param indicating the version created
|
1950
|
+
*
|
1951
|
+
* @deprecated Use {@link Crypto.CryptoApi.resetKeyBackup | `CryptoApi.resetKeyBackup`}.
|
1952
|
+
*/
|
1953
|
+
createKeyBackupVersion(info: IKeyBackupInfo): Promise<IKeyBackupInfo>;
|
1954
|
+
/**
|
1955
|
+
* @deprecated Use {@link Crypto.CryptoApi.deleteKeyBackupVersion | `CryptoApi.deleteKeyBackupVersion`}.
|
1956
|
+
*/
|
1957
|
+
deleteKeyBackupVersion(version: string): Promise<void>;
|
1958
|
+
private makeKeyBackupPath;
|
1959
|
+
/**
|
1960
|
+
* Back up session keys to the homeserver.
|
1961
|
+
* @param roomId - ID of the room that the keys are for Optional.
|
1962
|
+
* @param sessionId - ID of the session that the keys are for Optional.
|
1963
|
+
* @param version - backup version Optional.
|
1964
|
+
* @param data - Object keys to send
|
1965
|
+
* @returns a promise that will resolve when the keys
|
1966
|
+
* are uploaded
|
1967
|
+
*
|
1968
|
+
* @deprecated Not supported for Rust Cryptography.
|
1969
|
+
*/
|
1970
|
+
sendKeyBackup(roomId: undefined, sessionId: undefined, version: string | undefined, data: IKeyBackup): Promise<void>;
|
1971
|
+
sendKeyBackup(roomId: string, sessionId: undefined, version: string | undefined, data: IKeyBackup): Promise<void>;
|
1972
|
+
sendKeyBackup(roomId: string, sessionId: string, version: string | undefined, data: IKeyBackup): Promise<void>;
|
1973
|
+
/**
|
1974
|
+
* Marks all group sessions as needing to be backed up and schedules them to
|
1975
|
+
* upload in the background as soon as possible.
|
1976
|
+
*
|
1977
|
+
* @deprecated Not supported for Rust Cryptography. This is done automatically as part of
|
1978
|
+
* {@link CryptoApi.resetKeyBackup}, so there is probably no need to call this manually.
|
1979
|
+
*/
|
1980
|
+
scheduleAllGroupSessionsForBackup(): Promise<void>;
|
1981
|
+
/**
|
1982
|
+
* Marks all group sessions as needing to be backed up without scheduling
|
1983
|
+
* them to upload in the background.
|
1984
|
+
*
|
1985
|
+
* (This is done automatically as part of {@link CryptoApi.resetKeyBackup},
|
1986
|
+
* so there is probably no need to call this manually.)
|
1987
|
+
*
|
1988
|
+
* @returns Promise which resolves to the number of sessions requiring a backup.
|
1989
|
+
* @deprecated Not supported for Rust Cryptography.
|
1990
|
+
*/
|
1991
|
+
flagAllGroupSessionsForBackup(): Promise<number>;
|
1992
|
+
/**
|
1993
|
+
* Return true if recovery key is valid.
|
1994
|
+
* Try to decode the recovery key and check if it's successful.
|
1995
|
+
* @param recoveryKey
|
1996
|
+
* @deprecated Use {@link decodeRecoveryKey} directly
|
1997
|
+
*/
|
1998
|
+
isValidRecoveryKey(recoveryKey: string): boolean;
|
1999
|
+
/**
|
2000
|
+
* Get the raw key for a key backup from the password
|
2001
|
+
* Used when migrating key backups into SSSS
|
2002
|
+
*
|
2003
|
+
* The cross-signing API is currently UNSTABLE and may change without notice.
|
2004
|
+
*
|
2005
|
+
* @param password - Passphrase
|
2006
|
+
* @param backupInfo - Backup metadata from `checkKeyBackup`
|
2007
|
+
* @returns key backup key
|
2008
|
+
* @deprecated Deriving a backup key from a passphrase is not part of the matrix spec. Instead, a random key is generated and stored/shared via 4S.
|
2009
|
+
*/
|
2010
|
+
keyBackupKeyFromPassword(password: string, backupInfo: IKeyBackupInfo): Promise<Uint8Array>;
|
2011
|
+
/**
|
2012
|
+
* Get the raw key for a key backup from the recovery key
|
2013
|
+
* Used when migrating key backups into SSSS
|
2014
|
+
*
|
2015
|
+
* The cross-signing API is currently UNSTABLE and may change without notice.
|
2016
|
+
*
|
2017
|
+
* @param recoveryKey - The recovery key
|
2018
|
+
* @returns key backup key
|
2019
|
+
* @deprecated Use {@link decodeRecoveryKey} directly
|
2020
|
+
*/
|
2021
|
+
keyBackupKeyFromRecoveryKey(recoveryKey: string): Uint8Array;
|
2022
|
+
/**
|
2023
|
+
* Restore from an existing key backup via a passphrase.
|
2024
|
+
*
|
2025
|
+
* @param password - Passphrase
|
2026
|
+
* @param targetRoomId - Room ID to target a specific room.
|
2027
|
+
* Restores all rooms if omitted.
|
2028
|
+
* @param targetSessionId - Session ID to target a specific session.
|
2029
|
+
* Restores all sessions if omitted.
|
2030
|
+
* @param backupInfo - Backup metadata from `getKeyBackupVersion` or `checkKeyBackup`.`backupInfo`
|
2031
|
+
* @param opts - Optional params such as callbacks
|
2032
|
+
* @returns Status of restoration with `total` and `imported`
|
2033
|
+
* key counts.
|
2034
|
+
*
|
2035
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackupWithPassphrase | `CryptoApi.restoreKeyBackupWithPassphrase`}.
|
2036
|
+
*/
|
2037
|
+
restoreKeyBackupWithPassword(password: string, targetRoomId: undefined, targetSessionId: undefined, backupInfo: IKeyBackupInfo, opts: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2038
|
+
/**
|
2039
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackupWithPassphrase | `CryptoApi.restoreKeyBackupWithPassphrase`}.
|
2040
|
+
*/
|
2041
|
+
restoreKeyBackupWithPassword(password: string, targetRoomId: string, targetSessionId: undefined, backupInfo: IKeyBackupInfo, opts: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2042
|
+
/**
|
2043
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackupWithPassphrase | `CryptoApi.restoreKeyBackupWithPassphrase`}.
|
2044
|
+
*/
|
2045
|
+
restoreKeyBackupWithPassword(password: string, targetRoomId: string, targetSessionId: string, backupInfo: IKeyBackupInfo, opts: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2046
|
+
/**
|
2047
|
+
* Restore from an existing key backup via a private key stored in secret
|
2048
|
+
* storage.
|
2049
|
+
*
|
2050
|
+
* @param backupInfo - Backup metadata from `checkKeyBackup`
|
2051
|
+
* @param targetRoomId - Room ID to target a specific room.
|
2052
|
+
* Restores all rooms if omitted.
|
2053
|
+
* @param targetSessionId - Session ID to target a specific session.
|
2054
|
+
* Restores all sessions if omitted.
|
2055
|
+
* @param opts - Optional params such as callbacks
|
2056
|
+
* @returns Status of restoration with `total` and `imported`
|
2057
|
+
* key counts.
|
2058
|
+
*
|
2059
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackup | `CryptoApi.restoreKeyBackup`}.
|
2060
|
+
*/
|
2061
|
+
restoreKeyBackupWithSecretStorage(backupInfo: IKeyBackupInfo, targetRoomId?: string, targetSessionId?: string, opts?: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2062
|
+
/**
|
2063
|
+
* Restore from an existing key backup via an encoded recovery key.
|
2064
|
+
*
|
2065
|
+
* @param recoveryKey - Encoded recovery key
|
2066
|
+
* @param targetRoomId - Room ID to target a specific room.
|
2067
|
+
* Restores all rooms if omitted.
|
2068
|
+
* @param targetSessionId - Session ID to target a specific session.
|
2069
|
+
* Restores all sessions if omitted.
|
2070
|
+
* @param backupInfo - Backup metadata from `checkKeyBackup`
|
2071
|
+
* @param opts - Optional params such as callbacks
|
2072
|
+
|
2073
|
+
* @returns Status of restoration with `total` and `imported`
|
2074
|
+
* key counts.
|
2075
|
+
*
|
2076
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackup | `CryptoApi.restoreKeyBackup`}.
|
2077
|
+
*/
|
2078
|
+
restoreKeyBackupWithRecoveryKey(recoveryKey: string, targetRoomId: undefined, targetSessionId: undefined, backupInfo: IKeyBackupInfo, opts?: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2079
|
+
/**
|
2080
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackup | `CryptoApi.restoreKeyBackup`}.
|
2081
|
+
*/
|
2082
|
+
restoreKeyBackupWithRecoveryKey(recoveryKey: string, targetRoomId: string, targetSessionId: undefined, backupInfo: IKeyBackupInfo, opts?: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2083
|
+
/**
|
2084
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackup | `CryptoApi.restoreKeyBackup`}.
|
2085
|
+
*/
|
2086
|
+
restoreKeyBackupWithRecoveryKey(recoveryKey: string, targetRoomId: string, targetSessionId: string, backupInfo: IKeyBackupInfo, opts?: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2087
|
+
/**
|
2088
|
+
* Restore from an existing key backup via a private key stored locally
|
2089
|
+
* @param targetRoomId
|
2090
|
+
* @param targetSessionId
|
2091
|
+
* @param backupInfo
|
2092
|
+
* @param opts
|
2093
|
+
*
|
2094
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackup | `CryptoApi.restoreKeyBackup`}.
|
2095
|
+
*/
|
2096
|
+
restoreKeyBackupWithCache(targetRoomId: undefined, targetSessionId: undefined, backupInfo: IKeyBackupInfo, opts?: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2097
|
+
/**
|
2098
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackup | `CryptoApi.restoreKeyBackup`}.
|
2099
|
+
*/
|
2100
|
+
restoreKeyBackupWithCache(targetRoomId: string, targetSessionId: undefined, backupInfo: IKeyBackupInfo, opts?: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2101
|
+
/**
|
2102
|
+
* @deprecated Prefer {@link CryptoApi.restoreKeyBackup | `CryptoApi.restoreKeyBackup`}.
|
2103
|
+
*/
|
2104
|
+
restoreKeyBackupWithCache(targetRoomId: string, targetSessionId: string, backupInfo: IKeyBackupInfo, opts?: IKeyBackupRestoreOpts): Promise<IKeyBackupRestoreResult>;
|
2105
|
+
private restoreKeyBackup;
|
2106
|
+
/**
|
2107
|
+
* This method calculates the total number of keys present in the response of a `/room_keys/keys` call.
|
2108
|
+
*
|
2109
|
+
* @param res - The response from the server containing the keys to be counted.
|
2110
|
+
*
|
2111
|
+
* @returns The total number of keys in the backup.
|
2112
|
+
*/
|
2113
|
+
private getTotalKeyCount;
|
2114
|
+
/**
|
2115
|
+
* This method handles the decryption of a full backup, i.e a call to `/room_keys/keys`.
|
2116
|
+
* It will decrypt the keys in chunks and call the `block` callback for each chunk.
|
2117
|
+
*
|
2118
|
+
* @param res - The response from the server containing the keys to be decrypted.
|
2119
|
+
* @param backupDecryptor - An instance of the BackupDecryptor class used to decrypt the keys.
|
2120
|
+
* @param chunkSize - The size of the chunks to be processed at a time.
|
2121
|
+
* @param block - A callback function that is called for each chunk of keys.
|
2122
|
+
*
|
2123
|
+
* @returns A promise that resolves when the decryption is complete.
|
2124
|
+
*/
|
2125
|
+
private handleDecryptionOfAFullBackup;
|
2126
|
+
deleteKeysFromBackup(roomId: undefined, sessionId: undefined, version?: string): Promise<void>;
|
2127
|
+
deleteKeysFromBackup(roomId: string, sessionId: undefined, version?: string): Promise<void>;
|
2128
|
+
deleteKeysFromBackup(roomId: string, sessionId: string, version?: string): Promise<void>;
|
2129
|
+
/**
|
2130
|
+
* Get the config for the media repository.
|
2131
|
+
* @returns Promise which resolves with an object containing the config.
|
2132
|
+
*/
|
2133
|
+
getMediaConfig(): Promise<IMediaConfig>;
|
2134
|
+
/**
|
2135
|
+
* Get the room for the given room ID.
|
2136
|
+
* This function will return a valid room for any room for which a Room event
|
2137
|
+
* has been emitted. Note in particular that other events, eg. RoomState.members
|
2138
|
+
* will be emitted for a room before this function will return the given room.
|
2139
|
+
* @param roomId - The room ID
|
2140
|
+
* @returns The Room or null if it doesn't exist or there is no data store.
|
2141
|
+
*/
|
2142
|
+
getRoom(roomId: string | undefined): Room | null;
|
2143
|
+
/**
|
2144
|
+
* Retrieve all known rooms.
|
2145
|
+
* @returns A list of rooms, or an empty list if there is no data store.
|
2146
|
+
*/
|
2147
|
+
getRooms(): Room[];
|
2148
|
+
/**
|
2149
|
+
* Retrieve all rooms that should be displayed to the user
|
2150
|
+
* This is essentially getRooms() with some rooms filtered out, eg. old versions
|
2151
|
+
* of rooms that have been replaced or (in future) other rooms that have been
|
2152
|
+
* marked at the protocol level as not to be displayed to the user.
|
2153
|
+
*
|
2154
|
+
* @param msc3946ProcessDynamicPredecessor - if true, look for an
|
2155
|
+
* m.room.predecessor state event and
|
2156
|
+
* use it if found (MSC3946).
|
2157
|
+
* @returns A list of rooms, or an empty list if there is no data store.
|
2158
|
+
*/
|
2159
|
+
getVisibleRooms(msc3946ProcessDynamicPredecessor?: boolean): Room[];
|
2160
|
+
/**
|
2161
|
+
* Retrieve a user.
|
2162
|
+
* @param userId - The user ID to retrieve.
|
2163
|
+
* @returns A user or null if there is no data store or the user does
|
2164
|
+
* not exist.
|
2165
|
+
*/
|
2166
|
+
getUser(userId: string): User | null;
|
2167
|
+
/**
|
2168
|
+
* Retrieve all known users.
|
2169
|
+
* @returns A list of users, or an empty list if there is no data store.
|
2170
|
+
*/
|
2171
|
+
getUsers(): User[];
|
2172
|
+
/**
|
2173
|
+
* Set account data event for the current user.
|
2174
|
+
* It will retry the request up to 5 times.
|
2175
|
+
* @param eventType - The event type
|
2176
|
+
* @param content - the contents object for the event
|
2177
|
+
* @returns Promise which resolves: an empty object
|
2178
|
+
* @returns Rejects: with an error response.
|
2179
|
+
*/
|
2180
|
+
setAccountData(eventType: EventType | string, content: IContent): Promise<{}>;
|
2181
|
+
/**
|
2182
|
+
* Get account data event of given type for the current user.
|
2183
|
+
* @param eventType - The event type
|
2184
|
+
* @returns The contents of the given account data event
|
2185
|
+
*/
|
2186
|
+
getAccountData(eventType: string): MatrixEvent | undefined;
|
2187
|
+
/**
|
2188
|
+
* Get account data event of given type for the current user. This variant
|
2189
|
+
* gets account data directly from the homeserver if the local store is not
|
2190
|
+
* ready, which can be useful very early in startup before the initial sync.
|
2191
|
+
* @param eventType - The event type
|
2192
|
+
* @returns Promise which resolves: The contents of the given account data event.
|
2193
|
+
* @returns Rejects: with an error response.
|
2194
|
+
*/
|
2195
|
+
getAccountDataFromServer<T extends {
|
2196
|
+
[k: string]: any;
|
2197
|
+
}>(eventType: string): Promise<T | null>;
|
2198
|
+
deleteAccountData(eventType: string): Promise<void>;
|
2199
|
+
/**
|
2200
|
+
* Gets the users that are ignored by this client
|
2201
|
+
* @returns The array of users that are ignored (empty if none)
|
2202
|
+
*/
|
2203
|
+
getIgnoredUsers(): string[];
|
2204
|
+
/**
|
2205
|
+
* Sets the users that the current user should ignore.
|
2206
|
+
* @param userIds - the user IDs to ignore
|
2207
|
+
* @returns Promise which resolves: an empty object
|
2208
|
+
* @returns Rejects: with an error response.
|
2209
|
+
*/
|
2210
|
+
setIgnoredUsers(userIds: string[]): Promise<{}>;
|
2211
|
+
/**
|
2212
|
+
* Gets whether or not a specific user is being ignored by this client.
|
2213
|
+
* @param userId - the user ID to check
|
2214
|
+
* @returns true if the user is ignored, false otherwise
|
2215
|
+
*/
|
2216
|
+
isUserIgnored(userId: string): boolean;
|
2217
|
+
/**
|
2218
|
+
* Join a room. If you have already joined the room, this will no-op.
|
2219
|
+
* @param roomIdOrAlias - The room ID or room alias to join.
|
2220
|
+
* @param opts - Options when joining the room.
|
2221
|
+
* @returns Promise which resolves: Room object.
|
2222
|
+
* @returns Rejects: with an error response.
|
2223
|
+
*/
|
2224
|
+
joinRoom(roomIdOrAlias: string, opts?: IJoinRoomOpts): Promise<Room>;
|
2225
|
+
/**
|
2226
|
+
* Knock a room. If you have already knocked the room, this will no-op.
|
2227
|
+
* @param roomIdOrAlias - The room ID or room alias to knock.
|
2228
|
+
* @param opts - Options when knocking the room.
|
2229
|
+
* @returns Promise which resolves: `{room_id: {string}}`
|
2230
|
+
* @returns Rejects: with an error response.
|
2231
|
+
*/
|
2232
|
+
knockRoom(roomIdOrAlias: string, opts?: KnockRoomOpts): Promise<{
|
2233
|
+
room_id: string;
|
2234
|
+
}>;
|
2235
|
+
/**
|
2236
|
+
* Resend an event. Will also retry any to-device messages waiting to be sent.
|
2237
|
+
* @param event - The event to resend.
|
2238
|
+
* @param room - Optional. The room the event is in. Will update the
|
2239
|
+
* timeline entry if provided.
|
2240
|
+
* @returns Promise which resolves: to an ISendEventResponse object
|
2241
|
+
* @returns Rejects: with an error response.
|
2242
|
+
*/
|
2243
|
+
resendEvent(event: MatrixEvent, room: Room): Promise<ISendEventResponse>;
|
2244
|
+
/**
|
2245
|
+
* Cancel a queued or unsent event.
|
2246
|
+
*
|
2247
|
+
* @param event - Event to cancel
|
2248
|
+
* @throws Error if the event is not in QUEUED, NOT_SENT or ENCRYPTING state
|
2249
|
+
*/
|
2250
|
+
cancelPendingEvent(event: MatrixEvent): void;
|
2251
|
+
/**
|
2252
|
+
* @returns Promise which resolves: TODO
|
2253
|
+
* @returns Rejects: with an error response.
|
2254
|
+
*/
|
2255
|
+
setRoomName(roomId: string, name: string): Promise<ISendEventResponse>;
|
2256
|
+
/**
|
2257
|
+
* @param htmlTopic - Optional.
|
2258
|
+
* @returns Promise which resolves: TODO
|
2259
|
+
* @returns Rejects: with an error response.
|
2260
|
+
*/
|
2261
|
+
setRoomTopic(roomId: string, topic: string, htmlTopic?: string): Promise<ISendEventResponse>;
|
2262
|
+
/**
|
2263
|
+
* @returns Promise which resolves: to an object keyed by tagId with objects containing a numeric order field.
|
2264
|
+
* @returns Rejects: with an error response.
|
2265
|
+
*/
|
2266
|
+
getRoomTags(roomId: string): Promise<ITagsResponse>;
|
2267
|
+
/**
|
2268
|
+
* @param tagName - name of room tag to be set
|
2269
|
+
* @param metadata - associated with that tag to be stored
|
2270
|
+
* @returns Promise which resolves: to an empty object
|
2271
|
+
* @returns Rejects: with an error response.
|
2272
|
+
*/
|
2273
|
+
setRoomTag(roomId: string, tagName: string, metadata?: ITagMetadata): Promise<{}>;
|
2274
|
+
/**
|
2275
|
+
* @param tagName - name of room tag to be removed
|
2276
|
+
* @returns Promise which resolves: to an empty object
|
2277
|
+
* @returns Rejects: with an error response.
|
2278
|
+
*/
|
2279
|
+
deleteRoomTag(roomId: string, tagName: string): Promise<{}>;
|
2280
|
+
/**
|
2281
|
+
* @param eventType - event type to be set
|
2282
|
+
* @param content - event content
|
2283
|
+
* @returns Promise which resolves: to an empty object `{}`
|
2284
|
+
* @returns Rejects: with an error response.
|
2285
|
+
*/
|
2286
|
+
setRoomAccountData(roomId: string, eventType: string, content: Record<string, any>): Promise<{}>;
|
2287
|
+
/**
|
2288
|
+
* Set a power level to one or multiple users.
|
2289
|
+
* Will apply changes atop of current power level event from local state if running & synced, falling back
|
2290
|
+
* to fetching latest from the `/state/` API.
|
2291
|
+
* @param roomId - the room to update power levels in
|
2292
|
+
* @param userId - the ID of the user or users to update power levels of
|
2293
|
+
* @param powerLevel - the numeric power level to update given users to
|
2294
|
+
* @returns Promise which resolves: to an ISendEventResponse object
|
2295
|
+
* @returns Rejects: with an error response.
|
2296
|
+
*/
|
2297
|
+
setPowerLevel(roomId: string, userId: string | string[], powerLevel: number | undefined): Promise<ISendEventResponse>;
|
2298
|
+
/**
|
2299
|
+
* Create an m.beacon_info event
|
2300
|
+
* @returns
|
2301
|
+
*/
|
2302
|
+
unstable_createLiveBeacon(roomId: Room["roomId"], beaconInfoContent: MBeaconInfoEventContent): Promise<ISendEventResponse>;
|
2303
|
+
/**
|
2304
|
+
* Upsert a live beacon event
|
2305
|
+
* using a specific m.beacon_info.* event variable type
|
2306
|
+
* @param roomId - string
|
2307
|
+
* @returns
|
2308
|
+
*/
|
2309
|
+
unstable_setLiveBeacon(roomId: string, beaconInfoContent: MBeaconInfoEventContent): Promise<ISendEventResponse>;
|
2310
|
+
sendEvent<K extends keyof TimelineEvents>(roomId: string, eventType: K, content: TimelineEvents[K], txnId?: string): Promise<ISendEventResponse>;
|
2311
|
+
sendEvent<K extends keyof TimelineEvents>(roomId: string, threadId: string | null, eventType: K, content: TimelineEvents[K], txnId?: string): Promise<ISendEventResponse>;
|
2312
|
+
/**
|
2313
|
+
* If we expect that an event is part of a thread but is missing the relation
|
2314
|
+
* we need to add it manually, as well as the reply fallback
|
2315
|
+
*/
|
2316
|
+
private addThreadRelationIfNeeded;
|
2317
|
+
/**
|
2318
|
+
* @param eventObject - An object with the partial structure of an event, to which event_id, user_id, room_id and origin_server_ts will be added.
|
2319
|
+
* @param txnId - Optional.
|
2320
|
+
* @returns Promise which resolves: to an empty object `{}`
|
2321
|
+
* @returns Rejects: with an error response.
|
2322
|
+
*/
|
2323
|
+
private sendCompleteEvent;
|
2324
|
+
/**
|
2325
|
+
* encrypts the event if necessary; adds the event to the queue, or sends it; marks the event as sent/unsent
|
2326
|
+
* @returns returns a promise which resolves with the result of the send request
|
2327
|
+
*/
|
2328
|
+
protected encryptAndSendEvent(room: Room | null, event: MatrixEvent): Promise<ISendEventResponse>;
|
2329
|
+
/**
|
2330
|
+
* Simply sends a delayed event without encrypting it.
|
2331
|
+
* TODO: Allow encrypted delayed events, and encrypt them properly
|
2332
|
+
* @param delayOpts - Properties of the delay for this event.
|
2333
|
+
* @returns returns a promise which resolves with the result of the delayed send request
|
2334
|
+
*/
|
2335
|
+
protected encryptAndSendEvent(room: Room | null, event: MatrixEvent, delayOpts: SendDelayedEventRequestOpts): Promise<SendDelayedEventResponse>;
|
2336
|
+
private encryptEventIfNeeded;
|
2337
|
+
/**
|
2338
|
+
* Determine whether a given event should be encrypted when we send it to the given room.
|
2339
|
+
*
|
2340
|
+
* This takes into account event type and room configuration.
|
2341
|
+
*/
|
2342
|
+
private shouldEncryptEventForRoom;
|
2343
|
+
/**
|
2344
|
+
* Returns the eventType that should be used taking encryption into account
|
2345
|
+
* for a given eventType.
|
2346
|
+
* @param roomId - the room for the events `eventType` relates to
|
2347
|
+
* @param eventType - the event type
|
2348
|
+
* @returns the event type taking encryption into account
|
2349
|
+
*/
|
2350
|
+
private getEncryptedIfNeededEventType;
|
2351
|
+
protected updatePendingEventStatus(room: Room | null, event: MatrixEvent, newStatus: EventStatus): void;
|
2352
|
+
private sendEventHttpRequest;
|
2353
|
+
/**
|
2354
|
+
* @param txnId - transaction id. One will be made up if not supplied.
|
2355
|
+
* @param opts - Redact options
|
2356
|
+
* @returns Promise which resolves: TODO
|
2357
|
+
* @returns Rejects: with an error response.
|
2358
|
+
* @throws Error if called with `with_rel_types` (MSC3912) but the server does not support it.
|
2359
|
+
* Callers should check whether the server supports MSC3912 via `MatrixClient.canSupport`.
|
2360
|
+
*/
|
2361
|
+
redactEvent(roomId: string, eventId: string, txnId?: string | undefined, opts?: IRedactOpts): Promise<ISendEventResponse>;
|
2362
|
+
redactEvent(roomId: string, threadId: string | null, eventId: string, txnId?: string | undefined, opts?: IRedactOpts): Promise<ISendEventResponse>;
|
2363
|
+
/**
|
2364
|
+
* @param txnId - Optional.
|
2365
|
+
* @returns Promise which resolves: to an ISendEventResponse object
|
2366
|
+
* @returns Rejects: with an error response.
|
2367
|
+
*/
|
2368
|
+
sendMessage(roomId: string, content: RoomMessageEventContent, txnId?: string): Promise<ISendEventResponse>;
|
2369
|
+
sendMessage(roomId: string, threadId: string | null, content: RoomMessageEventContent, txnId?: string): Promise<ISendEventResponse>;
|
2370
|
+
/**
|
2371
|
+
* @param txnId - Optional.
|
2372
|
+
* @returns
|
2373
|
+
* @returns Rejects: with an error response.
|
2374
|
+
*/
|
2375
|
+
sendTextMessage(roomId: string, body: string, txnId?: string): Promise<ISendEventResponse>;
|
2376
|
+
sendTextMessage(roomId: string, threadId: string | null, body: string, txnId?: string): Promise<ISendEventResponse>;
|
2377
|
+
/**
|
2378
|
+
* @param txnId - Optional.
|
2379
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
2380
|
+
* @returns Rejects: with an error response.
|
2381
|
+
*/
|
2382
|
+
sendNotice(roomId: string, body: string, txnId?: string): Promise<ISendEventResponse>;
|
2383
|
+
sendNotice(roomId: string, threadId: string | null, body: string, txnId?: string): Promise<ISendEventResponse>;
|
2384
|
+
/**
|
2385
|
+
* @param txnId - Optional.
|
2386
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
2387
|
+
* @returns Rejects: with an error response.
|
2388
|
+
*/
|
2389
|
+
sendEmoteMessage(roomId: string, body: string, txnId?: string): Promise<ISendEventResponse>;
|
2390
|
+
sendEmoteMessage(roomId: string, threadId: string | null, body: string, txnId?: string): Promise<ISendEventResponse>;
|
2391
|
+
/**
|
2392
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
2393
|
+
* @returns Rejects: with an error response.
|
2394
|
+
*/
|
2395
|
+
sendImageMessage(roomId: string, url: string, info?: ImageInfo, text?: string): Promise<ISendEventResponse>;
|
2396
|
+
sendImageMessage(roomId: string, threadId: string | null, url: string, info?: ImageInfo, text?: string): Promise<ISendEventResponse>;
|
2397
|
+
/**
|
2398
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
2399
|
+
* @returns Rejects: with an error response.
|
2400
|
+
*/
|
2401
|
+
sendStickerMessage(roomId: string, url: string, info?: ImageInfo, text?: string): Promise<ISendEventResponse>;
|
2402
|
+
sendStickerMessage(roomId: string, threadId: string | null, url: string, info?: ImageInfo, text?: string): Promise<ISendEventResponse>;
|
2403
|
+
/**
|
2404
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
2405
|
+
* @returns Rejects: with an error response.
|
2406
|
+
*/
|
2407
|
+
sendHtmlMessage(roomId: string, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
2408
|
+
sendHtmlMessage(roomId: string, threadId: string | null, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
2409
|
+
/**
|
2410
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
2411
|
+
* @returns Rejects: with an error response.
|
2412
|
+
*/
|
2413
|
+
sendHtmlNotice(roomId: string, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
2414
|
+
sendHtmlNotice(roomId: string, threadId: string | null, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
2415
|
+
/**
|
2416
|
+
* @returns Promise which resolves: to a ISendEventResponse object
|
2417
|
+
* @returns Rejects: with an error response.
|
2418
|
+
*/
|
2419
|
+
sendHtmlEmote(roomId: string, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
2420
|
+
sendHtmlEmote(roomId: string, threadId: string | null, body: string, htmlBody: string): Promise<ISendEventResponse>;
|
2421
|
+
/**
|
2422
|
+
* Send a delayed timeline event.
|
2423
|
+
*
|
2424
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
2425
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
2426
|
+
*/
|
2427
|
+
_unstable_sendDelayedEvent<K extends keyof TimelineEvents>(roomId: string, delayOpts: SendDelayedEventRequestOpts, threadId: string | null, eventType: K, content: TimelineEvents[K], txnId?: string): Promise<SendDelayedEventResponse>;
|
2428
|
+
/**
|
2429
|
+
* Send a delayed state event.
|
2430
|
+
*
|
2431
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
2432
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
2433
|
+
*/
|
2434
|
+
_unstable_sendDelayedStateEvent<K extends keyof StateEvents>(roomId: string, delayOpts: SendDelayedEventRequestOpts, eventType: K, content: StateEvents[K], stateKey?: string, opts?: IRequestOpts): Promise<SendDelayedEventResponse>;
|
2435
|
+
/**
|
2436
|
+
* Get all pending delayed events for the calling user.
|
2437
|
+
*
|
2438
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
2439
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
2440
|
+
*/
|
2441
|
+
_unstable_getDelayedEvents(fromToken?: string): Promise<DelayedEventInfo>;
|
2442
|
+
/**
|
2443
|
+
* Manage a delayed event associated with the given delay_id.
|
2444
|
+
*
|
2445
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
2446
|
+
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
|
2447
|
+
*/
|
2448
|
+
_unstable_updateDelayedEvent(delayId: string, action: UpdateDelayedEventAction): Promise<{}>;
|
2449
|
+
/**
|
2450
|
+
* Send a receipt.
|
2451
|
+
* @param event - The event being acknowledged
|
2452
|
+
* @param receiptType - The kind of receipt e.g. "m.read". Other than
|
2453
|
+
* ReceiptType.Read are experimental!
|
2454
|
+
* @param body - Additional content to send alongside the receipt.
|
2455
|
+
* @param unthreaded - An unthreaded receipt will clear room+thread notifications
|
2456
|
+
* @returns Promise which resolves: to an empty object `{}`
|
2457
|
+
* @returns Rejects: with an error response.
|
2458
|
+
*/
|
2459
|
+
sendReceipt(event: MatrixEvent, receiptType: ReceiptType, body?: Record<string, any>, unthreaded?: boolean): Promise<{}>;
|
2460
|
+
/**
|
2461
|
+
* Send a read receipt.
|
2462
|
+
* @param event - The event that has been read.
|
2463
|
+
* @param receiptType - other than ReceiptType.Read are experimental! Optional.
|
2464
|
+
* @returns Promise which resolves: to an empty object `{}`
|
2465
|
+
* @returns Rejects: with an error response.
|
2466
|
+
*/
|
2467
|
+
sendReadReceipt(event: MatrixEvent | null, receiptType?: ReceiptType, unthreaded?: boolean): Promise<{} | undefined>;
|
2468
|
+
/**
|
2469
|
+
* Set a marker to indicate the point in a room before which the user has read every
|
2470
|
+
* event. This can be retrieved from room account data (the event type is `m.fully_read`)
|
2471
|
+
* and displayed as a horizontal line in the timeline that is visually distinct to the
|
2472
|
+
* position of the user's own read receipt.
|
2473
|
+
* @param roomId - ID of the room that has been read
|
2474
|
+
* @param rmEventId - ID of the event that has been read
|
2475
|
+
* @param rrEvent - the event tracked by the read receipt. This is here for
|
2476
|
+
* convenience because the RR and the RM are commonly updated at the same time as each
|
2477
|
+
* other. The local echo of this receipt will be done if set. Optional.
|
2478
|
+
* @param rpEvent - the m.read.private read receipt event for when we don't
|
2479
|
+
* want other users to see the read receipts. This is experimental. Optional.
|
2480
|
+
* @returns Promise which resolves: the empty object, `{}`.
|
2481
|
+
*/
|
2482
|
+
setRoomReadMarkers(roomId: string, rmEventId: string, rrEvent?: MatrixEvent, rpEvent?: MatrixEvent): Promise<{}>;
|
2483
|
+
/**
|
2484
|
+
* Get a preview of the given URL as of (roughly) the given point in time,
|
2485
|
+
* described as an object with OpenGraph keys and associated values.
|
2486
|
+
* Attributes may be synthesized where actual OG metadata is lacking.
|
2487
|
+
* Caches results to prevent hammering the server.
|
2488
|
+
* @param url - The URL to get preview data for
|
2489
|
+
* @param ts - The preferred point in time that the preview should
|
2490
|
+
* describe (ms since epoch). The preview returned will either be the most
|
2491
|
+
* recent one preceding this timestamp if available, or failing that the next
|
2492
|
+
* most recent available preview.
|
2493
|
+
* @returns Promise which resolves: Object of OG metadata.
|
2494
|
+
* @returns Rejects: with an error response.
|
2495
|
+
* May return synthesized attributes if the URL lacked OG meta.
|
2496
|
+
*/
|
2497
|
+
getUrlPreview(url: string, ts: number): Promise<IPreviewUrlResponse>;
|
2498
|
+
/**
|
2499
|
+
* @returns Promise which resolves: to an empty object `{}`
|
2500
|
+
* @returns Rejects: with an error response.
|
2501
|
+
*/
|
2502
|
+
sendTyping(roomId: string, isTyping: boolean, timeoutMs: number): Promise<{}>;
|
2503
|
+
/**
|
2504
|
+
* Determines the history of room upgrades for a given room, as far as the
|
2505
|
+
* client can see. Returns an array of Rooms where the first entry is the
|
2506
|
+
* oldest and the last entry is the newest (likely current) room. If the
|
2507
|
+
* provided room is not found, this returns an empty list. This works in
|
2508
|
+
* both directions, looking for older and newer rooms of the given room.
|
2509
|
+
* @param roomId - The room ID to search from
|
2510
|
+
* @param verifyLinks - If true, the function will only return rooms
|
2511
|
+
* which can be proven to be linked. For example, rooms which have a create
|
2512
|
+
* event pointing to an old room which the client is not aware of or doesn't
|
2513
|
+
* have a matching tombstone would not be returned.
|
2514
|
+
* @param msc3946ProcessDynamicPredecessor - if true, look for
|
2515
|
+
* m.room.predecessor state events as well as create events, and prefer
|
2516
|
+
* predecessor events where they exist (MSC3946).
|
2517
|
+
* @returns An array of rooms representing the upgrade
|
2518
|
+
* history.
|
2519
|
+
*/
|
2520
|
+
getRoomUpgradeHistory(roomId: string, verifyLinks?: boolean, msc3946ProcessDynamicPredecessor?: boolean): Room[];
|
2521
|
+
private findPredecessorRooms;
|
2522
|
+
private findSuccessorRooms;
|
2523
|
+
/**
|
2524
|
+
* @param reason - Optional.
|
2525
|
+
* @returns Promise which resolves: `{}` an empty object.
|
2526
|
+
* @returns Rejects: with an error response.
|
2527
|
+
*/
|
2528
|
+
invite(roomId: string, userId: string, reason?: string): Promise<{}>;
|
2529
|
+
/**
|
2530
|
+
* Invite a user to a room based on their email address.
|
2531
|
+
* @param roomId - The room to invite the user to.
|
2532
|
+
* @param email - The email address to invite.
|
2533
|
+
* @returns Promise which resolves: `{}` an empty object.
|
2534
|
+
* @returns Rejects: with an error response.
|
2535
|
+
*/
|
2536
|
+
inviteByEmail(roomId: string, email: string): Promise<{}>;
|
2537
|
+
/**
|
2538
|
+
* Invite a user to a room based on a third-party identifier.
|
2539
|
+
* @param roomId - The room to invite the user to.
|
2540
|
+
* @param medium - The medium to invite the user e.g. "email".
|
2541
|
+
* @param address - The address for the specified medium.
|
2542
|
+
* @returns Promise which resolves: `{}` an empty object.
|
2543
|
+
* @returns Rejects: with an error response.
|
2544
|
+
*/
|
2545
|
+
inviteByThreePid(roomId: string, medium: string, address: string): Promise<{}>;
|
2546
|
+
/**
|
2547
|
+
* @returns Promise which resolves: `{}` an empty object.
|
2548
|
+
* @returns Rejects: with an error response.
|
2549
|
+
*/
|
2550
|
+
leave(roomId: string): Promise<{}>;
|
2551
|
+
/**
|
2552
|
+
* Leaves all rooms in the chain of room upgrades based on the given room. By
|
2553
|
+
* default, this will leave all the previous and upgraded rooms, including the
|
2554
|
+
* given room. To only leave the given room and any previous rooms, keeping the
|
2555
|
+
* upgraded (modern) rooms untouched supply `false` to `includeFuture`.
|
2556
|
+
* @param roomId - The room ID to start leaving at
|
2557
|
+
* @param includeFuture - If true, the whole chain (past and future) of
|
2558
|
+
* upgraded rooms will be left.
|
2559
|
+
* @returns Promise which resolves when completed with an object keyed
|
2560
|
+
* by room ID and value of the error encountered when leaving or null.
|
2561
|
+
*/
|
2562
|
+
leaveRoomChain(roomId: string, includeFuture?: boolean): Promise<{
|
2563
|
+
[roomId: string]: Error | MatrixError | null;
|
2564
|
+
}>;
|
2565
|
+
/**
|
2566
|
+
* @param reason - Optional.
|
2567
|
+
* @returns Promise which resolves: TODO
|
2568
|
+
* @returns Rejects: with an error response.
|
2569
|
+
*/
|
2570
|
+
ban(roomId: string, userId: string, reason?: string): Promise<{}>;
|
2571
|
+
/**
|
2572
|
+
* @param deleteRoom - True to delete the room from the store on success.
|
2573
|
+
* Default: true.
|
2574
|
+
* @returns Promise which resolves: `{}` an empty object.
|
2575
|
+
* @returns Rejects: with an error response.
|
2576
|
+
*/
|
2577
|
+
forget(roomId: string, deleteRoom?: boolean): Promise<{}>;
|
2578
|
+
/**
|
2579
|
+
* @returns Promise which resolves: Object (currently empty)
|
2580
|
+
* @returns Rejects: with an error response.
|
2581
|
+
*/
|
2582
|
+
unban(roomId: string, userId: string): Promise<{}>;
|
2583
|
+
/**
|
2584
|
+
* @param reason - Optional.
|
2585
|
+
* @returns Promise which resolves: `{}` an empty object.
|
2586
|
+
* @returns Rejects: with an error response.
|
2587
|
+
*/
|
2588
|
+
kick(roomId: string, userId: string, reason?: string): Promise<{}>;
|
2589
|
+
private membershipChange;
|
2590
|
+
/**
|
2591
|
+
* Obtain a dict of actions which should be performed for this event according
|
2592
|
+
* to the push rules for this user. Caches the dict on the event.
|
2593
|
+
* @param event - The event to get push actions for.
|
2594
|
+
* @param forceRecalculate - forces to recalculate actions for an event
|
2595
|
+
* Useful when an event just got decrypted
|
2596
|
+
* @returns A dict of actions to perform.
|
2597
|
+
*/
|
2598
|
+
getPushActionsForEvent(event: MatrixEvent, forceRecalculate?: boolean): IActionsObject | null;
|
2599
|
+
/**
|
2600
|
+
* Obtain a dict of actions which should be performed for this event according
|
2601
|
+
* to the push rules for this user. Caches the dict on the event.
|
2602
|
+
* @param event - The event to get push actions for.
|
2603
|
+
* @param forceRecalculate - forces to recalculate actions for an event
|
2604
|
+
* Useful when an event just got decrypted
|
2605
|
+
* @returns A dict of actions to perform.
|
2606
|
+
*/
|
2607
|
+
getPushDetailsForEvent(event: MatrixEvent, forceRecalculate?: boolean): PushDetails | null;
|
2608
|
+
/**
|
2609
|
+
* @param info - The kind of info to set (e.g. 'avatar_url')
|
2610
|
+
* @param data - The JSON object to set.
|
2611
|
+
* @returns
|
2612
|
+
* @returns Rejects: with an error response.
|
2613
|
+
*/
|
2614
|
+
setProfileInfo(info: "avatar_url", data: {
|
2615
|
+
avatar_url: string;
|
2616
|
+
}): Promise<{}>;
|
2617
|
+
setProfileInfo(info: "displayname", data: {
|
2618
|
+
displayname: string;
|
2619
|
+
}): Promise<{}>;
|
2620
|
+
/**
|
2621
|
+
* @returns Promise which resolves: `{}` an empty object.
|
2622
|
+
* @returns Rejects: with an error response.
|
2623
|
+
*/
|
2624
|
+
setDisplayName(name: string): Promise<{}>;
|
2625
|
+
/**
|
2626
|
+
* @returns Promise which resolves: `{}` an empty object.
|
2627
|
+
* @returns Rejects: with an error response.
|
2628
|
+
*/
|
2629
|
+
setAvatarUrl(url: string): Promise<{}>;
|
2630
|
+
/**
|
2631
|
+
* Turn an MXC URL into an HTTP one. <strong>This method is experimental and
|
2632
|
+
* may change.</strong>
|
2633
|
+
* @param mxcUrl - The MXC URL
|
2634
|
+
* @param width - The desired width of the thumbnail.
|
2635
|
+
* @param height - The desired height of the thumbnail.
|
2636
|
+
* @param resizeMethod - The thumbnail resize method to use, either
|
2637
|
+
* "crop" or "scale".
|
2638
|
+
* @param allowDirectLinks - If true, return any non-mxc URLs
|
2639
|
+
* directly. Fetching such URLs will leak information about the user to
|
2640
|
+
* anyone they share a room with. If false, will return null for such URLs.
|
2641
|
+
* @param allowRedirects - If true, the caller supports the URL being 307 or
|
2642
|
+
* 308 redirected to another resource upon request. If false, redirects
|
2643
|
+
* are not expected. Implied `true` when `useAuthentication` is `true`.
|
2644
|
+
* @param useAuthentication - If true, the caller supports authenticated
|
2645
|
+
* media and wants an authentication-required URL. Note that server support
|
2646
|
+
* for authenticated media will *not* be checked - it is the caller's responsibility
|
2647
|
+
* to do so before calling this function. Note also that `useAuthentication`
|
2648
|
+
* implies `allowRedirects`. Defaults to false (unauthenticated endpoints).
|
2649
|
+
* @returns the avatar URL or null.
|
2650
|
+
*/
|
2651
|
+
mxcUrlToHttp(mxcUrl: string, width?: number, height?: number, resizeMethod?: string, allowDirectLinks?: boolean, allowRedirects?: boolean, useAuthentication?: boolean): string | null;
|
2652
|
+
/**
|
2653
|
+
* Specify the set_presence value to be used for subsequent calls to the Sync API.
|
2654
|
+
* This has an advantage over calls to the PUT /presence API in that it
|
2655
|
+
* doesn't clobber status_msg set by other devices.
|
2656
|
+
* @param presence - the presence to specify to set_presence of sync calls
|
2657
|
+
*/
|
2658
|
+
setSyncPresence(presence?: SetPresence): Promise<void>;
|
2659
|
+
/**
|
2660
|
+
* @param opts - Options to apply
|
2661
|
+
* @returns Promise which resolves
|
2662
|
+
* @returns Rejects: with an error response.
|
2663
|
+
* @throws If 'presence' isn't a valid presence enum value.
|
2664
|
+
*/
|
2665
|
+
setPresence(opts: IPresenceOpts): Promise<void>;
|
2666
|
+
/**
|
2667
|
+
* @param userId - The user to get presence for
|
2668
|
+
* @returns Promise which resolves: The presence state for this user.
|
2669
|
+
* @returns Rejects: with an error response.
|
2670
|
+
*/
|
2671
|
+
getPresence(userId: string): Promise<IStatusResponse>;
|
2672
|
+
/**
|
2673
|
+
* Retrieve older messages from the given room and put them in the timeline.
|
2674
|
+
*
|
2675
|
+
* If this is called multiple times whilst a request is ongoing, the <i>same</i>
|
2676
|
+
* Promise will be returned. If there was a problem requesting scrollback, there
|
2677
|
+
* will be a small delay before another request can be made (to prevent tight-looping
|
2678
|
+
* when there is no connection).
|
2679
|
+
*
|
2680
|
+
* @param room - The room to get older messages in.
|
2681
|
+
* @param limit - Optional. The maximum number of previous events to
|
2682
|
+
* pull in. Default: 30.
|
2683
|
+
* @returns Promise which resolves: Room. If you are at the beginning
|
2684
|
+
* of the timeline, `Room.oldState.paginationToken` will be
|
2685
|
+
* `null`.
|
2686
|
+
* @returns Rejects: with an error response.
|
2687
|
+
*/
|
2688
|
+
scrollback(room: Room, limit?: number): Promise<Room>;
|
2689
|
+
getEventMapper(options?: MapperOpts): EventMapper;
|
2690
|
+
/**
|
2691
|
+
* Get an EventTimeline for the given event
|
2692
|
+
*
|
2693
|
+
* <p>If the EventTimelineSet object already has the given event in its store, the
|
2694
|
+
* corresponding timeline will be returned. Otherwise, a /context request is
|
2695
|
+
* made, and used to construct an EventTimeline.
|
2696
|
+
* If the event does not belong to this EventTimelineSet then undefined will be returned.
|
2697
|
+
*
|
2698
|
+
* @param timelineSet - The timelineSet to look for the event in, must be bound to a room
|
2699
|
+
* @param eventId - The ID of the event to look for
|
2700
|
+
*
|
2701
|
+
* @returns Promise which resolves:
|
2702
|
+
* {@link EventTimeline} including the given event
|
2703
|
+
*/
|
2704
|
+
getEventTimeline(timelineSet: EventTimelineSet, eventId: string): Promise<Optional<EventTimeline>>;
|
2705
|
+
getThreadTimeline(timelineSet: EventTimelineSet, eventId: string): Promise<EventTimeline | undefined>;
|
2706
|
+
/**
|
2707
|
+
* Get an EventTimeline for the latest events in the room. This will just
|
2708
|
+
* call `/messages` to get the latest message in the room, then use
|
2709
|
+
* `client.getEventTimeline(...)` to construct a new timeline from it.
|
2710
|
+
*
|
2711
|
+
* @param timelineSet - The timelineSet to find or add the timeline to
|
2712
|
+
*
|
2713
|
+
* @returns Promise which resolves:
|
2714
|
+
* {@link EventTimeline} timeline with the latest events in the room
|
2715
|
+
*/
|
2716
|
+
getLatestTimeline(timelineSet: EventTimelineSet): Promise<Optional<EventTimeline>>;
|
2717
|
+
/**
|
2718
|
+
* Makes a request to /messages with the appropriate lazy loading filter set.
|
2719
|
+
* XXX: if we do get rid of scrollback (as it's not used at the moment),
|
2720
|
+
* we could inline this method again in paginateEventTimeline as that would
|
2721
|
+
* then be the only call-site
|
2722
|
+
* @param limit - the maximum amount of events the retrieve
|
2723
|
+
* @param dir - 'f' or 'b'
|
2724
|
+
* @param timelineFilter - the timeline filter to pass
|
2725
|
+
*/
|
2726
|
+
createMessagesRequest(roomId: string, fromToken: string | null, limit: number | undefined, dir: Direction, timelineFilter?: Filter): Promise<IMessagesResponse>;
|
2727
|
+
/**
|
2728
|
+
* Makes a request to /messages with the appropriate lazy loading filter set.
|
2729
|
+
* XXX: if we do get rid of scrollback (as it's not used at the moment),
|
2730
|
+
* we could inline this method again in paginateEventTimeline as that would
|
2731
|
+
* then be the only call-site
|
2732
|
+
* @param limit - the maximum amount of events the retrieve
|
2733
|
+
* @param dir - 'f' or 'b'
|
2734
|
+
* @param timelineFilter - the timeline filter to pass
|
2735
|
+
*/
|
2736
|
+
createThreadListMessagesRequest(roomId: string, fromToken: string | null, limit?: number, dir?: Direction, threadListType?: ThreadFilterType | null, timelineFilter?: Filter): Promise<IMessagesResponse>;
|
2737
|
+
/**
|
2738
|
+
* Take an EventTimeline, and back/forward-fill results.
|
2739
|
+
*
|
2740
|
+
* @param eventTimeline - timeline object to be updated
|
2741
|
+
*
|
2742
|
+
* @returns Promise which resolves to a boolean: false if there are no
|
2743
|
+
* events and we reached either end of the timeline; else true.
|
2744
|
+
*/
|
2745
|
+
paginateEventTimeline(eventTimeline: EventTimeline, opts: IPaginateOpts): Promise<boolean>;
|
2746
|
+
/**
|
2747
|
+
* Reset the notifTimelineSet entirely, paginating in some historical notifs as
|
2748
|
+
* a starting point for subsequent pagination.
|
2749
|
+
*/
|
2750
|
+
resetNotifTimelineSet(): void;
|
2751
|
+
/**
|
2752
|
+
* Peek into a room and receive updates about the room. This only works if the
|
2753
|
+
* history visibility for the room is world_readable.
|
2754
|
+
* @param roomId - The room to attempt to peek into.
|
2755
|
+
* @param limit - The number of timeline events to initially retrieve.
|
2756
|
+
* @returns Promise which resolves: Room object
|
2757
|
+
* @returns Rejects: with an error response.
|
2758
|
+
*/
|
2759
|
+
peekInRoom(roomId: string, limit?: number): Promise<Room>;
|
2760
|
+
/**
|
2761
|
+
* Stop any ongoing room peeking.
|
2762
|
+
*/
|
2763
|
+
stopPeeking(): void;
|
2764
|
+
/**
|
2765
|
+
* Set r/w flags for guest access in a room.
|
2766
|
+
* @param roomId - The room to configure guest access in.
|
2767
|
+
* @param opts - Options
|
2768
|
+
* @returns Promise which resolves
|
2769
|
+
* @returns Rejects: with an error response.
|
2770
|
+
*/
|
2771
|
+
setGuestAccess(roomId: string, opts: IGuestAccessOpts): Promise<void>;
|
2772
|
+
/**
|
2773
|
+
* Requests an email verification token for the purposes of registration.
|
2774
|
+
* This API requests a token from the homeserver.
|
2775
|
+
* The doesServerRequireIdServerParam() method can be used to determine if
|
2776
|
+
* the server requires the id_server parameter to be provided.
|
2777
|
+
*
|
2778
|
+
* Parameters and return value are as for requestEmailToken
|
2779
|
+
|
2780
|
+
* @param email - As requestEmailToken
|
2781
|
+
* @param clientSecret - As requestEmailToken
|
2782
|
+
* @param sendAttempt - As requestEmailToken
|
2783
|
+
* @param nextLink - As requestEmailToken
|
2784
|
+
* @returns Promise which resolves: As requestEmailToken
|
2785
|
+
*/
|
2786
|
+
requestRegisterEmailToken(email: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestTokenResponse>;
|
2787
|
+
/**
|
2788
|
+
* Requests a text message verification token for the purposes of registration.
|
2789
|
+
* This API requests a token from the homeserver.
|
2790
|
+
* The doesServerRequireIdServerParam() method can be used to determine if
|
2791
|
+
* the server requires the id_server parameter to be provided.
|
2792
|
+
*
|
2793
|
+
* @param phoneCountry - The ISO 3166-1 alpha-2 code for the country in which
|
2794
|
+
* phoneNumber should be parsed relative to.
|
2795
|
+
* @param phoneNumber - The phone number, in national or international format
|
2796
|
+
* @param clientSecret - As requestEmailToken
|
2797
|
+
* @param sendAttempt - As requestEmailToken
|
2798
|
+
* @param nextLink - As requestEmailToken
|
2799
|
+
* @returns Promise which resolves: As requestEmailToken
|
2800
|
+
*/
|
2801
|
+
requestRegisterMsisdnToken(phoneCountry: string, phoneNumber: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestMsisdnTokenResponse>;
|
2802
|
+
/**
|
2803
|
+
* Requests an email verification token for the purposes of adding a
|
2804
|
+
* third party identifier to an account.
|
2805
|
+
* This API requests a token from the homeserver.
|
2806
|
+
* The doesServerRequireIdServerParam() method can be used to determine if
|
2807
|
+
* the server requires the id_server parameter to be provided.
|
2808
|
+
* If an account with the given email address already exists and is
|
2809
|
+
* associated with an account other than the one the user is authed as,
|
2810
|
+
* it will either send an email to the address informing them of this
|
2811
|
+
* or return M_THREEPID_IN_USE (which one is up to the homeserver).
|
2812
|
+
*
|
2813
|
+
* @param email - As requestEmailToken
|
2814
|
+
* @param clientSecret - As requestEmailToken
|
2815
|
+
* @param sendAttempt - As requestEmailToken
|
2816
|
+
* @param nextLink - As requestEmailToken
|
2817
|
+
* @returns Promise which resolves: As requestEmailToken
|
2818
|
+
*/
|
2819
|
+
requestAdd3pidEmailToken(email: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestTokenResponse>;
|
2820
|
+
/**
|
2821
|
+
* Requests a text message verification token for the purposes of adding a
|
2822
|
+
* third party identifier to an account.
|
2823
|
+
* This API proxies the identity server /validate/email/requestToken API,
|
2824
|
+
* adding specific behaviour for the addition of phone numbers to an
|
2825
|
+
* account, as requestAdd3pidEmailToken.
|
2826
|
+
*
|
2827
|
+
* @param phoneCountry - As requestRegisterMsisdnToken
|
2828
|
+
* @param phoneNumber - As requestRegisterMsisdnToken
|
2829
|
+
* @param clientSecret - As requestEmailToken
|
2830
|
+
* @param sendAttempt - As requestEmailToken
|
2831
|
+
* @param nextLink - As requestEmailToken
|
2832
|
+
* @returns Promise which resolves: As requestEmailToken
|
2833
|
+
*/
|
2834
|
+
requestAdd3pidMsisdnToken(phoneCountry: string, phoneNumber: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestMsisdnTokenResponse>;
|
2835
|
+
/**
|
2836
|
+
* Requests an email verification token for the purposes of resetting
|
2837
|
+
* the password on an account.
|
2838
|
+
* This API proxies the identity server /validate/email/requestToken API,
|
2839
|
+
* adding specific behaviour for the password resetting. Specifically,
|
2840
|
+
* if no account with the given email address exists, it may either
|
2841
|
+
* return M_THREEPID_NOT_FOUND or send an email
|
2842
|
+
* to the address informing them of this (which one is up to the homeserver).
|
2843
|
+
*
|
2844
|
+
* requestEmailToken calls the equivalent API directly on the identity server,
|
2845
|
+
* therefore bypassing the password reset specific logic.
|
2846
|
+
*
|
2847
|
+
* @param email - As requestEmailToken
|
2848
|
+
* @param clientSecret - As requestEmailToken
|
2849
|
+
* @param sendAttempt - As requestEmailToken
|
2850
|
+
* @param nextLink - As requestEmailToken
|
2851
|
+
* @returns Promise which resolves: As requestEmailToken
|
2852
|
+
*/
|
2853
|
+
requestPasswordEmailToken(email: string, clientSecret: string, sendAttempt: number, nextLink?: string): Promise<IRequestTokenResponse>;
|
2854
|
+
/**
|
2855
|
+
* Requests a text message verification token for the purposes of resetting
|
2856
|
+
* the password on an account.
|
2857
|
+
* This API proxies the identity server /validate/email/requestToken API,
|
2858
|
+
* adding specific behaviour for the password resetting, as requestPasswordEmailToken.
|
2859
|
+
*
|
2860
|
+
* @param phoneCountry - As requestRegisterMsisdnToken
|
2861
|
+
* @param phoneNumber - As requestRegisterMsisdnToken
|
2862
|
+
* @param clientSecret - As requestEmailToken
|
2863
|
+
* @param sendAttempt - As requestEmailToken
|
2864
|
+
* @param nextLink - As requestEmailToken
|
2865
|
+
* @returns Promise which resolves: As requestEmailToken
|
2866
|
+
*/
|
2867
|
+
requestPasswordMsisdnToken(phoneCountry: string, phoneNumber: string, clientSecret: string, sendAttempt: number, nextLink: string): Promise<IRequestMsisdnTokenResponse>;
|
2868
|
+
/**
|
2869
|
+
* Internal utility function for requesting validation tokens from usage-specific
|
2870
|
+
* requestToken endpoints.
|
2871
|
+
*
|
2872
|
+
* @param endpoint - The endpoint to send the request to
|
2873
|
+
* @param params - Parameters for the POST request
|
2874
|
+
* @returns Promise which resolves: As requestEmailToken
|
2875
|
+
*/
|
2876
|
+
private requestTokenFromEndpoint;
|
2877
|
+
/**
|
2878
|
+
* Get the room-kind push rule associated with a room.
|
2879
|
+
* @param scope - "global" or device-specific.
|
2880
|
+
* @param roomId - the id of the room.
|
2881
|
+
* @returns the rule or undefined.
|
2882
|
+
*/
|
2883
|
+
getRoomPushRule(scope: "global" | "device", roomId: string): IPushRule | undefined;
|
2884
|
+
/**
|
2885
|
+
* Set a room-kind muting push rule in a room.
|
2886
|
+
* The operation also updates MatrixClient.pushRules at the end.
|
2887
|
+
* @param scope - "global" or device-specific.
|
2888
|
+
* @param roomId - the id of the room.
|
2889
|
+
* @param mute - the mute state.
|
2890
|
+
* @returns Promise which resolves: result object
|
2891
|
+
* @returns Rejects: with an error response.
|
2892
|
+
*/
|
2893
|
+
setRoomMutePushRule(scope: "global" | "device", roomId: string, mute: boolean): Promise<void> | undefined;
|
2894
|
+
searchMessageText(opts: ISearchOpts): Promise<ISearchResponse>;
|
2895
|
+
/**
|
2896
|
+
* Perform a server-side search for room events.
|
2897
|
+
*
|
2898
|
+
* The returned promise resolves to an object containing the fields:
|
2899
|
+
*
|
2900
|
+
* * count: estimate of the number of results
|
2901
|
+
* * next_batch: token for back-pagination; if undefined, there are no more results
|
2902
|
+
* * highlights: a list of words to highlight from the stemming algorithm
|
2903
|
+
* * results: a list of results
|
2904
|
+
*
|
2905
|
+
* Each entry in the results list is a SearchResult.
|
2906
|
+
*
|
2907
|
+
* @returns Promise which resolves: result object
|
2908
|
+
* @returns Rejects: with an error response.
|
2909
|
+
*/
|
2910
|
+
searchRoomEvents(opts: IEventSearchOpts): Promise<ISearchResults>;
|
2911
|
+
/**
|
2912
|
+
* Take a result from an earlier searchRoomEvents call, and backfill results.
|
2913
|
+
*
|
2914
|
+
* @param searchResults - the results object to be updated
|
2915
|
+
* @returns Promise which resolves: updated result object
|
2916
|
+
* @returns Rejects: with an error response.
|
2917
|
+
*/
|
2918
|
+
backPaginateRoomEventsSearch<T extends ISearchResults>(searchResults: T): Promise<T>;
|
2919
|
+
/**
|
2920
|
+
* helper for searchRoomEvents and backPaginateRoomEventsSearch. Processes the
|
2921
|
+
* response from the API call and updates the searchResults
|
2922
|
+
*
|
2923
|
+
* @returns searchResults
|
2924
|
+
* @internal
|
2925
|
+
*/
|
2926
|
+
processRoomEventsSearch<T extends ISearchResults>(searchResults: T, response: ISearchResponse): T;
|
2927
|
+
/**
|
2928
|
+
* Populate the store with rooms the user has left.
|
2929
|
+
* @returns Promise which resolves: TODO - Resolved when the rooms have
|
2930
|
+
* been added to the data store.
|
2931
|
+
* @returns Rejects: with an error response.
|
2932
|
+
*/
|
2933
|
+
syncLeftRooms(): Promise<Room[]>;
|
2934
|
+
/**
|
2935
|
+
* Create a new filter.
|
2936
|
+
* @param content - The HTTP body for the request
|
2937
|
+
* @returns Promise which resolves to a Filter object.
|
2938
|
+
* @returns Rejects: with an error response.
|
2939
|
+
*/
|
2940
|
+
createFilter(content: IFilterDefinition): Promise<Filter>;
|
2941
|
+
/**
|
2942
|
+
* Retrieve a filter.
|
2943
|
+
* @param userId - The user ID of the filter owner
|
2944
|
+
* @param filterId - The filter ID to retrieve
|
2945
|
+
* @param allowCached - True to allow cached filters to be returned.
|
2946
|
+
* Default: True.
|
2947
|
+
* @returns Promise which resolves: a Filter object
|
2948
|
+
* @returns Rejects: with an error response.
|
2949
|
+
*/
|
2950
|
+
getFilter(userId: string, filterId: string, allowCached: boolean): Promise<Filter>;
|
2951
|
+
/**
|
2952
|
+
* @returns Filter ID
|
2953
|
+
*/
|
2954
|
+
getOrCreateFilter(filterName: string, filter: Filter): Promise<string>;
|
2955
|
+
/**
|
2956
|
+
* Gets a bearer token from the homeserver that the user can
|
2957
|
+
* present to a third party in order to prove their ownership
|
2958
|
+
* of the Matrix account they are logged into.
|
2959
|
+
* @returns Promise which resolves: Token object
|
2960
|
+
* @returns Rejects: with an error response.
|
2961
|
+
*/
|
2962
|
+
getOpenIdToken(): Promise<IOpenIDToken>;
|
2963
|
+
private startCallEventHandler;
|
2964
|
+
private startMatrixRTC;
|
2965
|
+
/**
|
2966
|
+
* Once the client has been initialised, we want to clear notifications we
|
2967
|
+
* know for a fact should be here.
|
2968
|
+
* This issue should also be addressed on synapse's side and is tracked as part
|
2969
|
+
* of https://github.com/matrix-org/synapse/issues/14837
|
2970
|
+
*
|
2971
|
+
* We consider a room or a thread as fully read if the current user has sent
|
2972
|
+
* the last event in the live timeline of that context and if the read receipt
|
2973
|
+
* we have on record matches.
|
2974
|
+
*/
|
2975
|
+
private fixupRoomNotifications;
|
2976
|
+
/**
|
2977
|
+
* @returns Promise which resolves: ITurnServerResponse object
|
2978
|
+
* @returns Rejects: with an error response.
|
2979
|
+
*/
|
2980
|
+
turnServer(): Promise<ITurnServerResponse>;
|
2981
|
+
/**
|
2982
|
+
* Get the TURN servers for this homeserver.
|
2983
|
+
* @returns The servers or an empty list.
|
2984
|
+
*/
|
2985
|
+
getTurnServers(): ITurnServer[];
|
2986
|
+
/**
|
2987
|
+
* Get the unix timestamp (in milliseconds) at which the current
|
2988
|
+
* TURN credentials (from getTurnServers) expire
|
2989
|
+
* @returns The expiry timestamp in milliseconds
|
2990
|
+
*/
|
2991
|
+
getTurnServersExpiry(): number;
|
2992
|
+
get pollingTurnServers(): boolean;
|
2993
|
+
checkTurnServers(): Promise<boolean | undefined>;
|
2994
|
+
/**
|
2995
|
+
* Set whether to allow a fallback ICE server should be used for negotiating a
|
2996
|
+
* WebRTC connection if the homeserver doesn't provide any servers. Defaults to
|
2997
|
+
* false.
|
2998
|
+
*
|
2999
|
+
*/
|
3000
|
+
setFallbackICEServerAllowed(allow: boolean): void;
|
3001
|
+
/**
|
3002
|
+
* Get whether to allow a fallback ICE server should be used for negotiating a
|
3003
|
+
* WebRTC connection if the homeserver doesn't provide any servers. Defaults to
|
3004
|
+
* false.
|
3005
|
+
*
|
3006
|
+
* @returns
|
3007
|
+
*/
|
3008
|
+
isFallbackICEServerAllowed(): boolean;
|
3009
|
+
/**
|
3010
|
+
* Determines if the current user is an administrator of the Synapse homeserver.
|
3011
|
+
* Returns false if untrue or the homeserver does not appear to be a Synapse
|
3012
|
+
* homeserver. <strong>This function is implementation specific and may change
|
3013
|
+
* as a result.</strong>
|
3014
|
+
* @returns true if the user appears to be a Synapse administrator.
|
3015
|
+
*/
|
3016
|
+
isSynapseAdministrator(): Promise<boolean>;
|
3017
|
+
/**
|
3018
|
+
* Performs a whois lookup on a user using Synapse's administrator API.
|
3019
|
+
* <strong>This function is implementation specific and may change as a
|
3020
|
+
* result.</strong>
|
3021
|
+
* @param userId - the User ID to look up.
|
3022
|
+
* @returns the whois response - see Synapse docs for information.
|
3023
|
+
*/
|
3024
|
+
whoisSynapseUser(userId: string): Promise<ISynapseAdminWhoisResponse>;
|
3025
|
+
/**
|
3026
|
+
* Deactivates a user using Synapse's administrator API. <strong>This
|
3027
|
+
* function is implementation specific and may change as a result.</strong>
|
3028
|
+
* @param userId - the User ID to deactivate.
|
3029
|
+
* @returns the deactivate response - see Synapse docs for information.
|
3030
|
+
*/
|
3031
|
+
deactivateSynapseUser(userId: string): Promise<ISynapseAdminDeactivateResponse>;
|
3032
|
+
protected fetchClientWellKnown(): Promise<void>;
|
3033
|
+
getClientWellKnown(): IClientWellKnown | undefined;
|
3034
|
+
waitForClientWellKnown(): Promise<IClientWellKnown>;
|
3035
|
+
/**
|
3036
|
+
* store client options with boolean/string/numeric values
|
3037
|
+
* to know in the next session what flags the sync data was
|
3038
|
+
* created with (e.g. lazy loading)
|
3039
|
+
* @returns for store operation
|
3040
|
+
*/
|
3041
|
+
storeClientOptions(): Promise<void>;
|
3042
|
+
/**
|
3043
|
+
* Gets a set of room IDs in common with another user.
|
3044
|
+
*
|
3045
|
+
* Note: This endpoint is unstable, and can throw an `Error`.
|
3046
|
+
* Check progress on [MSC2666](https://github.com/matrix-org/matrix-spec-proposals/pull/2666) for more details.
|
3047
|
+
*
|
3048
|
+
* @param userId - The userId to check.
|
3049
|
+
* @returns Promise which resolves to an array of rooms
|
3050
|
+
* @returns Rejects: with an error response.
|
3051
|
+
*/
|
3052
|
+
_unstable_getSharedRooms(userId: string): Promise<string[]>;
|
3053
|
+
/**
|
3054
|
+
* Get the API versions supported by the server, along with any
|
3055
|
+
* unstable APIs it supports
|
3056
|
+
* @returns The server /versions response
|
3057
|
+
*/
|
3058
|
+
getVersions(): Promise<IServerVersions>;
|
3059
|
+
/**
|
3060
|
+
* Check if a particular spec version is supported by the server.
|
3061
|
+
* @param version - The spec version (such as "r0.5.0") to check for.
|
3062
|
+
* @returns Whether it is supported
|
3063
|
+
*/
|
3064
|
+
isVersionSupported(version: string): Promise<boolean>;
|
3065
|
+
/**
|
3066
|
+
* Query the server to see if it lists support for an unstable feature
|
3067
|
+
* in the /versions response
|
3068
|
+
* @param feature - the feature name
|
3069
|
+
* @returns true if the feature is supported
|
3070
|
+
*/
|
3071
|
+
doesServerSupportUnstableFeature(feature: string): Promise<boolean>;
|
3072
|
+
/**
|
3073
|
+
* Query the server to see if it is forcing encryption to be enabled for
|
3074
|
+
* a given room preset, based on the /versions response.
|
3075
|
+
* @param presetName - The name of the preset to check.
|
3076
|
+
* @returns true if the server is forcing encryption
|
3077
|
+
* for the preset.
|
3078
|
+
*/
|
3079
|
+
doesServerForceEncryptionForPreset(presetName: Preset): Promise<boolean>;
|
3080
|
+
doesServerSupportThread(): Promise<{
|
3081
|
+
threads: FeatureSupport;
|
3082
|
+
list: FeatureSupport;
|
3083
|
+
fwdPagination: FeatureSupport;
|
3084
|
+
}>;
|
3085
|
+
/**
|
3086
|
+
* Get if lazy loading members is being used.
|
3087
|
+
* @returns Whether or not members are lazy loaded by this client
|
3088
|
+
*/
|
3089
|
+
hasLazyLoadMembersEnabled(): boolean;
|
3090
|
+
/**
|
3091
|
+
* Set a function which is called when /sync returns a 'limited' response.
|
3092
|
+
* It is called with a room ID and returns a boolean. It should return 'true' if the SDK
|
3093
|
+
* can SAFELY remove events from this room. It may not be safe to remove events if there
|
3094
|
+
* are other references to the timelines for this room, e.g because the client is
|
3095
|
+
* actively viewing events in this room.
|
3096
|
+
* Default: returns false.
|
3097
|
+
* @param cb - The callback which will be invoked.
|
3098
|
+
*/
|
3099
|
+
setCanResetTimelineCallback(cb: ResetTimelineCallback): void;
|
3100
|
+
/**
|
3101
|
+
* Get the callback set via `setCanResetTimelineCallback`.
|
3102
|
+
* @returns The callback or null
|
3103
|
+
*/
|
3104
|
+
getCanResetTimelineCallback(): ResetTimelineCallback | undefined;
|
3105
|
+
/**
|
3106
|
+
* Returns relations for a given event. Handles encryption transparently,
|
3107
|
+
* with the caveat that the amount of events returned might be 0, even though you get a nextBatch.
|
3108
|
+
* When the returned promise resolves, all messages should have finished trying to decrypt.
|
3109
|
+
* @param roomId - the room of the event
|
3110
|
+
* @param eventId - the id of the event
|
3111
|
+
* @param relationType - the rel_type of the relations requested
|
3112
|
+
* @param eventType - the event type of the relations requested
|
3113
|
+
* @param opts - options with optional values for the request.
|
3114
|
+
* @returns an object with `events` as `MatrixEvent[]` and optionally `nextBatch` if more relations are available.
|
3115
|
+
*/
|
3116
|
+
relations(roomId: string, eventId: string, relationType: RelationType | string | null, eventType?: EventType | string | null, opts?: IRelationsRequestOpts): Promise<{
|
3117
|
+
originalEvent?: MatrixEvent | null;
|
3118
|
+
events: MatrixEvent[];
|
3119
|
+
nextBatch?: string | null;
|
3120
|
+
prevBatch?: string | null;
|
3121
|
+
}>;
|
3122
|
+
/**
|
3123
|
+
* The app may wish to see if we have a key cached without
|
3124
|
+
* triggering a user interaction.
|
3125
|
+
*
|
3126
|
+
* @deprecated Not supported for Rust Cryptography.
|
3127
|
+
*/
|
3128
|
+
getCrossSigningCacheCallbacks(): ICacheCallbacks | undefined;
|
3129
|
+
/**
|
3130
|
+
* Generates a random string suitable for use as a client secret. <strong>This
|
3131
|
+
* method is experimental and may change.</strong>
|
3132
|
+
* @returns A new client secret
|
3133
|
+
*/
|
3134
|
+
generateClientSecret(): string;
|
3135
|
+
/**
|
3136
|
+
* Attempts to decrypt an event
|
3137
|
+
* @param event - The event to decrypt
|
3138
|
+
* @returns A decryption promise
|
3139
|
+
*/
|
3140
|
+
decryptEventIfNeeded(event: MatrixEvent, options?: IDecryptOptions): Promise<void>;
|
3141
|
+
private termsUrlForService;
|
3142
|
+
/**
|
3143
|
+
* Get the Homeserver URL of this client
|
3144
|
+
* @returns Homeserver URL of this client
|
3145
|
+
*/
|
3146
|
+
getHomeserverUrl(): string;
|
3147
|
+
/**
|
3148
|
+
* Get the identity server URL of this client
|
3149
|
+
* @param stripProto - whether or not to strip the protocol from the URL
|
3150
|
+
* @returns Identity server URL of this client
|
3151
|
+
*/
|
3152
|
+
getIdentityServerUrl(stripProto?: boolean): string | undefined;
|
3153
|
+
/**
|
3154
|
+
* Set the identity server URL of this client
|
3155
|
+
* @param url - New identity server URL
|
3156
|
+
*/
|
3157
|
+
setIdentityServerUrl(url?: string): void;
|
3158
|
+
/**
|
3159
|
+
* Get the access token associated with this account.
|
3160
|
+
* @returns The access_token or null
|
3161
|
+
*/
|
3162
|
+
getAccessToken(): string | null;
|
3163
|
+
/**
|
3164
|
+
* Get the refresh token associated with this account.
|
3165
|
+
* @returns The refresh_token or null
|
3166
|
+
*/
|
3167
|
+
getRefreshToken(): string | null;
|
3168
|
+
/**
|
3169
|
+
* Set the access token associated with this account.
|
3170
|
+
* @param token - The new access token.
|
3171
|
+
*/
|
3172
|
+
setAccessToken(token: string): void;
|
3173
|
+
/**
|
3174
|
+
* @returns true if there is a valid access_token for this client.
|
3175
|
+
*/
|
3176
|
+
isLoggedIn(): boolean;
|
3177
|
+
/**
|
3178
|
+
* Make up a new transaction id
|
3179
|
+
*
|
3180
|
+
* @returns a new, unique, transaction id
|
3181
|
+
*/
|
3182
|
+
makeTxnId(): string;
|
3183
|
+
/**
|
3184
|
+
* Check whether a username is available prior to registration. An error response
|
3185
|
+
* indicates an invalid/unavailable username.
|
3186
|
+
* @param username - The username to check the availability of.
|
3187
|
+
* @returns Promise which resolves: to boolean of whether the username is available.
|
3188
|
+
*/
|
3189
|
+
isUsernameAvailable(username: string): Promise<boolean>;
|
3190
|
+
/**
|
3191
|
+
* @param bindThreepids - Set key 'email' to true to bind any email
|
3192
|
+
* threepid uses during registration in the identity server. Set 'msisdn' to
|
3193
|
+
* true to bind msisdn.
|
3194
|
+
* @returns Promise which resolves to a RegisterResponse object
|
3195
|
+
* @returns Rejects: with an error response.
|
3196
|
+
*/
|
3197
|
+
register(username: string, password: string, sessionId: string | null, auth: {
|
3198
|
+
session?: string;
|
3199
|
+
type: string;
|
3200
|
+
}, bindThreepids?: {
|
3201
|
+
email?: boolean;
|
3202
|
+
msisdn?: boolean;
|
3203
|
+
}, guestAccessToken?: string, inhibitLogin?: boolean): Promise<RegisterResponse>;
|
3204
|
+
/**
|
3205
|
+
* Register a guest account.
|
3206
|
+
* This method returns the auth info needed to create a new authenticated client,
|
3207
|
+
* Remember to call `setGuest(true)` on the (guest-)authenticated client, e.g:
|
3208
|
+
* ```javascript
|
3209
|
+
* const tmpClient = await sdk.createClient(MATRIX_INSTANCE);
|
3210
|
+
* const { user_id, device_id, access_token } = tmpClient.registerGuest();
|
3211
|
+
* const client = createClient({
|
3212
|
+
* baseUrl: MATRIX_INSTANCE,
|
3213
|
+
* accessToken: access_token,
|
3214
|
+
* userId: user_id,
|
3215
|
+
* deviceId: device_id,
|
3216
|
+
* })
|
3217
|
+
* client.setGuest(true);
|
3218
|
+
* ```
|
3219
|
+
*
|
3220
|
+
* @param body - JSON HTTP body to provide.
|
3221
|
+
* @returns Promise which resolves: JSON object that contains:
|
3222
|
+
* `{ user_id, device_id, access_token, home_server }`
|
3223
|
+
* @returns Rejects: with an error response.
|
3224
|
+
*/
|
3225
|
+
registerGuest({ body }?: {
|
3226
|
+
body?: RegisterRequest;
|
3227
|
+
}): Promise<RegisterResponse>;
|
3228
|
+
/**
|
3229
|
+
* @param data - parameters for registration request
|
3230
|
+
* @param kind - type of user to register. may be "guest"
|
3231
|
+
* @returns Promise which resolves: to the /register response
|
3232
|
+
* @returns Rejects: with an error response.
|
3233
|
+
*/
|
3234
|
+
registerRequest(data: RegisterRequest, kind?: string): Promise<RegisterResponse>;
|
3235
|
+
/**
|
3236
|
+
* Refreshes an access token using a provided refresh token. The refresh token
|
3237
|
+
* must be valid for the current access token known to the client instance.
|
3238
|
+
*
|
3239
|
+
* Note that this function will not cause a logout if the token is deemed
|
3240
|
+
* unknown by the server - the caller is responsible for managing logout
|
3241
|
+
* actions on error.
|
3242
|
+
* @param refreshToken - The refresh token.
|
3243
|
+
* @returns Promise which resolves to the new token.
|
3244
|
+
* @returns Rejects with an error response.
|
3245
|
+
*/
|
3246
|
+
refreshToken(refreshToken: string): Promise<IRefreshTokenResponse>;
|
3247
|
+
/**
|
3248
|
+
* @returns Promise which resolves to the available login flows
|
3249
|
+
* @returns Rejects: with an error response.
|
3250
|
+
*/
|
3251
|
+
loginFlows(): Promise<ILoginFlowsResponse>;
|
3252
|
+
/**
|
3253
|
+
* @returns Promise which resolves to a LoginResponse object
|
3254
|
+
* @returns Rejects: with an error response.
|
3255
|
+
*/
|
3256
|
+
login(loginType: LoginRequest["type"], data: Omit<LoginRequest, "type">): Promise<LoginResponse>;
|
3257
|
+
/**
|
3258
|
+
* @returns Promise which resolves to a LoginResponse object
|
3259
|
+
* @returns Rejects: with an error response.
|
3260
|
+
*/
|
3261
|
+
loginWithPassword(user: string, password: string): Promise<LoginResponse>;
|
3262
|
+
/**
|
3263
|
+
* @param redirectUrl - The URL to redirect to after the HS
|
3264
|
+
* authenticates with CAS.
|
3265
|
+
* @returns The HS URL to hit to begin the CAS login process.
|
3266
|
+
*/
|
3267
|
+
getCasLoginUrl(redirectUrl: string): string;
|
3268
|
+
/**
|
3269
|
+
* @param redirectUrl - The URL to redirect to after the HS
|
3270
|
+
* authenticates with the SSO.
|
3271
|
+
* @param loginType - The type of SSO login we are doing (sso or cas).
|
3272
|
+
* Defaults to 'sso'.
|
3273
|
+
* @param idpId - The ID of the Identity Provider being targeted, optional.
|
3274
|
+
* @param action - the SSO flow to indicate to the IdP, optional.
|
3275
|
+
* @returns The HS URL to hit to begin the SSO login process.
|
3276
|
+
*/
|
3277
|
+
getSsoLoginUrl(redirectUrl: string, loginType?: string, idpId?: string, action?: SSOAction): string;
|
3278
|
+
/**
|
3279
|
+
* @param token - Login token previously received from homeserver
|
3280
|
+
* @returns Promise which resolves to a LoginResponse object
|
3281
|
+
* @returns Rejects: with an error response.
|
3282
|
+
*/
|
3283
|
+
loginWithToken(token: string): Promise<LoginResponse>;
|
3284
|
+
/**
|
3285
|
+
* Logs out the current session.
|
3286
|
+
* Obviously, further calls that require authorisation should fail after this
|
3287
|
+
* method is called. The state of the MatrixClient object is not affected:
|
3288
|
+
* it is up to the caller to either reset or destroy the MatrixClient after
|
3289
|
+
* this method succeeds.
|
3290
|
+
* @param stopClient - whether to stop the client before calling /logout to prevent invalid token errors.
|
3291
|
+
* @returns Promise which resolves: On success, the empty object `{}`
|
3292
|
+
*/
|
3293
|
+
logout(stopClient?: boolean): Promise<{}>;
|
3294
|
+
/**
|
3295
|
+
* Deactivates the logged-in account.
|
3296
|
+
* Obviously, further calls that require authorisation should fail after this
|
3297
|
+
* method is called. The state of the MatrixClient object is not affected:
|
3298
|
+
* it is up to the caller to either reset or destroy the MatrixClient after
|
3299
|
+
* this method succeeds.
|
3300
|
+
* @param auth - Optional. Auth data to supply for User-Interactive auth.
|
3301
|
+
* @param erase - Optional. If set, send as `erase` attribute in the
|
3302
|
+
* JSON request body, indicating whether the account should be erased. Defaults
|
3303
|
+
* to false.
|
3304
|
+
* @returns Promise which resolves: On success, the empty object
|
3305
|
+
*/
|
3306
|
+
deactivateAccount(auth?: AuthDict, erase?: boolean): Promise<{
|
3307
|
+
id_server_unbind_result: IdServerUnbindResult;
|
3308
|
+
}>;
|
3309
|
+
/**
|
3310
|
+
* Make a request for an `m.login.token` to be issued as per
|
3311
|
+
* https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv1loginget_token
|
3312
|
+
*
|
3313
|
+
* The server may require User-Interactive auth.
|
3314
|
+
*
|
3315
|
+
* @param auth - Optional. Auth data to supply for User-Interactive auth.
|
3316
|
+
* @returns Promise which resolves: On success, the token response
|
3317
|
+
* or UIA auth data.
|
3318
|
+
*/
|
3319
|
+
requestLoginToken(auth?: AuthDict): Promise<UIAResponse<LoginTokenPostResponse>>;
|
3320
|
+
/**
|
3321
|
+
* Get the fallback URL to use for unknown interactive-auth stages.
|
3322
|
+
*
|
3323
|
+
* @param loginType - the type of stage being attempted
|
3324
|
+
* @param authSessionId - the auth session ID provided by the homeserver
|
3325
|
+
*
|
3326
|
+
* @returns HS URL to hit to for the fallback interface
|
3327
|
+
*/
|
3328
|
+
getFallbackAuthUrl(loginType: string, authSessionId: string): string;
|
3329
|
+
/**
|
3330
|
+
* Create a new room.
|
3331
|
+
* @param options - a list of options to pass to the /createRoom API.
|
3332
|
+
* @returns Promise which resolves: `{room_id: {string}}`
|
3333
|
+
* @returns Rejects: with an error response.
|
3334
|
+
*/
|
3335
|
+
createRoom(options: ICreateRoomOpts): Promise<{
|
3336
|
+
room_id: string;
|
3337
|
+
}>;
|
3338
|
+
/**
|
3339
|
+
* Fetches relations for a given event
|
3340
|
+
* @param roomId - the room of the event
|
3341
|
+
* @param eventId - the id of the event
|
3342
|
+
* @param relationType - the rel_type of the relations requested
|
3343
|
+
* @param eventType - the event type of the relations requested
|
3344
|
+
* @param opts - options with optional values for the request.
|
3345
|
+
* @returns the response, with chunk, prev_batch and, next_batch.
|
3346
|
+
*/
|
3347
|
+
fetchRelations(roomId: string, eventId: string, relationType: RelationType | string | null, eventType?: EventType | string | null, opts?: IRelationsRequestOpts): Promise<IRelationsResponse>;
|
3348
|
+
/**
|
3349
|
+
* @returns Promise which resolves: TODO
|
3350
|
+
* @returns Rejects: with an error response.
|
3351
|
+
*/
|
3352
|
+
roomState(roomId: string): Promise<IStateEventWithRoomId[]>;
|
3353
|
+
/**
|
3354
|
+
* Get an event in a room by its event id.
|
3355
|
+
*
|
3356
|
+
* @returns Promise which resolves to an object containing the event.
|
3357
|
+
* @returns Rejects: with an error response.
|
3358
|
+
*/
|
3359
|
+
fetchRoomEvent(roomId: string, eventId: string): Promise<Partial<IEvent>>;
|
3360
|
+
/**
|
3361
|
+
* @param includeMembership - the membership type to include in the response
|
3362
|
+
* @param excludeMembership - the membership type to exclude from the response
|
3363
|
+
* @param atEventId - the id of the event for which moment in the timeline the members should be returned for
|
3364
|
+
* @returns Promise which resolves: dictionary of userid to profile information
|
3365
|
+
* @returns Rejects: with an error response.
|
3366
|
+
*/
|
3367
|
+
members(roomId: string, includeMembership?: string, excludeMembership?: string, atEventId?: string): Promise<{
|
3368
|
+
[userId: string]: IStateEventWithRoomId[];
|
3369
|
+
}>;
|
3370
|
+
/**
|
3371
|
+
* Upgrades a room to a new protocol version
|
3372
|
+
* @param newVersion - The target version to upgrade to
|
3373
|
+
* @returns Promise which resolves: Object with key 'replacement_room'
|
3374
|
+
* @returns Rejects: with an error response.
|
3375
|
+
*/
|
3376
|
+
upgradeRoom(roomId: string, newVersion: string): Promise<{
|
3377
|
+
replacement_room: string;
|
3378
|
+
}>;
|
3379
|
+
/**
|
3380
|
+
* Retrieve a state event.
|
3381
|
+
* @returns Promise which resolves: TODO
|
3382
|
+
* @returns Rejects: with an error response.
|
3383
|
+
*/
|
3384
|
+
getStateEvent(roomId: string, eventType: string, stateKey: string): Promise<Record<string, any>>;
|
3385
|
+
/**
|
3386
|
+
* Send a state event into a room
|
3387
|
+
* @param roomId - ID of the room to send the event into
|
3388
|
+
* @param eventType - type of the state event to send
|
3389
|
+
* @param content - content of the event to send
|
3390
|
+
* @param stateKey - the stateKey to send into the room
|
3391
|
+
* @param opts - Options for the request function.
|
3392
|
+
* @returns Promise which resolves: TODO
|
3393
|
+
* @returns Rejects: with an error response.
|
3394
|
+
*/
|
3395
|
+
sendStateEvent<K extends keyof StateEvents>(roomId: string, eventType: K, content: StateEvents[K], stateKey?: string, opts?: IRequestOpts): Promise<ISendEventResponse>;
|
3396
|
+
/**
|
3397
|
+
* @returns Promise which resolves: TODO
|
3398
|
+
* @returns Rejects: with an error response.
|
3399
|
+
*/
|
3400
|
+
roomInitialSync(roomId: string, limit: number): Promise<IRoomInitialSyncResponse>;
|
3401
|
+
/**
|
3402
|
+
* Set a marker to indicate the point in a room before which the user has read every
|
3403
|
+
* event. This can be retrieved from room account data (the event type is `m.fully_read`)
|
3404
|
+
* and displayed as a horizontal line in the timeline that is visually distinct to the
|
3405
|
+
* position of the user's own read receipt.
|
3406
|
+
* @param roomId - ID of the room that has been read
|
3407
|
+
* @param rmEventId - ID of the event that has been read
|
3408
|
+
* @param rrEventId - ID of the event tracked by the read receipt. This is here
|
3409
|
+
* for convenience because the RR and the RM are commonly updated at the same time as
|
3410
|
+
* each other. Optional.
|
3411
|
+
* @param rpEventId - rpEvent the m.read.private read receipt event for when we
|
3412
|
+
* don't want other users to see the read receipts. This is experimental. Optional.
|
3413
|
+
* @returns Promise which resolves: the empty object, `{}`.
|
3414
|
+
*/
|
3415
|
+
setRoomReadMarkersHttpRequest(roomId: string, rmEventId: string, rrEventId?: string, rpEventId?: string): Promise<{}>;
|
3416
|
+
/**
|
3417
|
+
* @returns Promise which resolves: A list of the user's current rooms
|
3418
|
+
* @returns Rejects: with an error response.
|
3419
|
+
*/
|
3420
|
+
getJoinedRooms(): Promise<IJoinedRoomsResponse>;
|
3421
|
+
/**
|
3422
|
+
* Retrieve membership info. for a room.
|
3423
|
+
* @param roomId - ID of the room to get membership for
|
3424
|
+
* @returns Promise which resolves: A list of currently joined users
|
3425
|
+
* and their profile data.
|
3426
|
+
* @returns Rejects: with an error response.
|
3427
|
+
*/
|
3428
|
+
getJoinedRoomMembers(roomId: string): Promise<IJoinedMembersResponse>;
|
3429
|
+
/**
|
3430
|
+
* @param params - Options for this request
|
3431
|
+
* @returns Promise which resolves: IPublicRoomsResponse
|
3432
|
+
* @returns Rejects: with an error response.
|
3433
|
+
*/
|
3434
|
+
publicRooms({ server, limit, since, ...options }?: IRoomDirectoryOptions): Promise<IPublicRoomsResponse>;
|
3435
|
+
/**
|
3436
|
+
* Create an alias to room ID mapping.
|
3437
|
+
* @param alias - The room alias to create.
|
3438
|
+
* @param roomId - The room ID to link the alias to.
|
3439
|
+
* @returns Promise which resolves: an empty object `{}`
|
3440
|
+
* @returns Rejects: with an error response.
|
3441
|
+
*/
|
3442
|
+
createAlias(alias: string, roomId: string): Promise<{}>;
|
3443
|
+
/**
|
3444
|
+
* Delete an alias to room ID mapping. This alias must be on your local server,
|
3445
|
+
* and you must have sufficient access to do this operation.
|
3446
|
+
* @param alias - The room alias to delete.
|
3447
|
+
* @returns Promise which resolves: an empty object `{}`.
|
3448
|
+
* @returns Rejects: with an error response.
|
3449
|
+
*/
|
3450
|
+
deleteAlias(alias: string): Promise<{}>;
|
3451
|
+
/**
|
3452
|
+
* Gets the local aliases for the room. Note: this includes all local aliases, unlike the
|
3453
|
+
* curated list from the m.room.canonical_alias state event.
|
3454
|
+
* @param roomId - The room ID to get local aliases for.
|
3455
|
+
* @returns Promise which resolves: an object with an `aliases` property, containing an array of local aliases
|
3456
|
+
* @returns Rejects: with an error response.
|
3457
|
+
*/
|
3458
|
+
getLocalAliases(roomId: string): Promise<{
|
3459
|
+
aliases: string[];
|
3460
|
+
}>;
|
3461
|
+
/**
|
3462
|
+
* Get room info for the given alias.
|
3463
|
+
* @param alias - The room alias to resolve.
|
3464
|
+
* @returns Promise which resolves: Object with room_id and servers.
|
3465
|
+
* @returns Rejects: with an error response.
|
3466
|
+
*/
|
3467
|
+
getRoomIdForAlias(alias: string): Promise<{
|
3468
|
+
room_id: string;
|
3469
|
+
servers: string[];
|
3470
|
+
}>;
|
3471
|
+
/**
|
3472
|
+
* Get the visibility of a room in the current HS's room directory
|
3473
|
+
* @returns Promise which resolves: TODO
|
3474
|
+
* @returns Rejects: with an error response.
|
3475
|
+
*/
|
3476
|
+
getRoomDirectoryVisibility(roomId: string): Promise<{
|
3477
|
+
visibility: Visibility;
|
3478
|
+
}>;
|
3479
|
+
/**
|
3480
|
+
* Set the visibility of a room in the current HS's room directory
|
3481
|
+
* @param visibility - "public" to make the room visible
|
3482
|
+
* in the public directory, or "private" to make
|
3483
|
+
* it invisible.
|
3484
|
+
* @returns Promise which resolves: to an empty object `{}`
|
3485
|
+
* @returns Rejects: with an error response.
|
3486
|
+
*/
|
3487
|
+
setRoomDirectoryVisibility(roomId: string, visibility: Visibility): Promise<{}>;
|
3488
|
+
/**
|
3489
|
+
* Query the user directory with a term matching user IDs, display names and domains.
|
3490
|
+
* @param options
|
3491
|
+
* @param options.term - the term with which to search.
|
3492
|
+
* @param options.limit - the maximum number of results to return. The server will apply a limit if unspecified.
|
3493
|
+
* @returns Promise which resolves: an array of results.
|
3494
|
+
*/
|
3495
|
+
searchUserDirectory({ term, limit }: {
|
3496
|
+
term: string;
|
3497
|
+
limit?: number;
|
3498
|
+
}): Promise<IUserDirectoryResponse>;
|
3499
|
+
/**
|
3500
|
+
* Upload a file to the media repository on the homeserver.
|
3501
|
+
*
|
3502
|
+
* @param file - The object to upload. On a browser, something that
|
3503
|
+
* can be sent to XMLHttpRequest.send (typically a File). Under node.js,
|
3504
|
+
* a a Buffer, String or ReadStream.
|
3505
|
+
*
|
3506
|
+
* @param opts - options object
|
3507
|
+
*
|
3508
|
+
* @returns Promise which resolves to response object, as
|
3509
|
+
* determined by this.opts.onlyData, opts.rawResponse, and
|
3510
|
+
* opts.onlyContentUri. Rejects with an error (usually a MatrixError).
|
3511
|
+
*/
|
3512
|
+
uploadContent(file: FileType, opts?: UploadOpts): Promise<UploadResponse>;
|
3513
|
+
/**
|
3514
|
+
* Cancel a file upload in progress
|
3515
|
+
* @param upload - The object returned from uploadContent
|
3516
|
+
* @returns true if canceled, otherwise false
|
3517
|
+
*/
|
3518
|
+
cancelUpload(upload: Promise<UploadResponse>): boolean;
|
3519
|
+
/**
|
3520
|
+
* Get a list of all file uploads in progress
|
3521
|
+
* @returns Array of objects representing current uploads.
|
3522
|
+
* Currently in progress is element 0. Keys:
|
3523
|
+
* - promise: The promise associated with the upload
|
3524
|
+
* - loaded: Number of bytes uploaded
|
3525
|
+
* - total: Total number of bytes to upload
|
3526
|
+
*/
|
3527
|
+
getCurrentUploads(): Upload[];
|
3528
|
+
/**
|
3529
|
+
* @param info - The kind of info to retrieve (e.g. 'displayname',
|
3530
|
+
* 'avatar_url').
|
3531
|
+
* @returns Promise which resolves: TODO
|
3532
|
+
* @returns Rejects: with an error response.
|
3533
|
+
*/
|
3534
|
+
getProfileInfo(userId: string, info?: string): Promise<{
|
3535
|
+
avatar_url?: string;
|
3536
|
+
displayname?: string;
|
3537
|
+
}>;
|
3538
|
+
/**
|
3539
|
+
* Determine if the server supports extended profiles, as described by MSC4133.
|
3540
|
+
*
|
3541
|
+
* @returns `true` if supported, otherwise `false`
|
3542
|
+
*/
|
3543
|
+
doesServerSupportExtendedProfiles(): Promise<boolean>;
|
3544
|
+
/**
|
3545
|
+
* Get the prefix used for extended profile requests.
|
3546
|
+
*
|
3547
|
+
* @returns The prefix for use with `authedRequest`
|
3548
|
+
*/
|
3549
|
+
private getExtendedProfileRequestPrefix;
|
3550
|
+
/**
|
3551
|
+
* Fetch a user's *extended* profile, which may include additonal keys.
|
3552
|
+
*
|
3553
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
3554
|
+
* @param userId The user ID to fetch the profile of.
|
3555
|
+
* @returns A set of keys to property values.
|
3556
|
+
*
|
3557
|
+
* @throws An error if the server does not support MSC4133.
|
3558
|
+
* @throws A M_NOT_FOUND error if the profile could not be found.
|
3559
|
+
*/
|
3560
|
+
getExtendedProfile(userId: string): Promise<Record<string, unknown>>;
|
3561
|
+
/**
|
3562
|
+
* Fetch a specific key from the user's *extended* profile.
|
3563
|
+
*
|
3564
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
3565
|
+
* @param userId The user ID to fetch the profile of.
|
3566
|
+
* @param key The key of the property to fetch.
|
3567
|
+
* @returns The property value.
|
3568
|
+
*
|
3569
|
+
* @throws An error if the server does not support MSC4133.
|
3570
|
+
* @throws A M_NOT_FOUND error if the key was not set OR the profile could not be found.
|
3571
|
+
*/
|
3572
|
+
getExtendedProfileProperty(userId: string, key: string): Promise<unknown>;
|
3573
|
+
/**
|
3574
|
+
* Set a property on your *extended* profile.
|
3575
|
+
*
|
3576
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
3577
|
+
* @param key The key of the property to set.
|
3578
|
+
* @param value The value to set on the propety.
|
3579
|
+
*
|
3580
|
+
* @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
|
3581
|
+
*/
|
3582
|
+
setExtendedProfileProperty(key: string, value: unknown): Promise<void>;
|
3583
|
+
/**
|
3584
|
+
* Delete a property on your *extended* profile.
|
3585
|
+
*
|
3586
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
3587
|
+
* @param key The key of the property to delete.
|
3588
|
+
*
|
3589
|
+
* @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
|
3590
|
+
*/
|
3591
|
+
deleteExtendedProfileProperty(key: string): Promise<void>;
|
3592
|
+
/**
|
3593
|
+
* Update multiple properties on your *extended* profile. This will
|
3594
|
+
* merge with any existing keys.
|
3595
|
+
*
|
3596
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
3597
|
+
* @param profile The profile object to merge with the existing profile.
|
3598
|
+
* @returns The newly merged profile.
|
3599
|
+
*
|
3600
|
+
* @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
|
3601
|
+
*/
|
3602
|
+
patchExtendedProfile(profile: Record<string, unknown>): Promise<Record<string, unknown>>;
|
3603
|
+
/**
|
3604
|
+
* Set multiple properties on your *extended* profile. This will completely
|
3605
|
+
* replace the existing profile, removing any unspecified keys.
|
3606
|
+
*
|
3607
|
+
* @see https://github.com/tcpipuk/matrix-spec-proposals/blob/main/proposals/4133-extended-profiles.md
|
3608
|
+
* @param profile The profile object to set.
|
3609
|
+
*
|
3610
|
+
* @throws An error if the server does not support MSC4133 OR the server disallows editing the user profile.
|
3611
|
+
*/
|
3612
|
+
setExtendedProfile(profile: Record<string, unknown>): Promise<void>;
|
3613
|
+
/**
|
3614
|
+
* @returns Promise which resolves to a list of the user's threepids.
|
3615
|
+
* @returns Rejects: with an error response.
|
3616
|
+
*/
|
3617
|
+
getThreePids(): Promise<{
|
3618
|
+
threepids: IThreepid[];
|
3619
|
+
}>;
|
3620
|
+
/**
|
3621
|
+
* Add a 3PID to your homeserver account. This API does not use an identity
|
3622
|
+
* server, as the homeserver is expected to handle 3PID ownership validation.
|
3623
|
+
*
|
3624
|
+
* @param data - A object with 3PID validation data from having called
|
3625
|
+
* `account/3pid/<medium>/requestToken` on the homeserver.
|
3626
|
+
* @returns Promise which resolves: to an empty object `{}`
|
3627
|
+
* @returns Rejects: with an error response.
|
3628
|
+
*/
|
3629
|
+
addThreePidOnly(data: IAddThreePidOnlyBody): Promise<{}>;
|
3630
|
+
/**
|
3631
|
+
* Bind a 3PID for discovery onto an identity server via the homeserver. The
|
3632
|
+
* identity server handles 3PID ownership validation and the homeserver records
|
3633
|
+
* the new binding to track where all 3PIDs for the account are bound.
|
3634
|
+
*
|
3635
|
+
* @param data - A object with 3PID validation data from having called
|
3636
|
+
* `validate/<medium>/requestToken` on the identity server. It should also
|
3637
|
+
* contain `id_server` and `id_access_token` fields as well.
|
3638
|
+
* @returns Promise which resolves: to an empty object `{}`
|
3639
|
+
* @returns Rejects: with an error response.
|
3640
|
+
*/
|
3641
|
+
bindThreePid(data: IBindThreePidBody): Promise<{}>;
|
3642
|
+
/**
|
3643
|
+
* Unbind a 3PID for discovery on an identity server via the homeserver. The
|
3644
|
+
* homeserver removes its record of the binding to keep an updated record of
|
3645
|
+
* where all 3PIDs for the account are bound.
|
3646
|
+
*
|
3647
|
+
* @param medium - The threepid medium (eg. 'email')
|
3648
|
+
* @param address - The threepid address (eg. 'bob\@example.com')
|
3649
|
+
* this must be as returned by getThreePids.
|
3650
|
+
* @returns Promise which resolves: on success
|
3651
|
+
* @returns Rejects: with an error response.
|
3652
|
+
*/
|
3653
|
+
unbindThreePid(medium: string, address: string): Promise<{
|
3654
|
+
id_server_unbind_result: IdServerUnbindResult;
|
3655
|
+
}>;
|
3656
|
+
/**
|
3657
|
+
* @param medium - The threepid medium (eg. 'email')
|
3658
|
+
* @param address - The threepid address (eg. 'bob\@example.com')
|
3659
|
+
* this must be as returned by getThreePids.
|
3660
|
+
* @returns Promise which resolves: The server response on success
|
3661
|
+
* (generally the empty JSON object)
|
3662
|
+
* @returns Rejects: with an error response.
|
3663
|
+
*/
|
3664
|
+
deleteThreePid(medium: string, address: string): Promise<{
|
3665
|
+
id_server_unbind_result: IdServerUnbindResult;
|
3666
|
+
}>;
|
3667
|
+
/**
|
3668
|
+
* Make a request to change your password.
|
3669
|
+
* @param newPassword - The new desired password.
|
3670
|
+
* @param logoutDevices - Should all sessions be logged out after the password change. Defaults to true.
|
3671
|
+
* @returns Promise which resolves: to an empty object `{}`
|
3672
|
+
* @returns Rejects: with an error response.
|
3673
|
+
*/
|
3674
|
+
setPassword(authDict: AuthDict, newPassword: string, logoutDevices?: boolean): Promise<{}>;
|
3675
|
+
/**
|
3676
|
+
* Gets all devices recorded for the logged-in user
|
3677
|
+
* @returns Promise which resolves: result object
|
3678
|
+
* @returns Rejects: with an error response.
|
3679
|
+
*/
|
3680
|
+
getDevices(): Promise<{
|
3681
|
+
devices: IMyDevice[];
|
3682
|
+
}>;
|
3683
|
+
/**
|
3684
|
+
* Gets specific device details for the logged-in user
|
3685
|
+
* @param deviceId - device to query
|
3686
|
+
* @returns Promise which resolves: result object
|
3687
|
+
* @returns Rejects: with an error response.
|
3688
|
+
*/
|
3689
|
+
getDevice(deviceId: string): Promise<IMyDevice>;
|
3690
|
+
/**
|
3691
|
+
* Update the given device
|
3692
|
+
*
|
3693
|
+
* @param deviceId - device to update
|
3694
|
+
* @param body - body of request
|
3695
|
+
* @returns Promise which resolves: to an empty object `{}`
|
3696
|
+
* @returns Rejects: with an error response.
|
3697
|
+
*/
|
3698
|
+
setDeviceDetails(deviceId: string, body: {
|
3699
|
+
display_name: string;
|
3700
|
+
}): Promise<{}>;
|
3701
|
+
/**
|
3702
|
+
* Delete the given device
|
3703
|
+
*
|
3704
|
+
* @param deviceId - device to delete
|
3705
|
+
* @param auth - Optional. Auth data to supply for User-Interactive auth.
|
3706
|
+
* @returns Promise which resolves: result object
|
3707
|
+
* @returns Rejects: with an error response.
|
3708
|
+
*/
|
3709
|
+
deleteDevice(deviceId: string, auth?: AuthDict): Promise<{}>;
|
3710
|
+
/**
|
3711
|
+
* Delete multiple device
|
3712
|
+
*
|
3713
|
+
* @param devices - IDs of the devices to delete
|
3714
|
+
* @param auth - Optional. Auth data to supply for User-Interactive auth.
|
3715
|
+
* @returns Promise which resolves: result object
|
3716
|
+
* @returns Rejects: with an error response.
|
3717
|
+
*/
|
3718
|
+
deleteMultipleDevices(devices: string[], auth?: AuthDict): Promise<{}>;
|
3719
|
+
/**
|
3720
|
+
* Gets all pushers registered for the logged-in user
|
3721
|
+
*
|
3722
|
+
* @returns Promise which resolves: Array of objects representing pushers
|
3723
|
+
* @returns Rejects: with an error response.
|
3724
|
+
*/
|
3725
|
+
getPushers(): Promise<{
|
3726
|
+
pushers: IPusher[];
|
3727
|
+
}>;
|
3728
|
+
/**
|
3729
|
+
* Adds a new pusher or updates an existing pusher
|
3730
|
+
*
|
3731
|
+
* @param pusher - Object representing a pusher
|
3732
|
+
* @returns Promise which resolves: Empty json object on success
|
3733
|
+
* @returns Rejects: with an error response.
|
3734
|
+
*/
|
3735
|
+
setPusher(pusher: IPusherRequest): Promise<{}>;
|
3736
|
+
/**
|
3737
|
+
* Removes an existing pusher
|
3738
|
+
* @param pushKey - pushkey of pusher to remove
|
3739
|
+
* @param appId - app_id of pusher to remove
|
3740
|
+
* @returns Promise which resolves: Empty json object on success
|
3741
|
+
* @returns Rejects: with an error response.
|
3742
|
+
*/
|
3743
|
+
removePusher(pushKey: string, appId: string): Promise<{}>;
|
3744
|
+
/**
|
3745
|
+
* Persists local notification settings
|
3746
|
+
* @returns Promise which resolves: an empty object
|
3747
|
+
* @returns Rejects: with an error response.
|
3748
|
+
*/
|
3749
|
+
setLocalNotificationSettings(deviceId: string, notificationSettings: LocalNotificationSettings): Promise<{}>;
|
3750
|
+
/**
|
3751
|
+
* Get the push rules for the account from the server.
|
3752
|
+
* @returns Promise which resolves to the push rules.
|
3753
|
+
* @returns Rejects: with an error response.
|
3754
|
+
*/
|
3755
|
+
getPushRules(): Promise<IPushRules>;
|
3756
|
+
/**
|
3757
|
+
* Update the push rules for the account. This should be called whenever
|
3758
|
+
* updated push rules are available.
|
3759
|
+
*/
|
3760
|
+
setPushRules(rules: IPushRules): void;
|
3761
|
+
/**
|
3762
|
+
* @returns Promise which resolves: an empty object `{}`
|
3763
|
+
* @returns Rejects: with an error response.
|
3764
|
+
*/
|
3765
|
+
addPushRule(scope: string, kind: PushRuleKind, ruleId: Exclude<string, RuleId>, body: Pick<IPushRule, "actions" | "conditions" | "pattern">): Promise<{}>;
|
3766
|
+
/**
|
3767
|
+
* @returns Promise which resolves: an empty object `{}`
|
3768
|
+
* @returns Rejects: with an error response.
|
3769
|
+
*/
|
3770
|
+
deletePushRule(scope: string, kind: PushRuleKind, ruleId: Exclude<string, RuleId>): Promise<{}>;
|
3771
|
+
/**
|
3772
|
+
* Enable or disable a push notification rule.
|
3773
|
+
* @returns Promise which resolves: to an empty object `{}`
|
3774
|
+
* @returns Rejects: with an error response.
|
3775
|
+
*/
|
3776
|
+
setPushRuleEnabled(scope: string, kind: PushRuleKind, ruleId: RuleId | string, enabled: boolean): Promise<{}>;
|
3777
|
+
/**
|
3778
|
+
* Set the actions for a push notification rule.
|
3779
|
+
* @returns Promise which resolves: to an empty object `{}`
|
3780
|
+
* @returns Rejects: with an error response.
|
3781
|
+
*/
|
3782
|
+
setPushRuleActions(scope: string, kind: PushRuleKind, ruleId: RuleId | string, actions: PushRuleAction[]): Promise<{}>;
|
3783
|
+
/**
|
3784
|
+
* Perform a server-side search.
|
3785
|
+
* @param params
|
3786
|
+
* @param params.next_batch - the batch token to pass in the query string
|
3787
|
+
* @param params.body - the JSON object to pass to the request body.
|
3788
|
+
* @param abortSignal - optional signal used to cancel the http request.
|
3789
|
+
* @returns Promise which resolves to the search response object.
|
3790
|
+
* @returns Rejects: with an error response.
|
3791
|
+
*/
|
3792
|
+
search({ body, next_batch: nextBatch }: {
|
3793
|
+
body: ISearchRequestBody;
|
3794
|
+
next_batch?: string;
|
3795
|
+
}, abortSignal?: AbortSignal): Promise<ISearchResponse>;
|
3796
|
+
/**
|
3797
|
+
* Upload keys
|
3798
|
+
*
|
3799
|
+
* @param content - body of upload request
|
3800
|
+
*
|
3801
|
+
* @param opts - this method no longer takes any opts,
|
3802
|
+
* used to take opts.device_id but this was not removed from the spec as a redundant parameter
|
3803
|
+
*
|
3804
|
+
* @returns Promise which resolves: result object. Rejects: with
|
3805
|
+
* an error response ({@link MatrixError}).
|
3806
|
+
*/
|
3807
|
+
uploadKeysRequest(content: IUploadKeysRequest, opts?: void): Promise<IKeysUploadResponse>;
|
3808
|
+
uploadKeySignatures(content: KeySignatures): Promise<IUploadKeySignaturesResponse>;
|
3809
|
+
/**
|
3810
|
+
* Download device keys
|
3811
|
+
*
|
3812
|
+
* @param userIds - list of users to get keys for
|
3813
|
+
*
|
3814
|
+
* @param token - sync token to pass in the query request, to help
|
3815
|
+
* the HS give the most recent results
|
3816
|
+
*
|
3817
|
+
* @returns Promise which resolves: result object. Rejects: with
|
3818
|
+
* an error response ({@link MatrixError}).
|
3819
|
+
*/
|
3820
|
+
downloadKeysForUsers(userIds: string[], { token }?: {
|
3821
|
+
token?: string;
|
3822
|
+
}): Promise<IDownloadKeyResult>;
|
3823
|
+
/**
|
3824
|
+
* Claim one-time keys
|
3825
|
+
*
|
3826
|
+
* @param devices - a list of [userId, deviceId] pairs
|
3827
|
+
*
|
3828
|
+
* @param keyAlgorithm - desired key type
|
3829
|
+
*
|
3830
|
+
* @param timeout - the time (in milliseconds) to wait for keys from remote
|
3831
|
+
* servers
|
3832
|
+
*
|
3833
|
+
* @returns Promise which resolves: result object. Rejects: with
|
3834
|
+
* an error response ({@link MatrixError}).
|
3835
|
+
*/
|
3836
|
+
claimOneTimeKeys(devices: [string, string][], keyAlgorithm?: string, timeout?: number): Promise<IClaimOTKsResult>;
|
3837
|
+
/**
|
3838
|
+
* Ask the server for a list of users who have changed their device lists
|
3839
|
+
* between a pair of sync tokens
|
3840
|
+
*
|
3841
|
+
*
|
3842
|
+
* @returns Promise which resolves: result object. Rejects: with
|
3843
|
+
* an error response ({@link MatrixError}).
|
3844
|
+
*/
|
3845
|
+
getKeyChanges(oldToken: string, newToken: string): Promise<{
|
3846
|
+
changed: string[];
|
3847
|
+
left: string[];
|
3848
|
+
}>;
|
3849
|
+
uploadDeviceSigningKeys(auth?: AuthDict, keys?: CrossSigningKeys): Promise<{}>;
|
3850
|
+
/**
|
3851
|
+
* Register with an identity server using the OpenID token from the user's
|
3852
|
+
* Homeserver, which can be retrieved via
|
3853
|
+
* {@link MatrixClient#getOpenIdToken}.
|
3854
|
+
*
|
3855
|
+
* Note that the `/account/register` endpoint (as well as IS authentication in
|
3856
|
+
* general) was added as part of the v2 API version.
|
3857
|
+
*
|
3858
|
+
* @returns Promise which resolves: with object containing an Identity
|
3859
|
+
* Server access token.
|
3860
|
+
* @returns Rejects: with an error response.
|
3861
|
+
*/
|
3862
|
+
registerWithIdentityServer(hsOpenIdToken: IOpenIDToken): Promise<{
|
3863
|
+
access_token: string;
|
3864
|
+
token: string;
|
3865
|
+
}>;
|
3866
|
+
/**
|
3867
|
+
* Requests an email verification token directly from an identity server.
|
3868
|
+
*
|
3869
|
+
* This API is used as part of binding an email for discovery on an identity
|
3870
|
+
* server. The validation data that results should be passed to the
|
3871
|
+
* `bindThreePid` method to complete the binding process.
|
3872
|
+
*
|
3873
|
+
* @param email - The email address to request a token for
|
3874
|
+
* @param clientSecret - A secret binary string generated by the client.
|
3875
|
+
* It is recommended this be around 16 ASCII characters.
|
3876
|
+
* @param sendAttempt - If an identity server sees a duplicate request
|
3877
|
+
* with the same sendAttempt, it will not send another email.
|
3878
|
+
* To request another email to be sent, use a larger value for
|
3879
|
+
* the sendAttempt param as was used in the previous request.
|
3880
|
+
* @param nextLink - Optional If specified, the client will be redirected
|
3881
|
+
* to this link after validation.
|
3882
|
+
* @param identityAccessToken - The `access_token` field of the identity
|
3883
|
+
* server `/account/register` response (see {@link registerWithIdentityServer}).
|
3884
|
+
*
|
3885
|
+
* @returns Promise which resolves: TODO
|
3886
|
+
* @returns Rejects: with an error response.
|
3887
|
+
* @throws Error if no identity server is set
|
3888
|
+
*/
|
3889
|
+
requestEmailToken(email: string, clientSecret: string, sendAttempt: number, nextLink?: string, identityAccessToken?: string): Promise<IRequestTokenResponse>;
|
3890
|
+
/**
|
3891
|
+
* Requests a MSISDN verification token directly from an identity server.
|
3892
|
+
*
|
3893
|
+
* This API is used as part of binding a MSISDN for discovery on an identity
|
3894
|
+
* server. The validation data that results should be passed to the
|
3895
|
+
* `bindThreePid` method to complete the binding process.
|
3896
|
+
*
|
3897
|
+
* @param phoneCountry - The ISO 3166-1 alpha-2 code for the country in
|
3898
|
+
* which phoneNumber should be parsed relative to.
|
3899
|
+
* @param phoneNumber - The phone number, in national or international
|
3900
|
+
* format
|
3901
|
+
* @param clientSecret - A secret binary string generated by the client.
|
3902
|
+
* It is recommended this be around 16 ASCII characters.
|
3903
|
+
* @param sendAttempt - If an identity server sees a duplicate request
|
3904
|
+
* with the same sendAttempt, it will not send another SMS.
|
3905
|
+
* To request another SMS to be sent, use a larger value for
|
3906
|
+
* the sendAttempt param as was used in the previous request.
|
3907
|
+
* @param nextLink - Optional If specified, the client will be redirected
|
3908
|
+
* to this link after validation.
|
3909
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
3910
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
3911
|
+
*
|
3912
|
+
* @returns Promise which resolves to an object with a sid string
|
3913
|
+
* @returns Rejects: with an error response.
|
3914
|
+
* @throws Error if no identity server is set
|
3915
|
+
*/
|
3916
|
+
requestMsisdnToken(phoneCountry: string, phoneNumber: string, clientSecret: string, sendAttempt: number, nextLink?: string, identityAccessToken?: string): Promise<IRequestMsisdnTokenResponse>;
|
3917
|
+
/**
|
3918
|
+
* Submits a MSISDN token to the identity server
|
3919
|
+
*
|
3920
|
+
* This is used when submitting the code sent by SMS to a phone number.
|
3921
|
+
* The identity server has an equivalent API for email but the js-sdk does
|
3922
|
+
* not expose this, since email is normally validated by the user clicking
|
3923
|
+
* a link rather than entering a code.
|
3924
|
+
*
|
3925
|
+
* @param sid - The sid given in the response to requestToken
|
3926
|
+
* @param clientSecret - A secret binary string generated by the client.
|
3927
|
+
* This must be the same value submitted in the requestToken call.
|
3928
|
+
* @param msisdnToken - The MSISDN token, as enetered by the user.
|
3929
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
3930
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
3931
|
+
* Some legacy identity servers had no authentication here.
|
3932
|
+
*
|
3933
|
+
* @returns Promise which resolves: Object, containing success boolean.
|
3934
|
+
* @returns Rejects: with an error response.
|
3935
|
+
* @throws Error if No identity server is set
|
3936
|
+
*/
|
3937
|
+
submitMsisdnToken(sid: string, clientSecret: string, msisdnToken: string, identityAccessToken: string | null): Promise<{
|
3938
|
+
success: boolean;
|
3939
|
+
}>;
|
3940
|
+
/**
|
3941
|
+
* Submits a MSISDN token to an arbitrary URL.
|
3942
|
+
*
|
3943
|
+
* This is used when submitting the code sent by SMS to a phone number in the
|
3944
|
+
* newer 3PID flow where the homeserver validates 3PID ownership (as part of
|
3945
|
+
* `requestAdd3pidMsisdnToken`). The homeserver response may include a
|
3946
|
+
* `submit_url` to specify where the token should be sent, and this helper can
|
3947
|
+
* be used to pass the token to this URL.
|
3948
|
+
*
|
3949
|
+
* @param url - The URL to submit the token to
|
3950
|
+
* @param sid - The sid given in the response to requestToken
|
3951
|
+
* @param clientSecret - A secret binary string generated by the client.
|
3952
|
+
* This must be the same value submitted in the requestToken call.
|
3953
|
+
* @param msisdnToken - The MSISDN token, as enetered by the user.
|
3954
|
+
*
|
3955
|
+
* @returns Promise which resolves: Object, containing success boolean.
|
3956
|
+
* @returns Rejects: with an error response.
|
3957
|
+
*/
|
3958
|
+
submitMsisdnTokenOtherUrl(url: string, sid: string, clientSecret: string, msisdnToken: string): Promise<{
|
3959
|
+
success: boolean;
|
3960
|
+
}>;
|
3961
|
+
/**
|
3962
|
+
* Gets the V2 hashing information from the identity server. Primarily useful for
|
3963
|
+
* lookups.
|
3964
|
+
* @param identityAccessToken - The access token for the identity server.
|
3965
|
+
* @returns The hashing information for the identity server.
|
3966
|
+
*/
|
3967
|
+
getIdentityHashDetails(identityAccessToken: string): Promise<{
|
3968
|
+
/**
|
3969
|
+
* The algorithms the server supports. Must contain at least sha256.
|
3970
|
+
*/
|
3971
|
+
algorithms: string[];
|
3972
|
+
/**
|
3973
|
+
* The pepper the client MUST use in hashing identifiers,
|
3974
|
+
* and MUST supply to the /lookup endpoint when performing lookups.
|
3975
|
+
*/
|
3976
|
+
lookup_pepper: string;
|
3977
|
+
}>;
|
3978
|
+
/**
|
3979
|
+
* Performs a hashed lookup of addresses against the identity server. This is
|
3980
|
+
* only supported on identity servers which have at least the version 2 API.
|
3981
|
+
* @param addressPairs - An array of 2 element arrays.
|
3982
|
+
* The first element of each pair is the address, the second is the 3PID medium.
|
3983
|
+
* Eg: `["email@example.org", "email"]`
|
3984
|
+
* @param identityAccessToken - The access token for the identity server.
|
3985
|
+
* @returns A collection of address mappings to
|
3986
|
+
* found MXIDs. Results where no user could be found will not be listed.
|
3987
|
+
*/
|
3988
|
+
identityHashedLookup(addressPairs: [string, string][], identityAccessToken: string): Promise<{
|
3989
|
+
address: string;
|
3990
|
+
mxid: string;
|
3991
|
+
}[]>;
|
3992
|
+
/**
|
3993
|
+
* Looks up the public Matrix ID mapping for a given 3rd party
|
3994
|
+
* identifier from the identity server
|
3995
|
+
*
|
3996
|
+
* @param medium - The medium of the threepid, eg. 'email'
|
3997
|
+
* @param address - The textual address of the threepid
|
3998
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
3999
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
4000
|
+
*
|
4001
|
+
* @returns Promise which resolves: A threepid mapping
|
4002
|
+
* object or the empty object if no mapping
|
4003
|
+
* exists
|
4004
|
+
* @returns Rejects: with an error response.
|
4005
|
+
*/
|
4006
|
+
lookupThreePid(medium: string, address: string, identityAccessToken: string): Promise<{
|
4007
|
+
address: string;
|
4008
|
+
medium: string;
|
4009
|
+
mxid: string;
|
4010
|
+
} | {}>;
|
4011
|
+
/**
|
4012
|
+
* Looks up the public Matrix ID mappings for multiple 3PIDs.
|
4013
|
+
*
|
4014
|
+
* @param query - Array of arrays containing
|
4015
|
+
* [medium, address]
|
4016
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
4017
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
4018
|
+
*
|
4019
|
+
* @returns Promise which resolves: Lookup results from IS.
|
4020
|
+
* @returns Rejects: with an error response.
|
4021
|
+
*/
|
4022
|
+
bulkLookupThreePids(query: [string, string][], identityAccessToken: string): Promise<{
|
4023
|
+
threepids: [medium: string, address: string, mxid: string][];
|
4024
|
+
}>;
|
4025
|
+
/**
|
4026
|
+
* Get account info from the identity server. This is useful as a neutral check
|
4027
|
+
* to verify that other APIs are likely to approve access by testing that the
|
4028
|
+
* token is valid, terms have been agreed, etc.
|
4029
|
+
*
|
4030
|
+
* @param identityAccessToken - The `access_token` field of the Identity
|
4031
|
+
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
4032
|
+
*
|
4033
|
+
* @returns Promise which resolves: an object with account info.
|
4034
|
+
* @returns Rejects: with an error response.
|
4035
|
+
*/
|
4036
|
+
getIdentityAccount(identityAccessToken: string): Promise<{
|
4037
|
+
user_id: string;
|
4038
|
+
}>;
|
4039
|
+
/**
|
4040
|
+
* Send an event to a specific list of devices.
|
4041
|
+
* This is a low-level API that simply wraps the HTTP API
|
4042
|
+
* call to send to-device messages. We recommend using
|
4043
|
+
* queueToDevice() which is a higher level API.
|
4044
|
+
*
|
4045
|
+
* @param eventType - type of event to send
|
4046
|
+
* content to send. Map from user_id to device_id to content object.
|
4047
|
+
* @param txnId - transaction id. One will be made up if not
|
4048
|
+
* supplied.
|
4049
|
+
* @returns Promise which resolves: to an empty object `{}`
|
4050
|
+
*/
|
4051
|
+
sendToDevice(eventType: string, contentMap: SendToDeviceContentMap, txnId?: string): Promise<{}>;
|
4052
|
+
/**
|
4053
|
+
* Sends events directly to specific devices using Matrix's to-device
|
4054
|
+
* messaging system. The batch will be split up into appropriately sized
|
4055
|
+
* batches for sending and stored in the store so they can be retried
|
4056
|
+
* later if they fail to send. Retries will happen automatically.
|
4057
|
+
* @param batch - The to-device messages to send
|
4058
|
+
*/
|
4059
|
+
queueToDevice(batch: ToDeviceBatch): Promise<void>;
|
4060
|
+
/**
|
4061
|
+
* Get the third party protocols that can be reached using
|
4062
|
+
* this HS
|
4063
|
+
* @returns Promise which resolves to the result object
|
4064
|
+
*/
|
4065
|
+
getThirdpartyProtocols(): Promise<{
|
4066
|
+
[protocol: string]: IProtocol;
|
4067
|
+
}>;
|
4068
|
+
/**
|
4069
|
+
* Get information on how a specific place on a third party protocol
|
4070
|
+
* may be reached.
|
4071
|
+
* @param protocol - The protocol given in getThirdpartyProtocols()
|
4072
|
+
* @param params - Protocol-specific parameters, as given in the
|
4073
|
+
* response to getThirdpartyProtocols()
|
4074
|
+
* @returns Promise which resolves to the result object
|
4075
|
+
*/
|
4076
|
+
getThirdpartyLocation(protocol: string, params: {
|
4077
|
+
searchFields?: string[];
|
4078
|
+
}): Promise<IThirdPartyLocation[]>;
|
4079
|
+
/**
|
4080
|
+
* Get information on how a specific user on a third party protocol
|
4081
|
+
* may be reached.
|
4082
|
+
* @param protocol - The protocol given in getThirdpartyProtocols()
|
4083
|
+
* @param params - Protocol-specific parameters, as given in the
|
4084
|
+
* response to getThirdpartyProtocols()
|
4085
|
+
* @returns Promise which resolves to the result object
|
4086
|
+
*/
|
4087
|
+
getThirdpartyUser(protocol: string, params?: QueryDict): Promise<IThirdPartyUser[]>;
|
4088
|
+
getTerms(serviceType: SERVICE_TYPES, baseUrl: string): Promise<any>;
|
4089
|
+
agreeToTerms(serviceType: SERVICE_TYPES, baseUrl: string, accessToken: string, termsUrls: string[]): Promise<{}>;
|
4090
|
+
/**
|
4091
|
+
* Reports an event as inappropriate to the server, which may then notify the appropriate people.
|
4092
|
+
* @param roomId - The room in which the event being reported is located.
|
4093
|
+
* @param eventId - The event to report.
|
4094
|
+
* @param score - The score to rate this content as where -100 is most offensive and 0 is inoffensive.
|
4095
|
+
* @param reason - The reason the content is being reported. May be blank.
|
4096
|
+
* @returns Promise which resolves to an empty object if successful
|
4097
|
+
*/
|
4098
|
+
reportEvent(roomId: string, eventId: string, score: number, reason: string): Promise<{}>;
|
4099
|
+
/**
|
4100
|
+
* Fetches or paginates a room hierarchy as defined by MSC2946.
|
4101
|
+
* Falls back gracefully to sourcing its data from `getSpaceSummary` if this API is not yet supported by the server.
|
4102
|
+
* @param roomId - The ID of the space-room to use as the root of the summary.
|
4103
|
+
* @param limit - The maximum number of rooms to return per page.
|
4104
|
+
* @param maxDepth - The maximum depth in the tree from the root room to return.
|
4105
|
+
* @param suggestedOnly - Whether to only return rooms with suggested=true.
|
4106
|
+
* @param fromToken - The opaque token to paginate a previous request.
|
4107
|
+
* @returns the response, with next_batch & rooms fields.
|
4108
|
+
*/
|
4109
|
+
getRoomHierarchy(roomId: string, limit?: number, maxDepth?: number, suggestedOnly?: boolean, fromToken?: string): Promise<IRoomHierarchy>;
|
4110
|
+
/**
|
4111
|
+
* Creates a new file tree space with the given name. The client will pick
|
4112
|
+
* defaults for how it expects to be able to support the remaining API offered
|
4113
|
+
* by the returned class.
|
4114
|
+
*
|
4115
|
+
* Note that this is UNSTABLE and may have breaking changes without notice.
|
4116
|
+
* @param name - The name of the tree space.
|
4117
|
+
* @returns Promise which resolves to the created space.
|
4118
|
+
*/
|
4119
|
+
unstableCreateFileTree(name: string): Promise<MSC3089TreeSpace>;
|
4120
|
+
/**
|
4121
|
+
* Gets a reference to a tree space, if the room ID given is a tree space. If the room
|
4122
|
+
* does not appear to be a tree space then null is returned.
|
4123
|
+
*
|
4124
|
+
* Note that this is UNSTABLE and may have breaking changes without notice.
|
4125
|
+
* @param roomId - The room ID to get a tree space reference for.
|
4126
|
+
* @returns The tree space, or null if not a tree space.
|
4127
|
+
*/
|
4128
|
+
unstableGetFileTreeSpace(roomId: string): MSC3089TreeSpace | null;
|
4129
|
+
/**
|
4130
|
+
* Perform a single MSC3575 sliding sync request.
|
4131
|
+
* @param req - The request to make.
|
4132
|
+
* @param proxyBaseUrl - The base URL for the sliding sync proxy.
|
4133
|
+
* @param abortSignal - Optional signal to abort request mid-flight.
|
4134
|
+
* @returns The sliding sync response, or a standard error.
|
4135
|
+
* @throws on non 2xx status codes with an object with a field "httpStatus":number.
|
4136
|
+
*/
|
4137
|
+
slidingSync(req: MSC3575SlidingSyncRequest, proxyBaseUrl?: string, abortSignal?: AbortSignal): Promise<MSC3575SlidingSyncResponse>;
|
4138
|
+
/**
|
4139
|
+
* A helper to determine thread support
|
4140
|
+
* @returns a boolean to determine if threads are enabled
|
4141
|
+
*/
|
4142
|
+
supportsThreads(): boolean;
|
4143
|
+
/**
|
4144
|
+
* A helper to determine intentional mentions support
|
4145
|
+
* @returns a boolean to determine if intentional mentions are enabled on the server
|
4146
|
+
* @experimental
|
4147
|
+
*/
|
4148
|
+
supportsIntentionalMentions(): boolean;
|
4149
|
+
/**
|
4150
|
+
* Fetches the summary of a room as defined by an initial version of MSC3266 and implemented in Synapse
|
4151
|
+
* Proposed at https://github.com/matrix-org/matrix-doc/pull/3266
|
4152
|
+
* @param roomIdOrAlias - The ID or alias of the room to get the summary of.
|
4153
|
+
* @param via - The list of servers which know about the room if only an ID was provided.
|
4154
|
+
*/
|
4155
|
+
getRoomSummary(roomIdOrAlias: string, via?: string[]): Promise<RoomSummary>;
|
4156
|
+
/**
|
4157
|
+
* Processes a list of threaded events and adds them to their respective timelines
|
4158
|
+
* @param room - the room the adds the threaded events
|
4159
|
+
* @param threadedEvents - an array of the threaded events
|
4160
|
+
* @param toStartOfTimeline - the direction in which we want to add the events
|
4161
|
+
*/
|
4162
|
+
processThreadEvents(room: Room, threadedEvents: MatrixEvent[], toStartOfTimeline: boolean): void;
|
4163
|
+
/**
|
4164
|
+
* Processes a list of thread roots and creates a thread model
|
4165
|
+
* @param room - the room to create the threads in
|
4166
|
+
* @param threadedEvents - an array of thread roots
|
4167
|
+
* @param toStartOfTimeline - the direction
|
4168
|
+
*/
|
4169
|
+
processThreadRoots(room: Room, threadedEvents: MatrixEvent[], toStartOfTimeline: boolean): void;
|
4170
|
+
processBeaconEvents(room?: Room, events?: MatrixEvent[]): void;
|
4171
|
+
/**
|
4172
|
+
* Calls aggregation functions for event types that are aggregated
|
4173
|
+
* Polls and location beacons
|
4174
|
+
* @param room - room the events belong to
|
4175
|
+
* @param events - timeline events to be processed
|
4176
|
+
* @returns
|
4177
|
+
*/
|
4178
|
+
processAggregatedTimelineEvents(room?: Room, events?: MatrixEvent[]): void;
|
4179
|
+
/**
|
4180
|
+
* Fetches information about the user for the configured access token.
|
4181
|
+
*/
|
4182
|
+
whoami(): Promise<IWhoamiResponse>;
|
4183
|
+
/**
|
4184
|
+
* Find the event_id closest to the given timestamp in the given direction.
|
4185
|
+
* @returns Resolves: A promise of an object containing the event_id and
|
4186
|
+
* origin_server_ts of the closest event to the timestamp in the given direction
|
4187
|
+
* @returns Rejects: when the request fails (module:http-api.MatrixError)
|
4188
|
+
*/
|
4189
|
+
timestampToEvent(roomId: string, timestamp: number, dir: Direction): Promise<TimestampToEventResponse>;
|
4190
|
+
/**
|
4191
|
+
* Get the OIDC issuer responsible for authentication on this server, if any
|
4192
|
+
* @returns Resolves: A promise of an object containing the OIDC issuer if configured
|
4193
|
+
* @returns Rejects: when the request fails (module:http-api.MatrixError)
|
4194
|
+
* @experimental - part of MSC2965
|
4195
|
+
*/
|
4196
|
+
getAuthIssuer(): Promise<{
|
4197
|
+
issuer: string;
|
4198
|
+
}>;
|
4199
|
+
}
|
4200
|
+
/**
|
4201
|
+
* recalculates an accurate notifications count on event decryption.
|
4202
|
+
* Servers do not have enough knowledge about encrypted events to calculate an
|
4203
|
+
* accurate notification_count
|
4204
|
+
*/
|
4205
|
+
export declare function fixNotificationCountOnDecryption(cli: MatrixClient, event: MatrixEvent): void;
|
4206
|
+
/**
|
4207
|
+
* Given an event, figure out the thread ID we should use for it in a receipt.
|
4208
|
+
*
|
4209
|
+
* This will either be "main", or event.threadRootId. For the thread root, or
|
4210
|
+
* e.g. reactions to the thread root, this will be main. For events inside the
|
4211
|
+
* thread, or e.g. reactions to them, this will be event.threadRootId.
|
4212
|
+
*
|
4213
|
+
* (Exported for test.)
|
4214
|
+
*/
|
4215
|
+
export declare function threadIdForReceipt(event: MatrixEvent): string;
|
4216
|
+
/**
|
4217
|
+
* a) True for non-threaded messages, thread roots and non-thread relations to thread roots.
|
4218
|
+
* b) False for messages with thread relations to the thread root.
|
4219
|
+
* c) False for messages with any kind of relation to a message from case b.
|
4220
|
+
*
|
4221
|
+
* Note: true for redactions of messages that are in threads. Redacted messages
|
4222
|
+
* are not really in threads (because their relations are gone), so if they look
|
4223
|
+
* like they are in threads, that is a sign of a bug elsewhere. (At time of
|
4224
|
+
* writing, this bug definitely exists - messages are not moved to another
|
4225
|
+
* thread when they are redacted.)
|
4226
|
+
*
|
4227
|
+
* @returns true if this event is considered to be in the main timeline as far
|
4228
|
+
* as receipts are concerned.
|
4229
|
+
*/
|
4230
|
+
export declare function inMainTimelineForReceipt(event: MatrixEvent): boolean;
|
4231
|
+
export {};
|
4232
|
+
//# sourceMappingURL=client.d.ts.map
|