From d1b62695e1434659fb44d0bc7483d9b4eceed3bf Mon Sep 17 00:00:00 2001 From: Matt Silverlock Date: Tue, 23 Jul 2024 11:26:01 -0400 Subject: [PATCH] types: Fix D1 run() type (#2422) * types: Fix D1 run() type This is out of sync with prod, which is does accept a type parameter and returns a `D1Result` * [D1] Update tests for .run() types to match the current state --------- Co-authored-by: Max Rozen <3822106+rozenmd@users.noreply.github.com> --- types/defines/d1.d.ts | 2 +- types/test/types/d1.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/defines/d1.d.ts b/types/defines/d1.d.ts index 898fa9b5a38..19db8499b87 100644 --- a/types/defines/d1.d.ts +++ b/types/defines/d1.d.ts @@ -34,7 +34,7 @@ declare abstract class D1PreparedStatement { bind(...values: unknown[]): D1PreparedStatement; first(colName: string): Promise; first>(): Promise; - run(): Promise; + run>(): Promise>; all>(): Promise>; raw(options: {columnNames: true}): Promise<[string[], ...T[]]>; raw(options?: {columnNames?: false}): Promise; diff --git a/types/test/types/d1.ts b/types/test/types/d1.ts index 4ee3122b63b..8659c39d4c0 100644 --- a/types/test/types/d1.ts +++ b/types/test/types/d1.ts @@ -16,7 +16,7 @@ export const handler: ExportedHandler<{ DB: D1Database }> = { expectType<{ meta: Record; success: boolean; - results?: never; + results?: any; }>(response); }