Use typeof in customisations to avoid repeating

pull/21833/head
J. Ryan Stinnett 2020-11-27 11:11:11 +00:00
parent 6066645207
commit 86b2cd1f82
1 changed files with 7 additions and 18 deletions

View File

@ -67,24 +67,13 @@ function setupEncryptionNeeded(kind: SetupEncryptionKind): boolean {
// them all as optional. This allows customisers to only define and export the // them all as optional. This allows customisers to only define and export the
// customisations they need while still maintaining type safety. // customisations they need while still maintaining type safety.
export interface ISecurityCustomisations { export interface ISecurityCustomisations {
examineLoginResponse?: ( examineLoginResponse?: typeof examineLoginResponse;
response: any, persistCredentials?: typeof persistCredentials;
credentials: IMatrixClientCreds, createSecretStorageKey?: typeof createSecretStorageKey,
) => void; getSecretStorageKey?: typeof getSecretStorageKey,
persistCredentials?: ( catchAccessSecretStorageError?: typeof catchAccessSecretStorageError,
credentials: IMatrixClientCreds, setupEncryptionNeeded?: typeof setupEncryptionNeeded,
) => void; getDehydrationKey?: typeof getDehydrationKey,
createSecretStorageKey?: () => Uint8Array,
getSecretStorageKey?: () => Uint8Array,
catchAccessSecretStorageError?: (
e: Error,
) => void,
setupEncryptionNeeded?: (
kind: SetupEncryptionKind,
) => boolean,
getDehydrationKey?: (
keyInfo: ISecretStorageKeyInfo,
) => Promise<Uint8Array>,
} }
// A real customisation module will define and export one or more of the // A real customisation module will define and export one or more of the