mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-27 10:46:47 +00:00
wip
This commit is contained in:
+34
-3
@@ -10,18 +10,23 @@ declare global {
|
|||||||
getPublicKey(): Promise<{ publicKey: ArrayBuffer }>
|
getPublicKey(): Promise<{ publicKey: ArrayBuffer }>
|
||||||
encryptWithoutKey(
|
encryptWithoutKey(
|
||||||
data: ArrayBuffer,
|
data: ArrayBuffer,
|
||||||
userPublicKeys: Record<string, ArrayBuffer>
|
userPublicKeys: Record<string, ArrayBuffer>,
|
||||||
|
options?: { optimizeMemory?: boolean }
|
||||||
): Promise<{
|
): Promise<{
|
||||||
encryptedContent: ArrayBuffer
|
encryptedContent: ArrayBuffer
|
||||||
encryptedKeys: Record<string, ArrayBuffer>
|
encryptedKeys: Record<string, ArrayBuffer>
|
||||||
}>
|
}>
|
||||||
encryptWithKey(
|
encryptWithKey(
|
||||||
data: ArrayBuffer,
|
data: ArrayBuffer,
|
||||||
encryptedSymmetricKey: ArrayBuffer
|
encryptedSymmetricKey: ArrayBuffer,
|
||||||
|
encryptedKeyChain?: ArrayBuffer[],
|
||||||
|
options?: { optimizeMemory?: boolean }
|
||||||
): Promise<{ encryptedData: ArrayBuffer }>
|
): Promise<{ encryptedData: ArrayBuffer }>
|
||||||
decryptWithKey(
|
decryptWithKey(
|
||||||
encryptedData: ArrayBuffer,
|
encryptedData: ArrayBuffer,
|
||||||
encryptedSymmetricKey: ArrayBuffer
|
encryptedSymmetricKey: ArrayBuffer,
|
||||||
|
encryptedKeyChain?: ArrayBuffer[],
|
||||||
|
options?: { optimizeMemory?: boolean }
|
||||||
): Promise<{ data: ArrayBuffer }>
|
): Promise<{ data: ArrayBuffer }>
|
||||||
shareKeys(
|
shareKeys(
|
||||||
encryptedSymmetricKey: ArrayBuffer,
|
encryptedSymmetricKey: ArrayBuffer,
|
||||||
@@ -59,6 +64,29 @@ declare global {
|
|||||||
off<K extends string>(event: K, listener: (data: unknown) => void): void
|
off<K extends string>(event: K, listener: (data: unknown) => void): void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stable error codes carried by `VaultError`. Sourced from the
|
||||||
|
* encryption SDK (re-exported on `window.EncryptionClient.VaultErrorCode`)
|
||||||
|
* — meet consumers match on these via `(err as VaultError).code` rather
|
||||||
|
* than regexing message text. Keep in sync with the SDK definition.
|
||||||
|
*/
|
||||||
|
type VaultErrorCode =
|
||||||
|
| 'MISSING_KEYS'
|
||||||
|
| 'WRONG_SECRET_KEY'
|
||||||
|
| 'INVALID_BACKUP'
|
||||||
|
| 'INVALID_MNEMONIC'
|
||||||
|
| 'NOT_INITIALIZED'
|
||||||
|
| 'AUTH_REQUIRED'
|
||||||
|
| 'PRIVILEGED_ORIGIN_REQUIRED'
|
||||||
|
| 'TIMEOUT'
|
||||||
|
| 'IFRAME_REQUIRED'
|
||||||
|
| 'CIPHERTEXT_TOO_SHORT'
|
||||||
|
| 'UNKNOWN'
|
||||||
|
|
||||||
|
interface VaultError extends Error {
|
||||||
|
readonly code: VaultErrorCode
|
||||||
|
}
|
||||||
|
|
||||||
interface Window {
|
interface Window {
|
||||||
EncryptionClient: {
|
EncryptionClient: {
|
||||||
VaultClient: new (options: {
|
VaultClient: new (options: {
|
||||||
@@ -68,6 +96,9 @@ declare global {
|
|||||||
theme?: string
|
theme?: string
|
||||||
lang?: string
|
lang?: string
|
||||||
}) => VaultClient
|
}) => VaultClient
|
||||||
|
VaultError: new (code: VaultErrorCode, message: string) => VaultError
|
||||||
|
VaultErrorCode: { readonly [K in VaultErrorCode]: K }
|
||||||
|
isVaultError: (err: unknown) => err is VaultError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user