1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-07 23:02:56 +03:00

Bump eslint-plugin-matrix-org to enable @typescript-eslint/consistent-type-imports rule (#4680)

* Bump eslint-plugin-matrix-org to enable @typescript-eslint/consistent-type-imports rule

* Re-lint after merge
This commit is contained in:
Hugh Nimmo-Smith
2025-02-05 12:15:20 +00:00
committed by GitHub
parent 6e72b3554e
commit ff1db2b538
297 changed files with 1762 additions and 1573 deletions

View File

@@ -15,7 +15,7 @@ limitations under the License.
*/
import { UnstableValue } from "../NamespacedValue.ts";
import { IClientWellKnown } from "../client.ts";
import { type IClientWellKnown } from "../client.ts";
// disable lint because these are wire responses
/* eslint-disable camelcase */

View File

@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { RelatesToRelationship, REFERENCE_RELATION } from "./extensible_events.ts";
import { type RelatesToRelationship, type REFERENCE_RELATION } from "./extensible_events.ts";
import { UnstableValue } from "../NamespacedValue.ts";
import { MAssetEvent, MLocationEvent, MTimestampEvent } from "./location.ts";
import { type MAssetEvent, type MLocationEvent, type MTimestampEvent } from "./location.ts";
/**
* Beacon info and beacon event types as described in MSC3672

View File

@@ -16,48 +16,48 @@ limitations under the License.
import { NamespacedValue, UnstableValue } from "../NamespacedValue.ts";
import {
PolicyRuleEventContent,
RoomAvatarEventContent,
RoomCanonicalAliasEventContent,
RoomCreateEventContent,
RoomEncryptionEventContent,
RoomGuestAccessEventContent,
RoomHistoryVisibilityEventContent,
RoomJoinRulesEventContent,
RoomMemberEventContent,
RoomNameEventContent,
RoomPinnedEventsEventContent,
RoomPowerLevelsEventContent,
RoomServerAclEventContent,
RoomThirdPartyInviteEventContent,
RoomTombstoneEventContent,
RoomTopicEventContent,
SpaceChildEventContent,
SpaceParentEventContent,
type PolicyRuleEventContent,
type RoomAvatarEventContent,
type RoomCanonicalAliasEventContent,
type RoomCreateEventContent,
type RoomEncryptionEventContent,
type RoomGuestAccessEventContent,
type RoomHistoryVisibilityEventContent,
type RoomJoinRulesEventContent,
type RoomMemberEventContent,
type RoomNameEventContent,
type RoomPinnedEventsEventContent,
type RoomPowerLevelsEventContent,
type RoomServerAclEventContent,
type RoomThirdPartyInviteEventContent,
type RoomTombstoneEventContent,
type RoomTopicEventContent,
type SpaceChildEventContent,
type SpaceParentEventContent,
} from "./state_events.ts";
import { IGroupCallRoomMemberState, IGroupCallRoomState } from "../webrtc/groupCall.ts";
import { MSC3089EventContent } from "../models/MSC3089Branch.ts";
import { M_BEACON, M_BEACON_INFO, MBeaconEventContent, MBeaconInfoEventContent } from "./beacon.ts";
import { EmptyObject } from "./common.ts";
import { ReactionEventContent, RoomMessageEventContent, StickerEventContent } from "./events.ts";
import { type IGroupCallRoomMemberState, type IGroupCallRoomState } from "../webrtc/groupCall.ts";
import { type MSC3089EventContent } from "../models/MSC3089Branch.ts";
import { type M_BEACON, type M_BEACON_INFO, type MBeaconEventContent, type MBeaconInfoEventContent } from "./beacon.ts";
import { type EmptyObject } from "./common.ts";
import { type ReactionEventContent, type RoomMessageEventContent, type StickerEventContent } from "./events.ts";
import {
MCallAnswer,
MCallBase,
MCallCandidates,
MCallHangupReject,
MCallInviteNegotiate,
MCallReplacesEvent,
MCallSelectAnswer,
SDPStreamMetadata,
SDPStreamMetadataKey,
type MCallAnswer,
type MCallBase,
type MCallCandidates,
type MCallHangupReject,
type MCallInviteNegotiate,
type MCallReplacesEvent,
type MCallSelectAnswer,
type SDPStreamMetadata,
type SDPStreamMetadataKey,
} from "../webrtc/callEventTypes.ts";
import { EncryptionKeysEventContent, ICallNotifyContent } from "../matrixrtc/types.ts";
import { M_POLL_END, M_POLL_START, PollEndEventContent, PollStartEventContent } from "./polls.ts";
import { SessionMembershipData } from "../matrixrtc/CallMembership.ts";
import { LocalNotificationSettings } from "./local_notifications.ts";
import { IPushRules } from "./PushRules.ts";
import { SecretInfo, SecretStorageKeyDescription } from "../secret-storage.ts";
import { POLICIES_ACCOUNT_EVENT_TYPE } from "../models/invites-ignorer-types.ts";
import { type EncryptionKeysEventContent, type ICallNotifyContent } from "../matrixrtc/types.ts";
import { type M_POLL_END, type M_POLL_START, type PollEndEventContent, type PollStartEventContent } from "./polls.ts";
import { type SessionMembershipData } from "../matrixrtc/CallMembership.ts";
import { type LocalNotificationSettings } from "./local_notifications.ts";
import { type IPushRules } from "./PushRules.ts";
import { type SecretInfo, type SecretStorageKeyDescription } from "../secret-storage.ts";
import { type POLICIES_ACCOUNT_EVENT_TYPE } from "../models/invites-ignorer-types.ts";
export enum EventType {
// Room state events

View File

@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MsgType, RelationType } from "./event.ts";
import { FileInfo, ImageInfo, MediaEventContent } from "./media.ts";
import { XOR } from "./common.ts";
import { type MsgType, type RelationType } from "./event.ts";
import { type FileInfo, type ImageInfo, type MediaEventContent } from "./media.ts";
import { type XOR } from "./common.ts";
interface BaseTimelineEvent {
"body": string;

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { EitherAnd, NamespacedValue, Optional, UnstableValue } from "matrix-events-sdk";
import { type EitherAnd, NamespacedValue, type Optional, UnstableValue } from "matrix-events-sdk";
import { isProvided } from "../extensible_events_v1/utilities.ts";

View File

@@ -15,10 +15,10 @@ limitations under the License.
*/
// Types for MSC3488 - m.location: Extending events with location data
import { EitherAnd } from "matrix-events-sdk";
import { type EitherAnd } from "matrix-events-sdk";
import { UnstableValue } from "../NamespacedValue.ts";
import { M_TEXT } from "./extensible_events.ts";
import { type M_TEXT } from "./extensible_events.ts";
export enum LocationAssetType {
Self = "m.self",

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MsgType } from "../@types/event.ts";
import { type MsgType } from "../@types/event.ts";
/**
* Information on encrypted media attachments.

View File

@@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { EitherAnd, UnstableValue } from "matrix-events-sdk";
import { type EitherAnd, UnstableValue } from "matrix-events-sdk";
import {
ExtensibleAnyMessageEventContent,
REFERENCE_RELATION,
RelatesToRelationship,
TSNamespace,
type ExtensibleAnyMessageEventContent,
type REFERENCE_RELATION,
type RelatesToRelationship,
type TSNamespace,
} from "./extensible_events.ts";
import { EmptyObject } from "./common.ts";
import { type EmptyObject } from "./common.ts";
/**
* Identifier for a disclosed poll.

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { AuthDict } from "../interactive-auth.ts";
import { type AuthDict } from "../interactive-auth.ts";
/**
* The request body of a call to `POST /_matrix/client/v3/register`.

View File

@@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { IContent, IEvent } from "../models/event.ts";
import { Preset, Visibility } from "./partials.ts";
import { IEventWithRoomId, SearchKey } from "./search.ts";
import { IRoomEventFilter } from "../filter.ts";
import { Direction } from "../models/event-timeline.ts";
import { PushRuleAction } from "./PushRules.ts";
import { IRoomEvent } from "../sync-accumulator.ts";
import { EventType, RelationType, RoomType } from "./event.ts";
import { type IContent, type IEvent } from "../models/event.ts";
import { type Preset, type Visibility } from "./partials.ts";
import { type IEventWithRoomId, type SearchKey } from "./search.ts";
import { type IRoomEventFilter } from "../filter.ts";
import { type Direction } from "../models/event-timeline.ts";
import { type PushRuleAction } from "./PushRules.ts";
import { type IRoomEvent } from "../sync-accumulator.ts";
import { type EventType, type RelationType, type RoomType } from "./event.ts";
// allow camelcase as these are things that go onto the wire
/* eslint-disable camelcase */

View File

@@ -16,9 +16,9 @@ limitations under the License.
// Types relating to the /search API
import { IRoomEvent, IStateEvent } from "../sync-accumulator.ts";
import { IRoomEventFilter } from "../filter.ts";
import { SearchResult } from "../models/search-result.ts";
import { type IRoomEvent, type IStateEvent } from "../sync-accumulator.ts";
import { type IRoomEventFilter } from "../filter.ts";
import { type SearchResult } from "../models/search-result.ts";
/* eslint-disable camelcase */
export interface IEventWithRoomId extends IRoomEvent {

View File

@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { IPublicRoomsChunkRoom } from "../client.ts";
import { RoomType } from "./event.ts";
import { IStrippedState } from "../sync-accumulator.ts";
import { type IPublicRoomsChunkRoom } from "../client.ts";
import { type RoomType } from "./event.ts";
import { type IStrippedState } from "../sync-accumulator.ts";
// Types relating to Rooms of type `m.space` and related APIs

View File

@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { RoomType } from "./event.ts";
import { GuestAccess, HistoryVisibility, JoinRule, RestrictedAllowType } from "./partials.ts";
import { ImageInfo } from "./media.ts";
import { PolicyRecommendation } from "../models/invites-ignorer.ts";
import { type RoomType } from "./event.ts";
import { type GuestAccess, type HistoryVisibility, type JoinRule, type RestrictedAllowType } from "./partials.ts";
import { type ImageInfo } from "./media.ts";
import { type PolicyRecommendation } from "../models/invites-ignorer.ts";
export interface RoomCanonicalAliasEventContent {
alias?: string;

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { IdServerUnbindResult } from "./partials.ts";
import { type IdServerUnbindResult } from "./partials.ts";
// Types relating to Synapse Admin APIs

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { UnstableValue } from "../NamespacedValue.ts";
import { IMessageRendering } from "./extensible_events.ts";
import { type IMessageRendering } from "./extensible_events.ts";
/**
* Extensible topic event type based on MSC3765

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { AuthDict, IAuthData } from "../interactive-auth.ts";
import { type AuthDict, type IAuthData } from "../interactive-auth.ts";
/**
* Helper type to represent HTTP request body for a UIA enabled endpoint

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Optional } from "matrix-events-sdk/lib/types";
import { type Optional } from "matrix-events-sdk/lib/types";
/**
* Represents a simple Matrix namespaced value. This will assume that if a stable prefix

View File

@@ -17,9 +17,9 @@ limitations under the License.
*/
// eslint-disable-next-line no-restricted-imports
import { EventEmitter } from "events";
import { type EventEmitter } from "events";
import { ListenerMap, TypedEventEmitter } from "./models/typed-event-emitter.ts";
import { type ListenerMap, type TypedEventEmitter } from "./models/typed-event-emitter.ts";
export class ReEmitter {
public constructor(private readonly target: EventEmitter) {}

View File

@@ -16,13 +16,13 @@ limitations under the License.
import { ToDeviceMessageId } from "./@types/event.ts";
import { logger } from "./logger.ts";
import { MatrixClient, ClientEvent } from "./client.ts";
import { MatrixError } from "./http-api/index.ts";
import { type MatrixClient, ClientEvent } from "./client.ts";
import { type MatrixError } from "./http-api/index.ts";
import {
IndexedToDeviceBatch,
ToDeviceBatch,
ToDeviceBatchWithTxnId,
ToDevicePayload,
type IndexedToDeviceBatch,
type ToDeviceBatch,
type ToDeviceBatchWithTxnId,
type ToDevicePayload,
} from "./models/ToDeviceMessage.ts";
import { MatrixScheduler } from "./scheduler.ts";
import { SyncState } from "./sync.ts";

View File

@@ -15,9 +15,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { IClientWellKnown, IWellKnownConfig, IServerVersions } from "./client.ts";
import { type IClientWellKnown, type IWellKnownConfig, type IServerVersions } from "./client.ts";
import { logger } from "./logger.ts";
import { MatrixError, Method, timeoutSignal } from "./http-api/index.ts";
import { type MatrixError, Method, timeoutSignal } from "./http-api/index.ts";
import { SUPPORTED_MATRIX_VERSIONS } from "./version-support.ts";
// Dev note: Auto discovery is part of the spec.

View File

@@ -18,125 +18,151 @@ limitations under the License.
* This is an internal module. See {@link MatrixClient} for the public class.
*/
import { Optional } from "matrix-events-sdk";
import { type Optional } from "matrix-events-sdk";
import type { IDeviceKeys, IMegolmSessionData, IOneTimeKey } from "./@types/crypto.ts";
import { ISyncStateData, SetPresence, SyncApi, SyncApiOptions, SyncState } from "./sync.ts";
import { type ISyncStateData, type SetPresence, SyncApi, type SyncApiOptions, SyncState } from "./sync.ts";
import {
EventStatus,
IContent,
IDecryptOptions,
IEvent,
type IContent,
type IDecryptOptions,
type IEvent,
MatrixEvent,
MatrixEventEvent,
MatrixEventHandlerMap,
PushDetails,
type MatrixEventHandlerMap,
type PushDetails,
} from "./models/event.ts";
import { StubStore } from "./store/stub.ts";
import { CallEvent, CallEventHandlerMap, createNewMatrixCall, MatrixCall, supportsMatrixCall } from "./webrtc/call.ts";
import { Filter, IFilterDefinition, IRoomEventFilter } from "./filter.ts";
import { CallEventHandler, CallEventHandlerEvent, CallEventHandlerEventHandlerMap } from "./webrtc/callEventHandler.ts";
import {
type CallEvent,
type CallEventHandlerMap,
createNewMatrixCall,
type MatrixCall,
supportsMatrixCall,
} from "./webrtc/call.ts";
import { Filter, type IFilterDefinition, type IRoomEventFilter } from "./filter.ts";
import {
CallEventHandler,
type CallEventHandlerEvent,
type CallEventHandlerEventHandlerMap,
} from "./webrtc/callEventHandler.ts";
import {
GroupCallEventHandler,
GroupCallEventHandlerEvent,
GroupCallEventHandlerEventHandlerMap,
type GroupCallEventHandlerEvent,
type GroupCallEventHandlerEventHandlerMap,
} from "./webrtc/groupCallEventHandler.ts";
import * as utils from "./utils.ts";
import { noUnsafeEventProps, QueryDict, replaceParam, safeSet, sleep } from "./utils.ts";
import { noUnsafeEventProps, type QueryDict, replaceParam, safeSet, sleep } from "./utils.ts";
import { Direction, EventTimeline } from "./models/event-timeline.ts";
import { IActionsObject, PushProcessor } from "./pushprocessor.ts";
import { AutoDiscovery, AutoDiscoveryAction } from "./autodiscovery.ts";
import { type IActionsObject, PushProcessor } from "./pushprocessor.ts";
import { AutoDiscovery, type AutoDiscoveryAction } from "./autodiscovery.ts";
import { decodeBase64, encodeBase64, encodeUnpaddedBase64Url } from "./base64.ts";
import { IExportedDevice as IExportedOlmDevice } from "./crypto/OlmDevice.ts";
import { IOlmDevice } from "./crypto/algorithms/megolm.ts";
import { type IExportedDevice as IExportedOlmDevice } from "./crypto/OlmDevice.ts";
import { type IOlmDevice } from "./crypto/algorithms/megolm.ts";
import { TypedReEmitter } from "./ReEmitter.ts";
import { IRoomEncryption } from "./crypto/RoomList.ts";
import { logger, Logger } from "./logger.ts";
import { type IRoomEncryption } from "./crypto/RoomList.ts";
import { logger, type Logger } from "./logger.ts";
import { SERVICE_TYPES } from "./service-types.ts";
import {
Body,
type Body,
ClientPrefix,
FileType,
HttpApiEvent,
HttpApiEventHandlerMap,
HTTPError,
type FileType,
type HttpApiEvent,
type HttpApiEventHandlerMap,
type HTTPError,
IdentityPrefix,
IHttpOpts,
IRequestOpts,
type IHttpOpts,
type IRequestOpts,
MatrixError,
MatrixHttpApi,
MediaPrefix,
Method,
retryNetworkOperation,
TokenRefreshFunction,
Upload,
UploadOpts,
UploadResponse,
type TokenRefreshFunction,
type Upload,
type UploadOpts,
type UploadResponse,
} from "./http-api/index.ts";
import {
Crypto,
CryptoEvent as LegacyCryptoEvent,
CryptoEventHandlerMap as LegacyCryptoEventHandlerMap,
type CryptoEventHandlerMap as LegacyCryptoEventHandlerMap,
fixBackupKey,
ICheckOwnCrossSigningTrustOpts,
IRoomKeyRequestBody,
type ICheckOwnCrossSigningTrustOpts,
type IRoomKeyRequestBody,
isCryptoAvailable,
} from "./crypto/index.ts";
import { DeviceInfo } from "./crypto/deviceinfo.ts";
import { User, UserEvent, UserEventHandlerMap } from "./models/user.ts";
import { type DeviceInfo } from "./crypto/deviceinfo.ts";
import { User, UserEvent, type UserEventHandlerMap } from "./models/user.ts";
import { getHttpUriForMxc } from "./content-repo.ts";
import { SearchResult } from "./models/search-result.ts";
import { DEHYDRATION_ALGORITHM, IDehydratedDevice, IDehydratedDeviceKeyInfo } from "./crypto/dehydration.ts";
import { DEHYDRATION_ALGORITHM, type IDehydratedDevice, type IDehydratedDeviceKeyInfo } from "./crypto/dehydration.ts";
import {
IKeyBackupInfo,
IKeyBackupPrepareOpts,
IKeyBackupRestoreOpts,
IKeyBackupRestoreResult,
IKeyBackupRoomSessions,
IKeyBackupSession,
type IKeyBackupInfo,
type IKeyBackupPrepareOpts,
type IKeyBackupRestoreOpts,
type IKeyBackupRestoreResult,
type IKeyBackupRoomSessions,
type IKeyBackupSession,
} from "./crypto/keybackup.ts";
import { IIdentityServerProvider } from "./@types/IIdentityServerProvider.ts";
import { MatrixScheduler } from "./scheduler.ts";
import { BeaconEvent, BeaconEventHandlerMap } from "./models/beacon.ts";
import { AuthDict } from "./interactive-auth.ts";
import { IMinimalEvent, IRoomEvent, IStateEvent } from "./sync-accumulator.ts";
import { CrossSigningKey, ICreateSecretStorageOpts, IEncryptedEventInfo, IRecoveryKey } from "./crypto/api.ts";
import { EventTimelineSet } from "./models/event-timeline-set.ts";
import { VerificationRequest } from "./crypto/verification/request/VerificationRequest.ts";
import { VerificationBase as Verification } from "./crypto/verification/Base.ts";
import * as ContentHelpers from "./content-helpers.ts";
import { CrossSigningInfo, DeviceTrustLevel, ICacheCallbacks, UserTrustLevel } from "./crypto/CrossSigning.ts";
import { NotificationCountType, Room, RoomEvent, RoomEventHandlerMap, RoomNameState } from "./models/room.ts";
import { RoomMemberEvent, RoomMemberEventHandlerMap } from "./models/room-member.ts";
import { IPowerLevelsContent, RoomStateEvent, RoomStateEventHandlerMap } from "./models/room-state.ts";
import { type IIdentityServerProvider } from "./@types/IIdentityServerProvider.ts";
import { type MatrixScheduler } from "./scheduler.ts";
import { type BeaconEvent, type BeaconEventHandlerMap } from "./models/beacon.ts";
import { type AuthDict } from "./interactive-auth.ts";
import { type IMinimalEvent, type IRoomEvent, type IStateEvent } from "./sync-accumulator.ts";
import {
DelayedEventInfo,
IAddThreePidOnlyBody,
IBindThreePidBody,
IContextResponse,
ICreateRoomOpts,
IEventSearchOpts,
IFilterResponse,
IGuestAccessOpts,
IJoinRoomOpts,
INotificationsResponse,
IPaginateOpts,
IPresenceOpts,
IRedactOpts,
IRelationsRequestOpts,
IRelationsResponse,
IRoomDirectoryOptions,
ISearchOpts,
ISendEventResponse,
IStatusResponse,
ITagsResponse,
KnockRoomOpts,
SendDelayedEventRequestOpts,
SendDelayedEventResponse,
UpdateDelayedEventAction,
CrossSigningKey,
type ICreateSecretStorageOpts,
type IEncryptedEventInfo,
type IRecoveryKey,
} from "./crypto/api.ts";
import { type EventTimelineSet } from "./models/event-timeline-set.ts";
import { type VerificationRequest } from "./crypto/verification/request/VerificationRequest.ts";
import { type VerificationBase as Verification } from "./crypto/verification/Base.ts";
import * as ContentHelpers from "./content-helpers.ts";
import {
type CrossSigningInfo,
type DeviceTrustLevel,
type ICacheCallbacks,
type UserTrustLevel,
} from "./crypto/CrossSigning.ts";
import {
NotificationCountType,
type Room,
type RoomEvent,
type RoomEventHandlerMap,
type RoomNameState,
} from "./models/room.ts";
import { RoomMemberEvent, type RoomMemberEventHandlerMap } from "./models/room-member.ts";
import { type IPowerLevelsContent, type RoomStateEvent, type RoomStateEventHandlerMap } from "./models/room-state.ts";
import {
type DelayedEventInfo,
type IAddThreePidOnlyBody,
type IBindThreePidBody,
type IContextResponse,
type ICreateRoomOpts,
type IEventSearchOpts,
type IFilterResponse,
type IGuestAccessOpts,
type IJoinRoomOpts,
type INotificationsResponse,
type IPaginateOpts,
type IPresenceOpts,
type IRedactOpts,
type IRelationsRequestOpts,
type IRelationsResponse,
type IRoomDirectoryOptions,
type ISearchOpts,
type ISendEventResponse,
type IStatusResponse,
type ITagsResponse,
type KnockRoomOpts,
type SendDelayedEventRequestOpts,
type SendDelayedEventResponse,
type UpdateDelayedEventAction,
} from "./@types/requests.ts";
import {
AccountDataEvents,
type AccountDataEvents,
EventType,
LOCAL_NOTIFICATION_SETTINGS_PREFIX,
MSC3912_RELATION_BASED_REDACTIONS_PROP,
@@ -145,8 +171,8 @@ import {
RelationType,
RoomCreateTypeField,
RoomType,
StateEvents,
TimelineEvents,
type StateEvents,
type TimelineEvents,
UNSTABLE_MSC3088_ENABLED,
UNSTABLE_MSC3088_PURPOSE,
UNSTABLE_MSC3089_TREE_SUBTYPE,
@@ -154,54 +180,65 @@ import {
import {
GuestAccess,
HistoryVisibility,
IdServerUnbindResult,
JoinRule,
type IdServerUnbindResult,
type JoinRule,
Preset,
Terms,
Visibility,
type Terms,
type Visibility,
} from "./@types/partials.ts";
import { EventMapper, eventMapperFor, MapperOpts } from "./event-mapper.ts";
import { type EventMapper, eventMapperFor, type MapperOpts } from "./event-mapper.ts";
import { secureRandomString } from "./randomstring.ts";
import { BackupManager, IKeyBackup, IKeyBackupCheck, IPreparedKeyBackupVersion, TrustInfo } from "./crypto/backup.ts";
import { DEFAULT_TREE_POWER_LEVELS_TEMPLATE, MSC3089TreeSpace } from "./models/MSC3089TreeSpace.ts";
import { ISignatures } from "./@types/signed.ts";
import { IStore } from "./store/index.ts";
import { ISecretRequest } from "./crypto/SecretStorage.ts";
import {
IEventWithRoomId,
ISearchRequestBody,
ISearchResponse,
ISearchResults,
IStateEventWithRoomId,
BackupManager,
type IKeyBackup,
type IKeyBackupCheck,
type IPreparedKeyBackupVersion,
type TrustInfo,
} from "./crypto/backup.ts";
import { DEFAULT_TREE_POWER_LEVELS_TEMPLATE, MSC3089TreeSpace } from "./models/MSC3089TreeSpace.ts";
import { type ISignatures } from "./@types/signed.ts";
import { type IStore } from "./store/index.ts";
import { type ISecretRequest } from "./crypto/SecretStorage.ts";
import {
type IEventWithRoomId,
type ISearchRequestBody,
type ISearchResponse,
type ISearchResults,
type IStateEventWithRoomId,
SearchOrderBy,
} from "./@types/search.ts";
import { ISynapseAdminDeactivateResponse, ISynapseAdminWhoisResponse } from "./@types/synapse.ts";
import { IHierarchyRoom } from "./@types/spaces.ts";
import { type ISynapseAdminDeactivateResponse, type ISynapseAdminWhoisResponse } from "./@types/synapse.ts";
import { type IHierarchyRoom } from "./@types/spaces.ts";
import {
IPusher,
IPusherRequest,
IPushRule,
IPushRules,
PushRuleAction,
type IPusher,
type IPusherRequest,
type IPushRule,
type IPushRules,
type PushRuleAction,
PushRuleActionName,
PushRuleKind,
RuleId,
type RuleId,
} from "./@types/PushRules.ts";
import { IThreepid } from "./@types/threepids.ts";
import { CryptoStore, OutgoingRoomKeyRequest } from "./crypto/store/base.ts";
import { GroupCall, GroupCallIntent, GroupCallType, IGroupCallDataChannelOptions } from "./webrtc/groupCall.ts";
import { type IThreepid } from "./@types/threepids.ts";
import { type CryptoStore, type OutgoingRoomKeyRequest } from "./crypto/store/base.ts";
import {
GroupCall,
type GroupCallIntent,
type GroupCallType,
type IGroupCallDataChannelOptions,
} from "./webrtc/groupCall.ts";
import { MediaHandler } from "./webrtc/mediaHandler.ts";
import {
ILoginFlowsResponse,
IRefreshTokenResponse,
LoginRequest,
LoginResponse,
LoginTokenPostResponse,
SSOAction,
type ILoginFlowsResponse,
type IRefreshTokenResponse,
type LoginRequest,
type LoginResponse,
type LoginTokenPostResponse,
type SSOAction,
} from "./@types/auth.ts";
import { TypedEventEmitter } from "./models/typed-event-emitter.ts";
import { MAIN_ROOM_TIMELINE, ReceiptType } from "./@types/read_receipts.ts";
import { MSC3575SlidingSyncRequest, MSC3575SlidingSyncResponse, SlidingSync } from "./sliding-sync.ts";
import { type MSC3575SlidingSyncRequest, type MSC3575SlidingSyncResponse, type SlidingSync } from "./sliding-sync.ts";
import { SlidingSyncSdk } from "./sliding-sync-sdk.ts";
import {
determineFeatureSupport,
@@ -211,45 +248,49 @@ import {
ThreadFilterType,
threadFilterTypeToFilter,
} from "./models/thread.ts";
import { M_BEACON_INFO, MBeaconInfoEventContent } from "./@types/beacon.ts";
import { M_BEACON_INFO, type MBeaconInfoEventContent } from "./@types/beacon.ts";
import { NamespacedValue, UnstableValue } from "./NamespacedValue.ts";
import { ToDeviceMessageQueue } from "./ToDeviceMessageQueue.ts";
import { ToDeviceBatch } from "./models/ToDeviceMessage.ts";
import { type ToDeviceBatch } from "./models/ToDeviceMessage.ts";
import { IgnoredInvites } from "./models/invites-ignorer.ts";
import { UIARequest, UIAResponse } from "./@types/uia.ts";
import { LocalNotificationSettings } from "./@types/local_notifications.ts";
import { type UIARequest, type UIAResponse } from "./@types/uia.ts";
import { type LocalNotificationSettings } from "./@types/local_notifications.ts";
import { buildFeatureSupportMap, Feature, ServerSupport } from "./feature.ts";
import { BackupDecryptor, CryptoBackend } from "./common-crypto/CryptoBackend.ts";
import { type BackupDecryptor, type CryptoBackend } from "./common-crypto/CryptoBackend.ts";
import { RUST_SDK_STORE_PREFIX } from "./rust-crypto/constants.ts";
import {
BootstrapCrossSigningOpts,
CrossSigningKeyInfo,
CryptoApi,
type BootstrapCrossSigningOpts,
type CrossSigningKeyInfo,
type CryptoApi,
decodeRecoveryKey,
ImportRoomKeysOpts,
type ImportRoomKeysOpts,
CryptoEvent,
CryptoEventHandlerMap,
CryptoCallbacks,
type CryptoEventHandlerMap,
type CryptoCallbacks,
} from "./crypto-api/index.ts";
import { DeviceInfoMap } from "./crypto/DeviceList.ts";
import { type DeviceInfoMap } from "./crypto/DeviceList.ts";
import {
AddSecretStorageKeyOpts,
SecretStorageKey,
SecretStorageKeyDescription,
ServerSideSecretStorage,
type AddSecretStorageKeyOpts,
type SecretStorageKey,
type SecretStorageKeyDescription,
type ServerSideSecretStorage,
ServerSideSecretStorageImpl,
} from "./secret-storage.ts";
import { RegisterRequest, RegisterResponse } from "./@types/registration.ts";
import { type RegisterRequest, type RegisterResponse } from "./@types/registration.ts";
import { MatrixRTCSessionManager } from "./matrixrtc/MatrixRTCSessionManager.ts";
import { getRelationsThreadFilter } from "./thread-utils.ts";
import { KnownMembership, Membership } from "./@types/membership.ts";
import { RoomMessageEventContent, StickerEventContent } from "./@types/events.ts";
import { ImageInfo } from "./@types/media.ts";
import { Capabilities, ServerCapabilities } from "./serverCapabilities.ts";
import { KnownMembership, type Membership } from "./@types/membership.ts";
import { type RoomMessageEventContent, type StickerEventContent } from "./@types/events.ts";
import { type ImageInfo } from "./@types/media.ts";
import { type Capabilities, ServerCapabilities } from "./serverCapabilities.ts";
import { sha256 } from "./digest.ts";
import { keyFromAuthData } from "./common-crypto/key-passphrase.ts";
import { discoverAndValidateOIDCIssuerWellKnown, OidcClientConfig, validateAuthMetadataAndKeys } from "./oidc/index.ts";
import { EmptyObject } from "./@types/common.ts";
import {
discoverAndValidateOIDCIssuerWellKnown,
type OidcClientConfig,
validateAuthMetadataAndKeys,
} from "./oidc/index.ts";
import { type EmptyObject } from "./@types/common.ts";
export type Store = IStore;

View File

@@ -15,13 +15,13 @@ limitations under the License.
*/
import type { IDeviceLists, IToDeviceEvent } from "../sync-accumulator.ts";
import { IClearEvent, MatrixEvent } from "../models/event.ts";
import { Room } from "../models/room.ts";
import { CryptoApi, DecryptionFailureCode, ImportRoomKeysOpts } from "../crypto-api/index.ts";
import { CrossSigningInfo, UserTrustLevel } from "../crypto/CrossSigning.ts";
import { IEncryptedEventInfo } from "../crypto/api.ts";
import { KeyBackupInfo, KeyBackupSession } from "../crypto-api/keybackup.ts";
import { IMegolmSessionData } from "../@types/crypto.ts";
import { type IClearEvent, type MatrixEvent } from "../models/event.ts";
import { type Room } from "../models/room.ts";
import { type CryptoApi, type DecryptionFailureCode, type ImportRoomKeysOpts } from "../crypto-api/index.ts";
import { type CrossSigningInfo, type UserTrustLevel } from "../crypto/CrossSigning.ts";
import { type IEncryptedEventInfo } from "../crypto/api.ts";
import { type KeyBackupInfo, type KeyBackupSession } from "../crypto-api/keybackup.ts";
import { type IMegolmSessionData } from "../@types/crypto.ts";
/**
* Common interface for the crypto implementations

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MBeaconEventContent, MBeaconInfoContent, MBeaconInfoEventContent } from "./@types/beacon.ts";
import { type MBeaconEventContent, type MBeaconInfoContent, type MBeaconInfoEventContent } from "./@types/beacon.ts";
import { MsgType } from "./@types/event.ts";
import { M_TEXT, REFERENCE_RELATION } from "./@types/extensible_events.ts";
import { isProvided } from "./extensible_events_v1/utilities.ts";
@@ -23,14 +23,14 @@ import {
LocationAssetType,
M_LOCATION,
M_TIMESTAMP,
LocationEventWireContent,
MLocationEventContent,
MLocationContent,
MAssetContent,
LegacyLocationEventContent,
type LocationEventWireContent,
type MLocationEventContent,
type MLocationContent,
type MAssetContent,
type LegacyLocationEventContent,
} from "./@types/location.ts";
import { MRoomTopicEventContent, MTopicContent, M_TOPIC } from "./@types/topic.ts";
import { RoomMessageEventContent } from "./@types/events.ts";
import { type MRoomTopicEventContent, type MTopicContent, M_TOPIC } from "./@types/topic.ts";
import { type RoomMessageEventContent } from "./@types/events.ts";
/**
* Generates the content for a HTML Message event

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
import { CryptoEvent } from "./CryptoEvent.ts";
import { VerificationRequest } from "./verification.ts";
import { UserVerificationStatus } from "./index.ts";
import { RustBackupCryptoEventMap } from "../rust-crypto/backup.ts";
import { EmptyObject } from "../@types/common.ts";
import { type CryptoEvent } from "./CryptoEvent.ts";
import { type VerificationRequest } from "./verification.ts";
import { type UserVerificationStatus } from "./index.ts";
import { type RustBackupCryptoEventMap } from "../rust-crypto/backup.ts";
import { type EmptyObject } from "../@types/common.ts";
/**
* A map of the {@link CryptoEvent} fired by the {@link CryptoApi} and their payloads.

View File

@@ -17,20 +17,20 @@ limitations under the License.
import type { SecretsBundle } from "@matrix-org/matrix-sdk-crypto-wasm";
import type { IMegolmSessionData } from "../@types/crypto.ts";
import type { ToDeviceBatch, ToDevicePayload } from "../models/ToDeviceMessage.ts";
import { Room } from "../models/room.ts";
import { DeviceMap } from "../models/device.ts";
import { UIAuthCallback } from "../interactive-auth.ts";
import { PassphraseInfo, SecretStorageKeyDescription } from "../secret-storage.ts";
import { VerificationRequest } from "./verification.ts";
import { type Room } from "../models/room.ts";
import { type DeviceMap } from "../models/device.ts";
import { type UIAuthCallback } from "../interactive-auth.ts";
import { type PassphraseInfo, type SecretStorageKeyDescription } from "../secret-storage.ts";
import { type VerificationRequest } from "./verification.ts";
import {
BackupTrustInfo,
KeyBackupCheck,
KeyBackupInfo,
KeyBackupRestoreOpts,
KeyBackupRestoreResult,
type BackupTrustInfo,
type KeyBackupCheck,
type KeyBackupInfo,
type KeyBackupRestoreOpts,
type KeyBackupRestoreResult,
} from "./keybackup.ts";
import { ISignatures } from "../@types/signed.ts";
import { MatrixEvent } from "../models/event.ts";
import { type ISignatures } from "../@types/signed.ts";
import { type MatrixEvent } from "../models/event.ts";
/**
* `matrix-js-sdk/lib/crypto-api`: End-to-end encryption support.

View File

@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { ISigned } from "../@types/signed.ts";
import { AESEncryptedSecretStoragePayload } from "../@types/AESEncryptedSecretStoragePayload.ts";
import { ImportRoomKeyProgressData } from "./index.ts";
import { type ISigned } from "../@types/signed.ts";
import { type AESEncryptedSecretStoragePayload } from "../@types/AESEncryptedSecretStoragePayload.ts";
import { type ImportRoomKeyProgressData } from "./index.ts";
export interface Curve25519AuthData {
public_key: string;

View File

@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixEvent } from "../models/event.ts";
import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
import { type MatrixEvent } from "../models/event.ts";
import { type TypedEventEmitter } from "../models/typed-event-emitter.ts";
/**
* An incoming, or outgoing, request to verify a user or a device via cross-signing.

View File

@@ -19,18 +19,18 @@ limitations under the License.
*/
import type { PkSigning } from "@matrix-org/olm";
import { IObject, pkSign, pkVerify } from "./olmlib.ts";
import { type IObject, pkSign, pkVerify } from "./olmlib.ts";
import { logger } from "../logger.ts";
import { IndexedDBCryptoStore } from "../crypto/store/indexeddb-crypto-store.ts";
import { DeviceInfo } from "./deviceinfo.ts";
import { ISignedKey, MatrixClient } from "../client.ts";
import { OlmDevice } from "./OlmDevice.ts";
import { ICryptoCallbacks } from "./index.ts";
import { ISignatures } from "../@types/signed.ts";
import { CryptoStore, SecretStorePrivateKeys } from "./store/base.ts";
import { ServerSideSecretStorage, SecretStorageKeyDescription } from "../secret-storage.ts";
import { type DeviceInfo } from "./deviceinfo.ts";
import { type ISignedKey, type MatrixClient } from "../client.ts";
import { type OlmDevice } from "./OlmDevice.ts";
import { type ICryptoCallbacks } from "./index.ts";
import { type ISignatures } from "../@types/signed.ts";
import { type CryptoStore, type SecretStorePrivateKeys } from "./store/base.ts";
import { type ServerSideSecretStorage, type SecretStorageKeyDescription } from "../secret-storage.ts";
import {
CrossSigningKeyInfo,
type CrossSigningKeyInfo,
DeviceVerificationStatus,
UserVerificationStatus as UserTrustLevel,
} from "../crypto-api/index.ts";

View File

@@ -19,16 +19,16 @@ limitations under the License.
*/
import { logger } from "../logger.ts";
import { DeviceInfo, IDevice } from "./deviceinfo.ts";
import { CrossSigningInfo, ICrossSigningInfo } from "./CrossSigning.ts";
import { DeviceInfo, type IDevice } from "./deviceinfo.ts";
import { CrossSigningInfo, type ICrossSigningInfo } from "./CrossSigning.ts";
import * as olmlib from "./olmlib.ts";
import { IndexedDBCryptoStore } from "./store/indexeddb-crypto-store.ts";
import { chunkPromises, defer, IDeferred, sleep } from "../utils.ts";
import { DeviceKeys, IDownloadKeyResult, Keys, MatrixClient, SigningKeys } from "../client.ts";
import { OlmDevice } from "./OlmDevice.ts";
import { CryptoStore } from "./store/base.ts";
import { chunkPromises, defer, type IDeferred, sleep } from "../utils.ts";
import { type DeviceKeys, type IDownloadKeyResult, type Keys, type MatrixClient, type SigningKeys } from "../client.ts";
import { type OlmDevice } from "./OlmDevice.ts";
import { type CryptoStore } from "./store/base.ts";
import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
import { CryptoEvent, CryptoEventHandlerMap } from "./index.ts";
import { CryptoEvent, type CryptoEventHandlerMap } from "./index.ts";
/* State transition diagram for DeviceList.deviceTrackingStatus
*

View File

@@ -16,17 +16,23 @@ limitations under the License.
import { logger } from "../logger.ts";
import { MatrixEvent } from "../models/event.ts";
import { createCryptoStoreCacheCallbacks, ICacheCallbacks } from "./CrossSigning.ts";
import { createCryptoStoreCacheCallbacks, type ICacheCallbacks } from "./CrossSigning.ts";
import { IndexedDBCryptoStore } from "./store/indexeddb-crypto-store.ts";
import { Method, ClientPrefix } from "../http-api/index.ts";
import { Crypto, ICryptoCallbacks } from "./index.ts";
import { ClientEvent, ClientEventHandlerMap, CrossSigningKeys, ISignedKey, KeySignatures } from "../client.ts";
import { IKeyBackupInfo } from "./keybackup.ts";
import { type Crypto, type ICryptoCallbacks } from "./index.ts";
import {
ClientEvent,
type ClientEventHandlerMap,
type CrossSigningKeys,
type ISignedKey,
type KeySignatures,
} from "../client.ts";
import { type IKeyBackupInfo } from "./keybackup.ts";
import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
import { AccountDataClient, SecretStorageKeyDescription } from "../secret-storage.ts";
import { BootstrapCrossSigningOpts, CrossSigningKeyInfo } from "../crypto-api/index.ts";
import { AccountDataEvents } from "../@types/event.ts";
import { EmptyObject } from "../@types/common.ts";
import { type AccountDataClient, type SecretStorageKeyDescription } from "../secret-storage.ts";
import { type BootstrapCrossSigningOpts, type CrossSigningKeyInfo } from "../crypto-api/index.ts";
import { type AccountDataEvents } from "../@types/event.ts";
import { type EmptyObject } from "../@types/common.ts";
interface ICrossSigningKeys {
authUpload: BootstrapCrossSigningOpts["authUploadDeviceSigningKeys"];

View File

@@ -14,14 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Account, InboundGroupSession, OutboundGroupSession, Session, Utility } from "@matrix-org/olm";
import {
type Account,
type InboundGroupSession,
type OutboundGroupSession,
type Session,
type Utility,
} from "@matrix-org/olm";
import { logger, Logger } from "../logger.ts";
import { logger, type Logger } from "../logger.ts";
import { IndexedDBCryptoStore } from "./store/indexeddb-crypto-store.ts";
import { CryptoStore, IProblem, ISessionInfo, IWithheld } from "./store/base.ts";
import { IOlmDevice, IOutboundGroupSessionKey } from "./algorithms/megolm.ts";
import { IMegolmSessionData, OlmGroupSessionExtraData } from "../@types/crypto.ts";
import { IMessage } from "./algorithms/olm.ts";
import { type CryptoStore, type IProblem, type ISessionInfo, type IWithheld } from "./store/base.ts";
import { type IOlmDevice, type IOutboundGroupSessionKey } from "./algorithms/megolm.ts";
import { type IMegolmSessionData, type OlmGroupSessionExtraData } from "../@types/crypto.ts";
import { type IMessage } from "./algorithms/olm.ts";
import { DecryptionFailureCode } from "../crypto-api/index.ts";
import { DecryptionError } from "../common-crypto/CryptoBackend.ts";

View File

@@ -17,12 +17,12 @@ limitations under the License.
import { v4 as uuidv4 } from "uuid";
import { logger } from "../logger.ts";
import { MatrixClient } from "../client.ts";
import { IRoomKeyRequestBody, IRoomKeyRequestRecipient } from "./index.ts";
import { CryptoStore, OutgoingRoomKeyRequest } from "./store/base.ts";
import { type MatrixClient } from "../client.ts";
import { type IRoomKeyRequestBody, type IRoomKeyRequestRecipient } from "./index.ts";
import { type CryptoStore, type OutgoingRoomKeyRequest } from "./store/base.ts";
import { EventType, ToDeviceMessageId } from "../@types/event.ts";
import { MapWithDefault } from "../utils.ts";
import { EmptyObject } from "../@types/common.ts";
import { type EmptyObject } from "../@types/common.ts";
/**
* Internal module. Management of outgoing room key requests.

View File

@@ -18,7 +18,7 @@ limitations under the License.
* Manages the list of encrypted rooms
*/
import { CryptoStore } from "./store/base.ts";
import { type CryptoStore } from "./store/base.ts";
import { IndexedDBCryptoStore } from "./store/indexeddb-crypto-store.ts";
/* eslint-disable camelcase */

View File

@@ -15,12 +15,12 @@ limitations under the License.
*/
import { v4 as uuidv4 } from "uuid";
import { MatrixClient } from "../client.ts";
import { ICryptoCallbacks, IEncryptedContent } from "./index.ts";
import { defer, IDeferred } from "../utils.ts";
import { type MatrixClient } from "../client.ts";
import { type ICryptoCallbacks, type IEncryptedContent } from "./index.ts";
import { defer, type IDeferred } from "../utils.ts";
import { ToDeviceMessageId } from "../@types/event.ts";
import { logger } from "../logger.ts";
import { MatrixEvent } from "../models/event.ts";
import { type MatrixEvent } from "../models/event.ts";
import * as olmlib from "./olmlib.ts";
export interface ISecretRequest {

View File

@@ -14,20 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { ICryptoCallbacks } from "./index.ts";
import { MatrixEvent } from "../models/event.ts";
import { MatrixClient } from "../client.ts";
import { type ICryptoCallbacks } from "./index.ts";
import { type MatrixEvent } from "../models/event.ts";
import { type MatrixClient } from "../client.ts";
import {
SecretStorageKeyDescription,
SecretStorageKeyTuple,
SecretStorageKeyObject,
AddSecretStorageKeyOpts,
AccountDataClient,
ServerSideSecretStorage,
type SecretStorageKeyDescription,
type SecretStorageKeyTuple,
type SecretStorageKeyObject,
type AddSecretStorageKeyOpts,
type AccountDataClient,
type ServerSideSecretStorage,
ServerSideSecretStorageImpl,
SecretStorageKey,
type SecretStorageKey,
} from "../secret-storage.ts";
import { ISecretRequest, SecretSharing } from "./SecretSharing.ts";
import { type ISecretRequest, SecretSharing } from "./SecretSharing.ts";
/* re-exports for backwards compatibility */
export type {

View File

@@ -19,14 +19,19 @@ limitations under the License.
*/
import type { IMegolmSessionData } from "../../@types/crypto.ts";
import { MatrixClient } from "../../client.ts";
import { Room } from "../../models/room.ts";
import { OlmDevice } from "../OlmDevice.ts";
import { IContent, MatrixEvent, RoomMember } from "../../matrix.ts";
import { Crypto, IEncryptedContent, IEventDecryptionResult, IncomingRoomKeyRequest } from "../index.ts";
import { DeviceInfo } from "../deviceinfo.ts";
import { IRoomEncryption } from "../RoomList.ts";
import { DeviceInfoMap } from "../DeviceList.ts";
import { type MatrixClient } from "../../client.ts";
import { type Room } from "../../models/room.ts";
import { type OlmDevice } from "../OlmDevice.ts";
import { type IContent, type MatrixEvent, type RoomMember } from "../../matrix.ts";
import {
type Crypto,
type IEncryptedContent,
type IEventDecryptionResult,
type IncomingRoomKeyRequest,
} from "../index.ts";
import { type DeviceInfo } from "../deviceinfo.ts";
import { type IRoomEncryption } from "../RoomList.ts";
import { type DeviceInfoMap } from "../DeviceList.ts";
/**
* Map of registered encryption algorithm classes. A map from string to {@link EncryptionAlgorithm} class

View File

@@ -21,27 +21,27 @@ limitations under the License.
import { v4 as uuidv4 } from "uuid";
import type { IEventDecryptionResult, IMegolmSessionData } from "../../@types/crypto.ts";
import { logger, Logger } from "../../logger.ts";
import { logger, type Logger } from "../../logger.ts";
import * as olmlib from "../olmlib.ts";
import {
DecryptionAlgorithm,
DecryptionClassParams,
type DecryptionClassParams,
EncryptionAlgorithm,
IParams,
type IParams,
registerAlgorithm,
UnknownDeviceError,
} from "./base.ts";
import { IDecryptedGroupMessage, WITHHELD_MESSAGES } from "../OlmDevice.ts";
import { Room } from "../../models/room.ts";
import { DeviceInfo } from "../deviceinfo.ts";
import { IOlmSessionResult } from "../olmlib.ts";
import { DeviceInfoMap } from "../DeviceList.ts";
import { IContent, MatrixEvent } from "../../models/event.ts";
import { type IDecryptedGroupMessage, WITHHELD_MESSAGES } from "../OlmDevice.ts";
import { type Room } from "../../models/room.ts";
import { type DeviceInfo } from "../deviceinfo.ts";
import { type IOlmSessionResult } from "../olmlib.ts";
import { type DeviceInfoMap } from "../DeviceList.ts";
import { type IContent, type MatrixEvent } from "../../models/event.ts";
import { EventType, MsgType, ToDeviceMessageId } from "../../@types/event.ts";
import { IMegolmEncryptedContent, IncomingRoomKeyRequest, IEncryptedContent } from "../index.ts";
import { type IMegolmEncryptedContent, type IncomingRoomKeyRequest, type IEncryptedContent } from "../index.ts";
import { RoomKeyRequestState } from "../OutgoingRoomKeyRequestManager.ts";
import { OlmGroupSessionExtraData } from "../../@types/crypto.ts";
import { MatrixError } from "../../http-api/index.ts";
import { type OlmGroupSessionExtraData } from "../../@types/crypto.ts";
import { type MatrixError } from "../../http-api/index.ts";
import { immediate, MapWithDefault } from "../../utils.ts";
import { KnownMembership } from "../../@types/membership.ts";
import { DecryptionFailureCode } from "../../crypto-api/index.ts";

View File

@@ -23,10 +23,10 @@ import { logger } from "../../logger.ts";
import * as olmlib from "../olmlib.ts";
import { DeviceInfo } from "../deviceinfo.ts";
import { DecryptionAlgorithm, EncryptionAlgorithm, registerAlgorithm } from "./base.ts";
import { Room } from "../../models/room.ts";
import { IContent, MatrixEvent } from "../../models/event.ts";
import { IEncryptedContent, IOlmEncryptedContent } from "../index.ts";
import { IInboundSession } from "../OlmDevice.ts";
import { type Room } from "../../models/room.ts";
import { type IContent, type MatrixEvent } from "../../models/event.ts";
import { type IEncryptedContent, type IOlmEncryptedContent } from "../index.ts";
import { type IInboundSession } from "../OlmDevice.ts";
import { DecryptionFailureCode } from "../../crypto-api/index.ts";
import { DecryptionError } from "../../common-crypto/CryptoBackend.ts";

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { DeviceInfo } from "./deviceinfo.ts";
import { type DeviceInfo } from "./deviceinfo.ts";
/* re-exports for backwards compatibility. */
// CrossSigningKey is used as a value in `client.ts`, we can't export it as a type

View File

@@ -22,27 +22,27 @@ import type { IMegolmSessionData } from "../@types/crypto.ts";
import { MatrixClient } from "../client.ts";
import { logger } from "../logger.ts";
import { MEGOLM_ALGORITHM, verifySignature } from "./olmlib.ts";
import { DeviceInfo } from "./deviceinfo.ts";
import { DeviceTrustLevel } from "./CrossSigning.ts";
import { type DeviceInfo } from "./deviceinfo.ts";
import { type DeviceTrustLevel } from "./CrossSigning.ts";
import { keyFromPassphrase } from "./key_passphrase.ts";
import { encodeUri, safeSet, sleep } from "../utils.ts";
import { IndexedDBCryptoStore } from "./store/indexeddb-crypto-store.ts";
import {
Curve25519SessionData,
IAes256AuthData,
ICurve25519AuthData,
IKeyBackupInfo,
IKeyBackupSession,
type Curve25519SessionData,
type IAes256AuthData,
type ICurve25519AuthData,
type IKeyBackupInfo,
type IKeyBackupSession,
} from "./keybackup.ts";
import { UnstableValue } from "../NamespacedValue.ts";
import { CryptoEvent } from "./index.ts";
import { ClientPrefix, HTTPError, MatrixError, Method } from "../http-api/index.ts";
import { BackupTrustInfo } from "../crypto-api/keybackup.ts";
import { BackupDecryptor } from "../common-crypto/CryptoBackend.ts";
import { ClientPrefix, type HTTPError, MatrixError, Method } from "../http-api/index.ts";
import { type BackupTrustInfo } from "../crypto-api/keybackup.ts";
import { type BackupDecryptor } from "../common-crypto/CryptoBackend.ts";
import { encodeRecoveryKey } from "../crypto-api/index.ts";
import decryptAESSecretStorageItem from "../utils/decryptAESSecretStorageItem.ts";
import encryptAESSecretStorageItem from "../utils/encryptAESSecretStorageItem.ts";
import { AESEncryptedSecretStoragePayload } from "../@types/AESEncryptedSecretStoragePayload.ts";
import { type AESEncryptedSecretStoragePayload } from "../@types/AESEncryptedSecretStoragePayload.ts";
import { calculateKeyCheck } from "../secret-storage.ts";
const KEY_BACKUP_KEYS_PER_REQUEST = 200;

View File

@@ -20,9 +20,9 @@ import type { IDeviceKeys, IOneTimeKey } from "../@types/crypto.ts";
import { decodeBase64, encodeBase64 } from "../base64.ts";
import { IndexedDBCryptoStore } from "../crypto/store/indexeddb-crypto-store.ts";
import { logger } from "../logger.ts";
import { Crypto } from "./index.ts";
import { type Crypto } from "./index.ts";
import { Method } from "../http-api/index.ts";
import { SecretStorageKeyDescription } from "../secret-storage.ts";
import { type SecretStorageKeyDescription } from "../secret-storage.ts";
import decryptAESSecretStorageItem from "../utils/decryptAESSecretStorageItem.ts";
import encryptAESSecretStorageItem from "../utils/encryptAESSecretStorageItem.ts";

View File

@@ -15,7 +15,7 @@ limitations under the License.
*/
import { Device } from "../models/device.ts";
import { DeviceInfo } from "./deviceinfo.ts";
import { type DeviceInfo } from "./deviceinfo.ts";
/**
* Convert a {@link DeviceInfo} to a {@link Device}.

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { ISignatures } from "../@types/signed.ts";
import { type ISignatures } from "../@types/signed.ts";
import { DeviceVerification } from "../models/device.ts";
export interface IDevice {

View File

@@ -25,96 +25,102 @@ import type { PkDecryption, PkSigning } from "@matrix-org/olm";
import { EventType, ToDeviceMessageId } from "../@types/event.ts";
import { TypedReEmitter } from "../ReEmitter.ts";
import { logger } from "../logger.ts";
import { IExportedDevice, OlmDevice } from "./OlmDevice.ts";
import { IOlmDevice } from "./algorithms/megolm.ts";
import { type IExportedDevice, OlmDevice } from "./OlmDevice.ts";
import { type IOlmDevice } from "./algorithms/megolm.ts";
import * as olmlib from "./olmlib.ts";
import { DeviceInfoMap, DeviceList } from "./DeviceList.ts";
import { DeviceInfo, IDevice } from "./deviceinfo.ts";
import { type DeviceInfoMap, DeviceList } from "./DeviceList.ts";
import { DeviceInfo, type IDevice } from "./deviceinfo.ts";
import type { DecryptionAlgorithm, EncryptionAlgorithm } from "./algorithms/index.ts";
import * as algorithms from "./algorithms/index.ts";
import { createCryptoStoreCacheCallbacks, CrossSigningInfo, DeviceTrustLevel, UserTrustLevel } from "./CrossSigning.ts";
import { EncryptionSetupBuilder } from "./EncryptionSetup.ts";
import { SecretStorage as LegacySecretStorage } from "./SecretStorage.ts";
import { CrossSigningKey, ICreateSecretStorageOpts, IEncryptedEventInfo, IRecoveryKey } from "./api.ts";
import { CrossSigningKey, type ICreateSecretStorageOpts, type IEncryptedEventInfo, type IRecoveryKey } from "./api.ts";
import { OutgoingRoomKeyRequestManager } from "./OutgoingRoomKeyRequestManager.ts";
import { IndexedDBCryptoStore } from "./store/indexeddb-crypto-store.ts";
import { VerificationBase } from "./verification/Base.ts";
import { type VerificationBase } from "./verification/Base.ts";
import { ReciprocateQRCode, SCAN_QR_CODE_METHOD, SHOW_QR_CODE_METHOD } from "./verification/QRCode.ts";
import { SAS as SASVerification } from "./verification/SAS.ts";
import { keyFromPassphrase } from "./key_passphrase.ts";
import { VerificationRequest } from "./verification/request/VerificationRequest.ts";
import { InRoomChannel, InRoomRequests } from "./verification/request/InRoomChannel.ts";
import { Request, ToDeviceChannel, ToDeviceRequests } from "./verification/request/ToDeviceChannel.ts";
import { type Request, ToDeviceChannel, ToDeviceRequests } from "./verification/request/ToDeviceChannel.ts";
import { IllegalMethod } from "./verification/IllegalMethod.ts";
import { KeySignatureUploadError } from "../errors.ts";
import { DehydrationManager } from "./dehydration.ts";
import { BackupManager, LibOlmBackupDecryptor, backupTrustInfoFromLegacyTrustInfo } from "./backup.ts";
import { IStore } from "../store/index.ts";
import { Room, RoomEvent } from "../models/room.ts";
import { RoomMember, RoomMemberEvent } from "../models/room-member.ts";
import { EventStatus, IContent, IEvent, MatrixEvent, MatrixEventEvent } from "../models/event.ts";
import { ToDeviceBatch, ToDevicePayload } from "../models/ToDeviceMessage.ts";
import { ClientEvent, IKeysUploadResponse, ISignedKey, IUploadKeySignaturesResponse, MatrixClient } from "../client.ts";
import { IRoomEncryption, RoomList } from "./RoomList.ts";
import { IKeyBackupInfo } from "./keybackup.ts";
import { ISyncStateData } from "../sync.ts";
import { CryptoStore } from "./store/base.ts";
import { IVerificationChannel } from "./verification/request/Channel.ts";
import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
import { IDeviceLists, ISyncResponse, IToDeviceEvent } from "../sync-accumulator.ts";
import { ISignatures } from "../@types/signed.ts";
import { IMessage } from "./algorithms/olm.ts";
import { type IStore } from "../store/index.ts";
import { type Room, RoomEvent } from "../models/room.ts";
import { type RoomMember, RoomMemberEvent } from "../models/room-member.ts";
import { EventStatus, type IContent, type IEvent, MatrixEvent, MatrixEventEvent } from "../models/event.ts";
import { type ToDeviceBatch, type ToDevicePayload } from "../models/ToDeviceMessage.ts";
import {
BackupDecryptor,
CryptoBackend,
ClientEvent,
type IKeysUploadResponse,
type ISignedKey,
type IUploadKeySignaturesResponse,
MatrixClient,
} from "../client.ts";
import { type IRoomEncryption, RoomList } from "./RoomList.ts";
import { type IKeyBackupInfo } from "./keybackup.ts";
import { type ISyncStateData } from "../sync.ts";
import { type CryptoStore } from "./store/base.ts";
import { type IVerificationChannel } from "./verification/request/Channel.ts";
import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
import { type IDeviceLists, type ISyncResponse, type IToDeviceEvent } from "../sync-accumulator.ts";
import { type ISignatures } from "../@types/signed.ts";
import { type IMessage } from "./algorithms/olm.ts";
import {
type BackupDecryptor,
type CryptoBackend,
DecryptionError,
OnSyncCompletedData,
type OnSyncCompletedData,
} from "../common-crypto/CryptoBackend.ts";
import { RoomState, RoomStateEvent } from "../models/room-state.ts";
import { type RoomState, RoomStateEvent } from "../models/room-state.ts";
import { MapWithDefault, recursiveMapToObject } from "../utils.ts";
import {
AccountDataClient,
AddSecretStorageKeyOpts,
type AccountDataClient,
type AddSecretStorageKeyOpts,
calculateKeyCheck,
SECRET_STORAGE_ALGORITHM_V1_AES,
SecretStorageKey,
SecretStorageKeyDescription,
SecretStorageKeyObject,
SecretStorageKeyTuple,
type SecretStorageKey,
type SecretStorageKeyDescription,
type SecretStorageKeyObject,
type SecretStorageKeyTuple,
ServerSideSecretStorageImpl,
} from "../secret-storage.ts";
import { ISecretRequest } from "./SecretSharing.ts";
import { type ISecretRequest } from "./SecretSharing.ts";
import {
BackupTrustInfo,
BootstrapCrossSigningOpts,
CrossSigningKeyInfo,
CrossSigningStatus,
type BackupTrustInfo,
type BootstrapCrossSigningOpts,
type CrossSigningKeyInfo,
type CrossSigningStatus,
decodeRecoveryKey,
DecryptionFailureCode,
DeviceIsolationMode,
DeviceVerificationStatus,
type DeviceIsolationMode,
type DeviceVerificationStatus,
encodeRecoveryKey,
EventEncryptionInfo,
type EventEncryptionInfo,
EventShieldColour,
EventShieldReason,
ImportRoomKeysOpts,
KeyBackupCheck,
KeyBackupInfo,
OwnDeviceKeys,
type ImportRoomKeysOpts,
type KeyBackupCheck,
type KeyBackupInfo,
type OwnDeviceKeys,
CryptoEvent as CryptoApiCryptoEvent,
CryptoEventHandlerMap as CryptoApiCryptoEventHandlerMap,
KeyBackupRestoreResult,
KeyBackupRestoreOpts,
StartDehydrationOpts,
type CryptoEventHandlerMap as CryptoApiCryptoEventHandlerMap,
type KeyBackupRestoreResult,
type KeyBackupRestoreOpts,
type StartDehydrationOpts,
} from "../crypto-api/index.ts";
import { Device, DeviceMap } from "../models/device.ts";
import { type Device, type DeviceMap } from "../models/device.ts";
import { deviceInfoToDevice } from "./device-converter.ts";
import { ClientPrefix, MatrixError, Method } from "../http-api/index.ts";
import { decodeBase64, encodeBase64 } from "../base64.ts";
import { KnownMembership } from "../@types/membership.ts";
import decryptAESSecretStorageItem from "../utils/decryptAESSecretStorageItem.ts";
import encryptAESSecretStorageItem from "../utils/encryptAESSecretStorageItem.ts";
import { AESEncryptedSecretStoragePayload } from "../@types/AESEncryptedSecretStoragePayload.ts";
import { type AESEncryptedSecretStoragePayload } from "../@types/AESEncryptedSecretStoragePayload.ts";
/* re-exports for backwards compatibility */
export type {

View File

@@ -15,7 +15,7 @@ limitations under the License.
*/
// Export for backward compatibility
import { ImportRoomKeyProgressData } from "../crypto-api/index.ts";
import { type ImportRoomKeyProgressData } from "../crypto-api/index.ts";
export type {
Curve25519AuthData as ICurve25519AuthData,

View File

@@ -22,14 +22,14 @@ import anotherjson from "another-json";
import type { PkSigning } from "@matrix-org/olm";
import type { IOneTimeKey } from "../@types/crypto.ts";
import { OlmDevice } from "./OlmDevice.ts";
import { DeviceInfo } from "./deviceinfo.ts";
import { Logger, logger } from "../logger.ts";
import { IClaimOTKsResult, MatrixClient } from "../client.ts";
import { ISignatures } from "../@types/signed.ts";
import { MatrixEvent } from "../models/event.ts";
import { type OlmDevice } from "./OlmDevice.ts";
import { type DeviceInfo } from "./deviceinfo.ts";
import { type Logger, logger } from "../logger.ts";
import { type IClaimOTKsResult, type MatrixClient } from "../client.ts";
import { type ISignatures } from "../@types/signed.ts";
import { type MatrixEvent } from "../models/event.ts";
import { EventType } from "../@types/event.ts";
import { IMessage } from "./algorithms/olm.ts";
import { type IMessage } from "./algorithms/olm.ts";
import { MapWithDefault } from "../utils.ts";
enum Algorithm {

View File

@@ -14,19 +14,19 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { IRoomKeyRequestBody, IRoomKeyRequestRecipient } from "../index.ts";
import { RoomKeyRequestState } from "../OutgoingRoomKeyRequestManager.ts";
import { IOlmDevice } from "../algorithms/megolm.ts";
import { TrackingStatus } from "../DeviceList.ts";
import { IRoomEncryption } from "../RoomList.ts";
import { IDevice } from "../deviceinfo.ts";
import { ICrossSigningInfo } from "../CrossSigning.ts";
import { Logger } from "../../logger.ts";
import { InboundGroupSessionData } from "../OlmDevice.ts";
import { MatrixEvent } from "../../models/event.ts";
import { DehydrationManager } from "../dehydration.ts";
import { CrossSigningKeyInfo } from "../../crypto-api/index.ts";
import { AESEncryptedSecretStoragePayload } from "../../@types/AESEncryptedSecretStoragePayload.ts";
import { type IRoomKeyRequestBody, type IRoomKeyRequestRecipient } from "../index.ts";
import { type RoomKeyRequestState } from "../OutgoingRoomKeyRequestManager.ts";
import { type IOlmDevice } from "../algorithms/megolm.ts";
import { type TrackingStatus } from "../DeviceList.ts";
import { type IRoomEncryption } from "../RoomList.ts";
import { type IDevice } from "../deviceinfo.ts";
import { type ICrossSigningInfo } from "../CrossSigning.ts";
import { type Logger } from "../../logger.ts";
import { type InboundGroupSessionData } from "../OlmDevice.ts";
import { type MatrixEvent } from "../../models/event.ts";
import { type DehydrationManager } from "../dehydration.ts";
import { type CrossSigningKeyInfo } from "../../crypto-api/index.ts";
import { type AESEncryptedSecretStoragePayload } from "../../@types/AESEncryptedSecretStoragePayload.ts";
/**
* Internal module. Definitions for storage for the crypto module

View File

@@ -14,30 +14,30 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Logger, logger } from "../../logger.ts";
import { type Logger, logger } from "../../logger.ts";
import { deepCompare } from "../../utils.ts";
import {
CryptoStore,
IDeviceData,
IProblem,
ISession,
SessionExtended,
ISessionInfo,
IWithheld,
type CryptoStore,
type IDeviceData,
type IProblem,
type ISession,
type SessionExtended,
type ISessionInfo,
type IWithheld,
MigrationState,
Mode,
OutgoingRoomKeyRequest,
ParkedSharedHistory,
SecretStorePrivateKeys,
type Mode,
type OutgoingRoomKeyRequest,
type ParkedSharedHistory,
type SecretStorePrivateKeys,
SESSION_BATCH_SIZE,
ACCOUNT_OBJECT_KEY_MIGRATION_STATE,
} from "./base.ts";
import { IRoomKeyRequestBody, IRoomKeyRequestRecipient } from "../index.ts";
import { IOlmDevice } from "../algorithms/megolm.ts";
import { IRoomEncryption } from "../RoomList.ts";
import { InboundGroupSessionData } from "../OlmDevice.ts";
import { type IRoomKeyRequestBody, type IRoomKeyRequestRecipient } from "../index.ts";
import { type IOlmDevice } from "../algorithms/megolm.ts";
import { type IRoomEncryption } from "../RoomList.ts";
import { type InboundGroupSessionData } from "../OlmDevice.ts";
import { IndexedDBCryptoStore } from "./indexeddb-crypto-store.ts";
import { CrossSigningKeyInfo } from "../../crypto-api/index.ts";
import { type CrossSigningKeyInfo } from "../../crypto-api/index.ts";
const PROFILE_TRANSACTIONS = false;

View File

@@ -14,32 +14,32 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { logger, Logger } from "../../logger.ts";
import { logger, type Logger } from "../../logger.ts";
import { LocalStorageCryptoStore } from "./localStorage-crypto-store.ts";
import { MemoryCryptoStore } from "./memory-crypto-store.ts";
import * as IndexedDBCryptoStoreBackend from "./indexeddb-crypto-store-backend.ts";
import { InvalidCryptoStoreError, InvalidCryptoStoreState } from "../../errors.ts";
import * as IndexedDBHelpers from "../../indexeddb-helpers.ts";
import {
CryptoStore,
IDeviceData,
IProblem,
ISession,
SessionExtended,
ISessionInfo,
IWithheld,
type CryptoStore,
type IDeviceData,
type IProblem,
type ISession,
type SessionExtended,
type ISessionInfo,
type IWithheld,
MigrationState,
Mode,
OutgoingRoomKeyRequest,
ParkedSharedHistory,
SecretStorePrivateKeys,
type Mode,
type OutgoingRoomKeyRequest,
type ParkedSharedHistory,
type SecretStorePrivateKeys,
ACCOUNT_OBJECT_KEY_MIGRATION_STATE,
} from "./base.ts";
import { IRoomKeyRequestBody } from "../index.ts";
import { IOlmDevice } from "../algorithms/megolm.ts";
import { IRoomEncryption } from "../RoomList.ts";
import { InboundGroupSessionData } from "../OlmDevice.ts";
import { CrossSigningKeyInfo } from "../../crypto-api/index.ts";
import { type IRoomKeyRequestBody } from "../index.ts";
import { type IOlmDevice } from "../algorithms/megolm.ts";
import { type IRoomEncryption } from "../RoomList.ts";
import { type InboundGroupSessionData } from "../OlmDevice.ts";
import { type CrossSigningKeyInfo } from "../../crypto-api/index.ts";
/*
* Internal module. indexeddb storage for e2e.

View File

@@ -17,23 +17,23 @@ limitations under the License.
import { logger } from "../../logger.ts";
import { MemoryCryptoStore } from "./memory-crypto-store.ts";
import {
CryptoStore,
IDeviceData,
IProblem,
ISession,
SessionExtended,
ISessionInfo,
IWithheld,
type CryptoStore,
type IDeviceData,
type IProblem,
type ISession,
type SessionExtended,
type ISessionInfo,
type IWithheld,
MigrationState,
Mode,
SecretStorePrivateKeys,
type Mode,
type SecretStorePrivateKeys,
SESSION_BATCH_SIZE,
} from "./base.ts";
import { IOlmDevice } from "../algorithms/megolm.ts";
import { IRoomEncryption } from "../RoomList.ts";
import { InboundGroupSessionData } from "../OlmDevice.ts";
import { type IOlmDevice } from "../algorithms/megolm.ts";
import { type IRoomEncryption } from "../RoomList.ts";
import { type InboundGroupSessionData } from "../OlmDevice.ts";
import { safeSet } from "../../utils.ts";
import { CrossSigningKeyInfo } from "../../crypto-api/index.ts";
import { type CrossSigningKeyInfo } from "../../crypto-api/index.ts";
/**
* Internal module. Partial localStorage backed storage for e2e.

View File

@@ -17,25 +17,25 @@ limitations under the License.
import { logger } from "../../logger.ts";
import { deepCompare, promiseTry, safeSet } from "../../utils.ts";
import {
CryptoStore,
IDeviceData,
IProblem,
ISession,
SessionExtended,
ISessionInfo,
IWithheld,
type CryptoStore,
type IDeviceData,
type IProblem,
type ISession,
type SessionExtended,
type ISessionInfo,
type IWithheld,
MigrationState,
Mode,
OutgoingRoomKeyRequest,
ParkedSharedHistory,
SecretStorePrivateKeys,
type Mode,
type OutgoingRoomKeyRequest,
type ParkedSharedHistory,
type SecretStorePrivateKeys,
SESSION_BATCH_SIZE,
} from "./base.ts";
import { IRoomKeyRequestBody } from "../index.ts";
import { IOlmDevice } from "../algorithms/megolm.ts";
import { IRoomEncryption } from "../RoomList.ts";
import { InboundGroupSessionData } from "../OlmDevice.ts";
import { CrossSigningKeyInfo } from "../../crypto-api/index.ts";
import { type IRoomKeyRequestBody } from "../index.ts";
import { type IOlmDevice } from "../algorithms/megolm.ts";
import { type IRoomEncryption } from "../RoomList.ts";
import { type InboundGroupSessionData } from "../OlmDevice.ts";
import { type CrossSigningKeyInfo } from "../../crypto-api/index.ts";
function encodeSessionKey(senderCurve25519Key: string, sessionId: string): string {
return encodeURIComponent(senderCurve25519Key) + "/" + encodeURIComponent(sessionId);

View File

@@ -24,17 +24,17 @@ import { EventType } from "../../@types/event.ts";
import { logger } from "../../logger.ts";
import { DeviceInfo } from "../deviceinfo.ts";
import { newTimeoutError } from "./Error.ts";
import { KeysDuringVerification, requestKeysDuringVerification } from "../CrossSigning.ts";
import { IVerificationChannel } from "./request/Channel.ts";
import { MatrixClient } from "../../client.ts";
import { VerificationRequest } from "./request/VerificationRequest.ts";
import { type KeysDuringVerification, requestKeysDuringVerification } from "../CrossSigning.ts";
import { type IVerificationChannel } from "./request/Channel.ts";
import { type MatrixClient } from "../../client.ts";
import { type VerificationRequest } from "./request/VerificationRequest.ts";
import { TypedEventEmitter } from "../../models/typed-event-emitter.ts";
import {
ShowQrCodeCallbacks,
ShowSasCallbacks,
Verifier,
type ShowQrCodeCallbacks,
type ShowSasCallbacks,
type Verifier,
VerifierEvent,
VerifierEventHandlerMap,
type VerifierEventHandlerMap,
} from "../../crypto-api/verification.ts";
const timeoutException = new Error("Verification timed out");

View File

@@ -19,11 +19,11 @@ limitations under the License.
* do verification with this method).
*/
import { VerificationBase as Base, VerificationEvent, VerificationEventHandlerMap } from "./Base.ts";
import { IVerificationChannel } from "./request/Channel.ts";
import { MatrixClient } from "../../client.ts";
import { MatrixEvent } from "../../models/event.ts";
import { VerificationRequest } from "./request/VerificationRequest.ts";
import { VerificationBase as Base, type VerificationEvent, type VerificationEventHandlerMap } from "./Base.ts";
import { type IVerificationChannel } from "./request/Channel.ts";
import { type MatrixClient } from "../../client.ts";
import { type MatrixEvent } from "../../models/event.ts";
import { type VerificationRequest } from "./request/VerificationRequest.ts";
export class IllegalMethod extends Base<VerificationEvent, VerificationEventHandlerMap> {
public static factory(

View File

@@ -22,11 +22,11 @@ import { VerificationBase as Base } from "./Base.ts";
import { newKeyMismatchError, newUserCancelledError } from "./Error.ts";
import { decodeBase64, encodeUnpaddedBase64 } from "../../base64.ts";
import { logger } from "../../logger.ts";
import { VerificationRequest } from "./request/VerificationRequest.ts";
import { MatrixClient } from "../../client.ts";
import { IVerificationChannel } from "./request/Channel.ts";
import { MatrixEvent } from "../../models/event.ts";
import { ShowQrCodeCallbacks, VerifierEvent } from "../../crypto-api/verification.ts";
import { type VerificationRequest } from "./request/VerificationRequest.ts";
import { type MatrixClient } from "../../client.ts";
import { type IVerificationChannel } from "./request/Channel.ts";
import { type MatrixEvent } from "../../models/event.ts";
import { type ShowQrCodeCallbacks, VerifierEvent } from "../../crypto-api/verification.ts";
import { VerificationMethod } from "../../types.ts";
export const SHOW_QR_CODE_METHOD = VerificationMethod.ShowQrCode;

View File

@@ -19,7 +19,7 @@ limitations under the License.
*/
import anotherjson from "another-json";
import { Utility, SAS as OlmSAS } from "@matrix-org/olm";
import { type Utility, type SAS as OlmSAS } from "@matrix-org/olm";
import { VerificationBase as Base, SwitchStartEventError } from "./Base.ts";
import {
@@ -30,10 +30,15 @@ import {
newUserCancelledError,
} from "./Error.ts";
import { logger } from "../../logger.ts";
import { IContent, MatrixEvent } from "../../models/event.ts";
import { type IContent, type MatrixEvent } from "../../models/event.ts";
import { generateDecimalSas } from "./SASDecimal.ts";
import { EventType } from "../../@types/event.ts";
import { EmojiMapping, GeneratedSas, ShowSasCallbacks, VerifierEvent } from "../../crypto-api/verification.ts";
import {
type EmojiMapping,
type GeneratedSas,
type ShowSasCallbacks,
VerifierEvent,
} from "../../crypto-api/verification.ts";
import { VerificationMethod } from "../../types.ts";
// backwards-compatibility exports

View File

@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixEvent } from "../../../models/event.ts";
import { VerificationRequest } from "./VerificationRequest.ts";
import { type MatrixEvent } from "../../../models/event.ts";
import { type VerificationRequest } from "./VerificationRequest.ts";
export interface IVerificationChannel {
request?: VerificationRequest;

View File

@@ -17,11 +17,11 @@ limitations under the License.
import { VerificationRequest, REQUEST_TYPE, READY_TYPE, START_TYPE } from "./VerificationRequest.ts";
import { logger } from "../../../logger.ts";
import { IVerificationChannel } from "./Channel.ts";
import { EventType, TimelineEvents } from "../../../@types/event.ts";
import { MatrixClient } from "../../../client.ts";
import { MatrixEvent } from "../../../models/event.ts";
import { IRequestsMap } from "../../index.ts";
import { type IVerificationChannel } from "./Channel.ts";
import { EventType, type TimelineEvents } from "../../../@types/event.ts";
import { type MatrixClient } from "../../../client.ts";
import { type MatrixEvent } from "../../../models/event.ts";
import { type IRequestsMap } from "../../index.ts";
const MESSAGE_TYPE = EventType.RoomMessage;
const M_REFERENCE = "m.reference";

View File

@@ -28,9 +28,9 @@ import {
} from "./VerificationRequest.ts";
import { errorFromEvent, newUnexpectedMessageError } from "../Error.ts";
import { MatrixEvent } from "../../../models/event.ts";
import { IVerificationChannel } from "./Channel.ts";
import { MatrixClient } from "../../../client.ts";
import { IRequestsMap } from "../../index.ts";
import { type IVerificationChannel } from "./Channel.ts";
import { type MatrixClient } from "../../../client.ts";
import { type IRequestsMap } from "../../index.ts";
export type Request = VerificationRequest<ToDeviceChannel>;

View File

@@ -17,20 +17,20 @@ limitations under the License.
import { logger } from "../../../logger.ts";
import { errorFactory, errorFromEvent, newUnexpectedMessageError, newUnknownMethodError } from "../Error.ts";
import { QRCodeData, SCAN_QR_CODE_METHOD } from "../QRCode.ts";
import { IVerificationChannel } from "./Channel.ts";
import { MatrixClient } from "../../../client.ts";
import { MatrixEvent } from "../../../models/event.ts";
import { type IVerificationChannel } from "./Channel.ts";
import { type MatrixClient } from "../../../client.ts";
import { type MatrixEvent } from "../../../models/event.ts";
import { EventType } from "../../../@types/event.ts";
import { VerificationBase } from "../Base.ts";
import { VerificationMethod } from "../../index.ts";
import { type VerificationBase } from "../Base.ts";
import { type VerificationMethod } from "../../index.ts";
import { TypedEventEmitter } from "../../../models/typed-event-emitter.ts";
import {
canAcceptVerificationRequest,
VerificationPhase as Phase,
VerificationRequest as IVerificationRequest,
type VerificationRequest as IVerificationRequest,
VerificationRequestEvent,
VerificationRequestEventHandlerMap,
Verifier,
type VerificationRequestEventHandlerMap,
type Verifier,
} from "../../../crypto-api/verification.ts";
// backwards-compatibility exports

View File

@@ -15,49 +15,49 @@ limitations under the License.
*/
import {
WidgetApi,
type WidgetApi,
WidgetApiToWidgetAction,
WidgetApiResponseError,
MatrixCapabilities,
IWidgetApiRequest,
IWidgetApiAcknowledgeResponseData,
ISendEventToWidgetActionRequest,
ISendToDeviceToWidgetActionRequest,
ISendEventFromWidgetResponseData,
IWidgetApiRequestData,
WidgetApiAction,
IWidgetApiResponse,
IWidgetApiResponseData,
type IWidgetApiRequest,
type IWidgetApiAcknowledgeResponseData,
type ISendEventToWidgetActionRequest,
type ISendToDeviceToWidgetActionRequest,
type ISendEventFromWidgetResponseData,
type IWidgetApiRequestData,
type WidgetApiAction,
type IWidgetApiResponse,
type IWidgetApiResponseData,
} from "matrix-widget-api";
import { MatrixEvent, IEvent, IContent, EventStatus } from "./models/event.ts";
import { MatrixEvent, type IEvent, type IContent, EventStatus } from "./models/event.ts";
import {
ISendEventResponse,
SendDelayedEventRequestOpts,
SendDelayedEventResponse,
UpdateDelayedEventAction,
type ISendEventResponse,
type SendDelayedEventRequestOpts,
type SendDelayedEventResponse,
type UpdateDelayedEventAction,
} from "./@types/requests.ts";
import { EventType, StateEvents } from "./@types/event.ts";
import { EventType, type StateEvents } from "./@types/event.ts";
import { logger } from "./logger.ts";
import {
MatrixClient,
ClientEvent,
IMatrixClientCreateOpts,
IStartClientOpts,
SendToDeviceContentMap,
IOpenIDToken,
type IMatrixClientCreateOpts,
type IStartClientOpts,
type SendToDeviceContentMap,
type IOpenIDToken,
UNSTABLE_MSC4140_DELAYED_EVENTS,
} from "./client.ts";
import { SyncApi, SyncState } from "./sync.ts";
import { SlidingSyncSdk } from "./sliding-sync-sdk.ts";
import { MatrixError } from "./http-api/errors.ts";
import { User } from "./models/user.ts";
import { Room } from "./models/room.ts";
import { ToDeviceBatch, ToDevicePayload } from "./models/ToDeviceMessage.ts";
import { DeviceInfo } from "./crypto/deviceinfo.ts";
import { IOlmDevice } from "./crypto/algorithms/megolm.ts";
import { type Room } from "./models/room.ts";
import { type ToDeviceBatch, type ToDevicePayload } from "./models/ToDeviceMessage.ts";
import { type DeviceInfo } from "./crypto/deviceinfo.ts";
import { type IOlmDevice } from "./crypto/algorithms/megolm.ts";
import { MapWithDefault, recursiveMapToObject } from "./utils.ts";
import { EmptyObject, TypedEventEmitter } from "./matrix.ts";
import { type EmptyObject, TypedEventEmitter } from "./matrix.ts";
interface IStateEventRequest {
eventType: string;

View File

@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixClient } from "./client.ts";
import { IEvent, MatrixEvent, MatrixEventEvent } from "./models/event.ts";
import { type MatrixClient } from "./client.ts";
import { type IEvent, MatrixEvent, MatrixEventEvent } from "./models/event.ts";
import { RelationType } from "./@types/event.ts";
export type EventMapper = (obj: Partial<IEvent>) => MatrixEvent;

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { ExtensibleEventType, IPartialEvent } from "../@types/extensible_events.ts";
import { type ExtensibleEventType, type IPartialEvent } from "../@types/extensible_events.ts";
/**
* Represents an Extensible Event in Matrix.

View File

@@ -14,17 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Optional } from "matrix-events-sdk";
import { type Optional } from "matrix-events-sdk";
import { ExtensibleEvent } from "./ExtensibleEvent.ts";
import {
ExtensibleEventType,
IMessageRendering,
IPartialEvent,
type ExtensibleEventType,
type IMessageRendering,
type IPartialEvent,
isEventTypeSame,
M_HTML,
M_MESSAGE,
ExtensibleAnyMessageEventContent,
type ExtensibleAnyMessageEventContent,
M_TEXT,
} from "../@types/extensible_events.ts";
import { isOptionalAString, isProvided } from "./utilities.ts";

View File

@@ -15,13 +15,13 @@ limitations under the License.
*/
import {
ExtensibleEventType,
IPartialEvent,
type ExtensibleEventType,
type IPartialEvent,
isEventTypeSame,
M_TEXT,
REFERENCE_RELATION,
} from "../@types/extensible_events.ts";
import { M_POLL_END, PollEndEventContent } from "../@types/polls.ts";
import { M_POLL_END, type PollEndEventContent } from "../@types/polls.ts";
import { ExtensibleEvent } from "./ExtensibleEvent.ts";
import { InvalidEventError } from "./InvalidEventError.ts";
import { MessageEvent } from "./MessageEvent.ts";

View File

@@ -15,15 +15,15 @@ limitations under the License.
*/
import { ExtensibleEvent } from "./ExtensibleEvent.ts";
import { M_POLL_RESPONSE, PollResponseEventContent, PollResponseSubtype } from "../@types/polls.ts";
import { M_POLL_RESPONSE, type PollResponseEventContent, type PollResponseSubtype } from "../@types/polls.ts";
import {
ExtensibleEventType,
IPartialEvent,
type ExtensibleEventType,
type IPartialEvent,
isEventTypeSame,
REFERENCE_RELATION,
} from "../@types/extensible_events.ts";
import { InvalidEventError } from "./InvalidEventError.ts";
import { PollStartEvent } from "./PollStartEvent.ts";
import { type PollStartEvent } from "./PollStartEvent.ts";
/**
* Represents a poll response event.

View File

@@ -17,15 +17,15 @@ limitations under the License.
import { NamespacedValue } from "matrix-events-sdk";
import { MessageEvent } from "./MessageEvent.ts";
import { ExtensibleEventType, IPartialEvent, isEventTypeSame, M_TEXT } from "../@types/extensible_events.ts";
import { type ExtensibleEventType, type IPartialEvent, isEventTypeSame, M_TEXT } from "../@types/extensible_events.ts";
import {
KnownPollKind,
type KnownPollKind,
M_POLL_KIND_DISCLOSED,
M_POLL_KIND_UNDISCLOSED,
M_POLL_START,
PollStartEventContent,
PollStartSubtype,
PollAnswer,
type PollStartEventContent,
type PollStartSubtype,
type PollAnswer,
} from "../@types/polls.ts";
import { InvalidEventError } from "./InvalidEventError.ts";
import { ExtensibleEvent } from "./ExtensibleEvent.ts";

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Optional } from "matrix-events-sdk";
import { type Optional } from "matrix-events-sdk";
/**
* Determines if the given optional was provided a value.

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { IServerVersions } from "./client.ts";
import { type IServerVersions } from "./client.ts";
export enum ServerSupport {
Stable,

View File

@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { RelationType } from "./@types/event.ts";
import { MatrixEvent } from "./models/event.ts";
import { type RelationType } from "./@types/event.ts";
import { type MatrixEvent } from "./models/event.ts";
import { FILTER_RELATED_BY_REL_TYPES, FILTER_RELATED_BY_SENDERS, THREAD_RELATION_TYPE } from "./models/thread.ts";
/**

View File

@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { EventType, RelationType } from "./@types/event.ts";
import { type EventType, type RelationType } from "./@types/event.ts";
import { UNREAD_THREAD_NOTIFICATIONS } from "./@types/sync.ts";
import { FilterComponent, IFilterComponent } from "./filter-component.ts";
import { MatrixEvent } from "./models/event.ts";
import { FilterComponent, type IFilterComponent } from "./filter-component.ts";
import { type MatrixEvent } from "./models/event.ts";
/**
*/

View File

@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { IMatrixApiError as IWidgetMatrixError } from "matrix-widget-api";
import { type IMatrixApiError as IWidgetMatrixError } from "matrix-widget-api";
import { IUsageLimit } from "../@types/partials.ts";
import { MatrixEvent } from "../models/event.ts";
import { type IUsageLimit } from "../@types/partials.ts";
import { type MatrixEvent } from "../models/event.ts";
interface IErrorJson extends Partial<IUsageLimit> {
[key: string]: any; // extensible

View File

@@ -19,12 +19,18 @@ limitations under the License.
*/
import { checkObjectHasKeys, encodeParams } from "../utils.ts";
import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
import { type TypedEventEmitter } from "../models/typed-event-emitter.ts";
import { Method } from "./method.ts";
import { ConnectionError, MatrixError } from "./errors.ts";
import { HttpApiEvent, HttpApiEventHandlerMap, IHttpOpts, IRequestOpts, Body } from "./interface.ts";
import { ConnectionError, type MatrixError } from "./errors.ts";
import {
HttpApiEvent,
type HttpApiEventHandlerMap,
type IHttpOpts,
type IRequestOpts,
type Body,
} from "./interface.ts";
import { anySignal, parseErrorResponse, timeoutSignal } from "./utils.ts";
import { QueryDict } from "../utils.ts";
import { type QueryDict } from "../utils.ts";
interface TypedResponse<T> extends Response {
json(): Promise<T>;

View File

@@ -15,9 +15,16 @@ limitations under the License.
*/
import { FetchHttpApi } from "./fetch.ts";
import { FileType, IContentUri, IHttpOpts, Upload, UploadOpts, UploadResponse } from "./interface.ts";
import {
type FileType,
type IContentUri,
type IHttpOpts,
type Upload,
type UploadOpts,
type UploadResponse,
} from "./interface.ts";
import { MediaPrefix } from "./prefix.ts";
import { defer, QueryDict, removeElement } from "../utils.ts";
import { defer, type QueryDict, removeElement } from "../utils.ts";
import * as callbacks from "../realtime-callbacks.ts";
import { Method } from "./method.ts";
import { ConnectionError } from "./errors.ts";

View File

@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixError } from "./errors.ts";
import { Logger } from "../logger.ts";
import { type MatrixError } from "./errors.ts";
import { type Logger } from "../logger.ts";
export type Body = Record<string, any> | BodyInit;

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { parse as parseContentType, ParsedMediaType } from "content-type";
import { parse as parseContentType, type ParsedMediaType } from "content-type";
import { logger } from "../logger.ts";
import { sleep } from "../utils.ts";

View File

@@ -17,11 +17,11 @@ limitations under the License.
*/
import { logger } from "./logger.ts";
import { MatrixClient } from "./client.ts";
import { defer, IDeferred } from "./utils.ts";
import { type MatrixClient } from "./client.ts";
import { defer, type IDeferred } from "./utils.ts";
import { MatrixError } from "./http-api/index.ts";
import { UIAResponse } from "./@types/uia.ts";
import { UserIdentifier } from "./@types/auth.ts";
import { type UIAResponse } from "./@types/uia.ts";
import { type UserIdentifier } from "./@types/auth.ts";
const EMAIL_STAGE_TYPE = "m.login.email.identity";
const MSISDN_STAGE_TYPE = "m.login.msisdn";

View File

@@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { WidgetApi } from "matrix-widget-api";
import { type WidgetApi } from "matrix-widget-api";
import { MemoryCryptoStore } from "./crypto/store/memory-crypto-store.ts";
import { MemoryStore } from "./store/memory.ts";
import { MatrixScheduler } from "./scheduler.ts";
import { MatrixClient, ICreateClientOpts } from "./client.ts";
import { RoomWidgetClient, ICapabilities } from "./embedded.ts";
import { CryptoStore } from "./crypto/store/base.ts";
import { MatrixClient, type ICreateClientOpts } from "./client.ts";
import { RoomWidgetClient, type ICapabilities } from "./embedded.ts";
import { type CryptoStore } from "./crypto/store/base.ts";
export * from "./client.ts";
export * from "./serverCapabilities.ts";

View File

@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixEvent } from "../matrix.ts";
import { type MatrixEvent } from "../matrix.ts";
import { deepCompare } from "../utils.ts";
import { Focus } from "./focus.ts";
import { type Focus } from "./focus.ts";
import { isLivekitFocusActive } from "./LivekitFocus.ts";
/**

View File

@@ -1,13 +1,13 @@
import { type MatrixClient } from "../client.ts";
import { logger as rootLogger } from "../logger.ts";
import { MatrixEvent } from "../models/event.ts";
import { Room } from "../models/room.ts";
import { EncryptionConfig } from "./MatrixRTCSession.ts";
import { type MatrixEvent } from "../models/event.ts";
import { type Room } from "../models/room.ts";
import { type EncryptionConfig } from "./MatrixRTCSession.ts";
import { secureRandomBase64Url } from "../randomstring.ts";
import { EncryptionKeysEventContent } from "./types.ts";
import { type EncryptionKeysEventContent } from "./types.ts";
import { decodeBase64, encodeUnpaddedBase64 } from "../base64.ts";
import { MatrixError, safeGetRetryAfterMs } from "../http-api/errors.ts";
import { CallMembership } from "./CallMembership.ts";
import { type MatrixError, safeGetRetryAfterMs } from "../http-api/errors.ts";
import { type CallMembership } from "./CallMembership.ts";
import { EventType } from "../@types/event.ts";
const logger = rootLogger.getChild("MatrixRTCSession");

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Focus } from "./focus.ts";
import { type Focus } from "./focus.ts";
export interface LivekitFocusConfig extends Focus {
type: "livekit";

View File

@@ -17,16 +17,16 @@ limitations under the License.
import { logger as rootLogger } from "../logger.ts";
import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
import { EventTimeline } from "../models/event-timeline.ts";
import { Room } from "../models/room.ts";
import { MatrixClient } from "../client.ts";
import { type Room } from "../models/room.ts";
import { type MatrixClient } from "../client.ts";
import { EventType } from "../@types/event.ts";
import { CallMembership } from "./CallMembership.ts";
import { RoomStateEvent } from "../models/room-state.ts";
import { Focus } from "./focus.ts";
import { type Focus } from "./focus.ts";
import { KnownMembership } from "../@types/membership.ts";
import { MatrixEvent } from "../models/event.ts";
import { LegacyMembershipManager, IMembershipManager } from "./MembershipManager.ts";
import { EncryptionManager, IEncryptionManager, Statistics } from "./EncryptionManager.ts";
import { type MatrixEvent } from "../models/event.ts";
import { LegacyMembershipManager, type IMembershipManager } from "./MembershipManager.ts";
import { EncryptionManager, type IEncryptionManager, type Statistics } from "./EncryptionManager.ts";
const logger = rootLogger.getChild("MatrixRTCSession");

View File

@@ -15,11 +15,11 @@ limitations under the License.
*/
import { logger as rootLogger } from "../logger.ts";
import { MatrixClient, ClientEvent } from "../client.ts";
import { type MatrixClient, ClientEvent } from "../client.ts";
import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
import { Room, RoomEvent } from "../models/room.ts";
import { RoomState, RoomStateEvent } from "../models/room-state.ts";
import { MatrixEvent } from "../models/event.ts";
import { type Room, RoomEvent } from "../models/room.ts";
import { type RoomState, RoomStateEvent } from "../models/room-state.ts";
import { type MatrixEvent } from "../models/event.ts";
import { MatrixRTCSession } from "./MatrixRTCSession.ts";
import { EventType } from "../@types/event.ts";

View File

@@ -4,13 +4,13 @@ import type { MatrixClient } from "../client.ts";
import { HTTPError, MatrixError } from "../http-api/errors.ts";
import { logger } from "../logger.ts";
import { EventTimeline } from "../models/event-timeline.ts";
import { Room } from "../models/room.ts";
import { type Room } from "../models/room.ts";
import { sleep } from "../utils.ts";
import { CallMembership, DEFAULT_EXPIRE_DURATION, SessionMembershipData } from "./CallMembership.ts";
import { Focus } from "./focus.ts";
import { type CallMembership, DEFAULT_EXPIRE_DURATION, type SessionMembershipData } from "./CallMembership.ts";
import { type Focus } from "./focus.ts";
import { isLivekitFocusActive } from "./LivekitFocus.ts";
import { MembershipConfig } from "./MatrixRTCSession.ts";
import { EmptyObject } from "../@types/common.ts";
import { type MembershipConfig } from "./MatrixRTCSession.ts";
import { type EmptyObject } from "../@types/common.ts";
/**
* This interface defines what a MembershipManager uses and exposes.
* This interface is what we use to write tests and allows to change the actual implementation

View File

@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { IMentions } from "../matrix.ts";
import { type IMentions } from "../matrix.ts";
export interface EncryptionKeyEntry {
index: number;
key: string;

View File

@@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixClient } from "../client.ts";
import { type MatrixClient } from "../client.ts";
import { RelationType, UNSTABLE_MSC3089_BRANCH } from "../@types/event.ts";
import { IContent, MatrixEvent } from "./event.ts";
import { MSC3089TreeSpace } from "./MSC3089TreeSpace.ts";
import { type IContent, type MatrixEvent } from "./event.ts";
import { type MSC3089TreeSpace } from "./MSC3089TreeSpace.ts";
import { EventTimeline } from "./event-timeline.ts";
import { FileType } from "../http-api/index.ts";
import { type FileType } from "../http-api/index.ts";
import type { ISendEventResponse } from "../@types/requests.ts";
import { EncryptedFile } from "../@types/media.ts";
import { type EncryptedFile } from "../@types/media.ts";
export interface MSC3089EventContent {
active?: boolean;

View File

@@ -16,11 +16,11 @@ limitations under the License.
import promiseRetry from "p-retry";
import { MatrixClient } from "../client.ts";
import { type MatrixClient } from "../client.ts";
import { EventType, MsgType, UNSTABLE_MSC3089_BRANCH, UNSTABLE_MSC3089_LEAF } from "../@types/event.ts";
import { Room } from "./room.ts";
import { type Room } from "./room.ts";
import { logger } from "../logger.ts";
import { IContent, MatrixEvent } from "./event.ts";
import { type IContent, type MatrixEvent } from "./event.ts";
import {
averageBetweenStrings,
DEFAULT_ALPHABET,
@@ -30,12 +30,12 @@ import {
simpleRetryOperation,
} from "../utils.ts";
import { MSC3089Branch } from "./MSC3089Branch.ts";
import { ISendEventResponse } from "../@types/requests.ts";
import { FileType } from "../http-api/index.ts";
import { type ISendEventResponse } from "../@types/requests.ts";
import { type FileType } from "../http-api/index.ts";
import { KnownMembership } from "../@types/membership.ts";
import { RoomPowerLevelsEventContent, SpaceChildEventContent } from "../@types/state_events.ts";
import { type RoomPowerLevelsEventContent, type SpaceChildEventContent } from "../@types/state_events.ts";
import type { EncryptedFile, FileContent } from "../@types/media.ts";
import { EmptyObject } from "../@types/common.ts";
import { type EmptyObject } from "../@types/common.ts";
/**
* The recommended defaults for a tree space's power levels. Note that this

View File

@@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MBeaconEventContent } from "../@types/beacon.ts";
import { type MBeaconEventContent } from "../@types/beacon.ts";
import {
BeaconInfoState,
BeaconLocationState,
type BeaconInfoState,
type BeaconLocationState,
parseBeaconContent,
parseBeaconInfoContent,
} from "../content-helpers.ts";
import { MatrixEvent } from "./event.ts";
import { type MatrixEvent } from "./event.ts";
import { sortEventsByLatestContentTimestamp } from "../utils.ts";
import { TypedEventEmitter } from "./typed-event-emitter.ts";

View File

@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixEvent } from "./event.ts";
import { Room } from "./room.ts";
import { type MatrixEvent } from "./event.ts";
import { type Room } from "./room.ts";
import { inMainTimelineForReceipt, threadIdForReceipt } from "../client.ts";
/**

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixEvent } from "./event.ts";
import { type MatrixEvent } from "./event.ts";
import { Direction } from "./event-timeline.ts";
export class EventContext {

View File

@@ -14,16 +14,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { EventTimeline, IAddEventOptions } from "./event-timeline.ts";
import { MatrixEvent } from "./event.ts";
import { EventTimeline, type IAddEventOptions } from "./event-timeline.ts";
import { type MatrixEvent } from "./event.ts";
import { logger } from "../logger.ts";
import { Room, RoomEvent } from "./room.ts";
import { Filter } from "../filter.ts";
import { RoomState } from "./room-state.ts";
import { type Room, RoomEvent } from "./room.ts";
import { type Filter } from "../filter.ts";
import { type RoomState } from "./room-state.ts";
import { TypedEventEmitter } from "./typed-event-emitter.ts";
import { RelationsContainer } from "./relations-container.ts";
import { MatrixClient } from "../client.ts";
import { Thread, ThreadFilterType } from "./thread.ts";
import { type MatrixClient } from "../client.ts";
import { type Thread, type ThreadFilterType } from "./thread.ts";
const DEBUG = true;

View File

@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { IMarkerFoundOptions, RoomState } from "./room-state.ts";
import { EventTimelineSet } from "./event-timeline-set.ts";
import { MatrixEvent } from "./event.ts";
import { Filter } from "../filter.ts";
import { type IMarkerFoundOptions, RoomState } from "./room-state.ts";
import { type EventTimelineSet } from "./event-timeline-set.ts";
import { type MatrixEvent } from "./event.ts";
import { type Filter } from "../filter.ts";
import { EventType } from "../@types/event.ts";
export interface IInitialiseStateOptions extends Pick<IMarkerFoundOptions, "timelineWasEmpty"> {

View File

@@ -19,37 +19,37 @@ limitations under the License.
* the public classes.
*/
import { ExtensibleEvent, ExtensibleEvents, Optional } from "matrix-events-sdk";
import { type ExtensibleEvent, ExtensibleEvents, type Optional } from "matrix-events-sdk";
import type { IEventDecryptionResult } from "../@types/crypto.ts";
import { logger } from "../logger.ts";
import { VerificationRequest } from "../crypto/verification/request/VerificationRequest.ts";
import { type VerificationRequest } from "../crypto/verification/request/VerificationRequest.ts";
import {
EVENT_VISIBILITY_CHANGE_TYPE,
EventType,
MsgType,
type MsgType,
RelationType,
ToDeviceMessageId,
UNSIGNED_THREAD_ID_FIELD,
UNSIGNED_MEMBERSHIP_FIELD,
} from "../@types/event.ts";
import { Crypto } from "../crypto/index.ts";
import { type Crypto } from "../crypto/index.ts";
import { deepSortedObjectEntries, internaliseString } from "../utils.ts";
import { RoomMember } from "./room-member.ts";
import { Thread, THREAD_RELATION_TYPE, ThreadEvent, ThreadEventHandlerMap } from "./thread.ts";
import { IActionsObject } from "../pushprocessor.ts";
import { type RoomMember } from "./room-member.ts";
import { type Thread, THREAD_RELATION_TYPE, ThreadEvent, type ThreadEventHandlerMap } from "./thread.ts";
import { type IActionsObject } from "../pushprocessor.ts";
import { TypedReEmitter } from "../ReEmitter.ts";
import { MatrixError } from "../http-api/index.ts";
import { type MatrixError } from "../http-api/index.ts";
import { TypedEventEmitter } from "./typed-event-emitter.ts";
import { EventStatus } from "./event-status.ts";
import { CryptoBackend, DecryptionError } from "../common-crypto/CryptoBackend.ts";
import { IAnnotatedPushRule } from "../@types/PushRules.ts";
import { Room } from "./room.ts";
import { type EventStatus } from "./event-status.ts";
import { type CryptoBackend, DecryptionError } from "../common-crypto/CryptoBackend.ts";
import { type IAnnotatedPushRule } from "../@types/PushRules.ts";
import { type Room } from "./room.ts";
import { EventTimeline } from "./event-timeline.ts";
import { Membership } from "../@types/membership.ts";
import { type Membership } from "../@types/membership.ts";
import { DecryptionFailureCode } from "../crypto-api/index.ts";
import { RoomState } from "./room-state.ts";
import { EmptyObject } from "../@types/common.ts";
import { type RoomState } from "./room-state.ts";
import { type EmptyObject } from "../@types/common.ts";
export { EventStatus } from "./event-status.ts";

View File

@@ -14,13 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixClient } from "../client.ts";
import { IContent, MatrixEvent } from "./event.ts";
import { type MatrixClient } from "../client.ts";
import { type IContent, type MatrixEvent } from "./event.ts";
import { EventTimeline } from "./event-timeline.ts";
import { Preset } from "../@types/partials.ts";
import { globToRegexp } from "../utils.ts";
import { Room } from "./room.ts";
import { EventType, StateEvents } from "../@types/event.ts";
import { type Room } from "./room.ts";
import { EventType, type StateEvents } from "../@types/event.ts";
import {
IGNORE_INVITES_ACCOUNT_EVENT_KEY,
POLICIES_ACCOUNT_EVENT_TYPE,

View File

@@ -17,11 +17,11 @@ limitations under the License.
import { M_POLL_START } from "matrix-events-sdk";
import { M_POLL_END, M_POLL_RESPONSE } from "../@types/polls.ts";
import { MatrixClient } from "../client.ts";
import { PollStartEvent } from "../extensible_events_v1/PollStartEvent.ts";
import { MatrixEvent } from "./event.ts";
import { type MatrixClient } from "../client.ts";
import { type PollStartEvent } from "../extensible_events_v1/PollStartEvent.ts";
import { type MatrixEvent } from "./event.ts";
import { Relations } from "./relations.ts";
import { Room } from "./room.ts";
import { type Room } from "./room.ts";
import { TypedEventEmitter } from "./typed-event-emitter.ts";
export enum PollEvent {

View File

@@ -12,18 +12,18 @@ limitations under the License.
*/
import {
CachedReceipt,
type CachedReceipt,
MAIN_ROOM_TIMELINE,
Receipt,
ReceiptCache,
type Receipt,
type ReceiptCache,
ReceiptType,
WrappedReceipt,
type WrappedReceipt,
} from "../@types/read_receipts.ts";
import { ListenerMap, TypedEventEmitter } from "./typed-event-emitter.ts";
import { type ListenerMap, TypedEventEmitter } from "./typed-event-emitter.ts";
import { isSupportedReceiptType } from "../utils.ts";
import { MatrixEvent } from "./event.ts";
import { EventType } from "../@types/event.ts";
import { EventTimelineSet } from "./event-timeline-set.ts";
import { type EventTimelineSet } from "./event-timeline-set.ts";
import { MapWithDefault } from "../utils.ts";
import { NotificationCountType } from "./room.ts";
import { logger } from "../logger.ts";

View File

@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Relations, RelationsEvent, EventHandlerMap } from "./relations.ts";
import { MatrixEvent } from "./event.ts";
import { Listener } from "./typed-event-emitter.ts";
import { type Relations, type RelationsEvent, type EventHandlerMap } from "./relations.ts";
import { type MatrixEvent } from "./event.ts";
import { type Listener } from "./typed-event-emitter.ts";
export class RelatedRelations {
private relations: Relations[];

View File

@@ -15,11 +15,11 @@ limitations under the License.
*/
import { Relations } from "./relations.ts";
import { EventType, RelationType } from "../@types/event.ts";
import { EventStatus, MatrixEvent, MatrixEventEvent } from "./event.ts";
import { EventTimelineSet } from "./event-timeline-set.ts";
import { MatrixClient } from "../client.ts";
import { Room } from "./room.ts";
import { type EventType, type RelationType } from "../@types/event.ts";
import { EventStatus, type MatrixEvent, MatrixEventEvent } from "./event.ts";
import { type EventTimelineSet } from "./event-timeline-set.ts";
import { type MatrixClient } from "../client.ts";
import { type Room } from "./room.ts";
export class RelationsContainer {
// A tree of objects to access a set of related children for an event, as in:

View File

@@ -14,13 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { EventStatus, IAggregatedRelation, MatrixEvent, MatrixEventEvent } from "./event.ts";
import { EventStatus, type IAggregatedRelation, type MatrixEvent, MatrixEventEvent } from "./event.ts";
import { logger } from "../logger.ts";
import { RelationType } from "../@types/event.ts";
import { TypedEventEmitter } from "./typed-event-emitter.ts";
import { MatrixClient } from "../client.ts";
import { type MatrixClient } from "../client.ts";
import { Room } from "./room.ts";
import { CryptoBackend } from "../common-crypto/CryptoBackend.ts";
import { type CryptoBackend } from "../common-crypto/CryptoBackend.ts";
export enum RelationsEvent {
Add = "Relations.add",

View File

@@ -16,13 +16,13 @@ limitations under the License.
import { getHttpUriForMxc } from "../content-repo.ts";
import { removeDirectionOverrideChars, removeHiddenChars } from "../utils.ts";
import { User } from "./user.ts";
import { MatrixEvent } from "./event.ts";
import { RoomState } from "./room-state.ts";
import { type User } from "./user.ts";
import { type MatrixEvent } from "./event.ts";
import { type RoomState } from "./room-state.ts";
import { logger } from "../logger.ts";
import { TypedEventEmitter } from "./typed-event-emitter.ts";
import { EventType } from "../@types/event.ts";
import { KnownMembership, Membership } from "../@types/membership.ts";
import { KnownMembership, type Membership } from "../@types/membership.ts";
export enum RoomMemberEvent {
Membership = "RoomMember.membership",

View File

@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MAIN_ROOM_TIMELINE, Receipt, ReceiptContent } from "../@types/read_receipts.ts";
import { MAIN_ROOM_TIMELINE, type Receipt, type ReceiptContent } from "../@types/read_receipts.ts";
import { threadIdForReceipt } from "../client.ts";
import { Room, RoomEvent } from "./room.ts";
import { MatrixEvent } from "./event.ts";
import { type Room, RoomEvent } from "./room.ts";
import { type MatrixEvent } from "./event.ts";
import { logger } from "../logger.ts";
/**

Some files were not shown because too many files have changed in this diff Show More