Skip to content

Commit 79acd89

Browse files
authored
Export AsyncDatabaseConnection types in @powersync/web (#655)
1 parent 97da283 commit 79acd89

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

.changeset/curly-bugs-teach.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/web': minor
3+
---
4+
5+
Export AsyncDatabaseConnection (and related) types for internal use

packages/web/src/db/adapters/AsyncDatabaseConnection.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { BatchedUpdateNotification, QueryResult } from '@powersync/common';
22
import { ResolvedWebSQLOpenOptions } from './web-sql-flags';
33

44
/**
5+
* @internal
56
* Proxied query result does not contain a function for accessing row values
67
*/
78
export type ProxiedQueryResult = Omit<QueryResult, 'rows'> & {
@@ -10,6 +11,10 @@ export type ProxiedQueryResult = Omit<QueryResult, 'rows'> & {
1011
length: number;
1112
};
1213
};
14+
15+
/**
16+
* @internal
17+
*/
1318
export type OnTableChangeCallback = (event: BatchedUpdateNotification) => void;
1419

1520
/**
@@ -27,6 +32,9 @@ export interface AsyncDatabaseConnection<Config extends ResolvedWebSQLOpenOption
2732
getConfig(): Promise<Config>;
2833
}
2934

35+
/**
36+
* @internal
37+
*/
3038
export type OpenAsyncDatabaseConnection<Config extends ResolvedWebSQLOpenOptions = ResolvedWebSQLOpenOptions> = (
3139
config: Config
3240
) => AsyncDatabaseConnection;

packages/web/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from '@powersync/common';
2+
export * from './db/adapters/AsyncDatabaseConnection';
23
export * from './db/adapters/AbstractWebPowerSyncDatabaseOpenFactory';
34
export * from './db/adapters/AbstractWebSQLOpenFactory';
45
export * from './db/adapters/wa-sqlite/WASQLiteConnection';

0 commit comments

Comments
 (0)