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

TypeScript and doc fixes

This commit is contained in:
Hubert Chathi
2020-09-14 18:53:48 -04:00
parent b9886d4f34
commit 6bdbee533c
3 changed files with 40 additions and 4 deletions

View File

@@ -14,12 +14,18 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import * as Olm from "olm";
export {}; export {};
declare global { declare global {
namespace NodeJS { namespace NodeJS {
interface Global { interface Global {
localStorage: Storage; localStorage: Storage;
Olm: Olm;
} }
} }
interface Global {
Olm: Olm;
}
} }

View File

@@ -248,12 +248,12 @@ function keyFromRecoverySession(session, decryptionKey) {
* device. * device.
* Args: * Args:
* {string} name The name of the secret being requested. * {string} name The name of the secret being requested.
* {string} user_id (string) The user ID of the client requesting * {string} userId The user ID of the client requesting
* {string} device_id The device ID of the client requesting the secret. * {string} deviceId The device ID of the client requesting the secret.
* {string} request_id The ID of the request. Used to match a * {string} requestId The ID of the request. Used to match a
* corresponding `crypto.secrets.request_cancelled`. The request ID will be * corresponding `crypto.secrets.request_cancelled`. The request ID will be
* unique per sender, device pair. * unique per sender, device pair.
* {DeviceTrustLevel} device_trust: The trust status of the device requesting * {DeviceTrustLevel} deviceTrust: The trust status of the device requesting
* the secret as returned by {@link module:client~MatrixClient#checkDeviceTrust}. * the secret as returned by {@link module:client~MatrixClient#checkDeviceTrust}.
*/ */
export function MatrixClient(opts) { export function MatrixClient(opts) {

View File

@@ -121,11 +121,41 @@ interface ICreateClientOpts {
scheduler?: MatrixScheduler; scheduler?: MatrixScheduler;
request?: Request; request?: Request;
userId?: string; userId?: string;
deviceId?: string;
accessToken?: string; accessToken?: string;
identityServer?: any; identityServer?: any;
localTimeoutMs?: number; localTimeoutMs?: number;
useAuthorizationHeader?: boolean; useAuthorizationHeader?: boolean;
queryParams?: Record<string, unknown>; queryParams?: Record<string, unknown>;
deviceToImport?: {
olmDevice: {
pickledAccount: string;
sessions: Array<Record<string, any>>;
pickleKey: string;
};
userId: string;
deviceId: string;
};
sessionStore?: any;
unstableClientRelationAggregation?: boolean;
verificationMethods?: Array<any>;
forceTURN?: boolean;
fallbackICEServerAllowed?: boolean;
cryptoCallbacks?: {
getCrossSigningKey?: (keyType: string, pubKey: Uint8Array) => Promise<Uint8Array>;
saveCrossSigningKeys?: (keys: Record<string, Uint8Array>) => unknown;
shouldUpgradeDeviceVerifications?: (
users: Record<string, any>
) => Promise<Array<string>>;
getSecretStorageKey?: (
keys: {keys: Record<string, {pubkey: Uint8Array}>}, name: string
) => Promise<[string, Uint8Array] | null>;
cacheSecretStorageKey?: (keyId: string, key: Uint8Array) => unknown;
onSecretRequested?: (
name: string, userId: string, deviceId: string,
requestId: string, deviceTrust: any
) => Promise<string>;
};
} }
/** /**