Skip to content

Commit fe1392d

Browse files
committed
fix(dialect-wasm): fix NodeWasmDialect type
1 parent 7c64421 commit fe1392d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

packages/dialect-wasm/src/node-wasm-dialect/driver.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { InfoReturn, QueryReturn } from '../baseDriver'
22
import { BaseDriver, BaseSqliteConnection } from '../baseDriver'
3-
import type { NodeWasmDataBase } from './type'
3+
import type { NodeWasmDatabase } from './type'
44
import type { NodeWasmDialectConfig } from '.'
55

66
export class NodeWasmDriver extends BaseDriver {
77
private config: NodeWasmDialectConfig
8-
private db?: NodeWasmDataBase
8+
private db?: NodeWasmDatabase
99
constructor(config: NodeWasmDialectConfig) {
1010
super()
1111
this.config = config
@@ -26,13 +26,13 @@ export class NodeWasmDriver extends BaseDriver {
2626
}
2727

2828
class NodeWasmConnection extends BaseSqliteConnection {
29-
private db: NodeWasmDataBase
30-
constructor(db: any) {
29+
private db: NodeWasmDatabase
30+
constructor(db: NodeWasmDatabase) {
3131
super()
3232
this.db = db
3333
}
3434

35-
async query(sql: string, params?: any[] | undefined): QueryReturn {
35+
async query(sql: string, params?: any[]): QueryReturn {
3636
return this.db.all(sql, params)
3737
}
3838

packages/dialect-wasm/src/node-wasm-dialect/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { DatabaseConnection, Driver } from 'kysely'
22
import type { Promisable } from '../types'
33
import { BaseDialect } from '../baseDialect'
4-
import type { NodeWasmDataBase } from './type'
4+
import type { NodeWasmDatabase } from './type'
55
import { NodeWasmDriver } from './driver'
66

77
export interface NodeWasmDialectConfig {
8-
database: NodeWasmDataBase | (() => Promisable<NodeWasmDataBase>)
8+
database: NodeWasmDatabase | (() => Promisable<NodeWasmDatabase>)
99
onCreateConnection?: (connection: DatabaseConnection) => Promisable<void>
1010
}
1111

packages/dialect-wasm/src/node-wasm-dialect/type.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ export interface NodeWasmDBOptions {
77
}
88
}
99

10-
export interface NodeWasmDataBase extends BaseDB {
11-
get: (sql: string, param?: readonly unknown[]) => any
12-
all: (sql: string, param?: readonly unknown[]) => any[]
13-
run: (sql: string, param?: readonly unknown[]) => NodeWasmRunReturn
10+
export interface NodeWasmDatabase extends BaseDB {
11+
get: (sql: string, param?: any[]) => any
12+
all: (sql: string, param?: any[]) => any[]
13+
run: (sql: string, param?: any[]) => NodeWasmRunReturn
1414
}
1515

1616
export interface NodeWasmRunReturn {
17-
lastInsertRowid: number
18-
changes: number | bigint
17+
lastInsertRowid: number | bigint
18+
changes: number
1919
}

0 commit comments

Comments
 (0)