mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-08 10:44:20 +01:00
opfs for sync in one commit!
This commit is contained in:
16
bindings/javascript/packages/native/index.d.ts
vendored
16
bindings/javascript/packages/native/index.d.ts
vendored
@@ -91,6 +91,14 @@ export declare class Database {
|
||||
ioLoopAsync(): Promise<void>
|
||||
}
|
||||
|
||||
export declare class Opfs {
|
||||
constructor()
|
||||
}
|
||||
|
||||
export declare class OpfsFile {
|
||||
|
||||
}
|
||||
|
||||
/** A prepared statement. */
|
||||
export declare class Statement {
|
||||
reset(): void
|
||||
@@ -144,6 +152,14 @@ export declare class Statement {
|
||||
finalize(): void
|
||||
}
|
||||
|
||||
export declare function connect(path: string, opts?: DatabaseOpts | undefined | null): Promise<unknown>
|
||||
|
||||
export interface DatabaseOpts {
|
||||
tracing?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* turso-db in the the browser requires explicit thread pool initialization
|
||||
* so, we just put no-op task on the thread pool and force emnapi to allocate web worker
|
||||
*/
|
||||
export declare function initThreadPool(): Promise<unknown>
|
||||
|
||||
@@ -508,6 +508,10 @@ if (!nativeBinding) {
|
||||
throw new Error(`Failed to load native binding`)
|
||||
}
|
||||
|
||||
const { Database, Statement } = nativeBinding
|
||||
const { Database, Opfs, OpfsFile, Statement, connect, initThreadPool } = nativeBinding
|
||||
export { Database }
|
||||
export { Opfs }
|
||||
export { OpfsFile }
|
||||
export { Statement }
|
||||
export { connect }
|
||||
export { initThreadPool }
|
||||
|
||||
Reference in New Issue
Block a user