if type is not string, then codec is mandatory

This commit is contained in:
Sebastian 2023-05-29 14:53:36 -03:00
parent be9d3dad83
commit cb720b7a96
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069

View File

@ -36,6 +36,11 @@ export type StorageKey<Key> = {
codec: Codec<Key>; codec: Codec<Key>;
}; };
export function buildStorageKey<Key>(
name: string,
codec: Codec<Key>,
): StorageKey<Key>;
export function buildStorageKey(name: string): StorageKey<string>;
export function buildStorageKey<Key = string>( export function buildStorageKey<Key = string>(
name: string, name: string,
codec?: Codec<Key>, codec?: Codec<Key>,