tiny-crypto-suite
Version:
Tiny tools, big crypto — seamless encryption and certificate handling for modern web and Node apps.
50 lines • 1.67 kB
text/typescript
export default FakeMatrixServer;
/**
* Simulates a basic Matrix server handling identity and one-time keys.
* @class
*/
declare class FakeMatrixServer {
/**
* @type {Map<string, {curve25519: string, ed25519: string}>}
*/
identityKeys: Map<string, {
curve25519: string;
ed25519: string;
}>;
/**
* @type {Map<string, Record<string, {key: string}>>}
*/
oneTimeKeys: Map<string, Record<string, {
key: string;
}>>;
/**
* Uploads the identity keys for a user.
* @param {string} username - The user's Matrix ID.
* @param {{curve25519: string, ed25519: string}} identityKeys - The user's identity keys.
*/
uploadIdentityKeys(username: string, identityKeys: {
curve25519: string;
ed25519: string;
}): void;
/**
* Uploads one-time keys for a user.
* @param {string} username - The user's Matrix ID.
* @param {Record<string, {key: string}>} oneTimeKeys - One-time keys.
*/
uploadOneTimeKeys(username: string, oneTimeKeys: Record<string, {
key: string;
}>): void;
/**
* Fetches the Curve25519 identity key for a user.
* @param {string} username - The user's Matrix ID.
* @returns {string|null} The Curve25519 key or null if not found.
*/
fetchIdentityKey(username: string): string | null;
/**
* Fetches and removes a one-time key for a user.
* @param {string} username - The user's Matrix ID.
* @returns {string|null} The one-time key or null if none available.
*/
fetchOneTimeKey(username: string): string | null;
}
//# sourceMappingURL=FakeMatrixServer.d.mts.map