Enforce stronger types for ArrayBuffers and storage

This commit is contained in:
Fedor Indutny 2021-06-14 17:09:37 -07:00 committed by GitHub
parent 61ac79e9ae
commit 8f5086227a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 748 additions and 675 deletions

View file

@ -19,6 +19,7 @@ import { isNotNil } from './util/isNotNil';
import { isOlderThan } from './util/timestamp';
import { parseRetryAfter } from './util/parseRetryAfter';
import { getEnvironment, Environment } from './environment';
import { StorageInterface } from './types/Storage.d';
export type ChallengeResponse = {
readonly captcha: string;
@ -62,10 +63,7 @@ export type MinimalMessage = Pick<
};
export type Options = {
readonly storage: {
get(key: string): ReadonlyArray<StoredEntity>;
put(key: string, value: ReadonlyArray<StoredEntity>): Promise<void>;
};
readonly storage: Pick<StorageInterface, 'get' | 'put'>;
requestChallenge(request: IPCRequest): void;