1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-23 17:02:25 +03:00

Export de-facto public types out of @types (#3666)

* Export de-facto public types out of @types

* Make typedoc happier
This commit is contained in:
Michael Telatynski
2023-08-22 16:47:22 +01:00
committed by GitHub
parent 6bf4ed8672
commit 85ba069117
3 changed files with 44 additions and 31 deletions

View File

@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import type { IClearEvent } from "../models/event";
import type { ISignatures } from "./signed"; import type { ISignatures } from "./signed";
export type OlmGroupSessionExtraData = { export type OlmGroupSessionExtraData = {
@@ -22,33 +21,8 @@ export type OlmGroupSessionExtraData = {
sharedHistory?: boolean; sharedHistory?: boolean;
}; };
/** // Backwards compatible re-export
* The result of a (successful) call to {@link Crypto.decryptEvent} export type { EventDecryptionResult as IEventDecryptionResult } from "../common-crypto/CryptoBackend";
*/
export interface IEventDecryptionResult {
/**
* The plaintext payload for the event (typically containing <tt>type</tt> and <tt>content</tt> fields).
*/
clearEvent: IClearEvent;
/**
* List of curve25519 keys involved in telling us about the senderCurve25519Key and claimedEd25519Key.
* See {@link MatrixEvent#getForwardingCurve25519KeyChain}.
*/
forwardingCurve25519KeyChain?: string[];
/**
* Key owned by the sender of this event. See {@link MatrixEvent#getSenderKey}.
*/
senderCurve25519Key?: string;
/**
* ed25519 key claimed by the sender of this event. See {@link MatrixEvent#getClaimedEd25519Key}.
*/
claimedEd25519Key?: string;
untrusted?: boolean;
/**
* The sender doesn't authorize the unverified devices to decrypt his messages
*/
encryptedDisabledForUnverifiedDevices?: boolean;
}
interface Extensible { interface Extensible {
[key: string]: any; [key: string]: any;

View File

@@ -15,12 +15,11 @@ limitations under the License.
*/ */
import type { IDeviceLists, IToDeviceEvent } from "../sync-accumulator"; import type { IDeviceLists, IToDeviceEvent } from "../sync-accumulator";
import { MatrixEvent } from "../models/event"; import { IClearEvent, MatrixEvent } from "../models/event";
import { Room } from "../models/room"; import { Room } from "../models/room";
import { CryptoApi } from "../crypto-api"; import { CryptoApi } from "../crypto-api";
import { CrossSigningInfo, UserTrustLevel } from "../crypto/CrossSigning"; import { CrossSigningInfo, UserTrustLevel } from "../crypto/CrossSigning";
import { IEncryptedEventInfo } from "../crypto/api"; import { IEncryptedEventInfo } from "../crypto/api";
import { IEventDecryptionResult } from "../@types/crypto";
/** /**
* Common interface for the crypto implementations * Common interface for the crypto implementations
@@ -71,7 +70,7 @@ export interface CryptoBackend extends SyncCryptoCallbacks, CryptoApi {
* @returns a promise which resolves once we have finished decrypting. * @returns a promise which resolves once we have finished decrypting.
* Rejects with an error if there is a problem decrypting the event. * Rejects with an error if there is a problem decrypting the event.
*/ */
decryptEvent(event: MatrixEvent): Promise<IEventDecryptionResult>; decryptEvent(event: MatrixEvent): Promise<EventDecryptionResult>;
/** /**
* Get information about the encryption of an event * Get information about the encryption of an event
@@ -181,3 +180,31 @@ export interface OnSyncCompletedData {
export interface CheckOwnCrossSigningTrustOpts { export interface CheckOwnCrossSigningTrustOpts {
allowPrivateKeyRequests?: boolean; allowPrivateKeyRequests?: boolean;
} }
/**
* The result of a (successful) call to {@link CryptoBackend.decryptEvent}
*/
export interface EventDecryptionResult {
/**
* The plaintext payload for the event (typically containing <tt>type</tt> and <tt>content</tt> fields).
*/
clearEvent: IClearEvent;
/**
* List of curve25519 keys involved in telling us about the senderCurve25519Key and claimedEd25519Key.
* See {@link MatrixEvent#getForwardingCurve25519KeyChain}.
*/
forwardingCurve25519KeyChain?: string[];
/**
* Key owned by the sender of this event. See {@link MatrixEvent#getSenderKey}.
*/
senderCurve25519Key?: string;
/**
* ed25519 key claimed by the sender of this event. See {@link MatrixEvent#getClaimedEd25519Key}.
*/
claimedEd25519Key?: string;
untrusted?: boolean;
/**
* The sender doesn't authorize the unverified devices to decrypt his messages
*/
encryptedDisabledForUnverifiedDevices?: boolean;
}

View File

@@ -60,6 +60,18 @@ export * from "./@types/PushRules";
export * from "./@types/partials"; export * from "./@types/partials";
export * from "./@types/requests"; export * from "./@types/requests";
export * from "./@types/search"; export * from "./@types/search";
export * from "./@types/beacon";
export * from "./@types/topic";
export * from "./@types/location";
export * from "./@types/threepids";
export * from "./@types/auth";
export * from "./@types/polls";
export * from "./@types/local_notifications";
export * from "./@types/registration";
export * from "./@types/read_receipts";
export * from "./@types/crypto";
export * from "./@types/extensible_events";
export * from "./@types/IIdentityServerProvider";
export * from "./models/room-summary"; export * from "./models/room-summary";
export * from "./models/event-status"; export * from "./models/event-status";
export * as ContentHelpers from "./content-helpers"; export * as ContentHelpers from "./content-helpers";