Enforce stronger types for ArrayBuffers and storage
This commit is contained in:
parent
61ac79e9ae
commit
8f5086227a
56 changed files with 748 additions and 675 deletions
|
@ -2,15 +2,11 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { WebAPIConnectType, WebAPIType } from '../textsecure/WebAPI';
|
||||
|
||||
// We define a stricter storage here that returns `unknown` instead of `any`.
|
||||
type Storage = {
|
||||
get(key: string): unknown;
|
||||
};
|
||||
import { StorageInterface } from '../types/Storage.d';
|
||||
|
||||
export function connectToServerWithStoredCredentials(
|
||||
WebAPI: WebAPIConnectType,
|
||||
storage: Storage
|
||||
storage: Pick<StorageInterface, 'get'>
|
||||
): WebAPIType {
|
||||
const username = storage.get('uuid_id') || storage.get('number_id');
|
||||
if (typeof username !== 'string') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue