Skip to content

Commit b3d0739

Browse files
committed
chore: update types
1 parent b19d4a5 commit b3d0739

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"rc9": "^2.1.1",
5151
"ufo": "^1.4.0",
5252
"uncrypto": "^0.1.3",
53+
"unstorage": "^1.10.1",
5354
"wrangler": "^3.28.3",
5455
"zod": "^3.22.4"
5556
},

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/runtime/server/utils/database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { H3Error } from 'h3'
55

66
let _db: D1Database
77

8-
export function useDatabase() {
8+
export function useDatabase(): D1Database {
99
if (_db) {
1010
return _db
1111
}
@@ -23,7 +23,7 @@ export function useDatabase() {
2323
throw createError('Missing Cloudflare DB binding (D1)')
2424
}
2525

26-
export function useProxyDatabase(projectUrl: string, secretKey?: string) {
26+
export function useProxyDatabase(projectUrl: string, secretKey?: string): D1Database {
2727
const d1API = ofetch.create({
2828
baseURL: joinURL(projectUrl, '/api/_hub/database'),
2929
method: 'POST',

src/runtime/server/utils/kv.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { joinURL } from 'ufo'
66

77
let _kv: Storage
88

9-
export function useKV() {
9+
export function useKV(): Storage {
1010
if (_kv) {
1111
return _kv
1212
}
@@ -27,7 +27,7 @@ export function useKV() {
2727
throw createError('Missing Cloudflare KV binding (KV)')
2828
}
2929

30-
export function useProxyKV(projectUrl: string, secretKey?: string) {
30+
export function useProxyKV(projectUrl: string, secretKey?: string): Storage {
3131
return createStorage({
3232
driver: httpDriver({
3333
base: joinURL(projectUrl, '/api/_hub/kv/'),

0 commit comments

Comments
 (0)