Skip to content

Commit

Permalink
Reintroduce getMany optional method (#384)
Browse files Browse the repository at this point in the history
* Revert "Revert "Add missing `getMany` optional method on Store interface (#362)" (#365)"

This reverts commit da05c2f.

* null | undefined

* no null type
  • Loading branch information
trevor-scheer authored Jul 5, 2022
1 parent cf9bd6c commit daa9079
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/keyv/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,17 @@ declare namespace Keyv {
value: Value; expires: number | undefined;
}

type StoredData<Value> = DeserializedData<Value> | string | undefined;

interface Store<Value> {
get(key: string): Value | Promise<Value | undefined> | undefined;
set(key: string, value: Value, ttl?: number): any;
delete(key: string): boolean | Promise<boolean>;
clear(): void | Promise<void>;
has?(key: string): boolean | Promise<boolean>;
getMany?(
keys: string[]
): Array<StoredData<Value>> | Promise<Array<StoredData<Value>>> | undefined;
}
}

Expand Down

0 comments on commit daa9079

Please sign in to comment.