File tree 3 files changed +9
-6
lines changed
3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,6 @@ export default defineNuxtModule<ModuleOptions>({
54
54
ws : '' ,
55
55
NS : '' ,
56
56
DB : '' ,
57
- KV : undefined ,
58
- SC : undefined ,
59
- AC : undefined ,
60
- auth : undefined ,
61
57
} ,
62
58
} ,
63
59
server : {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { hash } from 'ohash'
4
4
import { createDefu , defu } from 'defu'
5
5
6
6
import type {
7
+ DatabasePreset ,
7
8
DatabasePresetKeys ,
8
9
KeysOf ,
9
10
PickFrom ,
@@ -96,7 +97,9 @@ export function useSurrealRPC<
96
97
} )
97
98
}
98
99
99
- export function useSurrealDatabases ( ) {
100
+ export function useSurrealDatabases ( ) : {
101
+ [ key in DatabasePresetKeys ] : DatabasePreset
102
+ } {
100
103
const {
101
104
databases : publicDatabases ,
102
105
defaultDatabase,
Original file line number Diff line number Diff line change 1
1
// The following nitropack import is from https://github.com/nuxt/module-builder/issues/141#issuecomment-2078248248
2
2
import type { } from 'nitropack'
3
+ import type { PublicRuntimeConfig , RuntimeConfig } from 'nuxt/schema'
3
4
import type { FetchOptions , ResponseType } from 'ofetch'
4
5
import { textToBase64 } from 'undio'
5
6
import type { H3Event } from 'h3'
@@ -57,7 +58,10 @@ export function useSurrealDatabases(event?: H3Event): {
57
58
return true
58
59
} )
59
60
60
- const databases = defuDatabases ( privateDatabases , publicDatabases )
61
+ const databases = defuDatabases <
62
+ RuntimeConfig [ 'surrealdb' ] [ 'databases' ] ,
63
+ PublicRuntimeConfig [ 'surrealdb' ] [ 'databases' ] [ ]
64
+ > ( privateDatabases , publicDatabases )
61
65
62
66
return databases
63
67
}
You can’t perform that action at this time.
0 commit comments