workers-types
workers-types copied to clipboard
`D1PreparedStatement.all`'s return type is wrong?
https://github.com/cloudflare/workers-types/blob/master/src/workers.json#L1712-L1721
It's return type is Promise<D1Result<T[]>>
.
I expect that D1Result<T[]>.results
returns T[][]
but actually it returns T[]
.
So, I think D1PreparedStatement.all
's return type should be Promise<D1Result<T>>
.
The docs also say that errors are thrown and never mention the error
property. So I wonder if the error
property can actually exist, and consequently if results
is optional.
D1PreparedStatement.run()
also has a results?
property, even though the docs say that .run()
returns no results (same goes for exec
I think)
Fixed by https://github.com/cloudflare/workers-types/pull/285.
Opened #289 for the other issues I mentioned