Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Fix type bug in DurableObject txn get #259

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rude-apples-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/workers-types": patch
---

Fix DurableObject transaction `get` to properly return `Promise<T | undefined>` instead of `Promise<T>`
5 changes: 4 additions & 1 deletion overrides/durableobjects.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ declare abstract class DurableObjectStorage {
}

declare abstract class DurableObjectTransaction {
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T>;
get<T = unknown>(
key: string,
options?: DurableObjectGetOptions
): Promise<T | undefined>;
get<T = unknown>(
keys: string[],
options?: DurableObjectGetOptions
Expand Down