export interface IStorageManagerLike { get?(key: string): Promise; set?(key: string, value: string): Promise; list?(prefix: string): Promise; delete?(key: string): Promise; } export function hasStorageManagerMethods( storageManager: IStorageManagerLike | undefined, methods: T[], ): storageManager is IStorageManagerLike & Required> { return !!storageManager && methods.every((method) => typeof storageManager[method] === 'function'); }